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 OpARM64LoweredPanicBoundsCR:
   184  		return rewriteValueARM64_OpARM64LoweredPanicBoundsCR(v)
   185  	case OpARM64LoweredPanicBoundsRC:
   186  		return rewriteValueARM64_OpARM64LoweredPanicBoundsRC(v)
   187  	case OpARM64LoweredPanicBoundsRR:
   188  		return rewriteValueARM64_OpARM64LoweredPanicBoundsRR(v)
   189  	case OpARM64MADD:
   190  		return rewriteValueARM64_OpARM64MADD(v)
   191  	case OpARM64MADDW:
   192  		return rewriteValueARM64_OpARM64MADDW(v)
   193  	case OpARM64MNEG:
   194  		return rewriteValueARM64_OpARM64MNEG(v)
   195  	case OpARM64MNEGW:
   196  		return rewriteValueARM64_OpARM64MNEGW(v)
   197  	case OpARM64MOD:
   198  		return rewriteValueARM64_OpARM64MOD(v)
   199  	case OpARM64MODW:
   200  		return rewriteValueARM64_OpARM64MODW(v)
   201  	case OpARM64MOVBUload:
   202  		return rewriteValueARM64_OpARM64MOVBUload(v)
   203  	case OpARM64MOVBUloadidx:
   204  		return rewriteValueARM64_OpARM64MOVBUloadidx(v)
   205  	case OpARM64MOVBUreg:
   206  		return rewriteValueARM64_OpARM64MOVBUreg(v)
   207  	case OpARM64MOVBload:
   208  		return rewriteValueARM64_OpARM64MOVBload(v)
   209  	case OpARM64MOVBloadidx:
   210  		return rewriteValueARM64_OpARM64MOVBloadidx(v)
   211  	case OpARM64MOVBreg:
   212  		return rewriteValueARM64_OpARM64MOVBreg(v)
   213  	case OpARM64MOVBstore:
   214  		return rewriteValueARM64_OpARM64MOVBstore(v)
   215  	case OpARM64MOVBstoreidx:
   216  		return rewriteValueARM64_OpARM64MOVBstoreidx(v)
   217  	case OpARM64MOVDload:
   218  		return rewriteValueARM64_OpARM64MOVDload(v)
   219  	case OpARM64MOVDloadidx:
   220  		return rewriteValueARM64_OpARM64MOVDloadidx(v)
   221  	case OpARM64MOVDloadidx8:
   222  		return rewriteValueARM64_OpARM64MOVDloadidx8(v)
   223  	case OpARM64MOVDnop:
   224  		return rewriteValueARM64_OpARM64MOVDnop(v)
   225  	case OpARM64MOVDreg:
   226  		return rewriteValueARM64_OpARM64MOVDreg(v)
   227  	case OpARM64MOVDstore:
   228  		return rewriteValueARM64_OpARM64MOVDstore(v)
   229  	case OpARM64MOVDstoreidx:
   230  		return rewriteValueARM64_OpARM64MOVDstoreidx(v)
   231  	case OpARM64MOVDstoreidx8:
   232  		return rewriteValueARM64_OpARM64MOVDstoreidx8(v)
   233  	case OpARM64MOVHUload:
   234  		return rewriteValueARM64_OpARM64MOVHUload(v)
   235  	case OpARM64MOVHUloadidx:
   236  		return rewriteValueARM64_OpARM64MOVHUloadidx(v)
   237  	case OpARM64MOVHUloadidx2:
   238  		return rewriteValueARM64_OpARM64MOVHUloadidx2(v)
   239  	case OpARM64MOVHUreg:
   240  		return rewriteValueARM64_OpARM64MOVHUreg(v)
   241  	case OpARM64MOVHload:
   242  		return rewriteValueARM64_OpARM64MOVHload(v)
   243  	case OpARM64MOVHloadidx:
   244  		return rewriteValueARM64_OpARM64MOVHloadidx(v)
   245  	case OpARM64MOVHloadidx2:
   246  		return rewriteValueARM64_OpARM64MOVHloadidx2(v)
   247  	case OpARM64MOVHreg:
   248  		return rewriteValueARM64_OpARM64MOVHreg(v)
   249  	case OpARM64MOVHstore:
   250  		return rewriteValueARM64_OpARM64MOVHstore(v)
   251  	case OpARM64MOVHstoreidx:
   252  		return rewriteValueARM64_OpARM64MOVHstoreidx(v)
   253  	case OpARM64MOVHstoreidx2:
   254  		return rewriteValueARM64_OpARM64MOVHstoreidx2(v)
   255  	case OpARM64MOVWUload:
   256  		return rewriteValueARM64_OpARM64MOVWUload(v)
   257  	case OpARM64MOVWUloadidx:
   258  		return rewriteValueARM64_OpARM64MOVWUloadidx(v)
   259  	case OpARM64MOVWUloadidx4:
   260  		return rewriteValueARM64_OpARM64MOVWUloadidx4(v)
   261  	case OpARM64MOVWUreg:
   262  		return rewriteValueARM64_OpARM64MOVWUreg(v)
   263  	case OpARM64MOVWload:
   264  		return rewriteValueARM64_OpARM64MOVWload(v)
   265  	case OpARM64MOVWloadidx:
   266  		return rewriteValueARM64_OpARM64MOVWloadidx(v)
   267  	case OpARM64MOVWloadidx4:
   268  		return rewriteValueARM64_OpARM64MOVWloadidx4(v)
   269  	case OpARM64MOVWreg:
   270  		return rewriteValueARM64_OpARM64MOVWreg(v)
   271  	case OpARM64MOVWstore:
   272  		return rewriteValueARM64_OpARM64MOVWstore(v)
   273  	case OpARM64MOVWstoreidx:
   274  		return rewriteValueARM64_OpARM64MOVWstoreidx(v)
   275  	case OpARM64MOVWstoreidx4:
   276  		return rewriteValueARM64_OpARM64MOVWstoreidx4(v)
   277  	case OpARM64MSUB:
   278  		return rewriteValueARM64_OpARM64MSUB(v)
   279  	case OpARM64MSUBW:
   280  		return rewriteValueARM64_OpARM64MSUBW(v)
   281  	case OpARM64MUL:
   282  		return rewriteValueARM64_OpARM64MUL(v)
   283  	case OpARM64MULW:
   284  		return rewriteValueARM64_OpARM64MULW(v)
   285  	case OpARM64MVN:
   286  		return rewriteValueARM64_OpARM64MVN(v)
   287  	case OpARM64MVNshiftLL:
   288  		return rewriteValueARM64_OpARM64MVNshiftLL(v)
   289  	case OpARM64MVNshiftRA:
   290  		return rewriteValueARM64_OpARM64MVNshiftRA(v)
   291  	case OpARM64MVNshiftRL:
   292  		return rewriteValueARM64_OpARM64MVNshiftRL(v)
   293  	case OpARM64MVNshiftRO:
   294  		return rewriteValueARM64_OpARM64MVNshiftRO(v)
   295  	case OpARM64NEG:
   296  		return rewriteValueARM64_OpARM64NEG(v)
   297  	case OpARM64NEGshiftLL:
   298  		return rewriteValueARM64_OpARM64NEGshiftLL(v)
   299  	case OpARM64NEGshiftRA:
   300  		return rewriteValueARM64_OpARM64NEGshiftRA(v)
   301  	case OpARM64NEGshiftRL:
   302  		return rewriteValueARM64_OpARM64NEGshiftRL(v)
   303  	case OpARM64NotEqual:
   304  		return rewriteValueARM64_OpARM64NotEqual(v)
   305  	case OpARM64OR:
   306  		return rewriteValueARM64_OpARM64OR(v)
   307  	case OpARM64ORN:
   308  		return rewriteValueARM64_OpARM64ORN(v)
   309  	case OpARM64ORNshiftLL:
   310  		return rewriteValueARM64_OpARM64ORNshiftLL(v)
   311  	case OpARM64ORNshiftRA:
   312  		return rewriteValueARM64_OpARM64ORNshiftRA(v)
   313  	case OpARM64ORNshiftRL:
   314  		return rewriteValueARM64_OpARM64ORNshiftRL(v)
   315  	case OpARM64ORNshiftRO:
   316  		return rewriteValueARM64_OpARM64ORNshiftRO(v)
   317  	case OpARM64ORconst:
   318  		return rewriteValueARM64_OpARM64ORconst(v)
   319  	case OpARM64ORshiftLL:
   320  		return rewriteValueARM64_OpARM64ORshiftLL(v)
   321  	case OpARM64ORshiftRA:
   322  		return rewriteValueARM64_OpARM64ORshiftRA(v)
   323  	case OpARM64ORshiftRL:
   324  		return rewriteValueARM64_OpARM64ORshiftRL(v)
   325  	case OpARM64ORshiftRO:
   326  		return rewriteValueARM64_OpARM64ORshiftRO(v)
   327  	case OpARM64REV:
   328  		return rewriteValueARM64_OpARM64REV(v)
   329  	case OpARM64REVW:
   330  		return rewriteValueARM64_OpARM64REVW(v)
   331  	case OpARM64ROR:
   332  		return rewriteValueARM64_OpARM64ROR(v)
   333  	case OpARM64RORW:
   334  		return rewriteValueARM64_OpARM64RORW(v)
   335  	case OpARM64SBCSflags:
   336  		return rewriteValueARM64_OpARM64SBCSflags(v)
   337  	case OpARM64SBFX:
   338  		return rewriteValueARM64_OpARM64SBFX(v)
   339  	case OpARM64SLL:
   340  		return rewriteValueARM64_OpARM64SLL(v)
   341  	case OpARM64SLLconst:
   342  		return rewriteValueARM64_OpARM64SLLconst(v)
   343  	case OpARM64SRA:
   344  		return rewriteValueARM64_OpARM64SRA(v)
   345  	case OpARM64SRAconst:
   346  		return rewriteValueARM64_OpARM64SRAconst(v)
   347  	case OpARM64SRL:
   348  		return rewriteValueARM64_OpARM64SRL(v)
   349  	case OpARM64SRLconst:
   350  		return rewriteValueARM64_OpARM64SRLconst(v)
   351  	case OpARM64STP:
   352  		return rewriteValueARM64_OpARM64STP(v)
   353  	case OpARM64SUB:
   354  		return rewriteValueARM64_OpARM64SUB(v)
   355  	case OpARM64SUBconst:
   356  		return rewriteValueARM64_OpARM64SUBconst(v)
   357  	case OpARM64SUBshiftLL:
   358  		return rewriteValueARM64_OpARM64SUBshiftLL(v)
   359  	case OpARM64SUBshiftRA:
   360  		return rewriteValueARM64_OpARM64SUBshiftRA(v)
   361  	case OpARM64SUBshiftRL:
   362  		return rewriteValueARM64_OpARM64SUBshiftRL(v)
   363  	case OpARM64TST:
   364  		return rewriteValueARM64_OpARM64TST(v)
   365  	case OpARM64TSTW:
   366  		return rewriteValueARM64_OpARM64TSTW(v)
   367  	case OpARM64TSTWconst:
   368  		return rewriteValueARM64_OpARM64TSTWconst(v)
   369  	case OpARM64TSTconst:
   370  		return rewriteValueARM64_OpARM64TSTconst(v)
   371  	case OpARM64TSTshiftLL:
   372  		return rewriteValueARM64_OpARM64TSTshiftLL(v)
   373  	case OpARM64TSTshiftRA:
   374  		return rewriteValueARM64_OpARM64TSTshiftRA(v)
   375  	case OpARM64TSTshiftRL:
   376  		return rewriteValueARM64_OpARM64TSTshiftRL(v)
   377  	case OpARM64TSTshiftRO:
   378  		return rewriteValueARM64_OpARM64TSTshiftRO(v)
   379  	case OpARM64UBFIZ:
   380  		return rewriteValueARM64_OpARM64UBFIZ(v)
   381  	case OpARM64UBFX:
   382  		return rewriteValueARM64_OpARM64UBFX(v)
   383  	case OpARM64UDIV:
   384  		return rewriteValueARM64_OpARM64UDIV(v)
   385  	case OpARM64UDIVW:
   386  		return rewriteValueARM64_OpARM64UDIVW(v)
   387  	case OpARM64UMOD:
   388  		return rewriteValueARM64_OpARM64UMOD(v)
   389  	case OpARM64UMODW:
   390  		return rewriteValueARM64_OpARM64UMODW(v)
   391  	case OpARM64XOR:
   392  		return rewriteValueARM64_OpARM64XOR(v)
   393  	case OpARM64XORconst:
   394  		return rewriteValueARM64_OpARM64XORconst(v)
   395  	case OpARM64XORshiftLL:
   396  		return rewriteValueARM64_OpARM64XORshiftLL(v)
   397  	case OpARM64XORshiftRA:
   398  		return rewriteValueARM64_OpARM64XORshiftRA(v)
   399  	case OpARM64XORshiftRL:
   400  		return rewriteValueARM64_OpARM64XORshiftRL(v)
   401  	case OpARM64XORshiftRO:
   402  		return rewriteValueARM64_OpARM64XORshiftRO(v)
   403  	case OpAbs:
   404  		v.Op = OpARM64FABSD
   405  		return true
   406  	case OpAdd16:
   407  		v.Op = OpARM64ADD
   408  		return true
   409  	case OpAdd32:
   410  		v.Op = OpARM64ADD
   411  		return true
   412  	case OpAdd32F:
   413  		v.Op = OpARM64FADDS
   414  		return true
   415  	case OpAdd64:
   416  		v.Op = OpARM64ADD
   417  		return true
   418  	case OpAdd64F:
   419  		v.Op = OpARM64FADDD
   420  		return true
   421  	case OpAdd8:
   422  		v.Op = OpARM64ADD
   423  		return true
   424  	case OpAddPtr:
   425  		v.Op = OpARM64ADD
   426  		return true
   427  	case OpAddr:
   428  		return rewriteValueARM64_OpAddr(v)
   429  	case OpAnd16:
   430  		v.Op = OpARM64AND
   431  		return true
   432  	case OpAnd32:
   433  		v.Op = OpARM64AND
   434  		return true
   435  	case OpAnd64:
   436  		v.Op = OpARM64AND
   437  		return true
   438  	case OpAnd8:
   439  		v.Op = OpARM64AND
   440  		return true
   441  	case OpAndB:
   442  		v.Op = OpARM64AND
   443  		return true
   444  	case OpAtomicAdd32:
   445  		v.Op = OpARM64LoweredAtomicAdd32
   446  		return true
   447  	case OpAtomicAdd32Variant:
   448  		v.Op = OpARM64LoweredAtomicAdd32Variant
   449  		return true
   450  	case OpAtomicAdd64:
   451  		v.Op = OpARM64LoweredAtomicAdd64
   452  		return true
   453  	case OpAtomicAdd64Variant:
   454  		v.Op = OpARM64LoweredAtomicAdd64Variant
   455  		return true
   456  	case OpAtomicAnd32value:
   457  		v.Op = OpARM64LoweredAtomicAnd32
   458  		return true
   459  	case OpAtomicAnd32valueVariant:
   460  		v.Op = OpARM64LoweredAtomicAnd32Variant
   461  		return true
   462  	case OpAtomicAnd64value:
   463  		v.Op = OpARM64LoweredAtomicAnd64
   464  		return true
   465  	case OpAtomicAnd64valueVariant:
   466  		v.Op = OpARM64LoweredAtomicAnd64Variant
   467  		return true
   468  	case OpAtomicAnd8value:
   469  		v.Op = OpARM64LoweredAtomicAnd8
   470  		return true
   471  	case OpAtomicAnd8valueVariant:
   472  		v.Op = OpARM64LoweredAtomicAnd8Variant
   473  		return true
   474  	case OpAtomicCompareAndSwap32:
   475  		v.Op = OpARM64LoweredAtomicCas32
   476  		return true
   477  	case OpAtomicCompareAndSwap32Variant:
   478  		v.Op = OpARM64LoweredAtomicCas32Variant
   479  		return true
   480  	case OpAtomicCompareAndSwap64:
   481  		v.Op = OpARM64LoweredAtomicCas64
   482  		return true
   483  	case OpAtomicCompareAndSwap64Variant:
   484  		v.Op = OpARM64LoweredAtomicCas64Variant
   485  		return true
   486  	case OpAtomicExchange32:
   487  		v.Op = OpARM64LoweredAtomicExchange32
   488  		return true
   489  	case OpAtomicExchange32Variant:
   490  		v.Op = OpARM64LoweredAtomicExchange32Variant
   491  		return true
   492  	case OpAtomicExchange64:
   493  		v.Op = OpARM64LoweredAtomicExchange64
   494  		return true
   495  	case OpAtomicExchange64Variant:
   496  		v.Op = OpARM64LoweredAtomicExchange64Variant
   497  		return true
   498  	case OpAtomicExchange8:
   499  		v.Op = OpARM64LoweredAtomicExchange8
   500  		return true
   501  	case OpAtomicExchange8Variant:
   502  		v.Op = OpARM64LoweredAtomicExchange8Variant
   503  		return true
   504  	case OpAtomicLoad32:
   505  		v.Op = OpARM64LDARW
   506  		return true
   507  	case OpAtomicLoad64:
   508  		v.Op = OpARM64LDAR
   509  		return true
   510  	case OpAtomicLoad8:
   511  		v.Op = OpARM64LDARB
   512  		return true
   513  	case OpAtomicLoadPtr:
   514  		v.Op = OpARM64LDAR
   515  		return true
   516  	case OpAtomicOr32value:
   517  		v.Op = OpARM64LoweredAtomicOr32
   518  		return true
   519  	case OpAtomicOr32valueVariant:
   520  		v.Op = OpARM64LoweredAtomicOr32Variant
   521  		return true
   522  	case OpAtomicOr64value:
   523  		v.Op = OpARM64LoweredAtomicOr64
   524  		return true
   525  	case OpAtomicOr64valueVariant:
   526  		v.Op = OpARM64LoweredAtomicOr64Variant
   527  		return true
   528  	case OpAtomicOr8value:
   529  		v.Op = OpARM64LoweredAtomicOr8
   530  		return true
   531  	case OpAtomicOr8valueVariant:
   532  		v.Op = OpARM64LoweredAtomicOr8Variant
   533  		return true
   534  	case OpAtomicStore32:
   535  		v.Op = OpARM64STLRW
   536  		return true
   537  	case OpAtomicStore64:
   538  		v.Op = OpARM64STLR
   539  		return true
   540  	case OpAtomicStore8:
   541  		v.Op = OpARM64STLRB
   542  		return true
   543  	case OpAtomicStorePtrNoWB:
   544  		v.Op = OpARM64STLR
   545  		return true
   546  	case OpAvg64u:
   547  		return rewriteValueARM64_OpAvg64u(v)
   548  	case OpBitLen16:
   549  		return rewriteValueARM64_OpBitLen16(v)
   550  	case OpBitLen32:
   551  		return rewriteValueARM64_OpBitLen32(v)
   552  	case OpBitLen64:
   553  		return rewriteValueARM64_OpBitLen64(v)
   554  	case OpBitLen8:
   555  		return rewriteValueARM64_OpBitLen8(v)
   556  	case OpBitRev16:
   557  		return rewriteValueARM64_OpBitRev16(v)
   558  	case OpBitRev32:
   559  		v.Op = OpARM64RBITW
   560  		return true
   561  	case OpBitRev64:
   562  		v.Op = OpARM64RBIT
   563  		return true
   564  	case OpBitRev8:
   565  		return rewriteValueARM64_OpBitRev8(v)
   566  	case OpBswap16:
   567  		v.Op = OpARM64REV16W
   568  		return true
   569  	case OpBswap32:
   570  		v.Op = OpARM64REVW
   571  		return true
   572  	case OpBswap64:
   573  		v.Op = OpARM64REV
   574  		return true
   575  	case OpCeil:
   576  		v.Op = OpARM64FRINTPD
   577  		return true
   578  	case OpClosureCall:
   579  		v.Op = OpARM64CALLclosure
   580  		return true
   581  	case OpCom16:
   582  		v.Op = OpARM64MVN
   583  		return true
   584  	case OpCom32:
   585  		v.Op = OpARM64MVN
   586  		return true
   587  	case OpCom64:
   588  		v.Op = OpARM64MVN
   589  		return true
   590  	case OpCom8:
   591  		v.Op = OpARM64MVN
   592  		return true
   593  	case OpCondSelect:
   594  		return rewriteValueARM64_OpCondSelect(v)
   595  	case OpConst16:
   596  		return rewriteValueARM64_OpConst16(v)
   597  	case OpConst32:
   598  		return rewriteValueARM64_OpConst32(v)
   599  	case OpConst32F:
   600  		return rewriteValueARM64_OpConst32F(v)
   601  	case OpConst64:
   602  		return rewriteValueARM64_OpConst64(v)
   603  	case OpConst64F:
   604  		return rewriteValueARM64_OpConst64F(v)
   605  	case OpConst8:
   606  		return rewriteValueARM64_OpConst8(v)
   607  	case OpConstBool:
   608  		return rewriteValueARM64_OpConstBool(v)
   609  	case OpConstNil:
   610  		return rewriteValueARM64_OpConstNil(v)
   611  	case OpCtz16:
   612  		return rewriteValueARM64_OpCtz16(v)
   613  	case OpCtz16NonZero:
   614  		v.Op = OpCtz32
   615  		return true
   616  	case OpCtz32:
   617  		return rewriteValueARM64_OpCtz32(v)
   618  	case OpCtz32NonZero:
   619  		v.Op = OpCtz32
   620  		return true
   621  	case OpCtz64:
   622  		return rewriteValueARM64_OpCtz64(v)
   623  	case OpCtz64NonZero:
   624  		v.Op = OpCtz64
   625  		return true
   626  	case OpCtz8:
   627  		return rewriteValueARM64_OpCtz8(v)
   628  	case OpCtz8NonZero:
   629  		v.Op = OpCtz32
   630  		return true
   631  	case OpCvt32Fto32:
   632  		v.Op = OpARM64FCVTZSSW
   633  		return true
   634  	case OpCvt32Fto32U:
   635  		v.Op = OpARM64FCVTZUSW
   636  		return true
   637  	case OpCvt32Fto64:
   638  		v.Op = OpARM64FCVTZSS
   639  		return true
   640  	case OpCvt32Fto64F:
   641  		v.Op = OpARM64FCVTSD
   642  		return true
   643  	case OpCvt32Fto64U:
   644  		v.Op = OpARM64FCVTZUS
   645  		return true
   646  	case OpCvt32Uto32F:
   647  		v.Op = OpARM64UCVTFWS
   648  		return true
   649  	case OpCvt32Uto64F:
   650  		v.Op = OpARM64UCVTFWD
   651  		return true
   652  	case OpCvt32to32F:
   653  		v.Op = OpARM64SCVTFWS
   654  		return true
   655  	case OpCvt32to64F:
   656  		v.Op = OpARM64SCVTFWD
   657  		return true
   658  	case OpCvt64Fto32:
   659  		v.Op = OpARM64FCVTZSDW
   660  		return true
   661  	case OpCvt64Fto32F:
   662  		v.Op = OpARM64FCVTDS
   663  		return true
   664  	case OpCvt64Fto32U:
   665  		v.Op = OpARM64FCVTZUDW
   666  		return true
   667  	case OpCvt64Fto64:
   668  		v.Op = OpARM64FCVTZSD
   669  		return true
   670  	case OpCvt64Fto64U:
   671  		v.Op = OpARM64FCVTZUD
   672  		return true
   673  	case OpCvt64Uto32F:
   674  		v.Op = OpARM64UCVTFS
   675  		return true
   676  	case OpCvt64Uto64F:
   677  		v.Op = OpARM64UCVTFD
   678  		return true
   679  	case OpCvt64to32F:
   680  		v.Op = OpARM64SCVTFS
   681  		return true
   682  	case OpCvt64to64F:
   683  		v.Op = OpARM64SCVTFD
   684  		return true
   685  	case OpCvtBoolToUint8:
   686  		v.Op = OpCopy
   687  		return true
   688  	case OpDiv16:
   689  		return rewriteValueARM64_OpDiv16(v)
   690  	case OpDiv16u:
   691  		return rewriteValueARM64_OpDiv16u(v)
   692  	case OpDiv32:
   693  		return rewriteValueARM64_OpDiv32(v)
   694  	case OpDiv32F:
   695  		v.Op = OpARM64FDIVS
   696  		return true
   697  	case OpDiv32u:
   698  		v.Op = OpARM64UDIVW
   699  		return true
   700  	case OpDiv64:
   701  		return rewriteValueARM64_OpDiv64(v)
   702  	case OpDiv64F:
   703  		v.Op = OpARM64FDIVD
   704  		return true
   705  	case OpDiv64u:
   706  		v.Op = OpARM64UDIV
   707  		return true
   708  	case OpDiv8:
   709  		return rewriteValueARM64_OpDiv8(v)
   710  	case OpDiv8u:
   711  		return rewriteValueARM64_OpDiv8u(v)
   712  	case OpEq16:
   713  		return rewriteValueARM64_OpEq16(v)
   714  	case OpEq32:
   715  		return rewriteValueARM64_OpEq32(v)
   716  	case OpEq32F:
   717  		return rewriteValueARM64_OpEq32F(v)
   718  	case OpEq64:
   719  		return rewriteValueARM64_OpEq64(v)
   720  	case OpEq64F:
   721  		return rewriteValueARM64_OpEq64F(v)
   722  	case OpEq8:
   723  		return rewriteValueARM64_OpEq8(v)
   724  	case OpEqB:
   725  		return rewriteValueARM64_OpEqB(v)
   726  	case OpEqPtr:
   727  		return rewriteValueARM64_OpEqPtr(v)
   728  	case OpFMA:
   729  		return rewriteValueARM64_OpFMA(v)
   730  	case OpFloor:
   731  		v.Op = OpARM64FRINTMD
   732  		return true
   733  	case OpGetCallerPC:
   734  		v.Op = OpARM64LoweredGetCallerPC
   735  		return true
   736  	case OpGetCallerSP:
   737  		v.Op = OpARM64LoweredGetCallerSP
   738  		return true
   739  	case OpGetClosurePtr:
   740  		v.Op = OpARM64LoweredGetClosurePtr
   741  		return true
   742  	case OpHmul32:
   743  		return rewriteValueARM64_OpHmul32(v)
   744  	case OpHmul32u:
   745  		return rewriteValueARM64_OpHmul32u(v)
   746  	case OpHmul64:
   747  		v.Op = OpARM64MULH
   748  		return true
   749  	case OpHmul64u:
   750  		v.Op = OpARM64UMULH
   751  		return true
   752  	case OpInterCall:
   753  		v.Op = OpARM64CALLinter
   754  		return true
   755  	case OpIsInBounds:
   756  		return rewriteValueARM64_OpIsInBounds(v)
   757  	case OpIsNonNil:
   758  		return rewriteValueARM64_OpIsNonNil(v)
   759  	case OpIsSliceInBounds:
   760  		return rewriteValueARM64_OpIsSliceInBounds(v)
   761  	case OpLeq16:
   762  		return rewriteValueARM64_OpLeq16(v)
   763  	case OpLeq16U:
   764  		return rewriteValueARM64_OpLeq16U(v)
   765  	case OpLeq32:
   766  		return rewriteValueARM64_OpLeq32(v)
   767  	case OpLeq32F:
   768  		return rewriteValueARM64_OpLeq32F(v)
   769  	case OpLeq32U:
   770  		return rewriteValueARM64_OpLeq32U(v)
   771  	case OpLeq64:
   772  		return rewriteValueARM64_OpLeq64(v)
   773  	case OpLeq64F:
   774  		return rewriteValueARM64_OpLeq64F(v)
   775  	case OpLeq64U:
   776  		return rewriteValueARM64_OpLeq64U(v)
   777  	case OpLeq8:
   778  		return rewriteValueARM64_OpLeq8(v)
   779  	case OpLeq8U:
   780  		return rewriteValueARM64_OpLeq8U(v)
   781  	case OpLess16:
   782  		return rewriteValueARM64_OpLess16(v)
   783  	case OpLess16U:
   784  		return rewriteValueARM64_OpLess16U(v)
   785  	case OpLess32:
   786  		return rewriteValueARM64_OpLess32(v)
   787  	case OpLess32F:
   788  		return rewriteValueARM64_OpLess32F(v)
   789  	case OpLess32U:
   790  		return rewriteValueARM64_OpLess32U(v)
   791  	case OpLess64:
   792  		return rewriteValueARM64_OpLess64(v)
   793  	case OpLess64F:
   794  		return rewriteValueARM64_OpLess64F(v)
   795  	case OpLess64U:
   796  		return rewriteValueARM64_OpLess64U(v)
   797  	case OpLess8:
   798  		return rewriteValueARM64_OpLess8(v)
   799  	case OpLess8U:
   800  		return rewriteValueARM64_OpLess8U(v)
   801  	case OpLoad:
   802  		return rewriteValueARM64_OpLoad(v)
   803  	case OpLocalAddr:
   804  		return rewriteValueARM64_OpLocalAddr(v)
   805  	case OpLsh16x16:
   806  		return rewriteValueARM64_OpLsh16x16(v)
   807  	case OpLsh16x32:
   808  		return rewriteValueARM64_OpLsh16x32(v)
   809  	case OpLsh16x64:
   810  		return rewriteValueARM64_OpLsh16x64(v)
   811  	case OpLsh16x8:
   812  		return rewriteValueARM64_OpLsh16x8(v)
   813  	case OpLsh32x16:
   814  		return rewriteValueARM64_OpLsh32x16(v)
   815  	case OpLsh32x32:
   816  		return rewriteValueARM64_OpLsh32x32(v)
   817  	case OpLsh32x64:
   818  		return rewriteValueARM64_OpLsh32x64(v)
   819  	case OpLsh32x8:
   820  		return rewriteValueARM64_OpLsh32x8(v)
   821  	case OpLsh64x16:
   822  		return rewriteValueARM64_OpLsh64x16(v)
   823  	case OpLsh64x32:
   824  		return rewriteValueARM64_OpLsh64x32(v)
   825  	case OpLsh64x64:
   826  		return rewriteValueARM64_OpLsh64x64(v)
   827  	case OpLsh64x8:
   828  		return rewriteValueARM64_OpLsh64x8(v)
   829  	case OpLsh8x16:
   830  		return rewriteValueARM64_OpLsh8x16(v)
   831  	case OpLsh8x32:
   832  		return rewriteValueARM64_OpLsh8x32(v)
   833  	case OpLsh8x64:
   834  		return rewriteValueARM64_OpLsh8x64(v)
   835  	case OpLsh8x8:
   836  		return rewriteValueARM64_OpLsh8x8(v)
   837  	case OpMax32F:
   838  		v.Op = OpARM64FMAXS
   839  		return true
   840  	case OpMax64F:
   841  		v.Op = OpARM64FMAXD
   842  		return true
   843  	case OpMemEq:
   844  		v.Op = OpARM64LoweredMemEq
   845  		return true
   846  	case OpMin32F:
   847  		v.Op = OpARM64FMINS
   848  		return true
   849  	case OpMin64F:
   850  		v.Op = OpARM64FMIND
   851  		return true
   852  	case OpMod16:
   853  		return rewriteValueARM64_OpMod16(v)
   854  	case OpMod16u:
   855  		return rewriteValueARM64_OpMod16u(v)
   856  	case OpMod32:
   857  		return rewriteValueARM64_OpMod32(v)
   858  	case OpMod32u:
   859  		v.Op = OpARM64UMODW
   860  		return true
   861  	case OpMod64:
   862  		return rewriteValueARM64_OpMod64(v)
   863  	case OpMod64u:
   864  		v.Op = OpARM64UMOD
   865  		return true
   866  	case OpMod8:
   867  		return rewriteValueARM64_OpMod8(v)
   868  	case OpMod8u:
   869  		return rewriteValueARM64_OpMod8u(v)
   870  	case OpMove:
   871  		return rewriteValueARM64_OpMove(v)
   872  	case OpMul16:
   873  		v.Op = OpARM64MULW
   874  		return true
   875  	case OpMul32:
   876  		v.Op = OpARM64MULW
   877  		return true
   878  	case OpMul32F:
   879  		v.Op = OpARM64FMULS
   880  		return true
   881  	case OpMul64:
   882  		v.Op = OpARM64MUL
   883  		return true
   884  	case OpMul64F:
   885  		v.Op = OpARM64FMULD
   886  		return true
   887  	case OpMul8:
   888  		v.Op = OpARM64MULW
   889  		return true
   890  	case OpNeg16:
   891  		v.Op = OpARM64NEG
   892  		return true
   893  	case OpNeg32:
   894  		v.Op = OpARM64NEG
   895  		return true
   896  	case OpNeg32F:
   897  		v.Op = OpARM64FNEGS
   898  		return true
   899  	case OpNeg64:
   900  		v.Op = OpARM64NEG
   901  		return true
   902  	case OpNeg64F:
   903  		v.Op = OpARM64FNEGD
   904  		return true
   905  	case OpNeg8:
   906  		v.Op = OpARM64NEG
   907  		return true
   908  	case OpNeq16:
   909  		return rewriteValueARM64_OpNeq16(v)
   910  	case OpNeq32:
   911  		return rewriteValueARM64_OpNeq32(v)
   912  	case OpNeq32F:
   913  		return rewriteValueARM64_OpNeq32F(v)
   914  	case OpNeq64:
   915  		return rewriteValueARM64_OpNeq64(v)
   916  	case OpNeq64F:
   917  		return rewriteValueARM64_OpNeq64F(v)
   918  	case OpNeq8:
   919  		return rewriteValueARM64_OpNeq8(v)
   920  	case OpNeqB:
   921  		v.Op = OpARM64XOR
   922  		return true
   923  	case OpNeqPtr:
   924  		return rewriteValueARM64_OpNeqPtr(v)
   925  	case OpNilCheck:
   926  		v.Op = OpARM64LoweredNilCheck
   927  		return true
   928  	case OpNot:
   929  		return rewriteValueARM64_OpNot(v)
   930  	case OpOffPtr:
   931  		return rewriteValueARM64_OpOffPtr(v)
   932  	case OpOr16:
   933  		v.Op = OpARM64OR
   934  		return true
   935  	case OpOr32:
   936  		v.Op = OpARM64OR
   937  		return true
   938  	case OpOr64:
   939  		v.Op = OpARM64OR
   940  		return true
   941  	case OpOr8:
   942  		v.Op = OpARM64OR
   943  		return true
   944  	case OpOrB:
   945  		v.Op = OpARM64OR
   946  		return true
   947  	case OpPanicBounds:
   948  		v.Op = OpARM64LoweredPanicBoundsRR
   949  		return true
   950  	case OpPopCount16:
   951  		return rewriteValueARM64_OpPopCount16(v)
   952  	case OpPopCount32:
   953  		return rewriteValueARM64_OpPopCount32(v)
   954  	case OpPopCount64:
   955  		return rewriteValueARM64_OpPopCount64(v)
   956  	case OpPrefetchCache:
   957  		return rewriteValueARM64_OpPrefetchCache(v)
   958  	case OpPrefetchCacheStreamed:
   959  		return rewriteValueARM64_OpPrefetchCacheStreamed(v)
   960  	case OpPubBarrier:
   961  		return rewriteValueARM64_OpPubBarrier(v)
   962  	case OpRotateLeft16:
   963  		return rewriteValueARM64_OpRotateLeft16(v)
   964  	case OpRotateLeft32:
   965  		return rewriteValueARM64_OpRotateLeft32(v)
   966  	case OpRotateLeft64:
   967  		return rewriteValueARM64_OpRotateLeft64(v)
   968  	case OpRotateLeft8:
   969  		return rewriteValueARM64_OpRotateLeft8(v)
   970  	case OpRound:
   971  		v.Op = OpARM64FRINTAD
   972  		return true
   973  	case OpRound32F:
   974  		v.Op = OpARM64LoweredRound32F
   975  		return true
   976  	case OpRound64F:
   977  		v.Op = OpARM64LoweredRound64F
   978  		return true
   979  	case OpRoundToEven:
   980  		v.Op = OpARM64FRINTND
   981  		return true
   982  	case OpRsh16Ux16:
   983  		return rewriteValueARM64_OpRsh16Ux16(v)
   984  	case OpRsh16Ux32:
   985  		return rewriteValueARM64_OpRsh16Ux32(v)
   986  	case OpRsh16Ux64:
   987  		return rewriteValueARM64_OpRsh16Ux64(v)
   988  	case OpRsh16Ux8:
   989  		return rewriteValueARM64_OpRsh16Ux8(v)
   990  	case OpRsh16x16:
   991  		return rewriteValueARM64_OpRsh16x16(v)
   992  	case OpRsh16x32:
   993  		return rewriteValueARM64_OpRsh16x32(v)
   994  	case OpRsh16x64:
   995  		return rewriteValueARM64_OpRsh16x64(v)
   996  	case OpRsh16x8:
   997  		return rewriteValueARM64_OpRsh16x8(v)
   998  	case OpRsh32Ux16:
   999  		return rewriteValueARM64_OpRsh32Ux16(v)
  1000  	case OpRsh32Ux32:
  1001  		return rewriteValueARM64_OpRsh32Ux32(v)
  1002  	case OpRsh32Ux64:
  1003  		return rewriteValueARM64_OpRsh32Ux64(v)
  1004  	case OpRsh32Ux8:
  1005  		return rewriteValueARM64_OpRsh32Ux8(v)
  1006  	case OpRsh32x16:
  1007  		return rewriteValueARM64_OpRsh32x16(v)
  1008  	case OpRsh32x32:
  1009  		return rewriteValueARM64_OpRsh32x32(v)
  1010  	case OpRsh32x64:
  1011  		return rewriteValueARM64_OpRsh32x64(v)
  1012  	case OpRsh32x8:
  1013  		return rewriteValueARM64_OpRsh32x8(v)
  1014  	case OpRsh64Ux16:
  1015  		return rewriteValueARM64_OpRsh64Ux16(v)
  1016  	case OpRsh64Ux32:
  1017  		return rewriteValueARM64_OpRsh64Ux32(v)
  1018  	case OpRsh64Ux64:
  1019  		return rewriteValueARM64_OpRsh64Ux64(v)
  1020  	case OpRsh64Ux8:
  1021  		return rewriteValueARM64_OpRsh64Ux8(v)
  1022  	case OpRsh64x16:
  1023  		return rewriteValueARM64_OpRsh64x16(v)
  1024  	case OpRsh64x32:
  1025  		return rewriteValueARM64_OpRsh64x32(v)
  1026  	case OpRsh64x64:
  1027  		return rewriteValueARM64_OpRsh64x64(v)
  1028  	case OpRsh64x8:
  1029  		return rewriteValueARM64_OpRsh64x8(v)
  1030  	case OpRsh8Ux16:
  1031  		return rewriteValueARM64_OpRsh8Ux16(v)
  1032  	case OpRsh8Ux32:
  1033  		return rewriteValueARM64_OpRsh8Ux32(v)
  1034  	case OpRsh8Ux64:
  1035  		return rewriteValueARM64_OpRsh8Ux64(v)
  1036  	case OpRsh8Ux8:
  1037  		return rewriteValueARM64_OpRsh8Ux8(v)
  1038  	case OpRsh8x16:
  1039  		return rewriteValueARM64_OpRsh8x16(v)
  1040  	case OpRsh8x32:
  1041  		return rewriteValueARM64_OpRsh8x32(v)
  1042  	case OpRsh8x64:
  1043  		return rewriteValueARM64_OpRsh8x64(v)
  1044  	case OpRsh8x8:
  1045  		return rewriteValueARM64_OpRsh8x8(v)
  1046  	case OpSelect0:
  1047  		return rewriteValueARM64_OpSelect0(v)
  1048  	case OpSelect1:
  1049  		return rewriteValueARM64_OpSelect1(v)
  1050  	case OpSelectN:
  1051  		return rewriteValueARM64_OpSelectN(v)
  1052  	case OpSignExt16to32:
  1053  		v.Op = OpARM64MOVHreg
  1054  		return true
  1055  	case OpSignExt16to64:
  1056  		v.Op = OpARM64MOVHreg
  1057  		return true
  1058  	case OpSignExt32to64:
  1059  		v.Op = OpARM64MOVWreg
  1060  		return true
  1061  	case OpSignExt8to16:
  1062  		v.Op = OpARM64MOVBreg
  1063  		return true
  1064  	case OpSignExt8to32:
  1065  		v.Op = OpARM64MOVBreg
  1066  		return true
  1067  	case OpSignExt8to64:
  1068  		v.Op = OpARM64MOVBreg
  1069  		return true
  1070  	case OpSlicemask:
  1071  		return rewriteValueARM64_OpSlicemask(v)
  1072  	case OpSqrt:
  1073  		v.Op = OpARM64FSQRTD
  1074  		return true
  1075  	case OpSqrt32:
  1076  		v.Op = OpARM64FSQRTS
  1077  		return true
  1078  	case OpStaticCall:
  1079  		v.Op = OpARM64CALLstatic
  1080  		return true
  1081  	case OpStore:
  1082  		return rewriteValueARM64_OpStore(v)
  1083  	case OpSub16:
  1084  		v.Op = OpARM64SUB
  1085  		return true
  1086  	case OpSub32:
  1087  		v.Op = OpARM64SUB
  1088  		return true
  1089  	case OpSub32F:
  1090  		v.Op = OpARM64FSUBS
  1091  		return true
  1092  	case OpSub64:
  1093  		v.Op = OpARM64SUB
  1094  		return true
  1095  	case OpSub64F:
  1096  		v.Op = OpARM64FSUBD
  1097  		return true
  1098  	case OpSub8:
  1099  		v.Op = OpARM64SUB
  1100  		return true
  1101  	case OpSubPtr:
  1102  		v.Op = OpARM64SUB
  1103  		return true
  1104  	case OpTailCall:
  1105  		v.Op = OpARM64CALLtail
  1106  		return true
  1107  	case OpTrunc:
  1108  		v.Op = OpARM64FRINTZD
  1109  		return true
  1110  	case OpTrunc16to8:
  1111  		v.Op = OpCopy
  1112  		return true
  1113  	case OpTrunc32to16:
  1114  		v.Op = OpCopy
  1115  		return true
  1116  	case OpTrunc32to8:
  1117  		v.Op = OpCopy
  1118  		return true
  1119  	case OpTrunc64to16:
  1120  		v.Op = OpCopy
  1121  		return true
  1122  	case OpTrunc64to32:
  1123  		v.Op = OpCopy
  1124  		return true
  1125  	case OpTrunc64to8:
  1126  		v.Op = OpCopy
  1127  		return true
  1128  	case OpWB:
  1129  		v.Op = OpARM64LoweredWB
  1130  		return true
  1131  	case OpXor16:
  1132  		v.Op = OpARM64XOR
  1133  		return true
  1134  	case OpXor32:
  1135  		v.Op = OpARM64XOR
  1136  		return true
  1137  	case OpXor64:
  1138  		v.Op = OpARM64XOR
  1139  		return true
  1140  	case OpXor8:
  1141  		v.Op = OpARM64XOR
  1142  		return true
  1143  	case OpZero:
  1144  		return rewriteValueARM64_OpZero(v)
  1145  	case OpZeroExt16to32:
  1146  		v.Op = OpARM64MOVHUreg
  1147  		return true
  1148  	case OpZeroExt16to64:
  1149  		v.Op = OpARM64MOVHUreg
  1150  		return true
  1151  	case OpZeroExt32to64:
  1152  		v.Op = OpARM64MOVWUreg
  1153  		return true
  1154  	case OpZeroExt8to16:
  1155  		v.Op = OpARM64MOVBUreg
  1156  		return true
  1157  	case OpZeroExt8to32:
  1158  		v.Op = OpARM64MOVBUreg
  1159  		return true
  1160  	case OpZeroExt8to64:
  1161  		v.Op = OpARM64MOVBUreg
  1162  		return true
  1163  	}
  1164  	return false
  1165  }
  1166  func rewriteValueARM64_OpARM64ADCSflags(v *Value) bool {
  1167  	v_2 := v.Args[2]
  1168  	v_1 := v.Args[1]
  1169  	v_0 := v.Args[0]
  1170  	b := v.Block
  1171  	typ := &b.Func.Config.Types
  1172  	// match: (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] (ADCzerocarry <typ.UInt64> c))))
  1173  	// result: (ADCSflags x y c)
  1174  	for {
  1175  		x := v_0
  1176  		y := v_1
  1177  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
  1178  			break
  1179  		}
  1180  		v_2_0 := v_2.Args[0]
  1181  		if v_2_0.Op != OpARM64ADDSconstflags || auxIntToInt64(v_2_0.AuxInt) != -1 {
  1182  			break
  1183  		}
  1184  		v_2_0_0 := v_2_0.Args[0]
  1185  		if v_2_0_0.Op != OpARM64ADCzerocarry || v_2_0_0.Type != typ.UInt64 {
  1186  			break
  1187  		}
  1188  		c := v_2_0_0.Args[0]
  1189  		v.reset(OpARM64ADCSflags)
  1190  		v.AddArg3(x, y, c)
  1191  		return true
  1192  	}
  1193  	// match: (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] (MOVDconst [0]))))
  1194  	// result: (ADDSflags x y)
  1195  	for {
  1196  		x := v_0
  1197  		y := v_1
  1198  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
  1199  			break
  1200  		}
  1201  		v_2_0 := v_2.Args[0]
  1202  		if v_2_0.Op != OpARM64ADDSconstflags || auxIntToInt64(v_2_0.AuxInt) != -1 {
  1203  			break
  1204  		}
  1205  		v_2_0_0 := v_2_0.Args[0]
  1206  		if v_2_0_0.Op != OpARM64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
  1207  			break
  1208  		}
  1209  		v.reset(OpARM64ADDSflags)
  1210  		v.AddArg2(x, y)
  1211  		return true
  1212  	}
  1213  	return false
  1214  }
  1215  func rewriteValueARM64_OpARM64ADD(v *Value) bool {
  1216  	v_1 := v.Args[1]
  1217  	v_0 := v.Args[0]
  1218  	b := v.Block
  1219  	// match: (ADD x (MOVDconst <t> [c]))
  1220  	// cond: !t.IsPtr()
  1221  	// result: (ADDconst [c] x)
  1222  	for {
  1223  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1224  			x := v_0
  1225  			if v_1.Op != OpARM64MOVDconst {
  1226  				continue
  1227  			}
  1228  			t := v_1.Type
  1229  			c := auxIntToInt64(v_1.AuxInt)
  1230  			if !(!t.IsPtr()) {
  1231  				continue
  1232  			}
  1233  			v.reset(OpARM64ADDconst)
  1234  			v.AuxInt = int64ToAuxInt(c)
  1235  			v.AddArg(x)
  1236  			return true
  1237  		}
  1238  		break
  1239  	}
  1240  	// match: (ADD a l:(MUL x y))
  1241  	// cond: l.Uses==1 && clobber(l)
  1242  	// result: (MADD a x y)
  1243  	for {
  1244  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1245  			a := v_0
  1246  			l := v_1
  1247  			if l.Op != OpARM64MUL {
  1248  				continue
  1249  			}
  1250  			y := l.Args[1]
  1251  			x := l.Args[0]
  1252  			if !(l.Uses == 1 && clobber(l)) {
  1253  				continue
  1254  			}
  1255  			v.reset(OpARM64MADD)
  1256  			v.AddArg3(a, x, y)
  1257  			return true
  1258  		}
  1259  		break
  1260  	}
  1261  	// match: (ADD a l:(MNEG x y))
  1262  	// cond: l.Uses==1 && clobber(l)
  1263  	// result: (MSUB a x y)
  1264  	for {
  1265  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1266  			a := v_0
  1267  			l := v_1
  1268  			if l.Op != OpARM64MNEG {
  1269  				continue
  1270  			}
  1271  			y := l.Args[1]
  1272  			x := l.Args[0]
  1273  			if !(l.Uses == 1 && clobber(l)) {
  1274  				continue
  1275  			}
  1276  			v.reset(OpARM64MSUB)
  1277  			v.AddArg3(a, x, y)
  1278  			return true
  1279  		}
  1280  		break
  1281  	}
  1282  	// match: (ADD a l:(MULW x y))
  1283  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
  1284  	// result: (MADDW a x y)
  1285  	for {
  1286  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1287  			a := v_0
  1288  			l := v_1
  1289  			if l.Op != OpARM64MULW {
  1290  				continue
  1291  			}
  1292  			y := l.Args[1]
  1293  			x := l.Args[0]
  1294  			if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
  1295  				continue
  1296  			}
  1297  			v.reset(OpARM64MADDW)
  1298  			v.AddArg3(a, x, y)
  1299  			return true
  1300  		}
  1301  		break
  1302  	}
  1303  	// match: (ADD a l:(MNEGW x y))
  1304  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
  1305  	// result: (MSUBW a x y)
  1306  	for {
  1307  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1308  			a := v_0
  1309  			l := v_1
  1310  			if l.Op != OpARM64MNEGW {
  1311  				continue
  1312  			}
  1313  			y := l.Args[1]
  1314  			x := l.Args[0]
  1315  			if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
  1316  				continue
  1317  			}
  1318  			v.reset(OpARM64MSUBW)
  1319  			v.AddArg3(a, x, y)
  1320  			return true
  1321  		}
  1322  		break
  1323  	}
  1324  	// match: (ADD <t> a p:(ADDconst [c] m:(MUL _ _)))
  1325  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1326  	// result: (ADDconst [c] (ADD <v.Type> a m))
  1327  	for {
  1328  		t := v.Type
  1329  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1330  			a := v_0
  1331  			p := v_1
  1332  			if p.Op != OpARM64ADDconst {
  1333  				continue
  1334  			}
  1335  			c := auxIntToInt64(p.AuxInt)
  1336  			m := p.Args[0]
  1337  			if m.Op != OpARM64MUL || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1338  				continue
  1339  			}
  1340  			v.reset(OpARM64ADDconst)
  1341  			v.AuxInt = int64ToAuxInt(c)
  1342  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1343  			v0.AddArg2(a, m)
  1344  			v.AddArg(v0)
  1345  			return true
  1346  		}
  1347  		break
  1348  	}
  1349  	// match: (ADD <t> a p:(ADDconst [c] m:(MULW _ _)))
  1350  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1351  	// result: (ADDconst [c] (ADD <v.Type> a m))
  1352  	for {
  1353  		t := v.Type
  1354  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1355  			a := v_0
  1356  			p := v_1
  1357  			if p.Op != OpARM64ADDconst {
  1358  				continue
  1359  			}
  1360  			c := auxIntToInt64(p.AuxInt)
  1361  			m := p.Args[0]
  1362  			if m.Op != OpARM64MULW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1363  				continue
  1364  			}
  1365  			v.reset(OpARM64ADDconst)
  1366  			v.AuxInt = int64ToAuxInt(c)
  1367  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1368  			v0.AddArg2(a, m)
  1369  			v.AddArg(v0)
  1370  			return true
  1371  		}
  1372  		break
  1373  	}
  1374  	// match: (ADD <t> a p:(ADDconst [c] m:(MNEG _ _)))
  1375  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1376  	// result: (ADDconst [c] (ADD <v.Type> a m))
  1377  	for {
  1378  		t := v.Type
  1379  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1380  			a := v_0
  1381  			p := v_1
  1382  			if p.Op != OpARM64ADDconst {
  1383  				continue
  1384  			}
  1385  			c := auxIntToInt64(p.AuxInt)
  1386  			m := p.Args[0]
  1387  			if m.Op != OpARM64MNEG || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1388  				continue
  1389  			}
  1390  			v.reset(OpARM64ADDconst)
  1391  			v.AuxInt = int64ToAuxInt(c)
  1392  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1393  			v0.AddArg2(a, m)
  1394  			v.AddArg(v0)
  1395  			return true
  1396  		}
  1397  		break
  1398  	}
  1399  	// match: (ADD <t> a p:(ADDconst [c] m:(MNEGW _ _)))
  1400  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1401  	// result: (ADDconst [c] (ADD <v.Type> a m))
  1402  	for {
  1403  		t := v.Type
  1404  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1405  			a := v_0
  1406  			p := v_1
  1407  			if p.Op != OpARM64ADDconst {
  1408  				continue
  1409  			}
  1410  			c := auxIntToInt64(p.AuxInt)
  1411  			m := p.Args[0]
  1412  			if m.Op != OpARM64MNEGW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1413  				continue
  1414  			}
  1415  			v.reset(OpARM64ADDconst)
  1416  			v.AuxInt = int64ToAuxInt(c)
  1417  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1418  			v0.AddArg2(a, m)
  1419  			v.AddArg(v0)
  1420  			return true
  1421  		}
  1422  		break
  1423  	}
  1424  	// match: (ADD <t> a p:(SUBconst [c] m:(MUL _ _)))
  1425  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1426  	// result: (SUBconst [c] (ADD <v.Type> a m))
  1427  	for {
  1428  		t := v.Type
  1429  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1430  			a := v_0
  1431  			p := v_1
  1432  			if p.Op != OpARM64SUBconst {
  1433  				continue
  1434  			}
  1435  			c := auxIntToInt64(p.AuxInt)
  1436  			m := p.Args[0]
  1437  			if m.Op != OpARM64MUL || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1438  				continue
  1439  			}
  1440  			v.reset(OpARM64SUBconst)
  1441  			v.AuxInt = int64ToAuxInt(c)
  1442  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1443  			v0.AddArg2(a, m)
  1444  			v.AddArg(v0)
  1445  			return true
  1446  		}
  1447  		break
  1448  	}
  1449  	// match: (ADD <t> a p:(SUBconst [c] m:(MULW _ _)))
  1450  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1451  	// result: (SUBconst [c] (ADD <v.Type> a m))
  1452  	for {
  1453  		t := v.Type
  1454  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1455  			a := v_0
  1456  			p := v_1
  1457  			if p.Op != OpARM64SUBconst {
  1458  				continue
  1459  			}
  1460  			c := auxIntToInt64(p.AuxInt)
  1461  			m := p.Args[0]
  1462  			if m.Op != OpARM64MULW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1463  				continue
  1464  			}
  1465  			v.reset(OpARM64SUBconst)
  1466  			v.AuxInt = int64ToAuxInt(c)
  1467  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1468  			v0.AddArg2(a, m)
  1469  			v.AddArg(v0)
  1470  			return true
  1471  		}
  1472  		break
  1473  	}
  1474  	// match: (ADD <t> a p:(SUBconst [c] m:(MNEG _ _)))
  1475  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1476  	// result: (SUBconst [c] (ADD <v.Type> a m))
  1477  	for {
  1478  		t := v.Type
  1479  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1480  			a := v_0
  1481  			p := v_1
  1482  			if p.Op != OpARM64SUBconst {
  1483  				continue
  1484  			}
  1485  			c := auxIntToInt64(p.AuxInt)
  1486  			m := p.Args[0]
  1487  			if m.Op != OpARM64MNEG || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1488  				continue
  1489  			}
  1490  			v.reset(OpARM64SUBconst)
  1491  			v.AuxInt = int64ToAuxInt(c)
  1492  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1493  			v0.AddArg2(a, m)
  1494  			v.AddArg(v0)
  1495  			return true
  1496  		}
  1497  		break
  1498  	}
  1499  	// match: (ADD <t> a p:(SUBconst [c] m:(MNEGW _ _)))
  1500  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
  1501  	// result: (SUBconst [c] (ADD <v.Type> a m))
  1502  	for {
  1503  		t := v.Type
  1504  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1505  			a := v_0
  1506  			p := v_1
  1507  			if p.Op != OpARM64SUBconst {
  1508  				continue
  1509  			}
  1510  			c := auxIntToInt64(p.AuxInt)
  1511  			m := p.Args[0]
  1512  			if m.Op != OpARM64MNEGW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
  1513  				continue
  1514  			}
  1515  			v.reset(OpARM64SUBconst)
  1516  			v.AuxInt = int64ToAuxInt(c)
  1517  			v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
  1518  			v0.AddArg2(a, m)
  1519  			v.AddArg(v0)
  1520  			return true
  1521  		}
  1522  		break
  1523  	}
  1524  	// match: (ADD x (NEG y))
  1525  	// result: (SUB x y)
  1526  	for {
  1527  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1528  			x := v_0
  1529  			if v_1.Op != OpARM64NEG {
  1530  				continue
  1531  			}
  1532  			y := v_1.Args[0]
  1533  			v.reset(OpARM64SUB)
  1534  			v.AddArg2(x, y)
  1535  			return true
  1536  		}
  1537  		break
  1538  	}
  1539  	// match: (ADD x0 x1:(SLLconst [c] y))
  1540  	// cond: clobberIfDead(x1)
  1541  	// result: (ADDshiftLL x0 y [c])
  1542  	for {
  1543  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1544  			x0 := v_0
  1545  			x1 := v_1
  1546  			if x1.Op != OpARM64SLLconst {
  1547  				continue
  1548  			}
  1549  			c := auxIntToInt64(x1.AuxInt)
  1550  			y := x1.Args[0]
  1551  			if !(clobberIfDead(x1)) {
  1552  				continue
  1553  			}
  1554  			v.reset(OpARM64ADDshiftLL)
  1555  			v.AuxInt = int64ToAuxInt(c)
  1556  			v.AddArg2(x0, y)
  1557  			return true
  1558  		}
  1559  		break
  1560  	}
  1561  	// match: (ADD x0 x1:(SRLconst [c] y))
  1562  	// cond: clobberIfDead(x1)
  1563  	// result: (ADDshiftRL x0 y [c])
  1564  	for {
  1565  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1566  			x0 := v_0
  1567  			x1 := v_1
  1568  			if x1.Op != OpARM64SRLconst {
  1569  				continue
  1570  			}
  1571  			c := auxIntToInt64(x1.AuxInt)
  1572  			y := x1.Args[0]
  1573  			if !(clobberIfDead(x1)) {
  1574  				continue
  1575  			}
  1576  			v.reset(OpARM64ADDshiftRL)
  1577  			v.AuxInt = int64ToAuxInt(c)
  1578  			v.AddArg2(x0, y)
  1579  			return true
  1580  		}
  1581  		break
  1582  	}
  1583  	// match: (ADD x0 x1:(SRAconst [c] y))
  1584  	// cond: clobberIfDead(x1)
  1585  	// result: (ADDshiftRA x0 y [c])
  1586  	for {
  1587  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1588  			x0 := v_0
  1589  			x1 := v_1
  1590  			if x1.Op != OpARM64SRAconst {
  1591  				continue
  1592  			}
  1593  			c := auxIntToInt64(x1.AuxInt)
  1594  			y := x1.Args[0]
  1595  			if !(clobberIfDead(x1)) {
  1596  				continue
  1597  			}
  1598  			v.reset(OpARM64ADDshiftRA)
  1599  			v.AuxInt = int64ToAuxInt(c)
  1600  			v.AddArg2(x0, y)
  1601  			return true
  1602  		}
  1603  		break
  1604  	}
  1605  	// match: (ADD x0 x1:(ANDshiftRA x2:(SLLconst [sl] y) z [63]))
  1606  	// cond: x1.Uses == 1 && x2.Uses == 1
  1607  	// result: (ADDshiftLL x0 (ANDshiftRA <y.Type> y z [63]) [sl])
  1608  	for {
  1609  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1610  			x0 := v_0
  1611  			x1 := v_1
  1612  			if x1.Op != OpARM64ANDshiftRA || auxIntToInt64(x1.AuxInt) != 63 {
  1613  				continue
  1614  			}
  1615  			z := x1.Args[1]
  1616  			x2 := x1.Args[0]
  1617  			if x2.Op != OpARM64SLLconst {
  1618  				continue
  1619  			}
  1620  			sl := auxIntToInt64(x2.AuxInt)
  1621  			y := x2.Args[0]
  1622  			if !(x1.Uses == 1 && x2.Uses == 1) {
  1623  				continue
  1624  			}
  1625  			v.reset(OpARM64ADDshiftLL)
  1626  			v.AuxInt = int64ToAuxInt(sl)
  1627  			v0 := b.NewValue0(v.Pos, OpARM64ANDshiftRA, y.Type)
  1628  			v0.AuxInt = int64ToAuxInt(63)
  1629  			v0.AddArg2(y, z)
  1630  			v.AddArg2(x0, v0)
  1631  			return true
  1632  		}
  1633  		break
  1634  	}
  1635  	// match: (ADD x0 x1:(ANDshiftLL x2:(SRAconst [63] z) y [sl]))
  1636  	// cond: x1.Uses == 1 && x2.Uses == 1
  1637  	// result: (ADDshiftLL x0 (ANDshiftRA <y.Type> y z [63]) [sl])
  1638  	for {
  1639  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1640  			x0 := v_0
  1641  			x1 := v_1
  1642  			if x1.Op != OpARM64ANDshiftLL {
  1643  				continue
  1644  			}
  1645  			sl := auxIntToInt64(x1.AuxInt)
  1646  			y := x1.Args[1]
  1647  			x2 := x1.Args[0]
  1648  			if x2.Op != OpARM64SRAconst || auxIntToInt64(x2.AuxInt) != 63 {
  1649  				continue
  1650  			}
  1651  			z := x2.Args[0]
  1652  			if !(x1.Uses == 1 && x2.Uses == 1) {
  1653  				continue
  1654  			}
  1655  			v.reset(OpARM64ADDshiftLL)
  1656  			v.AuxInt = int64ToAuxInt(sl)
  1657  			v0 := b.NewValue0(v.Pos, OpARM64ANDshiftRA, y.Type)
  1658  			v0.AuxInt = int64ToAuxInt(63)
  1659  			v0.AddArg2(y, z)
  1660  			v.AddArg2(x0, v0)
  1661  			return true
  1662  		}
  1663  		break
  1664  	}
  1665  	return false
  1666  }
  1667  func rewriteValueARM64_OpARM64ADDSflags(v *Value) bool {
  1668  	v_1 := v.Args[1]
  1669  	v_0 := v.Args[0]
  1670  	// match: (ADDSflags x (MOVDconst [c]))
  1671  	// result: (ADDSconstflags [c] x)
  1672  	for {
  1673  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1674  			x := v_0
  1675  			if v_1.Op != OpARM64MOVDconst {
  1676  				continue
  1677  			}
  1678  			c := auxIntToInt64(v_1.AuxInt)
  1679  			v.reset(OpARM64ADDSconstflags)
  1680  			v.AuxInt = int64ToAuxInt(c)
  1681  			v.AddArg(x)
  1682  			return true
  1683  		}
  1684  		break
  1685  	}
  1686  	return false
  1687  }
  1688  func rewriteValueARM64_OpARM64ADDconst(v *Value) bool {
  1689  	v_0 := v.Args[0]
  1690  	// match: (ADDconst [off1] (MOVDaddr [off2] {sym} ptr))
  1691  	// cond: is32Bit(off1+int64(off2))
  1692  	// result: (MOVDaddr [int32(off1)+off2] {sym} ptr)
  1693  	for {
  1694  		off1 := auxIntToInt64(v.AuxInt)
  1695  		if v_0.Op != OpARM64MOVDaddr {
  1696  			break
  1697  		}
  1698  		off2 := auxIntToInt32(v_0.AuxInt)
  1699  		sym := auxToSym(v_0.Aux)
  1700  		ptr := v_0.Args[0]
  1701  		if !(is32Bit(off1 + int64(off2))) {
  1702  			break
  1703  		}
  1704  		v.reset(OpARM64MOVDaddr)
  1705  		v.AuxInt = int32ToAuxInt(int32(off1) + off2)
  1706  		v.Aux = symToAux(sym)
  1707  		v.AddArg(ptr)
  1708  		return true
  1709  	}
  1710  	// match: (ADDconst [c] y)
  1711  	// cond: c < 0
  1712  	// result: (SUBconst [-c] y)
  1713  	for {
  1714  		c := auxIntToInt64(v.AuxInt)
  1715  		y := v_0
  1716  		if !(c < 0) {
  1717  			break
  1718  		}
  1719  		v.reset(OpARM64SUBconst)
  1720  		v.AuxInt = int64ToAuxInt(-c)
  1721  		v.AddArg(y)
  1722  		return true
  1723  	}
  1724  	// match: (ADDconst [0] x)
  1725  	// result: x
  1726  	for {
  1727  		if auxIntToInt64(v.AuxInt) != 0 {
  1728  			break
  1729  		}
  1730  		x := v_0
  1731  		v.copyOf(x)
  1732  		return true
  1733  	}
  1734  	// match: (ADDconst [c] (MOVDconst [d]))
  1735  	// result: (MOVDconst [c+d])
  1736  	for {
  1737  		c := auxIntToInt64(v.AuxInt)
  1738  		if v_0.Op != OpARM64MOVDconst {
  1739  			break
  1740  		}
  1741  		d := auxIntToInt64(v_0.AuxInt)
  1742  		v.reset(OpARM64MOVDconst)
  1743  		v.AuxInt = int64ToAuxInt(c + d)
  1744  		return true
  1745  	}
  1746  	// match: (ADDconst [c] (ADDconst [d] x))
  1747  	// result: (ADDconst [c+d] x)
  1748  	for {
  1749  		c := auxIntToInt64(v.AuxInt)
  1750  		if v_0.Op != OpARM64ADDconst {
  1751  			break
  1752  		}
  1753  		d := auxIntToInt64(v_0.AuxInt)
  1754  		x := v_0.Args[0]
  1755  		v.reset(OpARM64ADDconst)
  1756  		v.AuxInt = int64ToAuxInt(c + d)
  1757  		v.AddArg(x)
  1758  		return true
  1759  	}
  1760  	// match: (ADDconst [c] (SUBconst [d] x))
  1761  	// result: (ADDconst [c-d] x)
  1762  	for {
  1763  		c := auxIntToInt64(v.AuxInt)
  1764  		if v_0.Op != OpARM64SUBconst {
  1765  			break
  1766  		}
  1767  		d := auxIntToInt64(v_0.AuxInt)
  1768  		x := v_0.Args[0]
  1769  		v.reset(OpARM64ADDconst)
  1770  		v.AuxInt = int64ToAuxInt(c - d)
  1771  		v.AddArg(x)
  1772  		return true
  1773  	}
  1774  	return false
  1775  }
  1776  func rewriteValueARM64_OpARM64ADDshiftLL(v *Value) bool {
  1777  	v_1 := v.Args[1]
  1778  	v_0 := v.Args[0]
  1779  	b := v.Block
  1780  	typ := &b.Func.Config.Types
  1781  	// match: (ADDshiftLL (MOVDconst [c]) x [d])
  1782  	// result: (ADDconst [c] (SLLconst <x.Type> x [d]))
  1783  	for {
  1784  		d := auxIntToInt64(v.AuxInt)
  1785  		if v_0.Op != OpARM64MOVDconst {
  1786  			break
  1787  		}
  1788  		c := auxIntToInt64(v_0.AuxInt)
  1789  		x := v_1
  1790  		v.reset(OpARM64ADDconst)
  1791  		v.AuxInt = int64ToAuxInt(c)
  1792  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  1793  		v0.AuxInt = int64ToAuxInt(d)
  1794  		v0.AddArg(x)
  1795  		v.AddArg(v0)
  1796  		return true
  1797  	}
  1798  	// match: (ADDshiftLL x (MOVDconst [c]) [d])
  1799  	// result: (ADDconst x [int64(uint64(c)<<uint64(d))])
  1800  	for {
  1801  		d := auxIntToInt64(v.AuxInt)
  1802  		x := v_0
  1803  		if v_1.Op != OpARM64MOVDconst {
  1804  			break
  1805  		}
  1806  		c := auxIntToInt64(v_1.AuxInt)
  1807  		v.reset(OpARM64ADDconst)
  1808  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  1809  		v.AddArg(x)
  1810  		return true
  1811  	}
  1812  	// match: (ADDshiftLL <typ.UInt16> [8] (UBFX <typ.UInt16> [armBFAuxInt(8, 8)] x) x)
  1813  	// result: (REV16W x)
  1814  	for {
  1815  		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) {
  1816  			break
  1817  		}
  1818  		x := v_0.Args[0]
  1819  		if x != v_1 {
  1820  			break
  1821  		}
  1822  		v.reset(OpARM64REV16W)
  1823  		v.AddArg(x)
  1824  		return true
  1825  	}
  1826  	// match: (ADDshiftLL [8] (UBFX [armBFAuxInt(8, 24)] (ANDconst [c1] x)) (ANDconst [c2] x))
  1827  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  1828  	// result: (REV16W x)
  1829  	for {
  1830  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
  1831  			break
  1832  		}
  1833  		v_0_0 := v_0.Args[0]
  1834  		if v_0_0.Op != OpARM64ANDconst {
  1835  			break
  1836  		}
  1837  		c1 := auxIntToInt64(v_0_0.AuxInt)
  1838  		x := v_0_0.Args[0]
  1839  		if v_1.Op != OpARM64ANDconst {
  1840  			break
  1841  		}
  1842  		c2 := auxIntToInt64(v_1.AuxInt)
  1843  		if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  1844  			break
  1845  		}
  1846  		v.reset(OpARM64REV16W)
  1847  		v.AddArg(x)
  1848  		return true
  1849  	}
  1850  	// match: (ADDshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
  1851  	// cond: (uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff)
  1852  	// result: (REV16 x)
  1853  	for {
  1854  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1855  			break
  1856  		}
  1857  		v_0_0 := v_0.Args[0]
  1858  		if v_0_0.Op != OpARM64ANDconst {
  1859  			break
  1860  		}
  1861  		c1 := auxIntToInt64(v_0_0.AuxInt)
  1862  		x := v_0_0.Args[0]
  1863  		if v_1.Op != OpARM64ANDconst {
  1864  			break
  1865  		}
  1866  		c2 := auxIntToInt64(v_1.AuxInt)
  1867  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  1868  			break
  1869  		}
  1870  		v.reset(OpARM64REV16)
  1871  		v.AddArg(x)
  1872  		return true
  1873  	}
  1874  	// match: (ADDshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
  1875  	// cond: (uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff)
  1876  	// result: (REV16 (ANDconst <x.Type> [0xffffffff] x))
  1877  	for {
  1878  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1879  			break
  1880  		}
  1881  		v_0_0 := v_0.Args[0]
  1882  		if v_0_0.Op != OpARM64ANDconst {
  1883  			break
  1884  		}
  1885  		c1 := auxIntToInt64(v_0_0.AuxInt)
  1886  		x := v_0_0.Args[0]
  1887  		if v_1.Op != OpARM64ANDconst {
  1888  			break
  1889  		}
  1890  		c2 := auxIntToInt64(v_1.AuxInt)
  1891  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  1892  			break
  1893  		}
  1894  		v.reset(OpARM64REV16)
  1895  		v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
  1896  		v0.AuxInt = int64ToAuxInt(0xffffffff)
  1897  		v0.AddArg(x)
  1898  		v.AddArg(v0)
  1899  		return true
  1900  	}
  1901  	// match: (ADDshiftLL [c] (SRLconst x [64-c]) x2)
  1902  	// result: (EXTRconst [64-c] x2 x)
  1903  	for {
  1904  		c := auxIntToInt64(v.AuxInt)
  1905  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
  1906  			break
  1907  		}
  1908  		x := v_0.Args[0]
  1909  		x2 := v_1
  1910  		v.reset(OpARM64EXTRconst)
  1911  		v.AuxInt = int64ToAuxInt(64 - c)
  1912  		v.AddArg2(x2, x)
  1913  		return true
  1914  	}
  1915  	// match: (ADDshiftLL <t> [c] (UBFX [bfc] x) x2)
  1916  	// cond: c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)
  1917  	// result: (EXTRWconst [32-c] x2 x)
  1918  	for {
  1919  		t := v.Type
  1920  		c := auxIntToInt64(v.AuxInt)
  1921  		if v_0.Op != OpARM64UBFX {
  1922  			break
  1923  		}
  1924  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  1925  		x := v_0.Args[0]
  1926  		x2 := v_1
  1927  		if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
  1928  			break
  1929  		}
  1930  		v.reset(OpARM64EXTRWconst)
  1931  		v.AuxInt = int64ToAuxInt(32 - c)
  1932  		v.AddArg2(x2, x)
  1933  		return true
  1934  	}
  1935  	return false
  1936  }
  1937  func rewriteValueARM64_OpARM64ADDshiftRA(v *Value) bool {
  1938  	v_1 := v.Args[1]
  1939  	v_0 := v.Args[0]
  1940  	b := v.Block
  1941  	// match: (ADDshiftRA (MOVDconst [c]) x [d])
  1942  	// result: (ADDconst [c] (SRAconst <x.Type> x [d]))
  1943  	for {
  1944  		d := auxIntToInt64(v.AuxInt)
  1945  		if v_0.Op != OpARM64MOVDconst {
  1946  			break
  1947  		}
  1948  		c := auxIntToInt64(v_0.AuxInt)
  1949  		x := v_1
  1950  		v.reset(OpARM64ADDconst)
  1951  		v.AuxInt = int64ToAuxInt(c)
  1952  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  1953  		v0.AuxInt = int64ToAuxInt(d)
  1954  		v0.AddArg(x)
  1955  		v.AddArg(v0)
  1956  		return true
  1957  	}
  1958  	// match: (ADDshiftRA x (MOVDconst [c]) [d])
  1959  	// result: (ADDconst x [c>>uint64(d)])
  1960  	for {
  1961  		d := auxIntToInt64(v.AuxInt)
  1962  		x := v_0
  1963  		if v_1.Op != OpARM64MOVDconst {
  1964  			break
  1965  		}
  1966  		c := auxIntToInt64(v_1.AuxInt)
  1967  		v.reset(OpARM64ADDconst)
  1968  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  1969  		v.AddArg(x)
  1970  		return true
  1971  	}
  1972  	return false
  1973  }
  1974  func rewriteValueARM64_OpARM64ADDshiftRL(v *Value) bool {
  1975  	v_1 := v.Args[1]
  1976  	v_0 := v.Args[0]
  1977  	b := v.Block
  1978  	// match: (ADDshiftRL (MOVDconst [c]) x [d])
  1979  	// result: (ADDconst [c] (SRLconst <x.Type> x [d]))
  1980  	for {
  1981  		d := auxIntToInt64(v.AuxInt)
  1982  		if v_0.Op != OpARM64MOVDconst {
  1983  			break
  1984  		}
  1985  		c := auxIntToInt64(v_0.AuxInt)
  1986  		x := v_1
  1987  		v.reset(OpARM64ADDconst)
  1988  		v.AuxInt = int64ToAuxInt(c)
  1989  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  1990  		v0.AuxInt = int64ToAuxInt(d)
  1991  		v0.AddArg(x)
  1992  		v.AddArg(v0)
  1993  		return true
  1994  	}
  1995  	// match: (ADDshiftRL x (MOVDconst [c]) [d])
  1996  	// result: (ADDconst x [int64(uint64(c)>>uint64(d))])
  1997  	for {
  1998  		d := auxIntToInt64(v.AuxInt)
  1999  		x := v_0
  2000  		if v_1.Op != OpARM64MOVDconst {
  2001  			break
  2002  		}
  2003  		c := auxIntToInt64(v_1.AuxInt)
  2004  		v.reset(OpARM64ADDconst)
  2005  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  2006  		v.AddArg(x)
  2007  		return true
  2008  	}
  2009  	return false
  2010  }
  2011  func rewriteValueARM64_OpARM64AND(v *Value) bool {
  2012  	v_1 := v.Args[1]
  2013  	v_0 := v.Args[0]
  2014  	// match: (AND x (MOVDconst [c]))
  2015  	// result: (ANDconst [c] x)
  2016  	for {
  2017  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2018  			x := v_0
  2019  			if v_1.Op != OpARM64MOVDconst {
  2020  				continue
  2021  			}
  2022  			c := auxIntToInt64(v_1.AuxInt)
  2023  			v.reset(OpARM64ANDconst)
  2024  			v.AuxInt = int64ToAuxInt(c)
  2025  			v.AddArg(x)
  2026  			return true
  2027  		}
  2028  		break
  2029  	}
  2030  	// match: (AND x x)
  2031  	// result: x
  2032  	for {
  2033  		x := v_0
  2034  		if x != v_1 {
  2035  			break
  2036  		}
  2037  		v.copyOf(x)
  2038  		return true
  2039  	}
  2040  	// match: (AND x (MVN y))
  2041  	// result: (BIC x y)
  2042  	for {
  2043  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2044  			x := v_0
  2045  			if v_1.Op != OpARM64MVN {
  2046  				continue
  2047  			}
  2048  			y := v_1.Args[0]
  2049  			v.reset(OpARM64BIC)
  2050  			v.AddArg2(x, y)
  2051  			return true
  2052  		}
  2053  		break
  2054  	}
  2055  	// match: (AND x0 x1:(SLLconst [c] y))
  2056  	// cond: clobberIfDead(x1)
  2057  	// result: (ANDshiftLL x0 y [c])
  2058  	for {
  2059  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2060  			x0 := v_0
  2061  			x1 := v_1
  2062  			if x1.Op != OpARM64SLLconst {
  2063  				continue
  2064  			}
  2065  			c := auxIntToInt64(x1.AuxInt)
  2066  			y := x1.Args[0]
  2067  			if !(clobberIfDead(x1)) {
  2068  				continue
  2069  			}
  2070  			v.reset(OpARM64ANDshiftLL)
  2071  			v.AuxInt = int64ToAuxInt(c)
  2072  			v.AddArg2(x0, y)
  2073  			return true
  2074  		}
  2075  		break
  2076  	}
  2077  	// match: (AND x0 x1:(SRLconst [c] y))
  2078  	// cond: clobberIfDead(x1)
  2079  	// result: (ANDshiftRL x0 y [c])
  2080  	for {
  2081  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2082  			x0 := v_0
  2083  			x1 := v_1
  2084  			if x1.Op != OpARM64SRLconst {
  2085  				continue
  2086  			}
  2087  			c := auxIntToInt64(x1.AuxInt)
  2088  			y := x1.Args[0]
  2089  			if !(clobberIfDead(x1)) {
  2090  				continue
  2091  			}
  2092  			v.reset(OpARM64ANDshiftRL)
  2093  			v.AuxInt = int64ToAuxInt(c)
  2094  			v.AddArg2(x0, y)
  2095  			return true
  2096  		}
  2097  		break
  2098  	}
  2099  	// match: (AND x0 x1:(SRAconst [c] y))
  2100  	// cond: clobberIfDead(x1)
  2101  	// result: (ANDshiftRA x0 y [c])
  2102  	for {
  2103  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2104  			x0 := v_0
  2105  			x1 := v_1
  2106  			if x1.Op != OpARM64SRAconst {
  2107  				continue
  2108  			}
  2109  			c := auxIntToInt64(x1.AuxInt)
  2110  			y := x1.Args[0]
  2111  			if !(clobberIfDead(x1)) {
  2112  				continue
  2113  			}
  2114  			v.reset(OpARM64ANDshiftRA)
  2115  			v.AuxInt = int64ToAuxInt(c)
  2116  			v.AddArg2(x0, y)
  2117  			return true
  2118  		}
  2119  		break
  2120  	}
  2121  	// match: (AND x0 x1:(RORconst [c] y))
  2122  	// cond: clobberIfDead(x1)
  2123  	// result: (ANDshiftRO x0 y [c])
  2124  	for {
  2125  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2126  			x0 := v_0
  2127  			x1 := v_1
  2128  			if x1.Op != OpARM64RORconst {
  2129  				continue
  2130  			}
  2131  			c := auxIntToInt64(x1.AuxInt)
  2132  			y := x1.Args[0]
  2133  			if !(clobberIfDead(x1)) {
  2134  				continue
  2135  			}
  2136  			v.reset(OpARM64ANDshiftRO)
  2137  			v.AuxInt = int64ToAuxInt(c)
  2138  			v.AddArg2(x0, y)
  2139  			return true
  2140  		}
  2141  		break
  2142  	}
  2143  	return false
  2144  }
  2145  func rewriteValueARM64_OpARM64ANDconst(v *Value) bool {
  2146  	v_0 := v.Args[0]
  2147  	// match: (ANDconst [0] _)
  2148  	// result: (MOVDconst [0])
  2149  	for {
  2150  		if auxIntToInt64(v.AuxInt) != 0 {
  2151  			break
  2152  		}
  2153  		v.reset(OpARM64MOVDconst)
  2154  		v.AuxInt = int64ToAuxInt(0)
  2155  		return true
  2156  	}
  2157  	// match: (ANDconst [-1] x)
  2158  	// result: x
  2159  	for {
  2160  		if auxIntToInt64(v.AuxInt) != -1 {
  2161  			break
  2162  		}
  2163  		x := v_0
  2164  		v.copyOf(x)
  2165  		return true
  2166  	}
  2167  	// match: (ANDconst [c] (MOVDconst [d]))
  2168  	// result: (MOVDconst [c&d])
  2169  	for {
  2170  		c := auxIntToInt64(v.AuxInt)
  2171  		if v_0.Op != OpARM64MOVDconst {
  2172  			break
  2173  		}
  2174  		d := auxIntToInt64(v_0.AuxInt)
  2175  		v.reset(OpARM64MOVDconst)
  2176  		v.AuxInt = int64ToAuxInt(c & d)
  2177  		return true
  2178  	}
  2179  	// match: (ANDconst [c] (ANDconst [d] x))
  2180  	// result: (ANDconst [c&d] x)
  2181  	for {
  2182  		c := auxIntToInt64(v.AuxInt)
  2183  		if v_0.Op != OpARM64ANDconst {
  2184  			break
  2185  		}
  2186  		d := auxIntToInt64(v_0.AuxInt)
  2187  		x := v_0.Args[0]
  2188  		v.reset(OpARM64ANDconst)
  2189  		v.AuxInt = int64ToAuxInt(c & d)
  2190  		v.AddArg(x)
  2191  		return true
  2192  	}
  2193  	// match: (ANDconst [c] (MOVWUreg x))
  2194  	// result: (ANDconst [c&(1<<32-1)] x)
  2195  	for {
  2196  		c := auxIntToInt64(v.AuxInt)
  2197  		if v_0.Op != OpARM64MOVWUreg {
  2198  			break
  2199  		}
  2200  		x := v_0.Args[0]
  2201  		v.reset(OpARM64ANDconst)
  2202  		v.AuxInt = int64ToAuxInt(c & (1<<32 - 1))
  2203  		v.AddArg(x)
  2204  		return true
  2205  	}
  2206  	// match: (ANDconst [c] (MOVHUreg x))
  2207  	// result: (ANDconst [c&(1<<16-1)] x)
  2208  	for {
  2209  		c := auxIntToInt64(v.AuxInt)
  2210  		if v_0.Op != OpARM64MOVHUreg {
  2211  			break
  2212  		}
  2213  		x := v_0.Args[0]
  2214  		v.reset(OpARM64ANDconst)
  2215  		v.AuxInt = int64ToAuxInt(c & (1<<16 - 1))
  2216  		v.AddArg(x)
  2217  		return true
  2218  	}
  2219  	// match: (ANDconst [c] (MOVBUreg x))
  2220  	// result: (ANDconst [c&(1<<8-1)] x)
  2221  	for {
  2222  		c := auxIntToInt64(v.AuxInt)
  2223  		if v_0.Op != OpARM64MOVBUreg {
  2224  			break
  2225  		}
  2226  		x := v_0.Args[0]
  2227  		v.reset(OpARM64ANDconst)
  2228  		v.AuxInt = int64ToAuxInt(c & (1<<8 - 1))
  2229  		v.AddArg(x)
  2230  		return true
  2231  	}
  2232  	// match: (ANDconst [ac] (SLLconst [sc] x))
  2233  	// cond: isARM64BFMask(sc, ac, sc)
  2234  	// result: (UBFIZ [armBFAuxInt(sc, arm64BFWidth(ac, sc))] x)
  2235  	for {
  2236  		ac := auxIntToInt64(v.AuxInt)
  2237  		if v_0.Op != OpARM64SLLconst {
  2238  			break
  2239  		}
  2240  		sc := auxIntToInt64(v_0.AuxInt)
  2241  		x := v_0.Args[0]
  2242  		if !(isARM64BFMask(sc, ac, sc)) {
  2243  			break
  2244  		}
  2245  		v.reset(OpARM64UBFIZ)
  2246  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, sc)))
  2247  		v.AddArg(x)
  2248  		return true
  2249  	}
  2250  	// match: (ANDconst [ac] (SRLconst [sc] x))
  2251  	// cond: isARM64BFMask(sc, ac, 0)
  2252  	// result: (UBFX [armBFAuxInt(sc, arm64BFWidth(ac, 0))] x)
  2253  	for {
  2254  		ac := auxIntToInt64(v.AuxInt)
  2255  		if v_0.Op != OpARM64SRLconst {
  2256  			break
  2257  		}
  2258  		sc := auxIntToInt64(v_0.AuxInt)
  2259  		x := v_0.Args[0]
  2260  		if !(isARM64BFMask(sc, ac, 0)) {
  2261  			break
  2262  		}
  2263  		v.reset(OpARM64UBFX)
  2264  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, 0)))
  2265  		v.AddArg(x)
  2266  		return true
  2267  	}
  2268  	// match: (ANDconst [c] (UBFX [bfc] x))
  2269  	// cond: isARM64BFMask(0, c, 0)
  2270  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), arm64BFWidth(c, 0)))] x)
  2271  	for {
  2272  		c := auxIntToInt64(v.AuxInt)
  2273  		if v_0.Op != OpARM64UBFX {
  2274  			break
  2275  		}
  2276  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  2277  		x := v_0.Args[0]
  2278  		if !(isARM64BFMask(0, c, 0)) {
  2279  			break
  2280  		}
  2281  		v.reset(OpARM64UBFX)
  2282  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), arm64BFWidth(c, 0))))
  2283  		v.AddArg(x)
  2284  		return true
  2285  	}
  2286  	return false
  2287  }
  2288  func rewriteValueARM64_OpARM64ANDshiftLL(v *Value) bool {
  2289  	v_1 := v.Args[1]
  2290  	v_0 := v.Args[0]
  2291  	b := v.Block
  2292  	// match: (ANDshiftLL (MOVDconst [c]) x [d])
  2293  	// result: (ANDconst [c] (SLLconst <x.Type> x [d]))
  2294  	for {
  2295  		d := auxIntToInt64(v.AuxInt)
  2296  		if v_0.Op != OpARM64MOVDconst {
  2297  			break
  2298  		}
  2299  		c := auxIntToInt64(v_0.AuxInt)
  2300  		x := v_1
  2301  		v.reset(OpARM64ANDconst)
  2302  		v.AuxInt = int64ToAuxInt(c)
  2303  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  2304  		v0.AuxInt = int64ToAuxInt(d)
  2305  		v0.AddArg(x)
  2306  		v.AddArg(v0)
  2307  		return true
  2308  	}
  2309  	// match: (ANDshiftLL x (MOVDconst [c]) [d])
  2310  	// result: (ANDconst x [int64(uint64(c)<<uint64(d))])
  2311  	for {
  2312  		d := auxIntToInt64(v.AuxInt)
  2313  		x := v_0
  2314  		if v_1.Op != OpARM64MOVDconst {
  2315  			break
  2316  		}
  2317  		c := auxIntToInt64(v_1.AuxInt)
  2318  		v.reset(OpARM64ANDconst)
  2319  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  2320  		v.AddArg(x)
  2321  		return true
  2322  	}
  2323  	// match: (ANDshiftLL y:(SLLconst x [c]) x [c])
  2324  	// result: y
  2325  	for {
  2326  		c := auxIntToInt64(v.AuxInt)
  2327  		y := v_0
  2328  		if y.Op != OpARM64SLLconst || auxIntToInt64(y.AuxInt) != c {
  2329  			break
  2330  		}
  2331  		x := y.Args[0]
  2332  		if x != v_1 {
  2333  			break
  2334  		}
  2335  		v.copyOf(y)
  2336  		return true
  2337  	}
  2338  	return false
  2339  }
  2340  func rewriteValueARM64_OpARM64ANDshiftRA(v *Value) bool {
  2341  	v_1 := v.Args[1]
  2342  	v_0 := v.Args[0]
  2343  	b := v.Block
  2344  	// match: (ANDshiftRA (MOVDconst [c]) x [d])
  2345  	// result: (ANDconst [c] (SRAconst <x.Type> x [d]))
  2346  	for {
  2347  		d := auxIntToInt64(v.AuxInt)
  2348  		if v_0.Op != OpARM64MOVDconst {
  2349  			break
  2350  		}
  2351  		c := auxIntToInt64(v_0.AuxInt)
  2352  		x := v_1
  2353  		v.reset(OpARM64ANDconst)
  2354  		v.AuxInt = int64ToAuxInt(c)
  2355  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  2356  		v0.AuxInt = int64ToAuxInt(d)
  2357  		v0.AddArg(x)
  2358  		v.AddArg(v0)
  2359  		return true
  2360  	}
  2361  	// match: (ANDshiftRA x (MOVDconst [c]) [d])
  2362  	// result: (ANDconst x [c>>uint64(d)])
  2363  	for {
  2364  		d := auxIntToInt64(v.AuxInt)
  2365  		x := v_0
  2366  		if v_1.Op != OpARM64MOVDconst {
  2367  			break
  2368  		}
  2369  		c := auxIntToInt64(v_1.AuxInt)
  2370  		v.reset(OpARM64ANDconst)
  2371  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  2372  		v.AddArg(x)
  2373  		return true
  2374  	}
  2375  	// match: (ANDshiftRA y:(SRAconst x [c]) x [c])
  2376  	// result: y
  2377  	for {
  2378  		c := auxIntToInt64(v.AuxInt)
  2379  		y := v_0
  2380  		if y.Op != OpARM64SRAconst || auxIntToInt64(y.AuxInt) != c {
  2381  			break
  2382  		}
  2383  		x := y.Args[0]
  2384  		if x != v_1 {
  2385  			break
  2386  		}
  2387  		v.copyOf(y)
  2388  		return true
  2389  	}
  2390  	return false
  2391  }
  2392  func rewriteValueARM64_OpARM64ANDshiftRL(v *Value) bool {
  2393  	v_1 := v.Args[1]
  2394  	v_0 := v.Args[0]
  2395  	b := v.Block
  2396  	// match: (ANDshiftRL (MOVDconst [c]) x [d])
  2397  	// result: (ANDconst [c] (SRLconst <x.Type> x [d]))
  2398  	for {
  2399  		d := auxIntToInt64(v.AuxInt)
  2400  		if v_0.Op != OpARM64MOVDconst {
  2401  			break
  2402  		}
  2403  		c := auxIntToInt64(v_0.AuxInt)
  2404  		x := v_1
  2405  		v.reset(OpARM64ANDconst)
  2406  		v.AuxInt = int64ToAuxInt(c)
  2407  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  2408  		v0.AuxInt = int64ToAuxInt(d)
  2409  		v0.AddArg(x)
  2410  		v.AddArg(v0)
  2411  		return true
  2412  	}
  2413  	// match: (ANDshiftRL x (MOVDconst [c]) [d])
  2414  	// result: (ANDconst x [int64(uint64(c)>>uint64(d))])
  2415  	for {
  2416  		d := auxIntToInt64(v.AuxInt)
  2417  		x := v_0
  2418  		if v_1.Op != OpARM64MOVDconst {
  2419  			break
  2420  		}
  2421  		c := auxIntToInt64(v_1.AuxInt)
  2422  		v.reset(OpARM64ANDconst)
  2423  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  2424  		v.AddArg(x)
  2425  		return true
  2426  	}
  2427  	// match: (ANDshiftRL y:(SRLconst x [c]) x [c])
  2428  	// result: y
  2429  	for {
  2430  		c := auxIntToInt64(v.AuxInt)
  2431  		y := v_0
  2432  		if y.Op != OpARM64SRLconst || auxIntToInt64(y.AuxInt) != c {
  2433  			break
  2434  		}
  2435  		x := y.Args[0]
  2436  		if x != v_1 {
  2437  			break
  2438  		}
  2439  		v.copyOf(y)
  2440  		return true
  2441  	}
  2442  	return false
  2443  }
  2444  func rewriteValueARM64_OpARM64ANDshiftRO(v *Value) bool {
  2445  	v_1 := v.Args[1]
  2446  	v_0 := v.Args[0]
  2447  	b := v.Block
  2448  	// match: (ANDshiftRO (MOVDconst [c]) x [d])
  2449  	// result: (ANDconst [c] (RORconst <x.Type> x [d]))
  2450  	for {
  2451  		d := auxIntToInt64(v.AuxInt)
  2452  		if v_0.Op != OpARM64MOVDconst {
  2453  			break
  2454  		}
  2455  		c := auxIntToInt64(v_0.AuxInt)
  2456  		x := v_1
  2457  		v.reset(OpARM64ANDconst)
  2458  		v.AuxInt = int64ToAuxInt(c)
  2459  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
  2460  		v0.AuxInt = int64ToAuxInt(d)
  2461  		v0.AddArg(x)
  2462  		v.AddArg(v0)
  2463  		return true
  2464  	}
  2465  	// match: (ANDshiftRO x (MOVDconst [c]) [d])
  2466  	// result: (ANDconst x [rotateRight64(c, d)])
  2467  	for {
  2468  		d := auxIntToInt64(v.AuxInt)
  2469  		x := v_0
  2470  		if v_1.Op != OpARM64MOVDconst {
  2471  			break
  2472  		}
  2473  		c := auxIntToInt64(v_1.AuxInt)
  2474  		v.reset(OpARM64ANDconst)
  2475  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
  2476  		v.AddArg(x)
  2477  		return true
  2478  	}
  2479  	// match: (ANDshiftRO y:(RORconst x [c]) x [c])
  2480  	// result: y
  2481  	for {
  2482  		c := auxIntToInt64(v.AuxInt)
  2483  		y := v_0
  2484  		if y.Op != OpARM64RORconst || auxIntToInt64(y.AuxInt) != c {
  2485  			break
  2486  		}
  2487  		x := y.Args[0]
  2488  		if x != v_1 {
  2489  			break
  2490  		}
  2491  		v.copyOf(y)
  2492  		return true
  2493  	}
  2494  	return false
  2495  }
  2496  func rewriteValueARM64_OpARM64BIC(v *Value) bool {
  2497  	v_1 := v.Args[1]
  2498  	v_0 := v.Args[0]
  2499  	// match: (BIC x (MOVDconst [c]))
  2500  	// result: (ANDconst [^c] x)
  2501  	for {
  2502  		x := v_0
  2503  		if v_1.Op != OpARM64MOVDconst {
  2504  			break
  2505  		}
  2506  		c := auxIntToInt64(v_1.AuxInt)
  2507  		v.reset(OpARM64ANDconst)
  2508  		v.AuxInt = int64ToAuxInt(^c)
  2509  		v.AddArg(x)
  2510  		return true
  2511  	}
  2512  	// match: (BIC x x)
  2513  	// result: (MOVDconst [0])
  2514  	for {
  2515  		x := v_0
  2516  		if x != v_1 {
  2517  			break
  2518  		}
  2519  		v.reset(OpARM64MOVDconst)
  2520  		v.AuxInt = int64ToAuxInt(0)
  2521  		return true
  2522  	}
  2523  	// match: (BIC x0 x1:(SLLconst [c] y))
  2524  	// cond: clobberIfDead(x1)
  2525  	// result: (BICshiftLL x0 y [c])
  2526  	for {
  2527  		x0 := v_0
  2528  		x1 := v_1
  2529  		if x1.Op != OpARM64SLLconst {
  2530  			break
  2531  		}
  2532  		c := auxIntToInt64(x1.AuxInt)
  2533  		y := x1.Args[0]
  2534  		if !(clobberIfDead(x1)) {
  2535  			break
  2536  		}
  2537  		v.reset(OpARM64BICshiftLL)
  2538  		v.AuxInt = int64ToAuxInt(c)
  2539  		v.AddArg2(x0, y)
  2540  		return true
  2541  	}
  2542  	// match: (BIC x0 x1:(SRLconst [c] y))
  2543  	// cond: clobberIfDead(x1)
  2544  	// result: (BICshiftRL x0 y [c])
  2545  	for {
  2546  		x0 := v_0
  2547  		x1 := v_1
  2548  		if x1.Op != OpARM64SRLconst {
  2549  			break
  2550  		}
  2551  		c := auxIntToInt64(x1.AuxInt)
  2552  		y := x1.Args[0]
  2553  		if !(clobberIfDead(x1)) {
  2554  			break
  2555  		}
  2556  		v.reset(OpARM64BICshiftRL)
  2557  		v.AuxInt = int64ToAuxInt(c)
  2558  		v.AddArg2(x0, y)
  2559  		return true
  2560  	}
  2561  	// match: (BIC x0 x1:(SRAconst [c] y))
  2562  	// cond: clobberIfDead(x1)
  2563  	// result: (BICshiftRA x0 y [c])
  2564  	for {
  2565  		x0 := v_0
  2566  		x1 := v_1
  2567  		if x1.Op != OpARM64SRAconst {
  2568  			break
  2569  		}
  2570  		c := auxIntToInt64(x1.AuxInt)
  2571  		y := x1.Args[0]
  2572  		if !(clobberIfDead(x1)) {
  2573  			break
  2574  		}
  2575  		v.reset(OpARM64BICshiftRA)
  2576  		v.AuxInt = int64ToAuxInt(c)
  2577  		v.AddArg2(x0, y)
  2578  		return true
  2579  	}
  2580  	// match: (BIC x0 x1:(RORconst [c] y))
  2581  	// cond: clobberIfDead(x1)
  2582  	// result: (BICshiftRO x0 y [c])
  2583  	for {
  2584  		x0 := v_0
  2585  		x1 := v_1
  2586  		if x1.Op != OpARM64RORconst {
  2587  			break
  2588  		}
  2589  		c := auxIntToInt64(x1.AuxInt)
  2590  		y := x1.Args[0]
  2591  		if !(clobberIfDead(x1)) {
  2592  			break
  2593  		}
  2594  		v.reset(OpARM64BICshiftRO)
  2595  		v.AuxInt = int64ToAuxInt(c)
  2596  		v.AddArg2(x0, y)
  2597  		return true
  2598  	}
  2599  	return false
  2600  }
  2601  func rewriteValueARM64_OpARM64BICshiftLL(v *Value) bool {
  2602  	v_1 := v.Args[1]
  2603  	v_0 := v.Args[0]
  2604  	// match: (BICshiftLL x (MOVDconst [c]) [d])
  2605  	// result: (ANDconst x [^int64(uint64(c)<<uint64(d))])
  2606  	for {
  2607  		d := auxIntToInt64(v.AuxInt)
  2608  		x := v_0
  2609  		if v_1.Op != OpARM64MOVDconst {
  2610  			break
  2611  		}
  2612  		c := auxIntToInt64(v_1.AuxInt)
  2613  		v.reset(OpARM64ANDconst)
  2614  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
  2615  		v.AddArg(x)
  2616  		return true
  2617  	}
  2618  	// match: (BICshiftLL (SLLconst x [c]) x [c])
  2619  	// result: (MOVDconst [0])
  2620  	for {
  2621  		c := auxIntToInt64(v.AuxInt)
  2622  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
  2623  			break
  2624  		}
  2625  		x := v_0.Args[0]
  2626  		if x != v_1 {
  2627  			break
  2628  		}
  2629  		v.reset(OpARM64MOVDconst)
  2630  		v.AuxInt = int64ToAuxInt(0)
  2631  		return true
  2632  	}
  2633  	return false
  2634  }
  2635  func rewriteValueARM64_OpARM64BICshiftRA(v *Value) bool {
  2636  	v_1 := v.Args[1]
  2637  	v_0 := v.Args[0]
  2638  	// match: (BICshiftRA x (MOVDconst [c]) [d])
  2639  	// result: (ANDconst x [^(c>>uint64(d))])
  2640  	for {
  2641  		d := auxIntToInt64(v.AuxInt)
  2642  		x := v_0
  2643  		if v_1.Op != OpARM64MOVDconst {
  2644  			break
  2645  		}
  2646  		c := auxIntToInt64(v_1.AuxInt)
  2647  		v.reset(OpARM64ANDconst)
  2648  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
  2649  		v.AddArg(x)
  2650  		return true
  2651  	}
  2652  	// match: (BICshiftRA (SRAconst x [c]) x [c])
  2653  	// result: (MOVDconst [0])
  2654  	for {
  2655  		c := auxIntToInt64(v.AuxInt)
  2656  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
  2657  			break
  2658  		}
  2659  		x := v_0.Args[0]
  2660  		if x != v_1 {
  2661  			break
  2662  		}
  2663  		v.reset(OpARM64MOVDconst)
  2664  		v.AuxInt = int64ToAuxInt(0)
  2665  		return true
  2666  	}
  2667  	return false
  2668  }
  2669  func rewriteValueARM64_OpARM64BICshiftRL(v *Value) bool {
  2670  	v_1 := v.Args[1]
  2671  	v_0 := v.Args[0]
  2672  	// match: (BICshiftRL x (MOVDconst [c]) [d])
  2673  	// result: (ANDconst x [^int64(uint64(c)>>uint64(d))])
  2674  	for {
  2675  		d := auxIntToInt64(v.AuxInt)
  2676  		x := v_0
  2677  		if v_1.Op != OpARM64MOVDconst {
  2678  			break
  2679  		}
  2680  		c := auxIntToInt64(v_1.AuxInt)
  2681  		v.reset(OpARM64ANDconst)
  2682  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
  2683  		v.AddArg(x)
  2684  		return true
  2685  	}
  2686  	// match: (BICshiftRL (SRLconst x [c]) x [c])
  2687  	// result: (MOVDconst [0])
  2688  	for {
  2689  		c := auxIntToInt64(v.AuxInt)
  2690  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
  2691  			break
  2692  		}
  2693  		x := v_0.Args[0]
  2694  		if x != v_1 {
  2695  			break
  2696  		}
  2697  		v.reset(OpARM64MOVDconst)
  2698  		v.AuxInt = int64ToAuxInt(0)
  2699  		return true
  2700  	}
  2701  	return false
  2702  }
  2703  func rewriteValueARM64_OpARM64BICshiftRO(v *Value) bool {
  2704  	v_1 := v.Args[1]
  2705  	v_0 := v.Args[0]
  2706  	// match: (BICshiftRO x (MOVDconst [c]) [d])
  2707  	// result: (ANDconst x [^rotateRight64(c, d)])
  2708  	for {
  2709  		d := auxIntToInt64(v.AuxInt)
  2710  		x := v_0
  2711  		if v_1.Op != OpARM64MOVDconst {
  2712  			break
  2713  		}
  2714  		c := auxIntToInt64(v_1.AuxInt)
  2715  		v.reset(OpARM64ANDconst)
  2716  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
  2717  		v.AddArg(x)
  2718  		return true
  2719  	}
  2720  	// match: (BICshiftRO (RORconst x [c]) x [c])
  2721  	// result: (MOVDconst [0])
  2722  	for {
  2723  		c := auxIntToInt64(v.AuxInt)
  2724  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
  2725  			break
  2726  		}
  2727  		x := v_0.Args[0]
  2728  		if x != v_1 {
  2729  			break
  2730  		}
  2731  		v.reset(OpARM64MOVDconst)
  2732  		v.AuxInt = int64ToAuxInt(0)
  2733  		return true
  2734  	}
  2735  	return false
  2736  }
  2737  func rewriteValueARM64_OpARM64CMN(v *Value) bool {
  2738  	v_1 := v.Args[1]
  2739  	v_0 := v.Args[0]
  2740  	// match: (CMN x (MOVDconst [c]))
  2741  	// result: (CMNconst [c] x)
  2742  	for {
  2743  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2744  			x := v_0
  2745  			if v_1.Op != OpARM64MOVDconst {
  2746  				continue
  2747  			}
  2748  			c := auxIntToInt64(v_1.AuxInt)
  2749  			v.reset(OpARM64CMNconst)
  2750  			v.AuxInt = int64ToAuxInt(c)
  2751  			v.AddArg(x)
  2752  			return true
  2753  		}
  2754  		break
  2755  	}
  2756  	// match: (CMN x0 x1:(SLLconst [c] y))
  2757  	// cond: clobberIfDead(x1)
  2758  	// result: (CMNshiftLL x0 y [c])
  2759  	for {
  2760  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2761  			x0 := v_0
  2762  			x1 := v_1
  2763  			if x1.Op != OpARM64SLLconst {
  2764  				continue
  2765  			}
  2766  			c := auxIntToInt64(x1.AuxInt)
  2767  			y := x1.Args[0]
  2768  			if !(clobberIfDead(x1)) {
  2769  				continue
  2770  			}
  2771  			v.reset(OpARM64CMNshiftLL)
  2772  			v.AuxInt = int64ToAuxInt(c)
  2773  			v.AddArg2(x0, y)
  2774  			return true
  2775  		}
  2776  		break
  2777  	}
  2778  	// match: (CMN x0 x1:(SRLconst [c] y))
  2779  	// cond: clobberIfDead(x1)
  2780  	// result: (CMNshiftRL x0 y [c])
  2781  	for {
  2782  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2783  			x0 := v_0
  2784  			x1 := v_1
  2785  			if x1.Op != OpARM64SRLconst {
  2786  				continue
  2787  			}
  2788  			c := auxIntToInt64(x1.AuxInt)
  2789  			y := x1.Args[0]
  2790  			if !(clobberIfDead(x1)) {
  2791  				continue
  2792  			}
  2793  			v.reset(OpARM64CMNshiftRL)
  2794  			v.AuxInt = int64ToAuxInt(c)
  2795  			v.AddArg2(x0, y)
  2796  			return true
  2797  		}
  2798  		break
  2799  	}
  2800  	// match: (CMN x0 x1:(SRAconst [c] y))
  2801  	// cond: clobberIfDead(x1)
  2802  	// result: (CMNshiftRA x0 y [c])
  2803  	for {
  2804  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2805  			x0 := v_0
  2806  			x1 := v_1
  2807  			if x1.Op != OpARM64SRAconst {
  2808  				continue
  2809  			}
  2810  			c := auxIntToInt64(x1.AuxInt)
  2811  			y := x1.Args[0]
  2812  			if !(clobberIfDead(x1)) {
  2813  				continue
  2814  			}
  2815  			v.reset(OpARM64CMNshiftRA)
  2816  			v.AuxInt = int64ToAuxInt(c)
  2817  			v.AddArg2(x0, y)
  2818  			return true
  2819  		}
  2820  		break
  2821  	}
  2822  	return false
  2823  }
  2824  func rewriteValueARM64_OpARM64CMNW(v *Value) bool {
  2825  	v_1 := v.Args[1]
  2826  	v_0 := v.Args[0]
  2827  	// match: (CMNW x (MOVDconst [c]))
  2828  	// result: (CMNWconst [int32(c)] x)
  2829  	for {
  2830  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2831  			x := v_0
  2832  			if v_1.Op != OpARM64MOVDconst {
  2833  				continue
  2834  			}
  2835  			c := auxIntToInt64(v_1.AuxInt)
  2836  			v.reset(OpARM64CMNWconst)
  2837  			v.AuxInt = int32ToAuxInt(int32(c))
  2838  			v.AddArg(x)
  2839  			return true
  2840  		}
  2841  		break
  2842  	}
  2843  	return false
  2844  }
  2845  func rewriteValueARM64_OpARM64CMNWconst(v *Value) bool {
  2846  	v_0 := v.Args[0]
  2847  	// match: (CMNWconst [c] y)
  2848  	// cond: c < 0 && c != -1<<31
  2849  	// result: (CMPWconst [-c] y)
  2850  	for {
  2851  		c := auxIntToInt32(v.AuxInt)
  2852  		y := v_0
  2853  		if !(c < 0 && c != -1<<31) {
  2854  			break
  2855  		}
  2856  		v.reset(OpARM64CMPWconst)
  2857  		v.AuxInt = int32ToAuxInt(-c)
  2858  		v.AddArg(y)
  2859  		return true
  2860  	}
  2861  	// match: (CMNWconst (MOVDconst [x]) [y])
  2862  	// result: (FlagConstant [addFlags32(int32(x),y)])
  2863  	for {
  2864  		y := auxIntToInt32(v.AuxInt)
  2865  		if v_0.Op != OpARM64MOVDconst {
  2866  			break
  2867  		}
  2868  		x := auxIntToInt64(v_0.AuxInt)
  2869  		v.reset(OpARM64FlagConstant)
  2870  		v.AuxInt = flagConstantToAuxInt(addFlags32(int32(x), y))
  2871  		return true
  2872  	}
  2873  	return false
  2874  }
  2875  func rewriteValueARM64_OpARM64CMNconst(v *Value) bool {
  2876  	v_0 := v.Args[0]
  2877  	// match: (CMNconst [c] y)
  2878  	// cond: c < 0 && c != -1<<63
  2879  	// result: (CMPconst [-c] y)
  2880  	for {
  2881  		c := auxIntToInt64(v.AuxInt)
  2882  		y := v_0
  2883  		if !(c < 0 && c != -1<<63) {
  2884  			break
  2885  		}
  2886  		v.reset(OpARM64CMPconst)
  2887  		v.AuxInt = int64ToAuxInt(-c)
  2888  		v.AddArg(y)
  2889  		return true
  2890  	}
  2891  	// match: (CMNconst (MOVDconst [x]) [y])
  2892  	// result: (FlagConstant [addFlags64(x,y)])
  2893  	for {
  2894  		y := auxIntToInt64(v.AuxInt)
  2895  		if v_0.Op != OpARM64MOVDconst {
  2896  			break
  2897  		}
  2898  		x := auxIntToInt64(v_0.AuxInt)
  2899  		v.reset(OpARM64FlagConstant)
  2900  		v.AuxInt = flagConstantToAuxInt(addFlags64(x, y))
  2901  		return true
  2902  	}
  2903  	return false
  2904  }
  2905  func rewriteValueARM64_OpARM64CMNshiftLL(v *Value) bool {
  2906  	v_1 := v.Args[1]
  2907  	v_0 := v.Args[0]
  2908  	b := v.Block
  2909  	// match: (CMNshiftLL (MOVDconst [c]) x [d])
  2910  	// result: (CMNconst [c] (SLLconst <x.Type> x [d]))
  2911  	for {
  2912  		d := auxIntToInt64(v.AuxInt)
  2913  		if v_0.Op != OpARM64MOVDconst {
  2914  			break
  2915  		}
  2916  		c := auxIntToInt64(v_0.AuxInt)
  2917  		x := v_1
  2918  		v.reset(OpARM64CMNconst)
  2919  		v.AuxInt = int64ToAuxInt(c)
  2920  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  2921  		v0.AuxInt = int64ToAuxInt(d)
  2922  		v0.AddArg(x)
  2923  		v.AddArg(v0)
  2924  		return true
  2925  	}
  2926  	// match: (CMNshiftLL x (MOVDconst [c]) [d])
  2927  	// result: (CMNconst x [int64(uint64(c)<<uint64(d))])
  2928  	for {
  2929  		d := auxIntToInt64(v.AuxInt)
  2930  		x := v_0
  2931  		if v_1.Op != OpARM64MOVDconst {
  2932  			break
  2933  		}
  2934  		c := auxIntToInt64(v_1.AuxInt)
  2935  		v.reset(OpARM64CMNconst)
  2936  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  2937  		v.AddArg(x)
  2938  		return true
  2939  	}
  2940  	return false
  2941  }
  2942  func rewriteValueARM64_OpARM64CMNshiftRA(v *Value) bool {
  2943  	v_1 := v.Args[1]
  2944  	v_0 := v.Args[0]
  2945  	b := v.Block
  2946  	// match: (CMNshiftRA (MOVDconst [c]) x [d])
  2947  	// result: (CMNconst [c] (SRAconst <x.Type> x [d]))
  2948  	for {
  2949  		d := auxIntToInt64(v.AuxInt)
  2950  		if v_0.Op != OpARM64MOVDconst {
  2951  			break
  2952  		}
  2953  		c := auxIntToInt64(v_0.AuxInt)
  2954  		x := v_1
  2955  		v.reset(OpARM64CMNconst)
  2956  		v.AuxInt = int64ToAuxInt(c)
  2957  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  2958  		v0.AuxInt = int64ToAuxInt(d)
  2959  		v0.AddArg(x)
  2960  		v.AddArg(v0)
  2961  		return true
  2962  	}
  2963  	// match: (CMNshiftRA x (MOVDconst [c]) [d])
  2964  	// result: (CMNconst x [c>>uint64(d)])
  2965  	for {
  2966  		d := auxIntToInt64(v.AuxInt)
  2967  		x := v_0
  2968  		if v_1.Op != OpARM64MOVDconst {
  2969  			break
  2970  		}
  2971  		c := auxIntToInt64(v_1.AuxInt)
  2972  		v.reset(OpARM64CMNconst)
  2973  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  2974  		v.AddArg(x)
  2975  		return true
  2976  	}
  2977  	return false
  2978  }
  2979  func rewriteValueARM64_OpARM64CMNshiftRL(v *Value) bool {
  2980  	v_1 := v.Args[1]
  2981  	v_0 := v.Args[0]
  2982  	b := v.Block
  2983  	// match: (CMNshiftRL (MOVDconst [c]) x [d])
  2984  	// result: (CMNconst [c] (SRLconst <x.Type> x [d]))
  2985  	for {
  2986  		d := auxIntToInt64(v.AuxInt)
  2987  		if v_0.Op != OpARM64MOVDconst {
  2988  			break
  2989  		}
  2990  		c := auxIntToInt64(v_0.AuxInt)
  2991  		x := v_1
  2992  		v.reset(OpARM64CMNconst)
  2993  		v.AuxInt = int64ToAuxInt(c)
  2994  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  2995  		v0.AuxInt = int64ToAuxInt(d)
  2996  		v0.AddArg(x)
  2997  		v.AddArg(v0)
  2998  		return true
  2999  	}
  3000  	// match: (CMNshiftRL x (MOVDconst [c]) [d])
  3001  	// result: (CMNconst x [int64(uint64(c)>>uint64(d))])
  3002  	for {
  3003  		d := auxIntToInt64(v.AuxInt)
  3004  		x := v_0
  3005  		if v_1.Op != OpARM64MOVDconst {
  3006  			break
  3007  		}
  3008  		c := auxIntToInt64(v_1.AuxInt)
  3009  		v.reset(OpARM64CMNconst)
  3010  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  3011  		v.AddArg(x)
  3012  		return true
  3013  	}
  3014  	return false
  3015  }
  3016  func rewriteValueARM64_OpARM64CMP(v *Value) bool {
  3017  	v_1 := v.Args[1]
  3018  	v_0 := v.Args[0]
  3019  	b := v.Block
  3020  	// match: (CMP x (MOVDconst [c]))
  3021  	// result: (CMPconst [c] x)
  3022  	for {
  3023  		x := v_0
  3024  		if v_1.Op != OpARM64MOVDconst {
  3025  			break
  3026  		}
  3027  		c := auxIntToInt64(v_1.AuxInt)
  3028  		v.reset(OpARM64CMPconst)
  3029  		v.AuxInt = int64ToAuxInt(c)
  3030  		v.AddArg(x)
  3031  		return true
  3032  	}
  3033  	// match: (CMP (MOVDconst [c]) x)
  3034  	// result: (InvertFlags (CMPconst [c] x))
  3035  	for {
  3036  		if v_0.Op != OpARM64MOVDconst {
  3037  			break
  3038  		}
  3039  		c := auxIntToInt64(v_0.AuxInt)
  3040  		x := v_1
  3041  		v.reset(OpARM64InvertFlags)
  3042  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  3043  		v0.AuxInt = int64ToAuxInt(c)
  3044  		v0.AddArg(x)
  3045  		v.AddArg(v0)
  3046  		return true
  3047  	}
  3048  	// match: (CMP x y)
  3049  	// cond: canonLessThan(x,y)
  3050  	// result: (InvertFlags (CMP y x))
  3051  	for {
  3052  		x := v_0
  3053  		y := v_1
  3054  		if !(canonLessThan(x, y)) {
  3055  			break
  3056  		}
  3057  		v.reset(OpARM64InvertFlags)
  3058  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  3059  		v0.AddArg2(y, x)
  3060  		v.AddArg(v0)
  3061  		return true
  3062  	}
  3063  	// match: (CMP x0 x1:(SLLconst [c] y))
  3064  	// cond: clobberIfDead(x1)
  3065  	// result: (CMPshiftLL x0 y [c])
  3066  	for {
  3067  		x0 := v_0
  3068  		x1 := v_1
  3069  		if x1.Op != OpARM64SLLconst {
  3070  			break
  3071  		}
  3072  		c := auxIntToInt64(x1.AuxInt)
  3073  		y := x1.Args[0]
  3074  		if !(clobberIfDead(x1)) {
  3075  			break
  3076  		}
  3077  		v.reset(OpARM64CMPshiftLL)
  3078  		v.AuxInt = int64ToAuxInt(c)
  3079  		v.AddArg2(x0, y)
  3080  		return true
  3081  	}
  3082  	// match: (CMP x0:(SLLconst [c] y) x1)
  3083  	// cond: clobberIfDead(x0)
  3084  	// result: (InvertFlags (CMPshiftLL x1 y [c]))
  3085  	for {
  3086  		x0 := v_0
  3087  		if x0.Op != OpARM64SLLconst {
  3088  			break
  3089  		}
  3090  		c := auxIntToInt64(x0.AuxInt)
  3091  		y := x0.Args[0]
  3092  		x1 := v_1
  3093  		if !(clobberIfDead(x0)) {
  3094  			break
  3095  		}
  3096  		v.reset(OpARM64InvertFlags)
  3097  		v0 := b.NewValue0(v.Pos, OpARM64CMPshiftLL, types.TypeFlags)
  3098  		v0.AuxInt = int64ToAuxInt(c)
  3099  		v0.AddArg2(x1, y)
  3100  		v.AddArg(v0)
  3101  		return true
  3102  	}
  3103  	// match: (CMP x0 x1:(SRLconst [c] y))
  3104  	// cond: clobberIfDead(x1)
  3105  	// result: (CMPshiftRL x0 y [c])
  3106  	for {
  3107  		x0 := v_0
  3108  		x1 := v_1
  3109  		if x1.Op != OpARM64SRLconst {
  3110  			break
  3111  		}
  3112  		c := auxIntToInt64(x1.AuxInt)
  3113  		y := x1.Args[0]
  3114  		if !(clobberIfDead(x1)) {
  3115  			break
  3116  		}
  3117  		v.reset(OpARM64CMPshiftRL)
  3118  		v.AuxInt = int64ToAuxInt(c)
  3119  		v.AddArg2(x0, y)
  3120  		return true
  3121  	}
  3122  	// match: (CMP x0:(SRLconst [c] y) x1)
  3123  	// cond: clobberIfDead(x0)
  3124  	// result: (InvertFlags (CMPshiftRL x1 y [c]))
  3125  	for {
  3126  		x0 := v_0
  3127  		if x0.Op != OpARM64SRLconst {
  3128  			break
  3129  		}
  3130  		c := auxIntToInt64(x0.AuxInt)
  3131  		y := x0.Args[0]
  3132  		x1 := v_1
  3133  		if !(clobberIfDead(x0)) {
  3134  			break
  3135  		}
  3136  		v.reset(OpARM64InvertFlags)
  3137  		v0 := b.NewValue0(v.Pos, OpARM64CMPshiftRL, types.TypeFlags)
  3138  		v0.AuxInt = int64ToAuxInt(c)
  3139  		v0.AddArg2(x1, y)
  3140  		v.AddArg(v0)
  3141  		return true
  3142  	}
  3143  	// match: (CMP x0 x1:(SRAconst [c] y))
  3144  	// cond: clobberIfDead(x1)
  3145  	// result: (CMPshiftRA x0 y [c])
  3146  	for {
  3147  		x0 := v_0
  3148  		x1 := v_1
  3149  		if x1.Op != OpARM64SRAconst {
  3150  			break
  3151  		}
  3152  		c := auxIntToInt64(x1.AuxInt)
  3153  		y := x1.Args[0]
  3154  		if !(clobberIfDead(x1)) {
  3155  			break
  3156  		}
  3157  		v.reset(OpARM64CMPshiftRA)
  3158  		v.AuxInt = int64ToAuxInt(c)
  3159  		v.AddArg2(x0, y)
  3160  		return true
  3161  	}
  3162  	// match: (CMP x0:(SRAconst [c] y) x1)
  3163  	// cond: clobberIfDead(x0)
  3164  	// result: (InvertFlags (CMPshiftRA x1 y [c]))
  3165  	for {
  3166  		x0 := v_0
  3167  		if x0.Op != OpARM64SRAconst {
  3168  			break
  3169  		}
  3170  		c := auxIntToInt64(x0.AuxInt)
  3171  		y := x0.Args[0]
  3172  		x1 := v_1
  3173  		if !(clobberIfDead(x0)) {
  3174  			break
  3175  		}
  3176  		v.reset(OpARM64InvertFlags)
  3177  		v0 := b.NewValue0(v.Pos, OpARM64CMPshiftRA, types.TypeFlags)
  3178  		v0.AuxInt = int64ToAuxInt(c)
  3179  		v0.AddArg2(x1, y)
  3180  		v.AddArg(v0)
  3181  		return true
  3182  	}
  3183  	return false
  3184  }
  3185  func rewriteValueARM64_OpARM64CMPW(v *Value) bool {
  3186  	v_1 := v.Args[1]
  3187  	v_0 := v.Args[0]
  3188  	b := v.Block
  3189  	// match: (CMPW x (MOVDconst [c]))
  3190  	// result: (CMPWconst [int32(c)] x)
  3191  	for {
  3192  		x := v_0
  3193  		if v_1.Op != OpARM64MOVDconst {
  3194  			break
  3195  		}
  3196  		c := auxIntToInt64(v_1.AuxInt)
  3197  		v.reset(OpARM64CMPWconst)
  3198  		v.AuxInt = int32ToAuxInt(int32(c))
  3199  		v.AddArg(x)
  3200  		return true
  3201  	}
  3202  	// match: (CMPW (MOVDconst [c]) x)
  3203  	// result: (InvertFlags (CMPWconst [int32(c)] x))
  3204  	for {
  3205  		if v_0.Op != OpARM64MOVDconst {
  3206  			break
  3207  		}
  3208  		c := auxIntToInt64(v_0.AuxInt)
  3209  		x := v_1
  3210  		v.reset(OpARM64InvertFlags)
  3211  		v0 := b.NewValue0(v.Pos, OpARM64CMPWconst, types.TypeFlags)
  3212  		v0.AuxInt = int32ToAuxInt(int32(c))
  3213  		v0.AddArg(x)
  3214  		v.AddArg(v0)
  3215  		return true
  3216  	}
  3217  	// match: (CMPW x y)
  3218  	// cond: canonLessThan(x,y)
  3219  	// result: (InvertFlags (CMPW y x))
  3220  	for {
  3221  		x := v_0
  3222  		y := v_1
  3223  		if !(canonLessThan(x, y)) {
  3224  			break
  3225  		}
  3226  		v.reset(OpARM64InvertFlags)
  3227  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  3228  		v0.AddArg2(y, x)
  3229  		v.AddArg(v0)
  3230  		return true
  3231  	}
  3232  	return false
  3233  }
  3234  func rewriteValueARM64_OpARM64CMPWconst(v *Value) bool {
  3235  	v_0 := v.Args[0]
  3236  	// match: (CMPWconst [c] y)
  3237  	// cond: c < 0 && c != -1<<31
  3238  	// result: (CMNWconst [-c] y)
  3239  	for {
  3240  		c := auxIntToInt32(v.AuxInt)
  3241  		y := v_0
  3242  		if !(c < 0 && c != -1<<31) {
  3243  			break
  3244  		}
  3245  		v.reset(OpARM64CMNWconst)
  3246  		v.AuxInt = int32ToAuxInt(-c)
  3247  		v.AddArg(y)
  3248  		return true
  3249  	}
  3250  	// match: (CMPWconst (MOVDconst [x]) [y])
  3251  	// result: (FlagConstant [subFlags32(int32(x),y)])
  3252  	for {
  3253  		y := auxIntToInt32(v.AuxInt)
  3254  		if v_0.Op != OpARM64MOVDconst {
  3255  			break
  3256  		}
  3257  		x := auxIntToInt64(v_0.AuxInt)
  3258  		v.reset(OpARM64FlagConstant)
  3259  		v.AuxInt = flagConstantToAuxInt(subFlags32(int32(x), y))
  3260  		return true
  3261  	}
  3262  	// match: (CMPWconst (MOVBUreg _) [c])
  3263  	// cond: 0xff < c
  3264  	// result: (FlagConstant [subFlags64(0,1)])
  3265  	for {
  3266  		c := auxIntToInt32(v.AuxInt)
  3267  		if v_0.Op != OpARM64MOVBUreg || !(0xff < c) {
  3268  			break
  3269  		}
  3270  		v.reset(OpARM64FlagConstant)
  3271  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3272  		return true
  3273  	}
  3274  	// match: (CMPWconst (MOVHUreg _) [c])
  3275  	// cond: 0xffff < c
  3276  	// result: (FlagConstant [subFlags64(0,1)])
  3277  	for {
  3278  		c := auxIntToInt32(v.AuxInt)
  3279  		if v_0.Op != OpARM64MOVHUreg || !(0xffff < c) {
  3280  			break
  3281  		}
  3282  		v.reset(OpARM64FlagConstant)
  3283  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3284  		return true
  3285  	}
  3286  	return false
  3287  }
  3288  func rewriteValueARM64_OpARM64CMPconst(v *Value) bool {
  3289  	v_0 := v.Args[0]
  3290  	// match: (CMPconst [c] y)
  3291  	// cond: c < 0 && c != -1<<63
  3292  	// result: (CMNconst [-c] y)
  3293  	for {
  3294  		c := auxIntToInt64(v.AuxInt)
  3295  		y := v_0
  3296  		if !(c < 0 && c != -1<<63) {
  3297  			break
  3298  		}
  3299  		v.reset(OpARM64CMNconst)
  3300  		v.AuxInt = int64ToAuxInt(-c)
  3301  		v.AddArg(y)
  3302  		return true
  3303  	}
  3304  	// match: (CMPconst (MOVDconst [x]) [y])
  3305  	// result: (FlagConstant [subFlags64(x,y)])
  3306  	for {
  3307  		y := auxIntToInt64(v.AuxInt)
  3308  		if v_0.Op != OpARM64MOVDconst {
  3309  			break
  3310  		}
  3311  		x := auxIntToInt64(v_0.AuxInt)
  3312  		v.reset(OpARM64FlagConstant)
  3313  		v.AuxInt = flagConstantToAuxInt(subFlags64(x, y))
  3314  		return true
  3315  	}
  3316  	// match: (CMPconst (MOVBUreg _) [c])
  3317  	// cond: 0xff < c
  3318  	// result: (FlagConstant [subFlags64(0,1)])
  3319  	for {
  3320  		c := auxIntToInt64(v.AuxInt)
  3321  		if v_0.Op != OpARM64MOVBUreg || !(0xff < c) {
  3322  			break
  3323  		}
  3324  		v.reset(OpARM64FlagConstant)
  3325  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3326  		return true
  3327  	}
  3328  	// match: (CMPconst (MOVHUreg _) [c])
  3329  	// cond: 0xffff < c
  3330  	// result: (FlagConstant [subFlags64(0,1)])
  3331  	for {
  3332  		c := auxIntToInt64(v.AuxInt)
  3333  		if v_0.Op != OpARM64MOVHUreg || !(0xffff < c) {
  3334  			break
  3335  		}
  3336  		v.reset(OpARM64FlagConstant)
  3337  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3338  		return true
  3339  	}
  3340  	// match: (CMPconst (MOVWUreg _) [c])
  3341  	// cond: 0xffffffff < c
  3342  	// result: (FlagConstant [subFlags64(0,1)])
  3343  	for {
  3344  		c := auxIntToInt64(v.AuxInt)
  3345  		if v_0.Op != OpARM64MOVWUreg || !(0xffffffff < c) {
  3346  			break
  3347  		}
  3348  		v.reset(OpARM64FlagConstant)
  3349  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3350  		return true
  3351  	}
  3352  	// match: (CMPconst (ANDconst _ [m]) [n])
  3353  	// cond: 0 <= m && m < n
  3354  	// result: (FlagConstant [subFlags64(0,1)])
  3355  	for {
  3356  		n := auxIntToInt64(v.AuxInt)
  3357  		if v_0.Op != OpARM64ANDconst {
  3358  			break
  3359  		}
  3360  		m := auxIntToInt64(v_0.AuxInt)
  3361  		if !(0 <= m && m < n) {
  3362  			break
  3363  		}
  3364  		v.reset(OpARM64FlagConstant)
  3365  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3366  		return true
  3367  	}
  3368  	// match: (CMPconst (SRLconst _ [c]) [n])
  3369  	// cond: 0 <= n && 0 < c && c <= 63 && (1<<uint64(64-c)) <= uint64(n)
  3370  	// result: (FlagConstant [subFlags64(0,1)])
  3371  	for {
  3372  		n := auxIntToInt64(v.AuxInt)
  3373  		if v_0.Op != OpARM64SRLconst {
  3374  			break
  3375  		}
  3376  		c := auxIntToInt64(v_0.AuxInt)
  3377  		if !(0 <= n && 0 < c && c <= 63 && (1<<uint64(64-c)) <= uint64(n)) {
  3378  			break
  3379  		}
  3380  		v.reset(OpARM64FlagConstant)
  3381  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3382  		return true
  3383  	}
  3384  	return false
  3385  }
  3386  func rewriteValueARM64_OpARM64CMPshiftLL(v *Value) bool {
  3387  	v_1 := v.Args[1]
  3388  	v_0 := v.Args[0]
  3389  	b := v.Block
  3390  	// match: (CMPshiftLL (MOVDconst [c]) x [d])
  3391  	// result: (InvertFlags (CMPconst [c] (SLLconst <x.Type> x [d])))
  3392  	for {
  3393  		d := auxIntToInt64(v.AuxInt)
  3394  		if v_0.Op != OpARM64MOVDconst {
  3395  			break
  3396  		}
  3397  		c := auxIntToInt64(v_0.AuxInt)
  3398  		x := v_1
  3399  		v.reset(OpARM64InvertFlags)
  3400  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  3401  		v0.AuxInt = int64ToAuxInt(c)
  3402  		v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  3403  		v1.AuxInt = int64ToAuxInt(d)
  3404  		v1.AddArg(x)
  3405  		v0.AddArg(v1)
  3406  		v.AddArg(v0)
  3407  		return true
  3408  	}
  3409  	// match: (CMPshiftLL x (MOVDconst [c]) [d])
  3410  	// result: (CMPconst x [int64(uint64(c)<<uint64(d))])
  3411  	for {
  3412  		d := auxIntToInt64(v.AuxInt)
  3413  		x := v_0
  3414  		if v_1.Op != OpARM64MOVDconst {
  3415  			break
  3416  		}
  3417  		c := auxIntToInt64(v_1.AuxInt)
  3418  		v.reset(OpARM64CMPconst)
  3419  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  3420  		v.AddArg(x)
  3421  		return true
  3422  	}
  3423  	return false
  3424  }
  3425  func rewriteValueARM64_OpARM64CMPshiftRA(v *Value) bool {
  3426  	v_1 := v.Args[1]
  3427  	v_0 := v.Args[0]
  3428  	b := v.Block
  3429  	// match: (CMPshiftRA (MOVDconst [c]) x [d])
  3430  	// result: (InvertFlags (CMPconst [c] (SRAconst <x.Type> x [d])))
  3431  	for {
  3432  		d := auxIntToInt64(v.AuxInt)
  3433  		if v_0.Op != OpARM64MOVDconst {
  3434  			break
  3435  		}
  3436  		c := auxIntToInt64(v_0.AuxInt)
  3437  		x := v_1
  3438  		v.reset(OpARM64InvertFlags)
  3439  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  3440  		v0.AuxInt = int64ToAuxInt(c)
  3441  		v1 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  3442  		v1.AuxInt = int64ToAuxInt(d)
  3443  		v1.AddArg(x)
  3444  		v0.AddArg(v1)
  3445  		v.AddArg(v0)
  3446  		return true
  3447  	}
  3448  	// match: (CMPshiftRA x (MOVDconst [c]) [d])
  3449  	// result: (CMPconst x [c>>uint64(d)])
  3450  	for {
  3451  		d := auxIntToInt64(v.AuxInt)
  3452  		x := v_0
  3453  		if v_1.Op != OpARM64MOVDconst {
  3454  			break
  3455  		}
  3456  		c := auxIntToInt64(v_1.AuxInt)
  3457  		v.reset(OpARM64CMPconst)
  3458  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  3459  		v.AddArg(x)
  3460  		return true
  3461  	}
  3462  	return false
  3463  }
  3464  func rewriteValueARM64_OpARM64CMPshiftRL(v *Value) bool {
  3465  	v_1 := v.Args[1]
  3466  	v_0 := v.Args[0]
  3467  	b := v.Block
  3468  	// match: (CMPshiftRL (MOVDconst [c]) x [d])
  3469  	// result: (InvertFlags (CMPconst [c] (SRLconst <x.Type> x [d])))
  3470  	for {
  3471  		d := auxIntToInt64(v.AuxInt)
  3472  		if v_0.Op != OpARM64MOVDconst {
  3473  			break
  3474  		}
  3475  		c := auxIntToInt64(v_0.AuxInt)
  3476  		x := v_1
  3477  		v.reset(OpARM64InvertFlags)
  3478  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  3479  		v0.AuxInt = int64ToAuxInt(c)
  3480  		v1 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  3481  		v1.AuxInt = int64ToAuxInt(d)
  3482  		v1.AddArg(x)
  3483  		v0.AddArg(v1)
  3484  		v.AddArg(v0)
  3485  		return true
  3486  	}
  3487  	// match: (CMPshiftRL x (MOVDconst [c]) [d])
  3488  	// result: (CMPconst x [int64(uint64(c)>>uint64(d))])
  3489  	for {
  3490  		d := auxIntToInt64(v.AuxInt)
  3491  		x := v_0
  3492  		if v_1.Op != OpARM64MOVDconst {
  3493  			break
  3494  		}
  3495  		c := auxIntToInt64(v_1.AuxInt)
  3496  		v.reset(OpARM64CMPconst)
  3497  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  3498  		v.AddArg(x)
  3499  		return true
  3500  	}
  3501  	return false
  3502  }
  3503  func rewriteValueARM64_OpARM64CSEL(v *Value) bool {
  3504  	v_2 := v.Args[2]
  3505  	v_1 := v.Args[1]
  3506  	v_0 := v.Args[0]
  3507  	// match: (CSEL [cc] (MOVDconst [-1]) (MOVDconst [0]) flag)
  3508  	// result: (CSETM [cc] flag)
  3509  	for {
  3510  		cc := auxIntToOp(v.AuxInt)
  3511  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != -1 || v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  3512  			break
  3513  		}
  3514  		flag := v_2
  3515  		v.reset(OpARM64CSETM)
  3516  		v.AuxInt = opToAuxInt(cc)
  3517  		v.AddArg(flag)
  3518  		return true
  3519  	}
  3520  	// match: (CSEL [cc] (MOVDconst [0]) (MOVDconst [-1]) flag)
  3521  	// result: (CSETM [arm64Negate(cc)] flag)
  3522  	for {
  3523  		cc := auxIntToOp(v.AuxInt)
  3524  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 || v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  3525  			break
  3526  		}
  3527  		flag := v_2
  3528  		v.reset(OpARM64CSETM)
  3529  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3530  		v.AddArg(flag)
  3531  		return true
  3532  	}
  3533  	// match: (CSEL [cc] x (MOVDconst [0]) flag)
  3534  	// result: (CSEL0 [cc] x flag)
  3535  	for {
  3536  		cc := auxIntToOp(v.AuxInt)
  3537  		x := v_0
  3538  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  3539  			break
  3540  		}
  3541  		flag := v_2
  3542  		v.reset(OpARM64CSEL0)
  3543  		v.AuxInt = opToAuxInt(cc)
  3544  		v.AddArg2(x, flag)
  3545  		return true
  3546  	}
  3547  	// match: (CSEL [cc] (MOVDconst [0]) y flag)
  3548  	// result: (CSEL0 [arm64Negate(cc)] y flag)
  3549  	for {
  3550  		cc := auxIntToOp(v.AuxInt)
  3551  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
  3552  			break
  3553  		}
  3554  		y := v_1
  3555  		flag := v_2
  3556  		v.reset(OpARM64CSEL0)
  3557  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3558  		v.AddArg2(y, flag)
  3559  		return true
  3560  	}
  3561  	// match: (CSEL [cc] x (ADDconst [1] a) flag)
  3562  	// result: (CSINC [cc] x a flag)
  3563  	for {
  3564  		cc := auxIntToOp(v.AuxInt)
  3565  		x := v_0
  3566  		if v_1.Op != OpARM64ADDconst || auxIntToInt64(v_1.AuxInt) != 1 {
  3567  			break
  3568  		}
  3569  		a := v_1.Args[0]
  3570  		flag := v_2
  3571  		v.reset(OpARM64CSINC)
  3572  		v.AuxInt = opToAuxInt(cc)
  3573  		v.AddArg3(x, a, flag)
  3574  		return true
  3575  	}
  3576  	// match: (CSEL [cc] (ADDconst [1] a) x flag)
  3577  	// result: (CSINC [arm64Negate(cc)] x a flag)
  3578  	for {
  3579  		cc := auxIntToOp(v.AuxInt)
  3580  		if v_0.Op != OpARM64ADDconst || auxIntToInt64(v_0.AuxInt) != 1 {
  3581  			break
  3582  		}
  3583  		a := v_0.Args[0]
  3584  		x := v_1
  3585  		flag := v_2
  3586  		v.reset(OpARM64CSINC)
  3587  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3588  		v.AddArg3(x, a, flag)
  3589  		return true
  3590  	}
  3591  	// match: (CSEL [cc] x (MVN a) flag)
  3592  	// result: (CSINV [cc] x a flag)
  3593  	for {
  3594  		cc := auxIntToOp(v.AuxInt)
  3595  		x := v_0
  3596  		if v_1.Op != OpARM64MVN {
  3597  			break
  3598  		}
  3599  		a := v_1.Args[0]
  3600  		flag := v_2
  3601  		v.reset(OpARM64CSINV)
  3602  		v.AuxInt = opToAuxInt(cc)
  3603  		v.AddArg3(x, a, flag)
  3604  		return true
  3605  	}
  3606  	// match: (CSEL [cc] (MVN a) x flag)
  3607  	// result: (CSINV [arm64Negate(cc)] x a flag)
  3608  	for {
  3609  		cc := auxIntToOp(v.AuxInt)
  3610  		if v_0.Op != OpARM64MVN {
  3611  			break
  3612  		}
  3613  		a := v_0.Args[0]
  3614  		x := v_1
  3615  		flag := v_2
  3616  		v.reset(OpARM64CSINV)
  3617  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3618  		v.AddArg3(x, a, flag)
  3619  		return true
  3620  	}
  3621  	// match: (CSEL [cc] x (NEG a) flag)
  3622  	// result: (CSNEG [cc] x a flag)
  3623  	for {
  3624  		cc := auxIntToOp(v.AuxInt)
  3625  		x := v_0
  3626  		if v_1.Op != OpARM64NEG {
  3627  			break
  3628  		}
  3629  		a := v_1.Args[0]
  3630  		flag := v_2
  3631  		v.reset(OpARM64CSNEG)
  3632  		v.AuxInt = opToAuxInt(cc)
  3633  		v.AddArg3(x, a, flag)
  3634  		return true
  3635  	}
  3636  	// match: (CSEL [cc] (NEG a) x flag)
  3637  	// result: (CSNEG [arm64Negate(cc)] x a flag)
  3638  	for {
  3639  		cc := auxIntToOp(v.AuxInt)
  3640  		if v_0.Op != OpARM64NEG {
  3641  			break
  3642  		}
  3643  		a := v_0.Args[0]
  3644  		x := v_1
  3645  		flag := v_2
  3646  		v.reset(OpARM64CSNEG)
  3647  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3648  		v.AddArg3(x, a, flag)
  3649  		return true
  3650  	}
  3651  	// match: (CSEL [cc] x y (InvertFlags cmp))
  3652  	// result: (CSEL [arm64Invert(cc)] x y cmp)
  3653  	for {
  3654  		cc := auxIntToOp(v.AuxInt)
  3655  		x := v_0
  3656  		y := v_1
  3657  		if v_2.Op != OpARM64InvertFlags {
  3658  			break
  3659  		}
  3660  		cmp := v_2.Args[0]
  3661  		v.reset(OpARM64CSEL)
  3662  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3663  		v.AddArg3(x, y, cmp)
  3664  		return true
  3665  	}
  3666  	// match: (CSEL [cc] x _ flag)
  3667  	// cond: ccARM64Eval(cc, flag) > 0
  3668  	// result: x
  3669  	for {
  3670  		cc := auxIntToOp(v.AuxInt)
  3671  		x := v_0
  3672  		flag := v_2
  3673  		if !(ccARM64Eval(cc, flag) > 0) {
  3674  			break
  3675  		}
  3676  		v.copyOf(x)
  3677  		return true
  3678  	}
  3679  	// match: (CSEL [cc] _ y flag)
  3680  	// cond: ccARM64Eval(cc, flag) < 0
  3681  	// result: y
  3682  	for {
  3683  		cc := auxIntToOp(v.AuxInt)
  3684  		y := v_1
  3685  		flag := v_2
  3686  		if !(ccARM64Eval(cc, flag) < 0) {
  3687  			break
  3688  		}
  3689  		v.copyOf(y)
  3690  		return true
  3691  	}
  3692  	// match: (CSEL [cc] x y (CMPWconst [0] boolval))
  3693  	// cond: cc == OpARM64NotEqual && flagArg(boolval) != nil
  3694  	// result: (CSEL [boolval.Op] x y flagArg(boolval))
  3695  	for {
  3696  		cc := auxIntToOp(v.AuxInt)
  3697  		x := v_0
  3698  		y := v_1
  3699  		if v_2.Op != OpARM64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  3700  			break
  3701  		}
  3702  		boolval := v_2.Args[0]
  3703  		if !(cc == OpARM64NotEqual && flagArg(boolval) != nil) {
  3704  			break
  3705  		}
  3706  		v.reset(OpARM64CSEL)
  3707  		v.AuxInt = opToAuxInt(boolval.Op)
  3708  		v.AddArg3(x, y, flagArg(boolval))
  3709  		return true
  3710  	}
  3711  	// match: (CSEL [cc] x y (CMPWconst [0] boolval))
  3712  	// cond: cc == OpARM64Equal && flagArg(boolval) != nil
  3713  	// result: (CSEL [arm64Negate(boolval.Op)] x y flagArg(boolval))
  3714  	for {
  3715  		cc := auxIntToOp(v.AuxInt)
  3716  		x := v_0
  3717  		y := v_1
  3718  		if v_2.Op != OpARM64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  3719  			break
  3720  		}
  3721  		boolval := v_2.Args[0]
  3722  		if !(cc == OpARM64Equal && flagArg(boolval) != nil) {
  3723  			break
  3724  		}
  3725  		v.reset(OpARM64CSEL)
  3726  		v.AuxInt = opToAuxInt(arm64Negate(boolval.Op))
  3727  		v.AddArg3(x, y, flagArg(boolval))
  3728  		return true
  3729  	}
  3730  	return false
  3731  }
  3732  func rewriteValueARM64_OpARM64CSEL0(v *Value) bool {
  3733  	v_1 := v.Args[1]
  3734  	v_0 := v.Args[0]
  3735  	// match: (CSEL0 [cc] x (InvertFlags cmp))
  3736  	// result: (CSEL0 [arm64Invert(cc)] x cmp)
  3737  	for {
  3738  		cc := auxIntToOp(v.AuxInt)
  3739  		x := v_0
  3740  		if v_1.Op != OpARM64InvertFlags {
  3741  			break
  3742  		}
  3743  		cmp := v_1.Args[0]
  3744  		v.reset(OpARM64CSEL0)
  3745  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3746  		v.AddArg2(x, cmp)
  3747  		return true
  3748  	}
  3749  	// match: (CSEL0 [cc] x flag)
  3750  	// cond: ccARM64Eval(cc, flag) > 0
  3751  	// result: x
  3752  	for {
  3753  		cc := auxIntToOp(v.AuxInt)
  3754  		x := v_0
  3755  		flag := v_1
  3756  		if !(ccARM64Eval(cc, flag) > 0) {
  3757  			break
  3758  		}
  3759  		v.copyOf(x)
  3760  		return true
  3761  	}
  3762  	// match: (CSEL0 [cc] _ flag)
  3763  	// cond: ccARM64Eval(cc, flag) < 0
  3764  	// result: (MOVDconst [0])
  3765  	for {
  3766  		cc := auxIntToOp(v.AuxInt)
  3767  		flag := v_1
  3768  		if !(ccARM64Eval(cc, flag) < 0) {
  3769  			break
  3770  		}
  3771  		v.reset(OpARM64MOVDconst)
  3772  		v.AuxInt = int64ToAuxInt(0)
  3773  		return true
  3774  	}
  3775  	// match: (CSEL0 [cc] x (CMPWconst [0] boolval))
  3776  	// cond: cc == OpARM64NotEqual && flagArg(boolval) != nil
  3777  	// result: (CSEL0 [boolval.Op] x flagArg(boolval))
  3778  	for {
  3779  		cc := auxIntToOp(v.AuxInt)
  3780  		x := v_0
  3781  		if v_1.Op != OpARM64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 {
  3782  			break
  3783  		}
  3784  		boolval := v_1.Args[0]
  3785  		if !(cc == OpARM64NotEqual && flagArg(boolval) != nil) {
  3786  			break
  3787  		}
  3788  		v.reset(OpARM64CSEL0)
  3789  		v.AuxInt = opToAuxInt(boolval.Op)
  3790  		v.AddArg2(x, flagArg(boolval))
  3791  		return true
  3792  	}
  3793  	// match: (CSEL0 [cc] x (CMPWconst [0] boolval))
  3794  	// cond: cc == OpARM64Equal && flagArg(boolval) != nil
  3795  	// result: (CSEL0 [arm64Negate(boolval.Op)] x flagArg(boolval))
  3796  	for {
  3797  		cc := auxIntToOp(v.AuxInt)
  3798  		x := v_0
  3799  		if v_1.Op != OpARM64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 {
  3800  			break
  3801  		}
  3802  		boolval := v_1.Args[0]
  3803  		if !(cc == OpARM64Equal && flagArg(boolval) != nil) {
  3804  			break
  3805  		}
  3806  		v.reset(OpARM64CSEL0)
  3807  		v.AuxInt = opToAuxInt(arm64Negate(boolval.Op))
  3808  		v.AddArg2(x, flagArg(boolval))
  3809  		return true
  3810  	}
  3811  	return false
  3812  }
  3813  func rewriteValueARM64_OpARM64CSETM(v *Value) bool {
  3814  	v_0 := v.Args[0]
  3815  	// match: (CSETM [cc] (InvertFlags cmp))
  3816  	// result: (CSETM [arm64Invert(cc)] cmp)
  3817  	for {
  3818  		cc := auxIntToOp(v.AuxInt)
  3819  		if v_0.Op != OpARM64InvertFlags {
  3820  			break
  3821  		}
  3822  		cmp := v_0.Args[0]
  3823  		v.reset(OpARM64CSETM)
  3824  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3825  		v.AddArg(cmp)
  3826  		return true
  3827  	}
  3828  	// match: (CSETM [cc] flag)
  3829  	// cond: ccARM64Eval(cc, flag) > 0
  3830  	// result: (MOVDconst [-1])
  3831  	for {
  3832  		cc := auxIntToOp(v.AuxInt)
  3833  		flag := v_0
  3834  		if !(ccARM64Eval(cc, flag) > 0) {
  3835  			break
  3836  		}
  3837  		v.reset(OpARM64MOVDconst)
  3838  		v.AuxInt = int64ToAuxInt(-1)
  3839  		return true
  3840  	}
  3841  	// match: (CSETM [cc] flag)
  3842  	// cond: ccARM64Eval(cc, flag) < 0
  3843  	// result: (MOVDconst [0])
  3844  	for {
  3845  		cc := auxIntToOp(v.AuxInt)
  3846  		flag := v_0
  3847  		if !(ccARM64Eval(cc, flag) < 0) {
  3848  			break
  3849  		}
  3850  		v.reset(OpARM64MOVDconst)
  3851  		v.AuxInt = int64ToAuxInt(0)
  3852  		return true
  3853  	}
  3854  	return false
  3855  }
  3856  func rewriteValueARM64_OpARM64CSINC(v *Value) bool {
  3857  	v_2 := v.Args[2]
  3858  	v_1 := v.Args[1]
  3859  	v_0 := v.Args[0]
  3860  	// match: (CSINC [cc] x y (InvertFlags cmp))
  3861  	// result: (CSINC [arm64Invert(cc)] x y cmp)
  3862  	for {
  3863  		cc := auxIntToOp(v.AuxInt)
  3864  		x := v_0
  3865  		y := v_1
  3866  		if v_2.Op != OpARM64InvertFlags {
  3867  			break
  3868  		}
  3869  		cmp := v_2.Args[0]
  3870  		v.reset(OpARM64CSINC)
  3871  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3872  		v.AddArg3(x, y, cmp)
  3873  		return true
  3874  	}
  3875  	// match: (CSINC [cc] x _ flag)
  3876  	// cond: ccARM64Eval(cc, flag) > 0
  3877  	// result: x
  3878  	for {
  3879  		cc := auxIntToOp(v.AuxInt)
  3880  		x := v_0
  3881  		flag := v_2
  3882  		if !(ccARM64Eval(cc, flag) > 0) {
  3883  			break
  3884  		}
  3885  		v.copyOf(x)
  3886  		return true
  3887  	}
  3888  	// match: (CSINC [cc] _ y flag)
  3889  	// cond: ccARM64Eval(cc, flag) < 0
  3890  	// result: (ADDconst [1] y)
  3891  	for {
  3892  		cc := auxIntToOp(v.AuxInt)
  3893  		y := v_1
  3894  		flag := v_2
  3895  		if !(ccARM64Eval(cc, flag) < 0) {
  3896  			break
  3897  		}
  3898  		v.reset(OpARM64ADDconst)
  3899  		v.AuxInt = int64ToAuxInt(1)
  3900  		v.AddArg(y)
  3901  		return true
  3902  	}
  3903  	return false
  3904  }
  3905  func rewriteValueARM64_OpARM64CSINV(v *Value) bool {
  3906  	v_2 := v.Args[2]
  3907  	v_1 := v.Args[1]
  3908  	v_0 := v.Args[0]
  3909  	// match: (CSINV [cc] x y (InvertFlags cmp))
  3910  	// result: (CSINV [arm64Invert(cc)] x y cmp)
  3911  	for {
  3912  		cc := auxIntToOp(v.AuxInt)
  3913  		x := v_0
  3914  		y := v_1
  3915  		if v_2.Op != OpARM64InvertFlags {
  3916  			break
  3917  		}
  3918  		cmp := v_2.Args[0]
  3919  		v.reset(OpARM64CSINV)
  3920  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3921  		v.AddArg3(x, y, cmp)
  3922  		return true
  3923  	}
  3924  	// match: (CSINV [cc] x _ flag)
  3925  	// cond: ccARM64Eval(cc, flag) > 0
  3926  	// result: x
  3927  	for {
  3928  		cc := auxIntToOp(v.AuxInt)
  3929  		x := v_0
  3930  		flag := v_2
  3931  		if !(ccARM64Eval(cc, flag) > 0) {
  3932  			break
  3933  		}
  3934  		v.copyOf(x)
  3935  		return true
  3936  	}
  3937  	// match: (CSINV [cc] _ y flag)
  3938  	// cond: ccARM64Eval(cc, flag) < 0
  3939  	// result: (Not y)
  3940  	for {
  3941  		cc := auxIntToOp(v.AuxInt)
  3942  		y := v_1
  3943  		flag := v_2
  3944  		if !(ccARM64Eval(cc, flag) < 0) {
  3945  			break
  3946  		}
  3947  		v.reset(OpNot)
  3948  		v.AddArg(y)
  3949  		return true
  3950  	}
  3951  	return false
  3952  }
  3953  func rewriteValueARM64_OpARM64CSNEG(v *Value) bool {
  3954  	v_2 := v.Args[2]
  3955  	v_1 := v.Args[1]
  3956  	v_0 := v.Args[0]
  3957  	// match: (CSNEG [cc] x y (InvertFlags cmp))
  3958  	// result: (CSNEG [arm64Invert(cc)] x y cmp)
  3959  	for {
  3960  		cc := auxIntToOp(v.AuxInt)
  3961  		x := v_0
  3962  		y := v_1
  3963  		if v_2.Op != OpARM64InvertFlags {
  3964  			break
  3965  		}
  3966  		cmp := v_2.Args[0]
  3967  		v.reset(OpARM64CSNEG)
  3968  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3969  		v.AddArg3(x, y, cmp)
  3970  		return true
  3971  	}
  3972  	// match: (CSNEG [cc] x _ flag)
  3973  	// cond: ccARM64Eval(cc, flag) > 0
  3974  	// result: x
  3975  	for {
  3976  		cc := auxIntToOp(v.AuxInt)
  3977  		x := v_0
  3978  		flag := v_2
  3979  		if !(ccARM64Eval(cc, flag) > 0) {
  3980  			break
  3981  		}
  3982  		v.copyOf(x)
  3983  		return true
  3984  	}
  3985  	// match: (CSNEG [cc] _ y flag)
  3986  	// cond: ccARM64Eval(cc, flag) < 0
  3987  	// result: (NEG y)
  3988  	for {
  3989  		cc := auxIntToOp(v.AuxInt)
  3990  		y := v_1
  3991  		flag := v_2
  3992  		if !(ccARM64Eval(cc, flag) < 0) {
  3993  			break
  3994  		}
  3995  		v.reset(OpARM64NEG)
  3996  		v.AddArg(y)
  3997  		return true
  3998  	}
  3999  	return false
  4000  }
  4001  func rewriteValueARM64_OpARM64DIV(v *Value) bool {
  4002  	v_1 := v.Args[1]
  4003  	v_0 := v.Args[0]
  4004  	// match: (DIV (MOVDconst [c]) (MOVDconst [d]))
  4005  	// cond: d != 0
  4006  	// result: (MOVDconst [c/d])
  4007  	for {
  4008  		if v_0.Op != OpARM64MOVDconst {
  4009  			break
  4010  		}
  4011  		c := auxIntToInt64(v_0.AuxInt)
  4012  		if v_1.Op != OpARM64MOVDconst {
  4013  			break
  4014  		}
  4015  		d := auxIntToInt64(v_1.AuxInt)
  4016  		if !(d != 0) {
  4017  			break
  4018  		}
  4019  		v.reset(OpARM64MOVDconst)
  4020  		v.AuxInt = int64ToAuxInt(c / d)
  4021  		return true
  4022  	}
  4023  	return false
  4024  }
  4025  func rewriteValueARM64_OpARM64DIVW(v *Value) bool {
  4026  	v_1 := v.Args[1]
  4027  	v_0 := v.Args[0]
  4028  	// match: (DIVW (MOVDconst [c]) (MOVDconst [d]))
  4029  	// cond: d != 0
  4030  	// result: (MOVDconst [int64(uint32(int32(c)/int32(d)))])
  4031  	for {
  4032  		if v_0.Op != OpARM64MOVDconst {
  4033  			break
  4034  		}
  4035  		c := auxIntToInt64(v_0.AuxInt)
  4036  		if v_1.Op != OpARM64MOVDconst {
  4037  			break
  4038  		}
  4039  		d := auxIntToInt64(v_1.AuxInt)
  4040  		if !(d != 0) {
  4041  			break
  4042  		}
  4043  		v.reset(OpARM64MOVDconst)
  4044  		v.AuxInt = int64ToAuxInt(int64(uint32(int32(c) / int32(d))))
  4045  		return true
  4046  	}
  4047  	return false
  4048  }
  4049  func rewriteValueARM64_OpARM64EON(v *Value) bool {
  4050  	v_1 := v.Args[1]
  4051  	v_0 := v.Args[0]
  4052  	// match: (EON x (MOVDconst [c]))
  4053  	// result: (XORconst [^c] x)
  4054  	for {
  4055  		x := v_0
  4056  		if v_1.Op != OpARM64MOVDconst {
  4057  			break
  4058  		}
  4059  		c := auxIntToInt64(v_1.AuxInt)
  4060  		v.reset(OpARM64XORconst)
  4061  		v.AuxInt = int64ToAuxInt(^c)
  4062  		v.AddArg(x)
  4063  		return true
  4064  	}
  4065  	// match: (EON x x)
  4066  	// result: (MOVDconst [-1])
  4067  	for {
  4068  		x := v_0
  4069  		if x != v_1 {
  4070  			break
  4071  		}
  4072  		v.reset(OpARM64MOVDconst)
  4073  		v.AuxInt = int64ToAuxInt(-1)
  4074  		return true
  4075  	}
  4076  	// match: (EON x0 x1:(SLLconst [c] y))
  4077  	// cond: clobberIfDead(x1)
  4078  	// result: (EONshiftLL x0 y [c])
  4079  	for {
  4080  		x0 := v_0
  4081  		x1 := v_1
  4082  		if x1.Op != OpARM64SLLconst {
  4083  			break
  4084  		}
  4085  		c := auxIntToInt64(x1.AuxInt)
  4086  		y := x1.Args[0]
  4087  		if !(clobberIfDead(x1)) {
  4088  			break
  4089  		}
  4090  		v.reset(OpARM64EONshiftLL)
  4091  		v.AuxInt = int64ToAuxInt(c)
  4092  		v.AddArg2(x0, y)
  4093  		return true
  4094  	}
  4095  	// match: (EON x0 x1:(SRLconst [c] y))
  4096  	// cond: clobberIfDead(x1)
  4097  	// result: (EONshiftRL x0 y [c])
  4098  	for {
  4099  		x0 := v_0
  4100  		x1 := v_1
  4101  		if x1.Op != OpARM64SRLconst {
  4102  			break
  4103  		}
  4104  		c := auxIntToInt64(x1.AuxInt)
  4105  		y := x1.Args[0]
  4106  		if !(clobberIfDead(x1)) {
  4107  			break
  4108  		}
  4109  		v.reset(OpARM64EONshiftRL)
  4110  		v.AuxInt = int64ToAuxInt(c)
  4111  		v.AddArg2(x0, y)
  4112  		return true
  4113  	}
  4114  	// match: (EON x0 x1:(SRAconst [c] y))
  4115  	// cond: clobberIfDead(x1)
  4116  	// result: (EONshiftRA x0 y [c])
  4117  	for {
  4118  		x0 := v_0
  4119  		x1 := v_1
  4120  		if x1.Op != OpARM64SRAconst {
  4121  			break
  4122  		}
  4123  		c := auxIntToInt64(x1.AuxInt)
  4124  		y := x1.Args[0]
  4125  		if !(clobberIfDead(x1)) {
  4126  			break
  4127  		}
  4128  		v.reset(OpARM64EONshiftRA)
  4129  		v.AuxInt = int64ToAuxInt(c)
  4130  		v.AddArg2(x0, y)
  4131  		return true
  4132  	}
  4133  	// match: (EON x0 x1:(RORconst [c] y))
  4134  	// cond: clobberIfDead(x1)
  4135  	// result: (EONshiftRO x0 y [c])
  4136  	for {
  4137  		x0 := v_0
  4138  		x1 := v_1
  4139  		if x1.Op != OpARM64RORconst {
  4140  			break
  4141  		}
  4142  		c := auxIntToInt64(x1.AuxInt)
  4143  		y := x1.Args[0]
  4144  		if !(clobberIfDead(x1)) {
  4145  			break
  4146  		}
  4147  		v.reset(OpARM64EONshiftRO)
  4148  		v.AuxInt = int64ToAuxInt(c)
  4149  		v.AddArg2(x0, y)
  4150  		return true
  4151  	}
  4152  	return false
  4153  }
  4154  func rewriteValueARM64_OpARM64EONshiftLL(v *Value) bool {
  4155  	v_1 := v.Args[1]
  4156  	v_0 := v.Args[0]
  4157  	// match: (EONshiftLL x (MOVDconst [c]) [d])
  4158  	// result: (XORconst x [^int64(uint64(c)<<uint64(d))])
  4159  	for {
  4160  		d := auxIntToInt64(v.AuxInt)
  4161  		x := v_0
  4162  		if v_1.Op != OpARM64MOVDconst {
  4163  			break
  4164  		}
  4165  		c := auxIntToInt64(v_1.AuxInt)
  4166  		v.reset(OpARM64XORconst)
  4167  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
  4168  		v.AddArg(x)
  4169  		return true
  4170  	}
  4171  	// match: (EONshiftLL (SLLconst x [c]) x [c])
  4172  	// result: (MOVDconst [-1])
  4173  	for {
  4174  		c := auxIntToInt64(v.AuxInt)
  4175  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
  4176  			break
  4177  		}
  4178  		x := v_0.Args[0]
  4179  		if x != v_1 {
  4180  			break
  4181  		}
  4182  		v.reset(OpARM64MOVDconst)
  4183  		v.AuxInt = int64ToAuxInt(-1)
  4184  		return true
  4185  	}
  4186  	return false
  4187  }
  4188  func rewriteValueARM64_OpARM64EONshiftRA(v *Value) bool {
  4189  	v_1 := v.Args[1]
  4190  	v_0 := v.Args[0]
  4191  	// match: (EONshiftRA x (MOVDconst [c]) [d])
  4192  	// result: (XORconst x [^(c>>uint64(d))])
  4193  	for {
  4194  		d := auxIntToInt64(v.AuxInt)
  4195  		x := v_0
  4196  		if v_1.Op != OpARM64MOVDconst {
  4197  			break
  4198  		}
  4199  		c := auxIntToInt64(v_1.AuxInt)
  4200  		v.reset(OpARM64XORconst)
  4201  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
  4202  		v.AddArg(x)
  4203  		return true
  4204  	}
  4205  	// match: (EONshiftRA (SRAconst x [c]) x [c])
  4206  	// result: (MOVDconst [-1])
  4207  	for {
  4208  		c := auxIntToInt64(v.AuxInt)
  4209  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
  4210  			break
  4211  		}
  4212  		x := v_0.Args[0]
  4213  		if x != v_1 {
  4214  			break
  4215  		}
  4216  		v.reset(OpARM64MOVDconst)
  4217  		v.AuxInt = int64ToAuxInt(-1)
  4218  		return true
  4219  	}
  4220  	return false
  4221  }
  4222  func rewriteValueARM64_OpARM64EONshiftRL(v *Value) bool {
  4223  	v_1 := v.Args[1]
  4224  	v_0 := v.Args[0]
  4225  	// match: (EONshiftRL x (MOVDconst [c]) [d])
  4226  	// result: (XORconst x [^int64(uint64(c)>>uint64(d))])
  4227  	for {
  4228  		d := auxIntToInt64(v.AuxInt)
  4229  		x := v_0
  4230  		if v_1.Op != OpARM64MOVDconst {
  4231  			break
  4232  		}
  4233  		c := auxIntToInt64(v_1.AuxInt)
  4234  		v.reset(OpARM64XORconst)
  4235  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
  4236  		v.AddArg(x)
  4237  		return true
  4238  	}
  4239  	// match: (EONshiftRL (SRLconst x [c]) x [c])
  4240  	// result: (MOVDconst [-1])
  4241  	for {
  4242  		c := auxIntToInt64(v.AuxInt)
  4243  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
  4244  			break
  4245  		}
  4246  		x := v_0.Args[0]
  4247  		if x != v_1 {
  4248  			break
  4249  		}
  4250  		v.reset(OpARM64MOVDconst)
  4251  		v.AuxInt = int64ToAuxInt(-1)
  4252  		return true
  4253  	}
  4254  	return false
  4255  }
  4256  func rewriteValueARM64_OpARM64EONshiftRO(v *Value) bool {
  4257  	v_1 := v.Args[1]
  4258  	v_0 := v.Args[0]
  4259  	// match: (EONshiftRO x (MOVDconst [c]) [d])
  4260  	// result: (XORconst x [^rotateRight64(c, d)])
  4261  	for {
  4262  		d := auxIntToInt64(v.AuxInt)
  4263  		x := v_0
  4264  		if v_1.Op != OpARM64MOVDconst {
  4265  			break
  4266  		}
  4267  		c := auxIntToInt64(v_1.AuxInt)
  4268  		v.reset(OpARM64XORconst)
  4269  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
  4270  		v.AddArg(x)
  4271  		return true
  4272  	}
  4273  	// match: (EONshiftRO (RORconst x [c]) x [c])
  4274  	// result: (MOVDconst [-1])
  4275  	for {
  4276  		c := auxIntToInt64(v.AuxInt)
  4277  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
  4278  			break
  4279  		}
  4280  		x := v_0.Args[0]
  4281  		if x != v_1 {
  4282  			break
  4283  		}
  4284  		v.reset(OpARM64MOVDconst)
  4285  		v.AuxInt = int64ToAuxInt(-1)
  4286  		return true
  4287  	}
  4288  	return false
  4289  }
  4290  func rewriteValueARM64_OpARM64Equal(v *Value) bool {
  4291  	v_0 := v.Args[0]
  4292  	b := v.Block
  4293  	// match: (Equal (CMPconst [0] z:(AND x y)))
  4294  	// cond: z.Uses == 1
  4295  	// result: (Equal (TST x y))
  4296  	for {
  4297  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4298  			break
  4299  		}
  4300  		z := v_0.Args[0]
  4301  		if z.Op != OpARM64AND {
  4302  			break
  4303  		}
  4304  		y := z.Args[1]
  4305  		x := z.Args[0]
  4306  		if !(z.Uses == 1) {
  4307  			break
  4308  		}
  4309  		v.reset(OpARM64Equal)
  4310  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  4311  		v0.AddArg2(x, y)
  4312  		v.AddArg(v0)
  4313  		return true
  4314  	}
  4315  	// match: (Equal (CMPWconst [0] x:(ANDconst [c] y)))
  4316  	// cond: x.Uses == 1
  4317  	// result: (Equal (TSTWconst [int32(c)] y))
  4318  	for {
  4319  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4320  			break
  4321  		}
  4322  		x := v_0.Args[0]
  4323  		if x.Op != OpARM64ANDconst {
  4324  			break
  4325  		}
  4326  		c := auxIntToInt64(x.AuxInt)
  4327  		y := x.Args[0]
  4328  		if !(x.Uses == 1) {
  4329  			break
  4330  		}
  4331  		v.reset(OpARM64Equal)
  4332  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  4333  		v0.AuxInt = int32ToAuxInt(int32(c))
  4334  		v0.AddArg(y)
  4335  		v.AddArg(v0)
  4336  		return true
  4337  	}
  4338  	// match: (Equal (CMPWconst [0] z:(AND x y)))
  4339  	// cond: z.Uses == 1
  4340  	// result: (Equal (TSTW x y))
  4341  	for {
  4342  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4343  			break
  4344  		}
  4345  		z := v_0.Args[0]
  4346  		if z.Op != OpARM64AND {
  4347  			break
  4348  		}
  4349  		y := z.Args[1]
  4350  		x := z.Args[0]
  4351  		if !(z.Uses == 1) {
  4352  			break
  4353  		}
  4354  		v.reset(OpARM64Equal)
  4355  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  4356  		v0.AddArg2(x, y)
  4357  		v.AddArg(v0)
  4358  		return true
  4359  	}
  4360  	// match: (Equal (CMPconst [0] x:(ANDconst [c] y)))
  4361  	// cond: x.Uses == 1
  4362  	// result: (Equal (TSTconst [c] y))
  4363  	for {
  4364  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4365  			break
  4366  		}
  4367  		x := v_0.Args[0]
  4368  		if x.Op != OpARM64ANDconst {
  4369  			break
  4370  		}
  4371  		c := auxIntToInt64(x.AuxInt)
  4372  		y := x.Args[0]
  4373  		if !(x.Uses == 1) {
  4374  			break
  4375  		}
  4376  		v.reset(OpARM64Equal)
  4377  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  4378  		v0.AuxInt = int64ToAuxInt(c)
  4379  		v0.AddArg(y)
  4380  		v.AddArg(v0)
  4381  		return true
  4382  	}
  4383  	// match: (Equal (CMP x z:(NEG y)))
  4384  	// cond: z.Uses == 1
  4385  	// result: (Equal (CMN x y))
  4386  	for {
  4387  		if v_0.Op != OpARM64CMP {
  4388  			break
  4389  		}
  4390  		_ = v_0.Args[1]
  4391  		x := v_0.Args[0]
  4392  		z := v_0.Args[1]
  4393  		if z.Op != OpARM64NEG {
  4394  			break
  4395  		}
  4396  		y := z.Args[0]
  4397  		if !(z.Uses == 1) {
  4398  			break
  4399  		}
  4400  		v.reset(OpARM64Equal)
  4401  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  4402  		v0.AddArg2(x, y)
  4403  		v.AddArg(v0)
  4404  		return true
  4405  	}
  4406  	// match: (Equal (CMPW x z:(NEG y)))
  4407  	// cond: z.Uses == 1
  4408  	// result: (Equal (CMNW x y))
  4409  	for {
  4410  		if v_0.Op != OpARM64CMPW {
  4411  			break
  4412  		}
  4413  		_ = v_0.Args[1]
  4414  		x := v_0.Args[0]
  4415  		z := v_0.Args[1]
  4416  		if z.Op != OpARM64NEG {
  4417  			break
  4418  		}
  4419  		y := z.Args[0]
  4420  		if !(z.Uses == 1) {
  4421  			break
  4422  		}
  4423  		v.reset(OpARM64Equal)
  4424  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  4425  		v0.AddArg2(x, y)
  4426  		v.AddArg(v0)
  4427  		return true
  4428  	}
  4429  	// match: (Equal (CMPconst [0] x:(ADDconst [c] y)))
  4430  	// cond: x.Uses == 1
  4431  	// result: (Equal (CMNconst [c] y))
  4432  	for {
  4433  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4434  			break
  4435  		}
  4436  		x := v_0.Args[0]
  4437  		if x.Op != OpARM64ADDconst {
  4438  			break
  4439  		}
  4440  		c := auxIntToInt64(x.AuxInt)
  4441  		y := x.Args[0]
  4442  		if !(x.Uses == 1) {
  4443  			break
  4444  		}
  4445  		v.reset(OpARM64Equal)
  4446  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
  4447  		v0.AuxInt = int64ToAuxInt(c)
  4448  		v0.AddArg(y)
  4449  		v.AddArg(v0)
  4450  		return true
  4451  	}
  4452  	// match: (Equal (CMPWconst [0] x:(ADDconst [c] y)))
  4453  	// cond: x.Uses == 1
  4454  	// result: (Equal (CMNWconst [int32(c)] y))
  4455  	for {
  4456  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4457  			break
  4458  		}
  4459  		x := v_0.Args[0]
  4460  		if x.Op != OpARM64ADDconst {
  4461  			break
  4462  		}
  4463  		c := auxIntToInt64(x.AuxInt)
  4464  		y := x.Args[0]
  4465  		if !(x.Uses == 1) {
  4466  			break
  4467  		}
  4468  		v.reset(OpARM64Equal)
  4469  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
  4470  		v0.AuxInt = int32ToAuxInt(int32(c))
  4471  		v0.AddArg(y)
  4472  		v.AddArg(v0)
  4473  		return true
  4474  	}
  4475  	// match: (Equal (CMPconst [0] z:(ADD x y)))
  4476  	// cond: z.Uses == 1
  4477  	// result: (Equal (CMN x y))
  4478  	for {
  4479  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4480  			break
  4481  		}
  4482  		z := v_0.Args[0]
  4483  		if z.Op != OpARM64ADD {
  4484  			break
  4485  		}
  4486  		y := z.Args[1]
  4487  		x := z.Args[0]
  4488  		if !(z.Uses == 1) {
  4489  			break
  4490  		}
  4491  		v.reset(OpARM64Equal)
  4492  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  4493  		v0.AddArg2(x, y)
  4494  		v.AddArg(v0)
  4495  		return true
  4496  	}
  4497  	// match: (Equal (CMPWconst [0] z:(ADD x y)))
  4498  	// cond: z.Uses == 1
  4499  	// result: (Equal (CMNW x y))
  4500  	for {
  4501  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4502  			break
  4503  		}
  4504  		z := v_0.Args[0]
  4505  		if z.Op != OpARM64ADD {
  4506  			break
  4507  		}
  4508  		y := z.Args[1]
  4509  		x := z.Args[0]
  4510  		if !(z.Uses == 1) {
  4511  			break
  4512  		}
  4513  		v.reset(OpARM64Equal)
  4514  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  4515  		v0.AddArg2(x, y)
  4516  		v.AddArg(v0)
  4517  		return true
  4518  	}
  4519  	// match: (Equal (CMPconst [0] z:(MADD a x y)))
  4520  	// cond: z.Uses == 1
  4521  	// result: (Equal (CMN a (MUL <x.Type> x y)))
  4522  	for {
  4523  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4524  			break
  4525  		}
  4526  		z := v_0.Args[0]
  4527  		if z.Op != OpARM64MADD {
  4528  			break
  4529  		}
  4530  		y := z.Args[2]
  4531  		a := z.Args[0]
  4532  		x := z.Args[1]
  4533  		if !(z.Uses == 1) {
  4534  			break
  4535  		}
  4536  		v.reset(OpARM64Equal)
  4537  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  4538  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  4539  		v1.AddArg2(x, y)
  4540  		v0.AddArg2(a, v1)
  4541  		v.AddArg(v0)
  4542  		return true
  4543  	}
  4544  	// match: (Equal (CMPconst [0] z:(MSUB a x y)))
  4545  	// cond: z.Uses == 1
  4546  	// result: (Equal (CMP a (MUL <x.Type> x y)))
  4547  	for {
  4548  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4549  			break
  4550  		}
  4551  		z := v_0.Args[0]
  4552  		if z.Op != OpARM64MSUB {
  4553  			break
  4554  		}
  4555  		y := z.Args[2]
  4556  		a := z.Args[0]
  4557  		x := z.Args[1]
  4558  		if !(z.Uses == 1) {
  4559  			break
  4560  		}
  4561  		v.reset(OpARM64Equal)
  4562  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  4563  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  4564  		v1.AddArg2(x, y)
  4565  		v0.AddArg2(a, v1)
  4566  		v.AddArg(v0)
  4567  		return true
  4568  	}
  4569  	// match: (Equal (CMPWconst [0] z:(MADDW a x y)))
  4570  	// cond: z.Uses == 1
  4571  	// result: (Equal (CMNW a (MULW <x.Type> x y)))
  4572  	for {
  4573  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4574  			break
  4575  		}
  4576  		z := v_0.Args[0]
  4577  		if z.Op != OpARM64MADDW {
  4578  			break
  4579  		}
  4580  		y := z.Args[2]
  4581  		a := z.Args[0]
  4582  		x := z.Args[1]
  4583  		if !(z.Uses == 1) {
  4584  			break
  4585  		}
  4586  		v.reset(OpARM64Equal)
  4587  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  4588  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  4589  		v1.AddArg2(x, y)
  4590  		v0.AddArg2(a, v1)
  4591  		v.AddArg(v0)
  4592  		return true
  4593  	}
  4594  	// match: (Equal (CMPWconst [0] z:(MSUBW a x y)))
  4595  	// cond: z.Uses == 1
  4596  	// result: (Equal (CMPW a (MULW <x.Type> x y)))
  4597  	for {
  4598  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4599  			break
  4600  		}
  4601  		z := v_0.Args[0]
  4602  		if z.Op != OpARM64MSUBW {
  4603  			break
  4604  		}
  4605  		y := z.Args[2]
  4606  		a := z.Args[0]
  4607  		x := z.Args[1]
  4608  		if !(z.Uses == 1) {
  4609  			break
  4610  		}
  4611  		v.reset(OpARM64Equal)
  4612  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  4613  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  4614  		v1.AddArg2(x, y)
  4615  		v0.AddArg2(a, v1)
  4616  		v.AddArg(v0)
  4617  		return true
  4618  	}
  4619  	// match: (Equal (FlagConstant [fc]))
  4620  	// result: (MOVDconst [b2i(fc.eq())])
  4621  	for {
  4622  		if v_0.Op != OpARM64FlagConstant {
  4623  			break
  4624  		}
  4625  		fc := auxIntToFlagConstant(v_0.AuxInt)
  4626  		v.reset(OpARM64MOVDconst)
  4627  		v.AuxInt = int64ToAuxInt(b2i(fc.eq()))
  4628  		return true
  4629  	}
  4630  	// match: (Equal (InvertFlags x))
  4631  	// result: (Equal x)
  4632  	for {
  4633  		if v_0.Op != OpARM64InvertFlags {
  4634  			break
  4635  		}
  4636  		x := v_0.Args[0]
  4637  		v.reset(OpARM64Equal)
  4638  		v.AddArg(x)
  4639  		return true
  4640  	}
  4641  	return false
  4642  }
  4643  func rewriteValueARM64_OpARM64FADDD(v *Value) bool {
  4644  	v_1 := v.Args[1]
  4645  	v_0 := v.Args[0]
  4646  	// match: (FADDD a (FMULD x y))
  4647  	// cond: a.Block.Func.useFMA(v)
  4648  	// result: (FMADDD a x y)
  4649  	for {
  4650  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4651  			a := v_0
  4652  			if v_1.Op != OpARM64FMULD {
  4653  				continue
  4654  			}
  4655  			y := v_1.Args[1]
  4656  			x := v_1.Args[0]
  4657  			if !(a.Block.Func.useFMA(v)) {
  4658  				continue
  4659  			}
  4660  			v.reset(OpARM64FMADDD)
  4661  			v.AddArg3(a, x, y)
  4662  			return true
  4663  		}
  4664  		break
  4665  	}
  4666  	// match: (FADDD a (FNMULD x y))
  4667  	// cond: a.Block.Func.useFMA(v)
  4668  	// result: (FMSUBD a x y)
  4669  	for {
  4670  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4671  			a := v_0
  4672  			if v_1.Op != OpARM64FNMULD {
  4673  				continue
  4674  			}
  4675  			y := v_1.Args[1]
  4676  			x := v_1.Args[0]
  4677  			if !(a.Block.Func.useFMA(v)) {
  4678  				continue
  4679  			}
  4680  			v.reset(OpARM64FMSUBD)
  4681  			v.AddArg3(a, x, y)
  4682  			return true
  4683  		}
  4684  		break
  4685  	}
  4686  	return false
  4687  }
  4688  func rewriteValueARM64_OpARM64FADDS(v *Value) bool {
  4689  	v_1 := v.Args[1]
  4690  	v_0 := v.Args[0]
  4691  	// match: (FADDS a (FMULS x y))
  4692  	// cond: a.Block.Func.useFMA(v)
  4693  	// result: (FMADDS a x y)
  4694  	for {
  4695  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4696  			a := v_0
  4697  			if v_1.Op != OpARM64FMULS {
  4698  				continue
  4699  			}
  4700  			y := v_1.Args[1]
  4701  			x := v_1.Args[0]
  4702  			if !(a.Block.Func.useFMA(v)) {
  4703  				continue
  4704  			}
  4705  			v.reset(OpARM64FMADDS)
  4706  			v.AddArg3(a, x, y)
  4707  			return true
  4708  		}
  4709  		break
  4710  	}
  4711  	// match: (FADDS a (FNMULS x y))
  4712  	// cond: a.Block.Func.useFMA(v)
  4713  	// result: (FMSUBS a x y)
  4714  	for {
  4715  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4716  			a := v_0
  4717  			if v_1.Op != OpARM64FNMULS {
  4718  				continue
  4719  			}
  4720  			y := v_1.Args[1]
  4721  			x := v_1.Args[0]
  4722  			if !(a.Block.Func.useFMA(v)) {
  4723  				continue
  4724  			}
  4725  			v.reset(OpARM64FMSUBS)
  4726  			v.AddArg3(a, x, y)
  4727  			return true
  4728  		}
  4729  		break
  4730  	}
  4731  	return false
  4732  }
  4733  func rewriteValueARM64_OpARM64FCMPD(v *Value) bool {
  4734  	v_1 := v.Args[1]
  4735  	v_0 := v.Args[0]
  4736  	b := v.Block
  4737  	// match: (FCMPD x (FMOVDconst [0]))
  4738  	// result: (FCMPD0 x)
  4739  	for {
  4740  		x := v_0
  4741  		if v_1.Op != OpARM64FMOVDconst || auxIntToFloat64(v_1.AuxInt) != 0 {
  4742  			break
  4743  		}
  4744  		v.reset(OpARM64FCMPD0)
  4745  		v.AddArg(x)
  4746  		return true
  4747  	}
  4748  	// match: (FCMPD (FMOVDconst [0]) x)
  4749  	// result: (InvertFlags (FCMPD0 x))
  4750  	for {
  4751  		if v_0.Op != OpARM64FMOVDconst || auxIntToFloat64(v_0.AuxInt) != 0 {
  4752  			break
  4753  		}
  4754  		x := v_1
  4755  		v.reset(OpARM64InvertFlags)
  4756  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD0, types.TypeFlags)
  4757  		v0.AddArg(x)
  4758  		v.AddArg(v0)
  4759  		return true
  4760  	}
  4761  	return false
  4762  }
  4763  func rewriteValueARM64_OpARM64FCMPS(v *Value) bool {
  4764  	v_1 := v.Args[1]
  4765  	v_0 := v.Args[0]
  4766  	b := v.Block
  4767  	// match: (FCMPS x (FMOVSconst [0]))
  4768  	// result: (FCMPS0 x)
  4769  	for {
  4770  		x := v_0
  4771  		if v_1.Op != OpARM64FMOVSconst || auxIntToFloat64(v_1.AuxInt) != 0 {
  4772  			break
  4773  		}
  4774  		v.reset(OpARM64FCMPS0)
  4775  		v.AddArg(x)
  4776  		return true
  4777  	}
  4778  	// match: (FCMPS (FMOVSconst [0]) x)
  4779  	// result: (InvertFlags (FCMPS0 x))
  4780  	for {
  4781  		if v_0.Op != OpARM64FMOVSconst || auxIntToFloat64(v_0.AuxInt) != 0 {
  4782  			break
  4783  		}
  4784  		x := v_1
  4785  		v.reset(OpARM64InvertFlags)
  4786  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS0, types.TypeFlags)
  4787  		v0.AddArg(x)
  4788  		v.AddArg(v0)
  4789  		return true
  4790  	}
  4791  	return false
  4792  }
  4793  func rewriteValueARM64_OpARM64FMOVDfpgp(v *Value) bool {
  4794  	v_0 := v.Args[0]
  4795  	b := v.Block
  4796  	// match: (FMOVDfpgp <t> (Arg [off] {sym}))
  4797  	// result: @b.Func.Entry (Arg <t> [off] {sym})
  4798  	for {
  4799  		t := v.Type
  4800  		if v_0.Op != OpArg {
  4801  			break
  4802  		}
  4803  		off := auxIntToInt32(v_0.AuxInt)
  4804  		sym := auxToSym(v_0.Aux)
  4805  		b = b.Func.Entry
  4806  		v0 := b.NewValue0(v.Pos, OpArg, t)
  4807  		v.copyOf(v0)
  4808  		v0.AuxInt = int32ToAuxInt(off)
  4809  		v0.Aux = symToAux(sym)
  4810  		return true
  4811  	}
  4812  	return false
  4813  }
  4814  func rewriteValueARM64_OpARM64FMOVDgpfp(v *Value) bool {
  4815  	v_0 := v.Args[0]
  4816  	b := v.Block
  4817  	// match: (FMOVDgpfp <t> (Arg [off] {sym}))
  4818  	// result: @b.Func.Entry (Arg <t> [off] {sym})
  4819  	for {
  4820  		t := v.Type
  4821  		if v_0.Op != OpArg {
  4822  			break
  4823  		}
  4824  		off := auxIntToInt32(v_0.AuxInt)
  4825  		sym := auxToSym(v_0.Aux)
  4826  		b = b.Func.Entry
  4827  		v0 := b.NewValue0(v.Pos, OpArg, t)
  4828  		v.copyOf(v0)
  4829  		v0.AuxInt = int32ToAuxInt(off)
  4830  		v0.Aux = symToAux(sym)
  4831  		return true
  4832  	}
  4833  	return false
  4834  }
  4835  func rewriteValueARM64_OpARM64FMOVDload(v *Value) bool {
  4836  	v_1 := v.Args[1]
  4837  	v_0 := v.Args[0]
  4838  	b := v.Block
  4839  	config := b.Func.Config
  4840  	// match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr val _))
  4841  	// result: (FMOVDgpfp val)
  4842  	for {
  4843  		off := auxIntToInt32(v.AuxInt)
  4844  		sym := auxToSym(v.Aux)
  4845  		ptr := v_0
  4846  		if v_1.Op != OpARM64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4847  			break
  4848  		}
  4849  		val := v_1.Args[1]
  4850  		if ptr != v_1.Args[0] {
  4851  			break
  4852  		}
  4853  		v.reset(OpARM64FMOVDgpfp)
  4854  		v.AddArg(val)
  4855  		return true
  4856  	}
  4857  	// match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  4858  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4859  	// result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
  4860  	for {
  4861  		off1 := auxIntToInt32(v.AuxInt)
  4862  		sym := auxToSym(v.Aux)
  4863  		if v_0.Op != OpARM64ADDconst {
  4864  			break
  4865  		}
  4866  		off2 := auxIntToInt64(v_0.AuxInt)
  4867  		ptr := v_0.Args[0]
  4868  		mem := v_1
  4869  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4870  			break
  4871  		}
  4872  		v.reset(OpARM64FMOVDload)
  4873  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4874  		v.Aux = symToAux(sym)
  4875  		v.AddArg2(ptr, mem)
  4876  		return true
  4877  	}
  4878  	// match: (FMOVDload [off] {sym} (ADD ptr idx) mem)
  4879  	// cond: off == 0 && sym == nil
  4880  	// result: (FMOVDloadidx ptr idx mem)
  4881  	for {
  4882  		off := auxIntToInt32(v.AuxInt)
  4883  		sym := auxToSym(v.Aux)
  4884  		if v_0.Op != OpARM64ADD {
  4885  			break
  4886  		}
  4887  		idx := v_0.Args[1]
  4888  		ptr := v_0.Args[0]
  4889  		mem := v_1
  4890  		if !(off == 0 && sym == nil) {
  4891  			break
  4892  		}
  4893  		v.reset(OpARM64FMOVDloadidx)
  4894  		v.AddArg3(ptr, idx, mem)
  4895  		return true
  4896  	}
  4897  	// match: (FMOVDload [off] {sym} (ADDshiftLL [3] ptr idx) mem)
  4898  	// cond: off == 0 && sym == nil
  4899  	// result: (FMOVDloadidx8 ptr idx mem)
  4900  	for {
  4901  		off := auxIntToInt32(v.AuxInt)
  4902  		sym := auxToSym(v.Aux)
  4903  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  4904  			break
  4905  		}
  4906  		idx := v_0.Args[1]
  4907  		ptr := v_0.Args[0]
  4908  		mem := v_1
  4909  		if !(off == 0 && sym == nil) {
  4910  			break
  4911  		}
  4912  		v.reset(OpARM64FMOVDloadidx8)
  4913  		v.AddArg3(ptr, idx, mem)
  4914  		return true
  4915  	}
  4916  	// match: (FMOVDload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  4917  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4918  	// result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  4919  	for {
  4920  		off1 := auxIntToInt32(v.AuxInt)
  4921  		sym1 := auxToSym(v.Aux)
  4922  		if v_0.Op != OpARM64MOVDaddr {
  4923  			break
  4924  		}
  4925  		off2 := auxIntToInt32(v_0.AuxInt)
  4926  		sym2 := auxToSym(v_0.Aux)
  4927  		ptr := v_0.Args[0]
  4928  		mem := v_1
  4929  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4930  			break
  4931  		}
  4932  		v.reset(OpARM64FMOVDload)
  4933  		v.AuxInt = int32ToAuxInt(off1 + off2)
  4934  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4935  		v.AddArg2(ptr, mem)
  4936  		return true
  4937  	}
  4938  	return false
  4939  }
  4940  func rewriteValueARM64_OpARM64FMOVDloadidx(v *Value) bool {
  4941  	v_2 := v.Args[2]
  4942  	v_1 := v.Args[1]
  4943  	v_0 := v.Args[0]
  4944  	// match: (FMOVDloadidx ptr (MOVDconst [c]) mem)
  4945  	// cond: is32Bit(c)
  4946  	// result: (FMOVDload [int32(c)] ptr mem)
  4947  	for {
  4948  		ptr := v_0
  4949  		if v_1.Op != OpARM64MOVDconst {
  4950  			break
  4951  		}
  4952  		c := auxIntToInt64(v_1.AuxInt)
  4953  		mem := v_2
  4954  		if !(is32Bit(c)) {
  4955  			break
  4956  		}
  4957  		v.reset(OpARM64FMOVDload)
  4958  		v.AuxInt = int32ToAuxInt(int32(c))
  4959  		v.AddArg2(ptr, mem)
  4960  		return true
  4961  	}
  4962  	// match: (FMOVDloadidx (MOVDconst [c]) ptr mem)
  4963  	// cond: is32Bit(c)
  4964  	// result: (FMOVDload [int32(c)] ptr mem)
  4965  	for {
  4966  		if v_0.Op != OpARM64MOVDconst {
  4967  			break
  4968  		}
  4969  		c := auxIntToInt64(v_0.AuxInt)
  4970  		ptr := v_1
  4971  		mem := v_2
  4972  		if !(is32Bit(c)) {
  4973  			break
  4974  		}
  4975  		v.reset(OpARM64FMOVDload)
  4976  		v.AuxInt = int32ToAuxInt(int32(c))
  4977  		v.AddArg2(ptr, mem)
  4978  		return true
  4979  	}
  4980  	// match: (FMOVDloadidx ptr (SLLconst [3] idx) mem)
  4981  	// result: (FMOVDloadidx8 ptr idx mem)
  4982  	for {
  4983  		ptr := v_0
  4984  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  4985  			break
  4986  		}
  4987  		idx := v_1.Args[0]
  4988  		mem := v_2
  4989  		v.reset(OpARM64FMOVDloadidx8)
  4990  		v.AddArg3(ptr, idx, mem)
  4991  		return true
  4992  	}
  4993  	// match: (FMOVDloadidx (SLLconst [3] idx) ptr mem)
  4994  	// result: (FMOVDloadidx8 ptr idx mem)
  4995  	for {
  4996  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  4997  			break
  4998  		}
  4999  		idx := v_0.Args[0]
  5000  		ptr := v_1
  5001  		mem := v_2
  5002  		v.reset(OpARM64FMOVDloadidx8)
  5003  		v.AddArg3(ptr, idx, mem)
  5004  		return true
  5005  	}
  5006  	return false
  5007  }
  5008  func rewriteValueARM64_OpARM64FMOVDloadidx8(v *Value) bool {
  5009  	v_2 := v.Args[2]
  5010  	v_1 := v.Args[1]
  5011  	v_0 := v.Args[0]
  5012  	// match: (FMOVDloadidx8 ptr (MOVDconst [c]) mem)
  5013  	// cond: is32Bit(c<<3)
  5014  	// result: (FMOVDload ptr [int32(c)<<3] mem)
  5015  	for {
  5016  		ptr := v_0
  5017  		if v_1.Op != OpARM64MOVDconst {
  5018  			break
  5019  		}
  5020  		c := auxIntToInt64(v_1.AuxInt)
  5021  		mem := v_2
  5022  		if !(is32Bit(c << 3)) {
  5023  			break
  5024  		}
  5025  		v.reset(OpARM64FMOVDload)
  5026  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  5027  		v.AddArg2(ptr, mem)
  5028  		return true
  5029  	}
  5030  	return false
  5031  }
  5032  func rewriteValueARM64_OpARM64FMOVDstore(v *Value) bool {
  5033  	v_2 := v.Args[2]
  5034  	v_1 := v.Args[1]
  5035  	v_0 := v.Args[0]
  5036  	b := v.Block
  5037  	config := b.Func.Config
  5038  	// match: (FMOVDstore [off] {sym} ptr (FMOVDgpfp val) mem)
  5039  	// result: (MOVDstore [off] {sym} ptr val mem)
  5040  	for {
  5041  		off := auxIntToInt32(v.AuxInt)
  5042  		sym := auxToSym(v.Aux)
  5043  		ptr := v_0
  5044  		if v_1.Op != OpARM64FMOVDgpfp {
  5045  			break
  5046  		}
  5047  		val := v_1.Args[0]
  5048  		mem := v_2
  5049  		v.reset(OpARM64MOVDstore)
  5050  		v.AuxInt = int32ToAuxInt(off)
  5051  		v.Aux = symToAux(sym)
  5052  		v.AddArg3(ptr, val, mem)
  5053  		return true
  5054  	}
  5055  	// match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5056  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5057  	// result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
  5058  	for {
  5059  		off1 := auxIntToInt32(v.AuxInt)
  5060  		sym := auxToSym(v.Aux)
  5061  		if v_0.Op != OpARM64ADDconst {
  5062  			break
  5063  		}
  5064  		off2 := auxIntToInt64(v_0.AuxInt)
  5065  		ptr := v_0.Args[0]
  5066  		val := v_1
  5067  		mem := v_2
  5068  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5069  			break
  5070  		}
  5071  		v.reset(OpARM64FMOVDstore)
  5072  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5073  		v.Aux = symToAux(sym)
  5074  		v.AddArg3(ptr, val, mem)
  5075  		return true
  5076  	}
  5077  	// match: (FMOVDstore [off] {sym} (ADD ptr idx) val mem)
  5078  	// cond: off == 0 && sym == nil
  5079  	// result: (FMOVDstoreidx ptr idx val mem)
  5080  	for {
  5081  		off := auxIntToInt32(v.AuxInt)
  5082  		sym := auxToSym(v.Aux)
  5083  		if v_0.Op != OpARM64ADD {
  5084  			break
  5085  		}
  5086  		idx := v_0.Args[1]
  5087  		ptr := v_0.Args[0]
  5088  		val := v_1
  5089  		mem := v_2
  5090  		if !(off == 0 && sym == nil) {
  5091  			break
  5092  		}
  5093  		v.reset(OpARM64FMOVDstoreidx)
  5094  		v.AddArg4(ptr, idx, val, mem)
  5095  		return true
  5096  	}
  5097  	// match: (FMOVDstore [off] {sym} (ADDshiftLL [3] ptr idx) val mem)
  5098  	// cond: off == 0 && sym == nil
  5099  	// result: (FMOVDstoreidx8 ptr idx val mem)
  5100  	for {
  5101  		off := auxIntToInt32(v.AuxInt)
  5102  		sym := auxToSym(v.Aux)
  5103  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  5104  			break
  5105  		}
  5106  		idx := v_0.Args[1]
  5107  		ptr := v_0.Args[0]
  5108  		val := v_1
  5109  		mem := v_2
  5110  		if !(off == 0 && sym == nil) {
  5111  			break
  5112  		}
  5113  		v.reset(OpARM64FMOVDstoreidx8)
  5114  		v.AddArg4(ptr, idx, val, mem)
  5115  		return true
  5116  	}
  5117  	// match: (FMOVDstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  5118  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5119  	// result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5120  	for {
  5121  		off1 := auxIntToInt32(v.AuxInt)
  5122  		sym1 := auxToSym(v.Aux)
  5123  		if v_0.Op != OpARM64MOVDaddr {
  5124  			break
  5125  		}
  5126  		off2 := auxIntToInt32(v_0.AuxInt)
  5127  		sym2 := auxToSym(v_0.Aux)
  5128  		ptr := v_0.Args[0]
  5129  		val := v_1
  5130  		mem := v_2
  5131  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5132  			break
  5133  		}
  5134  		v.reset(OpARM64FMOVDstore)
  5135  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5136  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5137  		v.AddArg3(ptr, val, mem)
  5138  		return true
  5139  	}
  5140  	return false
  5141  }
  5142  func rewriteValueARM64_OpARM64FMOVDstoreidx(v *Value) bool {
  5143  	v_3 := v.Args[3]
  5144  	v_2 := v.Args[2]
  5145  	v_1 := v.Args[1]
  5146  	v_0 := v.Args[0]
  5147  	// match: (FMOVDstoreidx ptr (MOVDconst [c]) val mem)
  5148  	// cond: is32Bit(c)
  5149  	// result: (FMOVDstore [int32(c)] ptr val mem)
  5150  	for {
  5151  		ptr := v_0
  5152  		if v_1.Op != OpARM64MOVDconst {
  5153  			break
  5154  		}
  5155  		c := auxIntToInt64(v_1.AuxInt)
  5156  		val := v_2
  5157  		mem := v_3
  5158  		if !(is32Bit(c)) {
  5159  			break
  5160  		}
  5161  		v.reset(OpARM64FMOVDstore)
  5162  		v.AuxInt = int32ToAuxInt(int32(c))
  5163  		v.AddArg3(ptr, val, mem)
  5164  		return true
  5165  	}
  5166  	// match: (FMOVDstoreidx (MOVDconst [c]) idx val mem)
  5167  	// cond: is32Bit(c)
  5168  	// result: (FMOVDstore [int32(c)] idx val mem)
  5169  	for {
  5170  		if v_0.Op != OpARM64MOVDconst {
  5171  			break
  5172  		}
  5173  		c := auxIntToInt64(v_0.AuxInt)
  5174  		idx := v_1
  5175  		val := v_2
  5176  		mem := v_3
  5177  		if !(is32Bit(c)) {
  5178  			break
  5179  		}
  5180  		v.reset(OpARM64FMOVDstore)
  5181  		v.AuxInt = int32ToAuxInt(int32(c))
  5182  		v.AddArg3(idx, val, mem)
  5183  		return true
  5184  	}
  5185  	// match: (FMOVDstoreidx ptr (SLLconst [3] idx) val mem)
  5186  	// result: (FMOVDstoreidx8 ptr idx val mem)
  5187  	for {
  5188  		ptr := v_0
  5189  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  5190  			break
  5191  		}
  5192  		idx := v_1.Args[0]
  5193  		val := v_2
  5194  		mem := v_3
  5195  		v.reset(OpARM64FMOVDstoreidx8)
  5196  		v.AddArg4(ptr, idx, val, mem)
  5197  		return true
  5198  	}
  5199  	// match: (FMOVDstoreidx (SLLconst [3] idx) ptr val mem)
  5200  	// result: (FMOVDstoreidx8 ptr idx val mem)
  5201  	for {
  5202  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  5203  			break
  5204  		}
  5205  		idx := v_0.Args[0]
  5206  		ptr := v_1
  5207  		val := v_2
  5208  		mem := v_3
  5209  		v.reset(OpARM64FMOVDstoreidx8)
  5210  		v.AddArg4(ptr, idx, val, mem)
  5211  		return true
  5212  	}
  5213  	return false
  5214  }
  5215  func rewriteValueARM64_OpARM64FMOVDstoreidx8(v *Value) bool {
  5216  	v_3 := v.Args[3]
  5217  	v_2 := v.Args[2]
  5218  	v_1 := v.Args[1]
  5219  	v_0 := v.Args[0]
  5220  	// match: (FMOVDstoreidx8 ptr (MOVDconst [c]) val mem)
  5221  	// cond: is32Bit(c<<3)
  5222  	// result: (FMOVDstore [int32(c)<<3] ptr val mem)
  5223  	for {
  5224  		ptr := v_0
  5225  		if v_1.Op != OpARM64MOVDconst {
  5226  			break
  5227  		}
  5228  		c := auxIntToInt64(v_1.AuxInt)
  5229  		val := v_2
  5230  		mem := v_3
  5231  		if !(is32Bit(c << 3)) {
  5232  			break
  5233  		}
  5234  		v.reset(OpARM64FMOVDstore)
  5235  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  5236  		v.AddArg3(ptr, val, mem)
  5237  		return true
  5238  	}
  5239  	return false
  5240  }
  5241  func rewriteValueARM64_OpARM64FMOVSload(v *Value) bool {
  5242  	v_1 := v.Args[1]
  5243  	v_0 := v.Args[0]
  5244  	b := v.Block
  5245  	config := b.Func.Config
  5246  	// match: (FMOVSload [off] {sym} ptr (MOVWstore [off] {sym} ptr val _))
  5247  	// result: (FMOVSgpfp val)
  5248  	for {
  5249  		off := auxIntToInt32(v.AuxInt)
  5250  		sym := auxToSym(v.Aux)
  5251  		ptr := v_0
  5252  		if v_1.Op != OpARM64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5253  			break
  5254  		}
  5255  		val := v_1.Args[1]
  5256  		if ptr != v_1.Args[0] {
  5257  			break
  5258  		}
  5259  		v.reset(OpARM64FMOVSgpfp)
  5260  		v.AddArg(val)
  5261  		return true
  5262  	}
  5263  	// match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
  5264  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5265  	// result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
  5266  	for {
  5267  		off1 := auxIntToInt32(v.AuxInt)
  5268  		sym := auxToSym(v.Aux)
  5269  		if v_0.Op != OpARM64ADDconst {
  5270  			break
  5271  		}
  5272  		off2 := auxIntToInt64(v_0.AuxInt)
  5273  		ptr := v_0.Args[0]
  5274  		mem := v_1
  5275  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5276  			break
  5277  		}
  5278  		v.reset(OpARM64FMOVSload)
  5279  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5280  		v.Aux = symToAux(sym)
  5281  		v.AddArg2(ptr, mem)
  5282  		return true
  5283  	}
  5284  	// match: (FMOVSload [off] {sym} (ADD ptr idx) mem)
  5285  	// cond: off == 0 && sym == nil
  5286  	// result: (FMOVSloadidx ptr idx mem)
  5287  	for {
  5288  		off := auxIntToInt32(v.AuxInt)
  5289  		sym := auxToSym(v.Aux)
  5290  		if v_0.Op != OpARM64ADD {
  5291  			break
  5292  		}
  5293  		idx := v_0.Args[1]
  5294  		ptr := v_0.Args[0]
  5295  		mem := v_1
  5296  		if !(off == 0 && sym == nil) {
  5297  			break
  5298  		}
  5299  		v.reset(OpARM64FMOVSloadidx)
  5300  		v.AddArg3(ptr, idx, mem)
  5301  		return true
  5302  	}
  5303  	// match: (FMOVSload [off] {sym} (ADDshiftLL [2] ptr idx) mem)
  5304  	// cond: off == 0 && sym == nil
  5305  	// result: (FMOVSloadidx4 ptr idx mem)
  5306  	for {
  5307  		off := auxIntToInt32(v.AuxInt)
  5308  		sym := auxToSym(v.Aux)
  5309  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
  5310  			break
  5311  		}
  5312  		idx := v_0.Args[1]
  5313  		ptr := v_0.Args[0]
  5314  		mem := v_1
  5315  		if !(off == 0 && sym == nil) {
  5316  			break
  5317  		}
  5318  		v.reset(OpARM64FMOVSloadidx4)
  5319  		v.AddArg3(ptr, idx, mem)
  5320  		return true
  5321  	}
  5322  	// match: (FMOVSload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  5323  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5324  	// result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5325  	for {
  5326  		off1 := auxIntToInt32(v.AuxInt)
  5327  		sym1 := auxToSym(v.Aux)
  5328  		if v_0.Op != OpARM64MOVDaddr {
  5329  			break
  5330  		}
  5331  		off2 := auxIntToInt32(v_0.AuxInt)
  5332  		sym2 := auxToSym(v_0.Aux)
  5333  		ptr := v_0.Args[0]
  5334  		mem := v_1
  5335  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5336  			break
  5337  		}
  5338  		v.reset(OpARM64FMOVSload)
  5339  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5340  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5341  		v.AddArg2(ptr, mem)
  5342  		return true
  5343  	}
  5344  	return false
  5345  }
  5346  func rewriteValueARM64_OpARM64FMOVSloadidx(v *Value) bool {
  5347  	v_2 := v.Args[2]
  5348  	v_1 := v.Args[1]
  5349  	v_0 := v.Args[0]
  5350  	// match: (FMOVSloadidx ptr (MOVDconst [c]) mem)
  5351  	// cond: is32Bit(c)
  5352  	// result: (FMOVSload [int32(c)] ptr mem)
  5353  	for {
  5354  		ptr := v_0
  5355  		if v_1.Op != OpARM64MOVDconst {
  5356  			break
  5357  		}
  5358  		c := auxIntToInt64(v_1.AuxInt)
  5359  		mem := v_2
  5360  		if !(is32Bit(c)) {
  5361  			break
  5362  		}
  5363  		v.reset(OpARM64FMOVSload)
  5364  		v.AuxInt = int32ToAuxInt(int32(c))
  5365  		v.AddArg2(ptr, mem)
  5366  		return true
  5367  	}
  5368  	// match: (FMOVSloadidx (MOVDconst [c]) ptr mem)
  5369  	// cond: is32Bit(c)
  5370  	// result: (FMOVSload [int32(c)] ptr mem)
  5371  	for {
  5372  		if v_0.Op != OpARM64MOVDconst {
  5373  			break
  5374  		}
  5375  		c := auxIntToInt64(v_0.AuxInt)
  5376  		ptr := v_1
  5377  		mem := v_2
  5378  		if !(is32Bit(c)) {
  5379  			break
  5380  		}
  5381  		v.reset(OpARM64FMOVSload)
  5382  		v.AuxInt = int32ToAuxInt(int32(c))
  5383  		v.AddArg2(ptr, mem)
  5384  		return true
  5385  	}
  5386  	// match: (FMOVSloadidx ptr (SLLconst [2] idx) mem)
  5387  	// result: (FMOVSloadidx4 ptr idx mem)
  5388  	for {
  5389  		ptr := v_0
  5390  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
  5391  			break
  5392  		}
  5393  		idx := v_1.Args[0]
  5394  		mem := v_2
  5395  		v.reset(OpARM64FMOVSloadidx4)
  5396  		v.AddArg3(ptr, idx, mem)
  5397  		return true
  5398  	}
  5399  	// match: (FMOVSloadidx (SLLconst [2] idx) ptr mem)
  5400  	// result: (FMOVSloadidx4 ptr idx mem)
  5401  	for {
  5402  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
  5403  			break
  5404  		}
  5405  		idx := v_0.Args[0]
  5406  		ptr := v_1
  5407  		mem := v_2
  5408  		v.reset(OpARM64FMOVSloadidx4)
  5409  		v.AddArg3(ptr, idx, mem)
  5410  		return true
  5411  	}
  5412  	return false
  5413  }
  5414  func rewriteValueARM64_OpARM64FMOVSloadidx4(v *Value) bool {
  5415  	v_2 := v.Args[2]
  5416  	v_1 := v.Args[1]
  5417  	v_0 := v.Args[0]
  5418  	// match: (FMOVSloadidx4 ptr (MOVDconst [c]) mem)
  5419  	// cond: is32Bit(c<<2)
  5420  	// result: (FMOVSload ptr [int32(c)<<2] mem)
  5421  	for {
  5422  		ptr := v_0
  5423  		if v_1.Op != OpARM64MOVDconst {
  5424  			break
  5425  		}
  5426  		c := auxIntToInt64(v_1.AuxInt)
  5427  		mem := v_2
  5428  		if !(is32Bit(c << 2)) {
  5429  			break
  5430  		}
  5431  		v.reset(OpARM64FMOVSload)
  5432  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
  5433  		v.AddArg2(ptr, mem)
  5434  		return true
  5435  	}
  5436  	return false
  5437  }
  5438  func rewriteValueARM64_OpARM64FMOVSstore(v *Value) bool {
  5439  	v_2 := v.Args[2]
  5440  	v_1 := v.Args[1]
  5441  	v_0 := v.Args[0]
  5442  	b := v.Block
  5443  	config := b.Func.Config
  5444  	// match: (FMOVSstore [off] {sym} ptr (FMOVSgpfp val) mem)
  5445  	// result: (MOVWstore [off] {sym} ptr val mem)
  5446  	for {
  5447  		off := auxIntToInt32(v.AuxInt)
  5448  		sym := auxToSym(v.Aux)
  5449  		ptr := v_0
  5450  		if v_1.Op != OpARM64FMOVSgpfp {
  5451  			break
  5452  		}
  5453  		val := v_1.Args[0]
  5454  		mem := v_2
  5455  		v.reset(OpARM64MOVWstore)
  5456  		v.AuxInt = int32ToAuxInt(off)
  5457  		v.Aux = symToAux(sym)
  5458  		v.AddArg3(ptr, val, mem)
  5459  		return true
  5460  	}
  5461  	// match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5462  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5463  	// result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
  5464  	for {
  5465  		off1 := auxIntToInt32(v.AuxInt)
  5466  		sym := auxToSym(v.Aux)
  5467  		if v_0.Op != OpARM64ADDconst {
  5468  			break
  5469  		}
  5470  		off2 := auxIntToInt64(v_0.AuxInt)
  5471  		ptr := v_0.Args[0]
  5472  		val := v_1
  5473  		mem := v_2
  5474  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5475  			break
  5476  		}
  5477  		v.reset(OpARM64FMOVSstore)
  5478  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5479  		v.Aux = symToAux(sym)
  5480  		v.AddArg3(ptr, val, mem)
  5481  		return true
  5482  	}
  5483  	// match: (FMOVSstore [off] {sym} (ADD ptr idx) val mem)
  5484  	// cond: off == 0 && sym == nil
  5485  	// result: (FMOVSstoreidx ptr idx val mem)
  5486  	for {
  5487  		off := auxIntToInt32(v.AuxInt)
  5488  		sym := auxToSym(v.Aux)
  5489  		if v_0.Op != OpARM64ADD {
  5490  			break
  5491  		}
  5492  		idx := v_0.Args[1]
  5493  		ptr := v_0.Args[0]
  5494  		val := v_1
  5495  		mem := v_2
  5496  		if !(off == 0 && sym == nil) {
  5497  			break
  5498  		}
  5499  		v.reset(OpARM64FMOVSstoreidx)
  5500  		v.AddArg4(ptr, idx, val, mem)
  5501  		return true
  5502  	}
  5503  	// match: (FMOVSstore [off] {sym} (ADDshiftLL [2] ptr idx) val mem)
  5504  	// cond: off == 0 && sym == nil
  5505  	// result: (FMOVSstoreidx4 ptr idx val mem)
  5506  	for {
  5507  		off := auxIntToInt32(v.AuxInt)
  5508  		sym := auxToSym(v.Aux)
  5509  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
  5510  			break
  5511  		}
  5512  		idx := v_0.Args[1]
  5513  		ptr := v_0.Args[0]
  5514  		val := v_1
  5515  		mem := v_2
  5516  		if !(off == 0 && sym == nil) {
  5517  			break
  5518  		}
  5519  		v.reset(OpARM64FMOVSstoreidx4)
  5520  		v.AddArg4(ptr, idx, val, mem)
  5521  		return true
  5522  	}
  5523  	// match: (FMOVSstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  5524  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5525  	// result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5526  	for {
  5527  		off1 := auxIntToInt32(v.AuxInt)
  5528  		sym1 := auxToSym(v.Aux)
  5529  		if v_0.Op != OpARM64MOVDaddr {
  5530  			break
  5531  		}
  5532  		off2 := auxIntToInt32(v_0.AuxInt)
  5533  		sym2 := auxToSym(v_0.Aux)
  5534  		ptr := v_0.Args[0]
  5535  		val := v_1
  5536  		mem := v_2
  5537  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5538  			break
  5539  		}
  5540  		v.reset(OpARM64FMOVSstore)
  5541  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5542  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5543  		v.AddArg3(ptr, val, mem)
  5544  		return true
  5545  	}
  5546  	return false
  5547  }
  5548  func rewriteValueARM64_OpARM64FMOVSstoreidx(v *Value) bool {
  5549  	v_3 := v.Args[3]
  5550  	v_2 := v.Args[2]
  5551  	v_1 := v.Args[1]
  5552  	v_0 := v.Args[0]
  5553  	// match: (FMOVSstoreidx ptr (MOVDconst [c]) val mem)
  5554  	// cond: is32Bit(c)
  5555  	// result: (FMOVSstore [int32(c)] ptr val mem)
  5556  	for {
  5557  		ptr := v_0
  5558  		if v_1.Op != OpARM64MOVDconst {
  5559  			break
  5560  		}
  5561  		c := auxIntToInt64(v_1.AuxInt)
  5562  		val := v_2
  5563  		mem := v_3
  5564  		if !(is32Bit(c)) {
  5565  			break
  5566  		}
  5567  		v.reset(OpARM64FMOVSstore)
  5568  		v.AuxInt = int32ToAuxInt(int32(c))
  5569  		v.AddArg3(ptr, val, mem)
  5570  		return true
  5571  	}
  5572  	// match: (FMOVSstoreidx (MOVDconst [c]) idx val mem)
  5573  	// cond: is32Bit(c)
  5574  	// result: (FMOVSstore [int32(c)] idx val mem)
  5575  	for {
  5576  		if v_0.Op != OpARM64MOVDconst {
  5577  			break
  5578  		}
  5579  		c := auxIntToInt64(v_0.AuxInt)
  5580  		idx := v_1
  5581  		val := v_2
  5582  		mem := v_3
  5583  		if !(is32Bit(c)) {
  5584  			break
  5585  		}
  5586  		v.reset(OpARM64FMOVSstore)
  5587  		v.AuxInt = int32ToAuxInt(int32(c))
  5588  		v.AddArg3(idx, val, mem)
  5589  		return true
  5590  	}
  5591  	// match: (FMOVSstoreidx ptr (SLLconst [2] idx) val mem)
  5592  	// result: (FMOVSstoreidx4 ptr idx val mem)
  5593  	for {
  5594  		ptr := v_0
  5595  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
  5596  			break
  5597  		}
  5598  		idx := v_1.Args[0]
  5599  		val := v_2
  5600  		mem := v_3
  5601  		v.reset(OpARM64FMOVSstoreidx4)
  5602  		v.AddArg4(ptr, idx, val, mem)
  5603  		return true
  5604  	}
  5605  	// match: (FMOVSstoreidx (SLLconst [2] idx) ptr val mem)
  5606  	// result: (FMOVSstoreidx4 ptr idx val mem)
  5607  	for {
  5608  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
  5609  			break
  5610  		}
  5611  		idx := v_0.Args[0]
  5612  		ptr := v_1
  5613  		val := v_2
  5614  		mem := v_3
  5615  		v.reset(OpARM64FMOVSstoreidx4)
  5616  		v.AddArg4(ptr, idx, val, mem)
  5617  		return true
  5618  	}
  5619  	return false
  5620  }
  5621  func rewriteValueARM64_OpARM64FMOVSstoreidx4(v *Value) bool {
  5622  	v_3 := v.Args[3]
  5623  	v_2 := v.Args[2]
  5624  	v_1 := v.Args[1]
  5625  	v_0 := v.Args[0]
  5626  	// match: (FMOVSstoreidx4 ptr (MOVDconst [c]) val mem)
  5627  	// cond: is32Bit(c<<2)
  5628  	// result: (FMOVSstore [int32(c)<<2] ptr val mem)
  5629  	for {
  5630  		ptr := v_0
  5631  		if v_1.Op != OpARM64MOVDconst {
  5632  			break
  5633  		}
  5634  		c := auxIntToInt64(v_1.AuxInt)
  5635  		val := v_2
  5636  		mem := v_3
  5637  		if !(is32Bit(c << 2)) {
  5638  			break
  5639  		}
  5640  		v.reset(OpARM64FMOVSstore)
  5641  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
  5642  		v.AddArg3(ptr, val, mem)
  5643  		return true
  5644  	}
  5645  	return false
  5646  }
  5647  func rewriteValueARM64_OpARM64FMULD(v *Value) bool {
  5648  	v_1 := v.Args[1]
  5649  	v_0 := v.Args[0]
  5650  	// match: (FMULD (FNEGD x) y)
  5651  	// result: (FNMULD x y)
  5652  	for {
  5653  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5654  			if v_0.Op != OpARM64FNEGD {
  5655  				continue
  5656  			}
  5657  			x := v_0.Args[0]
  5658  			y := v_1
  5659  			v.reset(OpARM64FNMULD)
  5660  			v.AddArg2(x, y)
  5661  			return true
  5662  		}
  5663  		break
  5664  	}
  5665  	return false
  5666  }
  5667  func rewriteValueARM64_OpARM64FMULS(v *Value) bool {
  5668  	v_1 := v.Args[1]
  5669  	v_0 := v.Args[0]
  5670  	// match: (FMULS (FNEGS x) y)
  5671  	// result: (FNMULS x y)
  5672  	for {
  5673  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5674  			if v_0.Op != OpARM64FNEGS {
  5675  				continue
  5676  			}
  5677  			x := v_0.Args[0]
  5678  			y := v_1
  5679  			v.reset(OpARM64FNMULS)
  5680  			v.AddArg2(x, y)
  5681  			return true
  5682  		}
  5683  		break
  5684  	}
  5685  	return false
  5686  }
  5687  func rewriteValueARM64_OpARM64FNEGD(v *Value) bool {
  5688  	v_0 := v.Args[0]
  5689  	// match: (FNEGD (FMULD x y))
  5690  	// result: (FNMULD x y)
  5691  	for {
  5692  		if v_0.Op != OpARM64FMULD {
  5693  			break
  5694  		}
  5695  		y := v_0.Args[1]
  5696  		x := v_0.Args[0]
  5697  		v.reset(OpARM64FNMULD)
  5698  		v.AddArg2(x, y)
  5699  		return true
  5700  	}
  5701  	// match: (FNEGD (FNMULD x y))
  5702  	// result: (FMULD x y)
  5703  	for {
  5704  		if v_0.Op != OpARM64FNMULD {
  5705  			break
  5706  		}
  5707  		y := v_0.Args[1]
  5708  		x := v_0.Args[0]
  5709  		v.reset(OpARM64FMULD)
  5710  		v.AddArg2(x, y)
  5711  		return true
  5712  	}
  5713  	return false
  5714  }
  5715  func rewriteValueARM64_OpARM64FNEGS(v *Value) bool {
  5716  	v_0 := v.Args[0]
  5717  	// match: (FNEGS (FMULS x y))
  5718  	// result: (FNMULS x y)
  5719  	for {
  5720  		if v_0.Op != OpARM64FMULS {
  5721  			break
  5722  		}
  5723  		y := v_0.Args[1]
  5724  		x := v_0.Args[0]
  5725  		v.reset(OpARM64FNMULS)
  5726  		v.AddArg2(x, y)
  5727  		return true
  5728  	}
  5729  	// match: (FNEGS (FNMULS x y))
  5730  	// result: (FMULS x y)
  5731  	for {
  5732  		if v_0.Op != OpARM64FNMULS {
  5733  			break
  5734  		}
  5735  		y := v_0.Args[1]
  5736  		x := v_0.Args[0]
  5737  		v.reset(OpARM64FMULS)
  5738  		v.AddArg2(x, y)
  5739  		return true
  5740  	}
  5741  	return false
  5742  }
  5743  func rewriteValueARM64_OpARM64FNMULD(v *Value) bool {
  5744  	v_1 := v.Args[1]
  5745  	v_0 := v.Args[0]
  5746  	// match: (FNMULD (FNEGD x) y)
  5747  	// result: (FMULD x y)
  5748  	for {
  5749  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5750  			if v_0.Op != OpARM64FNEGD {
  5751  				continue
  5752  			}
  5753  			x := v_0.Args[0]
  5754  			y := v_1
  5755  			v.reset(OpARM64FMULD)
  5756  			v.AddArg2(x, y)
  5757  			return true
  5758  		}
  5759  		break
  5760  	}
  5761  	return false
  5762  }
  5763  func rewriteValueARM64_OpARM64FNMULS(v *Value) bool {
  5764  	v_1 := v.Args[1]
  5765  	v_0 := v.Args[0]
  5766  	// match: (FNMULS (FNEGS x) y)
  5767  	// result: (FMULS x y)
  5768  	for {
  5769  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5770  			if v_0.Op != OpARM64FNEGS {
  5771  				continue
  5772  			}
  5773  			x := v_0.Args[0]
  5774  			y := v_1
  5775  			v.reset(OpARM64FMULS)
  5776  			v.AddArg2(x, y)
  5777  			return true
  5778  		}
  5779  		break
  5780  	}
  5781  	return false
  5782  }
  5783  func rewriteValueARM64_OpARM64FSUBD(v *Value) bool {
  5784  	v_1 := v.Args[1]
  5785  	v_0 := v.Args[0]
  5786  	// match: (FSUBD a (FMULD x y))
  5787  	// cond: a.Block.Func.useFMA(v)
  5788  	// result: (FMSUBD a x y)
  5789  	for {
  5790  		a := v_0
  5791  		if v_1.Op != OpARM64FMULD {
  5792  			break
  5793  		}
  5794  		y := v_1.Args[1]
  5795  		x := v_1.Args[0]
  5796  		if !(a.Block.Func.useFMA(v)) {
  5797  			break
  5798  		}
  5799  		v.reset(OpARM64FMSUBD)
  5800  		v.AddArg3(a, x, y)
  5801  		return true
  5802  	}
  5803  	// match: (FSUBD (FMULD x y) a)
  5804  	// cond: a.Block.Func.useFMA(v)
  5805  	// result: (FNMSUBD a x y)
  5806  	for {
  5807  		if v_0.Op != OpARM64FMULD {
  5808  			break
  5809  		}
  5810  		y := v_0.Args[1]
  5811  		x := v_0.Args[0]
  5812  		a := v_1
  5813  		if !(a.Block.Func.useFMA(v)) {
  5814  			break
  5815  		}
  5816  		v.reset(OpARM64FNMSUBD)
  5817  		v.AddArg3(a, x, y)
  5818  		return true
  5819  	}
  5820  	// match: (FSUBD a (FNMULD x y))
  5821  	// cond: a.Block.Func.useFMA(v)
  5822  	// result: (FMADDD a x y)
  5823  	for {
  5824  		a := v_0
  5825  		if v_1.Op != OpARM64FNMULD {
  5826  			break
  5827  		}
  5828  		y := v_1.Args[1]
  5829  		x := v_1.Args[0]
  5830  		if !(a.Block.Func.useFMA(v)) {
  5831  			break
  5832  		}
  5833  		v.reset(OpARM64FMADDD)
  5834  		v.AddArg3(a, x, y)
  5835  		return true
  5836  	}
  5837  	// match: (FSUBD (FNMULD x y) a)
  5838  	// cond: a.Block.Func.useFMA(v)
  5839  	// result: (FNMADDD a x y)
  5840  	for {
  5841  		if v_0.Op != OpARM64FNMULD {
  5842  			break
  5843  		}
  5844  		y := v_0.Args[1]
  5845  		x := v_0.Args[0]
  5846  		a := v_1
  5847  		if !(a.Block.Func.useFMA(v)) {
  5848  			break
  5849  		}
  5850  		v.reset(OpARM64FNMADDD)
  5851  		v.AddArg3(a, x, y)
  5852  		return true
  5853  	}
  5854  	return false
  5855  }
  5856  func rewriteValueARM64_OpARM64FSUBS(v *Value) bool {
  5857  	v_1 := v.Args[1]
  5858  	v_0 := v.Args[0]
  5859  	// match: (FSUBS a (FMULS x y))
  5860  	// cond: a.Block.Func.useFMA(v)
  5861  	// result: (FMSUBS a x y)
  5862  	for {
  5863  		a := v_0
  5864  		if v_1.Op != OpARM64FMULS {
  5865  			break
  5866  		}
  5867  		y := v_1.Args[1]
  5868  		x := v_1.Args[0]
  5869  		if !(a.Block.Func.useFMA(v)) {
  5870  			break
  5871  		}
  5872  		v.reset(OpARM64FMSUBS)
  5873  		v.AddArg3(a, x, y)
  5874  		return true
  5875  	}
  5876  	// match: (FSUBS (FMULS x y) a)
  5877  	// cond: a.Block.Func.useFMA(v)
  5878  	// result: (FNMSUBS a x y)
  5879  	for {
  5880  		if v_0.Op != OpARM64FMULS {
  5881  			break
  5882  		}
  5883  		y := v_0.Args[1]
  5884  		x := v_0.Args[0]
  5885  		a := v_1
  5886  		if !(a.Block.Func.useFMA(v)) {
  5887  			break
  5888  		}
  5889  		v.reset(OpARM64FNMSUBS)
  5890  		v.AddArg3(a, x, y)
  5891  		return true
  5892  	}
  5893  	// match: (FSUBS a (FNMULS x y))
  5894  	// cond: a.Block.Func.useFMA(v)
  5895  	// result: (FMADDS a x y)
  5896  	for {
  5897  		a := v_0
  5898  		if v_1.Op != OpARM64FNMULS {
  5899  			break
  5900  		}
  5901  		y := v_1.Args[1]
  5902  		x := v_1.Args[0]
  5903  		if !(a.Block.Func.useFMA(v)) {
  5904  			break
  5905  		}
  5906  		v.reset(OpARM64FMADDS)
  5907  		v.AddArg3(a, x, y)
  5908  		return true
  5909  	}
  5910  	// match: (FSUBS (FNMULS x y) a)
  5911  	// cond: a.Block.Func.useFMA(v)
  5912  	// result: (FNMADDS a x y)
  5913  	for {
  5914  		if v_0.Op != OpARM64FNMULS {
  5915  			break
  5916  		}
  5917  		y := v_0.Args[1]
  5918  		x := v_0.Args[0]
  5919  		a := v_1
  5920  		if !(a.Block.Func.useFMA(v)) {
  5921  			break
  5922  		}
  5923  		v.reset(OpARM64FNMADDS)
  5924  		v.AddArg3(a, x, y)
  5925  		return true
  5926  	}
  5927  	return false
  5928  }
  5929  func rewriteValueARM64_OpARM64GreaterEqual(v *Value) bool {
  5930  	v_0 := v.Args[0]
  5931  	b := v.Block
  5932  	// match: (GreaterEqual (CMPconst [0] z:(AND x y)))
  5933  	// cond: z.Uses == 1
  5934  	// result: (GreaterEqual (TST x y))
  5935  	for {
  5936  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  5937  			break
  5938  		}
  5939  		z := v_0.Args[0]
  5940  		if z.Op != OpARM64AND {
  5941  			break
  5942  		}
  5943  		y := z.Args[1]
  5944  		x := z.Args[0]
  5945  		if !(z.Uses == 1) {
  5946  			break
  5947  		}
  5948  		v.reset(OpARM64GreaterEqual)
  5949  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  5950  		v0.AddArg2(x, y)
  5951  		v.AddArg(v0)
  5952  		return true
  5953  	}
  5954  	// match: (GreaterEqual (CMPWconst [0] x:(ANDconst [c] y)))
  5955  	// cond: x.Uses == 1
  5956  	// result: (GreaterEqual (TSTWconst [int32(c)] y))
  5957  	for {
  5958  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5959  			break
  5960  		}
  5961  		x := v_0.Args[0]
  5962  		if x.Op != OpARM64ANDconst {
  5963  			break
  5964  		}
  5965  		c := auxIntToInt64(x.AuxInt)
  5966  		y := x.Args[0]
  5967  		if !(x.Uses == 1) {
  5968  			break
  5969  		}
  5970  		v.reset(OpARM64GreaterEqual)
  5971  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  5972  		v0.AuxInt = int32ToAuxInt(int32(c))
  5973  		v0.AddArg(y)
  5974  		v.AddArg(v0)
  5975  		return true
  5976  	}
  5977  	// match: (GreaterEqual (CMPWconst [0] z:(AND x y)))
  5978  	// cond: z.Uses == 1
  5979  	// result: (GreaterEqual (TSTW x y))
  5980  	for {
  5981  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5982  			break
  5983  		}
  5984  		z := v_0.Args[0]
  5985  		if z.Op != OpARM64AND {
  5986  			break
  5987  		}
  5988  		y := z.Args[1]
  5989  		x := z.Args[0]
  5990  		if !(z.Uses == 1) {
  5991  			break
  5992  		}
  5993  		v.reset(OpARM64GreaterEqual)
  5994  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  5995  		v0.AddArg2(x, y)
  5996  		v.AddArg(v0)
  5997  		return true
  5998  	}
  5999  	// match: (GreaterEqual (CMPconst [0] x:(ANDconst [c] y)))
  6000  	// cond: x.Uses == 1
  6001  	// result: (GreaterEqual (TSTconst [c] y))
  6002  	for {
  6003  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6004  			break
  6005  		}
  6006  		x := v_0.Args[0]
  6007  		if x.Op != OpARM64ANDconst {
  6008  			break
  6009  		}
  6010  		c := auxIntToInt64(x.AuxInt)
  6011  		y := x.Args[0]
  6012  		if !(x.Uses == 1) {
  6013  			break
  6014  		}
  6015  		v.reset(OpARM64GreaterEqual)
  6016  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  6017  		v0.AuxInt = int64ToAuxInt(c)
  6018  		v0.AddArg(y)
  6019  		v.AddArg(v0)
  6020  		return true
  6021  	}
  6022  	// match: (GreaterEqual (CMPconst [0] x:(ADDconst [c] y)))
  6023  	// cond: x.Uses == 1
  6024  	// result: (GreaterEqualNoov (CMNconst [c] y))
  6025  	for {
  6026  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6027  			break
  6028  		}
  6029  		x := v_0.Args[0]
  6030  		if x.Op != OpARM64ADDconst {
  6031  			break
  6032  		}
  6033  		c := auxIntToInt64(x.AuxInt)
  6034  		y := x.Args[0]
  6035  		if !(x.Uses == 1) {
  6036  			break
  6037  		}
  6038  		v.reset(OpARM64GreaterEqualNoov)
  6039  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
  6040  		v0.AuxInt = int64ToAuxInt(c)
  6041  		v0.AddArg(y)
  6042  		v.AddArg(v0)
  6043  		return true
  6044  	}
  6045  	// match: (GreaterEqual (CMPWconst [0] x:(ADDconst [c] y)))
  6046  	// cond: x.Uses == 1
  6047  	// result: (GreaterEqualNoov (CMNWconst [int32(c)] y))
  6048  	for {
  6049  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6050  			break
  6051  		}
  6052  		x := v_0.Args[0]
  6053  		if x.Op != OpARM64ADDconst {
  6054  			break
  6055  		}
  6056  		c := auxIntToInt64(x.AuxInt)
  6057  		y := x.Args[0]
  6058  		if !(x.Uses == 1) {
  6059  			break
  6060  		}
  6061  		v.reset(OpARM64GreaterEqualNoov)
  6062  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
  6063  		v0.AuxInt = int32ToAuxInt(int32(c))
  6064  		v0.AddArg(y)
  6065  		v.AddArg(v0)
  6066  		return true
  6067  	}
  6068  	// match: (GreaterEqual (CMPconst [0] z:(ADD x y)))
  6069  	// cond: z.Uses == 1
  6070  	// result: (GreaterEqualNoov (CMN x y))
  6071  	for {
  6072  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6073  			break
  6074  		}
  6075  		z := v_0.Args[0]
  6076  		if z.Op != OpARM64ADD {
  6077  			break
  6078  		}
  6079  		y := z.Args[1]
  6080  		x := z.Args[0]
  6081  		if !(z.Uses == 1) {
  6082  			break
  6083  		}
  6084  		v.reset(OpARM64GreaterEqualNoov)
  6085  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  6086  		v0.AddArg2(x, y)
  6087  		v.AddArg(v0)
  6088  		return true
  6089  	}
  6090  	// match: (GreaterEqual (CMPWconst [0] z:(ADD x y)))
  6091  	// cond: z.Uses == 1
  6092  	// result: (GreaterEqualNoov (CMNW x y))
  6093  	for {
  6094  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6095  			break
  6096  		}
  6097  		z := v_0.Args[0]
  6098  		if z.Op != OpARM64ADD {
  6099  			break
  6100  		}
  6101  		y := z.Args[1]
  6102  		x := z.Args[0]
  6103  		if !(z.Uses == 1) {
  6104  			break
  6105  		}
  6106  		v.reset(OpARM64GreaterEqualNoov)
  6107  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  6108  		v0.AddArg2(x, y)
  6109  		v.AddArg(v0)
  6110  		return true
  6111  	}
  6112  	// match: (GreaterEqual (CMPconst [0] z:(MADD a x y)))
  6113  	// cond: z.Uses == 1
  6114  	// result: (GreaterEqualNoov (CMN a (MUL <x.Type> x y)))
  6115  	for {
  6116  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6117  			break
  6118  		}
  6119  		z := v_0.Args[0]
  6120  		if z.Op != OpARM64MADD {
  6121  			break
  6122  		}
  6123  		y := z.Args[2]
  6124  		a := z.Args[0]
  6125  		x := z.Args[1]
  6126  		if !(z.Uses == 1) {
  6127  			break
  6128  		}
  6129  		v.reset(OpARM64GreaterEqualNoov)
  6130  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  6131  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  6132  		v1.AddArg2(x, y)
  6133  		v0.AddArg2(a, v1)
  6134  		v.AddArg(v0)
  6135  		return true
  6136  	}
  6137  	// match: (GreaterEqual (CMPconst [0] z:(MSUB a x y)))
  6138  	// cond: z.Uses == 1
  6139  	// result: (GreaterEqualNoov (CMP a (MUL <x.Type> x y)))
  6140  	for {
  6141  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6142  			break
  6143  		}
  6144  		z := v_0.Args[0]
  6145  		if z.Op != OpARM64MSUB {
  6146  			break
  6147  		}
  6148  		y := z.Args[2]
  6149  		a := z.Args[0]
  6150  		x := z.Args[1]
  6151  		if !(z.Uses == 1) {
  6152  			break
  6153  		}
  6154  		v.reset(OpARM64GreaterEqualNoov)
  6155  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  6156  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  6157  		v1.AddArg2(x, y)
  6158  		v0.AddArg2(a, v1)
  6159  		v.AddArg(v0)
  6160  		return true
  6161  	}
  6162  	// match: (GreaterEqual (CMPWconst [0] z:(MADDW a x y)))
  6163  	// cond: z.Uses == 1
  6164  	// result: (GreaterEqualNoov (CMNW a (MULW <x.Type> x y)))
  6165  	for {
  6166  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6167  			break
  6168  		}
  6169  		z := v_0.Args[0]
  6170  		if z.Op != OpARM64MADDW {
  6171  			break
  6172  		}
  6173  		y := z.Args[2]
  6174  		a := z.Args[0]
  6175  		x := z.Args[1]
  6176  		if !(z.Uses == 1) {
  6177  			break
  6178  		}
  6179  		v.reset(OpARM64GreaterEqualNoov)
  6180  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  6181  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  6182  		v1.AddArg2(x, y)
  6183  		v0.AddArg2(a, v1)
  6184  		v.AddArg(v0)
  6185  		return true
  6186  	}
  6187  	// match: (GreaterEqual (CMPWconst [0] z:(MSUBW a x y)))
  6188  	// cond: z.Uses == 1
  6189  	// result: (GreaterEqualNoov (CMPW a (MULW <x.Type> x y)))
  6190  	for {
  6191  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6192  			break
  6193  		}
  6194  		z := v_0.Args[0]
  6195  		if z.Op != OpARM64MSUBW {
  6196  			break
  6197  		}
  6198  		y := z.Args[2]
  6199  		a := z.Args[0]
  6200  		x := z.Args[1]
  6201  		if !(z.Uses == 1) {
  6202  			break
  6203  		}
  6204  		v.reset(OpARM64GreaterEqualNoov)
  6205  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  6206  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  6207  		v1.AddArg2(x, y)
  6208  		v0.AddArg2(a, v1)
  6209  		v.AddArg(v0)
  6210  		return true
  6211  	}
  6212  	// match: (GreaterEqual (FlagConstant [fc]))
  6213  	// result: (MOVDconst [b2i(fc.ge())])
  6214  	for {
  6215  		if v_0.Op != OpARM64FlagConstant {
  6216  			break
  6217  		}
  6218  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6219  		v.reset(OpARM64MOVDconst)
  6220  		v.AuxInt = int64ToAuxInt(b2i(fc.ge()))
  6221  		return true
  6222  	}
  6223  	// match: (GreaterEqual (InvertFlags x))
  6224  	// result: (LessEqual x)
  6225  	for {
  6226  		if v_0.Op != OpARM64InvertFlags {
  6227  			break
  6228  		}
  6229  		x := v_0.Args[0]
  6230  		v.reset(OpARM64LessEqual)
  6231  		v.AddArg(x)
  6232  		return true
  6233  	}
  6234  	return false
  6235  }
  6236  func rewriteValueARM64_OpARM64GreaterEqualF(v *Value) bool {
  6237  	v_0 := v.Args[0]
  6238  	// match: (GreaterEqualF (InvertFlags x))
  6239  	// result: (LessEqualF x)
  6240  	for {
  6241  		if v_0.Op != OpARM64InvertFlags {
  6242  			break
  6243  		}
  6244  		x := v_0.Args[0]
  6245  		v.reset(OpARM64LessEqualF)
  6246  		v.AddArg(x)
  6247  		return true
  6248  	}
  6249  	return false
  6250  }
  6251  func rewriteValueARM64_OpARM64GreaterEqualNoov(v *Value) bool {
  6252  	v_0 := v.Args[0]
  6253  	b := v.Block
  6254  	typ := &b.Func.Config.Types
  6255  	// match: (GreaterEqualNoov (FlagConstant [fc]))
  6256  	// result: (MOVDconst [b2i(fc.geNoov())])
  6257  	for {
  6258  		if v_0.Op != OpARM64FlagConstant {
  6259  			break
  6260  		}
  6261  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6262  		v.reset(OpARM64MOVDconst)
  6263  		v.AuxInt = int64ToAuxInt(b2i(fc.geNoov()))
  6264  		return true
  6265  	}
  6266  	// match: (GreaterEqualNoov (InvertFlags x))
  6267  	// result: (CSINC [OpARM64NotEqual] (LessThanNoov <typ.Bool> x) (MOVDconst [0]) x)
  6268  	for {
  6269  		if v_0.Op != OpARM64InvertFlags {
  6270  			break
  6271  		}
  6272  		x := v_0.Args[0]
  6273  		v.reset(OpARM64CSINC)
  6274  		v.AuxInt = opToAuxInt(OpARM64NotEqual)
  6275  		v0 := b.NewValue0(v.Pos, OpARM64LessThanNoov, typ.Bool)
  6276  		v0.AddArg(x)
  6277  		v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
  6278  		v1.AuxInt = int64ToAuxInt(0)
  6279  		v.AddArg3(v0, v1, x)
  6280  		return true
  6281  	}
  6282  	return false
  6283  }
  6284  func rewriteValueARM64_OpARM64GreaterEqualU(v *Value) bool {
  6285  	v_0 := v.Args[0]
  6286  	// match: (GreaterEqualU (FlagConstant [fc]))
  6287  	// result: (MOVDconst [b2i(fc.uge())])
  6288  	for {
  6289  		if v_0.Op != OpARM64FlagConstant {
  6290  			break
  6291  		}
  6292  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6293  		v.reset(OpARM64MOVDconst)
  6294  		v.AuxInt = int64ToAuxInt(b2i(fc.uge()))
  6295  		return true
  6296  	}
  6297  	// match: (GreaterEqualU (InvertFlags x))
  6298  	// result: (LessEqualU x)
  6299  	for {
  6300  		if v_0.Op != OpARM64InvertFlags {
  6301  			break
  6302  		}
  6303  		x := v_0.Args[0]
  6304  		v.reset(OpARM64LessEqualU)
  6305  		v.AddArg(x)
  6306  		return true
  6307  	}
  6308  	return false
  6309  }
  6310  func rewriteValueARM64_OpARM64GreaterThan(v *Value) bool {
  6311  	v_0 := v.Args[0]
  6312  	b := v.Block
  6313  	// match: (GreaterThan (CMPconst [0] z:(AND x y)))
  6314  	// cond: z.Uses == 1
  6315  	// result: (GreaterThan (TST x y))
  6316  	for {
  6317  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6318  			break
  6319  		}
  6320  		z := v_0.Args[0]
  6321  		if z.Op != OpARM64AND {
  6322  			break
  6323  		}
  6324  		y := z.Args[1]
  6325  		x := z.Args[0]
  6326  		if !(z.Uses == 1) {
  6327  			break
  6328  		}
  6329  		v.reset(OpARM64GreaterThan)
  6330  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  6331  		v0.AddArg2(x, y)
  6332  		v.AddArg(v0)
  6333  		return true
  6334  	}
  6335  	// match: (GreaterThan (CMPWconst [0] x:(ANDconst [c] y)))
  6336  	// cond: x.Uses == 1
  6337  	// result: (GreaterThan (TSTWconst [int32(c)] y))
  6338  	for {
  6339  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6340  			break
  6341  		}
  6342  		x := v_0.Args[0]
  6343  		if x.Op != OpARM64ANDconst {
  6344  			break
  6345  		}
  6346  		c := auxIntToInt64(x.AuxInt)
  6347  		y := x.Args[0]
  6348  		if !(x.Uses == 1) {
  6349  			break
  6350  		}
  6351  		v.reset(OpARM64GreaterThan)
  6352  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  6353  		v0.AuxInt = int32ToAuxInt(int32(c))
  6354  		v0.AddArg(y)
  6355  		v.AddArg(v0)
  6356  		return true
  6357  	}
  6358  	// match: (GreaterThan (CMPWconst [0] z:(AND x y)))
  6359  	// cond: z.Uses == 1
  6360  	// result: (GreaterThan (TSTW x y))
  6361  	for {
  6362  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6363  			break
  6364  		}
  6365  		z := v_0.Args[0]
  6366  		if z.Op != OpARM64AND {
  6367  			break
  6368  		}
  6369  		y := z.Args[1]
  6370  		x := z.Args[0]
  6371  		if !(z.Uses == 1) {
  6372  			break
  6373  		}
  6374  		v.reset(OpARM64GreaterThan)
  6375  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  6376  		v0.AddArg2(x, y)
  6377  		v.AddArg(v0)
  6378  		return true
  6379  	}
  6380  	// match: (GreaterThan (CMPconst [0] x:(ANDconst [c] y)))
  6381  	// cond: x.Uses == 1
  6382  	// result: (GreaterThan (TSTconst [c] y))
  6383  	for {
  6384  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6385  			break
  6386  		}
  6387  		x := v_0.Args[0]
  6388  		if x.Op != OpARM64ANDconst {
  6389  			break
  6390  		}
  6391  		c := auxIntToInt64(x.AuxInt)
  6392  		y := x.Args[0]
  6393  		if !(x.Uses == 1) {
  6394  			break
  6395  		}
  6396  		v.reset(OpARM64GreaterThan)
  6397  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  6398  		v0.AuxInt = int64ToAuxInt(c)
  6399  		v0.AddArg(y)
  6400  		v.AddArg(v0)
  6401  		return true
  6402  	}
  6403  	// match: (GreaterThan (FlagConstant [fc]))
  6404  	// result: (MOVDconst [b2i(fc.gt())])
  6405  	for {
  6406  		if v_0.Op != OpARM64FlagConstant {
  6407  			break
  6408  		}
  6409  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6410  		v.reset(OpARM64MOVDconst)
  6411  		v.AuxInt = int64ToAuxInt(b2i(fc.gt()))
  6412  		return true
  6413  	}
  6414  	// match: (GreaterThan (InvertFlags x))
  6415  	// result: (LessThan x)
  6416  	for {
  6417  		if v_0.Op != OpARM64InvertFlags {
  6418  			break
  6419  		}
  6420  		x := v_0.Args[0]
  6421  		v.reset(OpARM64LessThan)
  6422  		v.AddArg(x)
  6423  		return true
  6424  	}
  6425  	return false
  6426  }
  6427  func rewriteValueARM64_OpARM64GreaterThanF(v *Value) bool {
  6428  	v_0 := v.Args[0]
  6429  	// match: (GreaterThanF (InvertFlags x))
  6430  	// result: (LessThanF x)
  6431  	for {
  6432  		if v_0.Op != OpARM64InvertFlags {
  6433  			break
  6434  		}
  6435  		x := v_0.Args[0]
  6436  		v.reset(OpARM64LessThanF)
  6437  		v.AddArg(x)
  6438  		return true
  6439  	}
  6440  	return false
  6441  }
  6442  func rewriteValueARM64_OpARM64GreaterThanU(v *Value) bool {
  6443  	v_0 := v.Args[0]
  6444  	// match: (GreaterThanU (FlagConstant [fc]))
  6445  	// result: (MOVDconst [b2i(fc.ugt())])
  6446  	for {
  6447  		if v_0.Op != OpARM64FlagConstant {
  6448  			break
  6449  		}
  6450  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6451  		v.reset(OpARM64MOVDconst)
  6452  		v.AuxInt = int64ToAuxInt(b2i(fc.ugt()))
  6453  		return true
  6454  	}
  6455  	// match: (GreaterThanU (InvertFlags x))
  6456  	// result: (LessThanU x)
  6457  	for {
  6458  		if v_0.Op != OpARM64InvertFlags {
  6459  			break
  6460  		}
  6461  		x := v_0.Args[0]
  6462  		v.reset(OpARM64LessThanU)
  6463  		v.AddArg(x)
  6464  		return true
  6465  	}
  6466  	return false
  6467  }
  6468  func rewriteValueARM64_OpARM64LDP(v *Value) bool {
  6469  	v_1 := v.Args[1]
  6470  	v_0 := v.Args[0]
  6471  	b := v.Block
  6472  	config := b.Func.Config
  6473  	// match: (LDP [off1] {sym} (ADDconst [off2] ptr) mem)
  6474  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  6475  	// result: (LDP [off1+int32(off2)] {sym} ptr mem)
  6476  	for {
  6477  		off1 := auxIntToInt32(v.AuxInt)
  6478  		sym := auxToSym(v.Aux)
  6479  		if v_0.Op != OpARM64ADDconst {
  6480  			break
  6481  		}
  6482  		off2 := auxIntToInt64(v_0.AuxInt)
  6483  		ptr := v_0.Args[0]
  6484  		mem := v_1
  6485  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  6486  			break
  6487  		}
  6488  		v.reset(OpARM64LDP)
  6489  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6490  		v.Aux = symToAux(sym)
  6491  		v.AddArg2(ptr, mem)
  6492  		return true
  6493  	}
  6494  	// match: (LDP [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  6495  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  6496  	// result: (LDP [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6497  	for {
  6498  		off1 := auxIntToInt32(v.AuxInt)
  6499  		sym1 := auxToSym(v.Aux)
  6500  		if v_0.Op != OpARM64MOVDaddr {
  6501  			break
  6502  		}
  6503  		off2 := auxIntToInt32(v_0.AuxInt)
  6504  		sym2 := auxToSym(v_0.Aux)
  6505  		ptr := v_0.Args[0]
  6506  		mem := v_1
  6507  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  6508  			break
  6509  		}
  6510  		v.reset(OpARM64LDP)
  6511  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6512  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6513  		v.AddArg2(ptr, mem)
  6514  		return true
  6515  	}
  6516  	return false
  6517  }
  6518  func rewriteValueARM64_OpARM64LessEqual(v *Value) bool {
  6519  	v_0 := v.Args[0]
  6520  	b := v.Block
  6521  	// match: (LessEqual (CMPconst [0] z:(AND x y)))
  6522  	// cond: z.Uses == 1
  6523  	// result: (LessEqual (TST x y))
  6524  	for {
  6525  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6526  			break
  6527  		}
  6528  		z := v_0.Args[0]
  6529  		if z.Op != OpARM64AND {
  6530  			break
  6531  		}
  6532  		y := z.Args[1]
  6533  		x := z.Args[0]
  6534  		if !(z.Uses == 1) {
  6535  			break
  6536  		}
  6537  		v.reset(OpARM64LessEqual)
  6538  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  6539  		v0.AddArg2(x, y)
  6540  		v.AddArg(v0)
  6541  		return true
  6542  	}
  6543  	// match: (LessEqual (CMPWconst [0] x:(ANDconst [c] y)))
  6544  	// cond: x.Uses == 1
  6545  	// result: (LessEqual (TSTWconst [int32(c)] y))
  6546  	for {
  6547  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6548  			break
  6549  		}
  6550  		x := v_0.Args[0]
  6551  		if x.Op != OpARM64ANDconst {
  6552  			break
  6553  		}
  6554  		c := auxIntToInt64(x.AuxInt)
  6555  		y := x.Args[0]
  6556  		if !(x.Uses == 1) {
  6557  			break
  6558  		}
  6559  		v.reset(OpARM64LessEqual)
  6560  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  6561  		v0.AuxInt = int32ToAuxInt(int32(c))
  6562  		v0.AddArg(y)
  6563  		v.AddArg(v0)
  6564  		return true
  6565  	}
  6566  	// match: (LessEqual (CMPWconst [0] z:(AND x y)))
  6567  	// cond: z.Uses == 1
  6568  	// result: (LessEqual (TSTW x y))
  6569  	for {
  6570  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6571  			break
  6572  		}
  6573  		z := v_0.Args[0]
  6574  		if z.Op != OpARM64AND {
  6575  			break
  6576  		}
  6577  		y := z.Args[1]
  6578  		x := z.Args[0]
  6579  		if !(z.Uses == 1) {
  6580  			break
  6581  		}
  6582  		v.reset(OpARM64LessEqual)
  6583  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  6584  		v0.AddArg2(x, y)
  6585  		v.AddArg(v0)
  6586  		return true
  6587  	}
  6588  	// match: (LessEqual (CMPconst [0] x:(ANDconst [c] y)))
  6589  	// cond: x.Uses == 1
  6590  	// result: (LessEqual (TSTconst [c] y))
  6591  	for {
  6592  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6593  			break
  6594  		}
  6595  		x := v_0.Args[0]
  6596  		if x.Op != OpARM64ANDconst {
  6597  			break
  6598  		}
  6599  		c := auxIntToInt64(x.AuxInt)
  6600  		y := x.Args[0]
  6601  		if !(x.Uses == 1) {
  6602  			break
  6603  		}
  6604  		v.reset(OpARM64LessEqual)
  6605  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  6606  		v0.AuxInt = int64ToAuxInt(c)
  6607  		v0.AddArg(y)
  6608  		v.AddArg(v0)
  6609  		return true
  6610  	}
  6611  	// match: (LessEqual (FlagConstant [fc]))
  6612  	// result: (MOVDconst [b2i(fc.le())])
  6613  	for {
  6614  		if v_0.Op != OpARM64FlagConstant {
  6615  			break
  6616  		}
  6617  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6618  		v.reset(OpARM64MOVDconst)
  6619  		v.AuxInt = int64ToAuxInt(b2i(fc.le()))
  6620  		return true
  6621  	}
  6622  	// match: (LessEqual (InvertFlags x))
  6623  	// result: (GreaterEqual x)
  6624  	for {
  6625  		if v_0.Op != OpARM64InvertFlags {
  6626  			break
  6627  		}
  6628  		x := v_0.Args[0]
  6629  		v.reset(OpARM64GreaterEqual)
  6630  		v.AddArg(x)
  6631  		return true
  6632  	}
  6633  	return false
  6634  }
  6635  func rewriteValueARM64_OpARM64LessEqualF(v *Value) bool {
  6636  	v_0 := v.Args[0]
  6637  	// match: (LessEqualF (InvertFlags x))
  6638  	// result: (GreaterEqualF x)
  6639  	for {
  6640  		if v_0.Op != OpARM64InvertFlags {
  6641  			break
  6642  		}
  6643  		x := v_0.Args[0]
  6644  		v.reset(OpARM64GreaterEqualF)
  6645  		v.AddArg(x)
  6646  		return true
  6647  	}
  6648  	return false
  6649  }
  6650  func rewriteValueARM64_OpARM64LessEqualU(v *Value) bool {
  6651  	v_0 := v.Args[0]
  6652  	// match: (LessEqualU (FlagConstant [fc]))
  6653  	// result: (MOVDconst [b2i(fc.ule())])
  6654  	for {
  6655  		if v_0.Op != OpARM64FlagConstant {
  6656  			break
  6657  		}
  6658  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6659  		v.reset(OpARM64MOVDconst)
  6660  		v.AuxInt = int64ToAuxInt(b2i(fc.ule()))
  6661  		return true
  6662  	}
  6663  	// match: (LessEqualU (InvertFlags x))
  6664  	// result: (GreaterEqualU x)
  6665  	for {
  6666  		if v_0.Op != OpARM64InvertFlags {
  6667  			break
  6668  		}
  6669  		x := v_0.Args[0]
  6670  		v.reset(OpARM64GreaterEqualU)
  6671  		v.AddArg(x)
  6672  		return true
  6673  	}
  6674  	return false
  6675  }
  6676  func rewriteValueARM64_OpARM64LessThan(v *Value) bool {
  6677  	v_0 := v.Args[0]
  6678  	b := v.Block
  6679  	// match: (LessThan (CMPconst [0] z:(AND x y)))
  6680  	// cond: z.Uses == 1
  6681  	// result: (LessThan (TST x y))
  6682  	for {
  6683  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6684  			break
  6685  		}
  6686  		z := v_0.Args[0]
  6687  		if z.Op != OpARM64AND {
  6688  			break
  6689  		}
  6690  		y := z.Args[1]
  6691  		x := z.Args[0]
  6692  		if !(z.Uses == 1) {
  6693  			break
  6694  		}
  6695  		v.reset(OpARM64LessThan)
  6696  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  6697  		v0.AddArg2(x, y)
  6698  		v.AddArg(v0)
  6699  		return true
  6700  	}
  6701  	// match: (LessThan (CMPWconst [0] x:(ANDconst [c] y)))
  6702  	// cond: x.Uses == 1
  6703  	// result: (LessThan (TSTWconst [int32(c)] y))
  6704  	for {
  6705  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6706  			break
  6707  		}
  6708  		x := v_0.Args[0]
  6709  		if x.Op != OpARM64ANDconst {
  6710  			break
  6711  		}
  6712  		c := auxIntToInt64(x.AuxInt)
  6713  		y := x.Args[0]
  6714  		if !(x.Uses == 1) {
  6715  			break
  6716  		}
  6717  		v.reset(OpARM64LessThan)
  6718  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  6719  		v0.AuxInt = int32ToAuxInt(int32(c))
  6720  		v0.AddArg(y)
  6721  		v.AddArg(v0)
  6722  		return true
  6723  	}
  6724  	// match: (LessThan (CMPWconst [0] z:(AND x y)))
  6725  	// cond: z.Uses == 1
  6726  	// result: (LessThan (TSTW x y))
  6727  	for {
  6728  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6729  			break
  6730  		}
  6731  		z := v_0.Args[0]
  6732  		if z.Op != OpARM64AND {
  6733  			break
  6734  		}
  6735  		y := z.Args[1]
  6736  		x := z.Args[0]
  6737  		if !(z.Uses == 1) {
  6738  			break
  6739  		}
  6740  		v.reset(OpARM64LessThan)
  6741  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  6742  		v0.AddArg2(x, y)
  6743  		v.AddArg(v0)
  6744  		return true
  6745  	}
  6746  	// match: (LessThan (CMPconst [0] x:(ANDconst [c] y)))
  6747  	// cond: x.Uses == 1
  6748  	// result: (LessThan (TSTconst [c] y))
  6749  	for {
  6750  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6751  			break
  6752  		}
  6753  		x := v_0.Args[0]
  6754  		if x.Op != OpARM64ANDconst {
  6755  			break
  6756  		}
  6757  		c := auxIntToInt64(x.AuxInt)
  6758  		y := x.Args[0]
  6759  		if !(x.Uses == 1) {
  6760  			break
  6761  		}
  6762  		v.reset(OpARM64LessThan)
  6763  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  6764  		v0.AuxInt = int64ToAuxInt(c)
  6765  		v0.AddArg(y)
  6766  		v.AddArg(v0)
  6767  		return true
  6768  	}
  6769  	// match: (LessThan (CMPconst [0] x:(ADDconst [c] y)))
  6770  	// cond: x.Uses == 1
  6771  	// result: (LessThanNoov (CMNconst [c] y))
  6772  	for {
  6773  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6774  			break
  6775  		}
  6776  		x := v_0.Args[0]
  6777  		if x.Op != OpARM64ADDconst {
  6778  			break
  6779  		}
  6780  		c := auxIntToInt64(x.AuxInt)
  6781  		y := x.Args[0]
  6782  		if !(x.Uses == 1) {
  6783  			break
  6784  		}
  6785  		v.reset(OpARM64LessThanNoov)
  6786  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
  6787  		v0.AuxInt = int64ToAuxInt(c)
  6788  		v0.AddArg(y)
  6789  		v.AddArg(v0)
  6790  		return true
  6791  	}
  6792  	// match: (LessThan (CMPWconst [0] x:(ADDconst [c] y)))
  6793  	// cond: x.Uses == 1
  6794  	// result: (LessThanNoov (CMNWconst [int32(c)] y))
  6795  	for {
  6796  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6797  			break
  6798  		}
  6799  		x := v_0.Args[0]
  6800  		if x.Op != OpARM64ADDconst {
  6801  			break
  6802  		}
  6803  		c := auxIntToInt64(x.AuxInt)
  6804  		y := x.Args[0]
  6805  		if !(x.Uses == 1) {
  6806  			break
  6807  		}
  6808  		v.reset(OpARM64LessThanNoov)
  6809  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
  6810  		v0.AuxInt = int32ToAuxInt(int32(c))
  6811  		v0.AddArg(y)
  6812  		v.AddArg(v0)
  6813  		return true
  6814  	}
  6815  	// match: (LessThan (CMPconst [0] z:(ADD x y)))
  6816  	// cond: z.Uses == 1
  6817  	// result: (LessThanNoov (CMN x y))
  6818  	for {
  6819  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6820  			break
  6821  		}
  6822  		z := v_0.Args[0]
  6823  		if z.Op != OpARM64ADD {
  6824  			break
  6825  		}
  6826  		y := z.Args[1]
  6827  		x := z.Args[0]
  6828  		if !(z.Uses == 1) {
  6829  			break
  6830  		}
  6831  		v.reset(OpARM64LessThanNoov)
  6832  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  6833  		v0.AddArg2(x, y)
  6834  		v.AddArg(v0)
  6835  		return true
  6836  	}
  6837  	// match: (LessThan (CMPWconst [0] z:(ADD x y)))
  6838  	// cond: z.Uses == 1
  6839  	// result: (LessThanNoov (CMNW x y))
  6840  	for {
  6841  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6842  			break
  6843  		}
  6844  		z := v_0.Args[0]
  6845  		if z.Op != OpARM64ADD {
  6846  			break
  6847  		}
  6848  		y := z.Args[1]
  6849  		x := z.Args[0]
  6850  		if !(z.Uses == 1) {
  6851  			break
  6852  		}
  6853  		v.reset(OpARM64LessThanNoov)
  6854  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  6855  		v0.AddArg2(x, y)
  6856  		v.AddArg(v0)
  6857  		return true
  6858  	}
  6859  	// match: (LessThan (CMPconst [0] z:(MADD a x y)))
  6860  	// cond: z.Uses == 1
  6861  	// result: (LessThanNoov (CMN a (MUL <x.Type> x y)))
  6862  	for {
  6863  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6864  			break
  6865  		}
  6866  		z := v_0.Args[0]
  6867  		if z.Op != OpARM64MADD {
  6868  			break
  6869  		}
  6870  		y := z.Args[2]
  6871  		a := z.Args[0]
  6872  		x := z.Args[1]
  6873  		if !(z.Uses == 1) {
  6874  			break
  6875  		}
  6876  		v.reset(OpARM64LessThanNoov)
  6877  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  6878  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  6879  		v1.AddArg2(x, y)
  6880  		v0.AddArg2(a, v1)
  6881  		v.AddArg(v0)
  6882  		return true
  6883  	}
  6884  	// match: (LessThan (CMPconst [0] z:(MSUB a x y)))
  6885  	// cond: z.Uses == 1
  6886  	// result: (LessThanNoov (CMP a (MUL <x.Type> x y)))
  6887  	for {
  6888  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6889  			break
  6890  		}
  6891  		z := v_0.Args[0]
  6892  		if z.Op != OpARM64MSUB {
  6893  			break
  6894  		}
  6895  		y := z.Args[2]
  6896  		a := z.Args[0]
  6897  		x := z.Args[1]
  6898  		if !(z.Uses == 1) {
  6899  			break
  6900  		}
  6901  		v.reset(OpARM64LessThanNoov)
  6902  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  6903  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  6904  		v1.AddArg2(x, y)
  6905  		v0.AddArg2(a, v1)
  6906  		v.AddArg(v0)
  6907  		return true
  6908  	}
  6909  	// match: (LessThan (CMPWconst [0] z:(MADDW a x y)))
  6910  	// cond: z.Uses == 1
  6911  	// result: (LessThanNoov (CMNW a (MULW <x.Type> x y)))
  6912  	for {
  6913  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6914  			break
  6915  		}
  6916  		z := v_0.Args[0]
  6917  		if z.Op != OpARM64MADDW {
  6918  			break
  6919  		}
  6920  		y := z.Args[2]
  6921  		a := z.Args[0]
  6922  		x := z.Args[1]
  6923  		if !(z.Uses == 1) {
  6924  			break
  6925  		}
  6926  		v.reset(OpARM64LessThanNoov)
  6927  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  6928  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  6929  		v1.AddArg2(x, y)
  6930  		v0.AddArg2(a, v1)
  6931  		v.AddArg(v0)
  6932  		return true
  6933  	}
  6934  	// match: (LessThan (CMPWconst [0] z:(MSUBW a x y)))
  6935  	// cond: z.Uses == 1
  6936  	// result: (LessThanNoov (CMPW a (MULW <x.Type> x y)))
  6937  	for {
  6938  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6939  			break
  6940  		}
  6941  		z := v_0.Args[0]
  6942  		if z.Op != OpARM64MSUBW {
  6943  			break
  6944  		}
  6945  		y := z.Args[2]
  6946  		a := z.Args[0]
  6947  		x := z.Args[1]
  6948  		if !(z.Uses == 1) {
  6949  			break
  6950  		}
  6951  		v.reset(OpARM64LessThanNoov)
  6952  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  6953  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  6954  		v1.AddArg2(x, y)
  6955  		v0.AddArg2(a, v1)
  6956  		v.AddArg(v0)
  6957  		return true
  6958  	}
  6959  	// match: (LessThan (FlagConstant [fc]))
  6960  	// result: (MOVDconst [b2i(fc.lt())])
  6961  	for {
  6962  		if v_0.Op != OpARM64FlagConstant {
  6963  			break
  6964  		}
  6965  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6966  		v.reset(OpARM64MOVDconst)
  6967  		v.AuxInt = int64ToAuxInt(b2i(fc.lt()))
  6968  		return true
  6969  	}
  6970  	// match: (LessThan (InvertFlags x))
  6971  	// result: (GreaterThan x)
  6972  	for {
  6973  		if v_0.Op != OpARM64InvertFlags {
  6974  			break
  6975  		}
  6976  		x := v_0.Args[0]
  6977  		v.reset(OpARM64GreaterThan)
  6978  		v.AddArg(x)
  6979  		return true
  6980  	}
  6981  	return false
  6982  }
  6983  func rewriteValueARM64_OpARM64LessThanF(v *Value) bool {
  6984  	v_0 := v.Args[0]
  6985  	// match: (LessThanF (InvertFlags x))
  6986  	// result: (GreaterThanF x)
  6987  	for {
  6988  		if v_0.Op != OpARM64InvertFlags {
  6989  			break
  6990  		}
  6991  		x := v_0.Args[0]
  6992  		v.reset(OpARM64GreaterThanF)
  6993  		v.AddArg(x)
  6994  		return true
  6995  	}
  6996  	return false
  6997  }
  6998  func rewriteValueARM64_OpARM64LessThanNoov(v *Value) bool {
  6999  	v_0 := v.Args[0]
  7000  	b := v.Block
  7001  	typ := &b.Func.Config.Types
  7002  	// match: (LessThanNoov (FlagConstant [fc]))
  7003  	// result: (MOVDconst [b2i(fc.ltNoov())])
  7004  	for {
  7005  		if v_0.Op != OpARM64FlagConstant {
  7006  			break
  7007  		}
  7008  		fc := auxIntToFlagConstant(v_0.AuxInt)
  7009  		v.reset(OpARM64MOVDconst)
  7010  		v.AuxInt = int64ToAuxInt(b2i(fc.ltNoov()))
  7011  		return true
  7012  	}
  7013  	// match: (LessThanNoov (InvertFlags x))
  7014  	// result: (CSEL0 [OpARM64NotEqual] (GreaterEqualNoov <typ.Bool> x) x)
  7015  	for {
  7016  		if v_0.Op != OpARM64InvertFlags {
  7017  			break
  7018  		}
  7019  		x := v_0.Args[0]
  7020  		v.reset(OpARM64CSEL0)
  7021  		v.AuxInt = opToAuxInt(OpARM64NotEqual)
  7022  		v0 := b.NewValue0(v.Pos, OpARM64GreaterEqualNoov, typ.Bool)
  7023  		v0.AddArg(x)
  7024  		v.AddArg2(v0, x)
  7025  		return true
  7026  	}
  7027  	return false
  7028  }
  7029  func rewriteValueARM64_OpARM64LessThanU(v *Value) bool {
  7030  	v_0 := v.Args[0]
  7031  	// match: (LessThanU (FlagConstant [fc]))
  7032  	// result: (MOVDconst [b2i(fc.ult())])
  7033  	for {
  7034  		if v_0.Op != OpARM64FlagConstant {
  7035  			break
  7036  		}
  7037  		fc := auxIntToFlagConstant(v_0.AuxInt)
  7038  		v.reset(OpARM64MOVDconst)
  7039  		v.AuxInt = int64ToAuxInt(b2i(fc.ult()))
  7040  		return true
  7041  	}
  7042  	// match: (LessThanU (InvertFlags x))
  7043  	// result: (GreaterThanU x)
  7044  	for {
  7045  		if v_0.Op != OpARM64InvertFlags {
  7046  			break
  7047  		}
  7048  		x := v_0.Args[0]
  7049  		v.reset(OpARM64GreaterThanU)
  7050  		v.AddArg(x)
  7051  		return true
  7052  	}
  7053  	return false
  7054  }
  7055  func rewriteValueARM64_OpARM64LoweredPanicBoundsCR(v *Value) bool {
  7056  	v_1 := v.Args[1]
  7057  	v_0 := v.Args[0]
  7058  	// match: (LoweredPanicBoundsCR [kind] {p} (MOVDconst [c]) mem)
  7059  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:p.C, Cy:c}} mem)
  7060  	for {
  7061  		kind := auxIntToInt64(v.AuxInt)
  7062  		p := auxToPanicBoundsC(v.Aux)
  7063  		if v_0.Op != OpARM64MOVDconst {
  7064  			break
  7065  		}
  7066  		c := auxIntToInt64(v_0.AuxInt)
  7067  		mem := v_1
  7068  		v.reset(OpARM64LoweredPanicBoundsCC)
  7069  		v.AuxInt = int64ToAuxInt(kind)
  7070  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: p.C, Cy: c})
  7071  		v.AddArg(mem)
  7072  		return true
  7073  	}
  7074  	return false
  7075  }
  7076  func rewriteValueARM64_OpARM64LoweredPanicBoundsRC(v *Value) bool {
  7077  	v_1 := v.Args[1]
  7078  	v_0 := v.Args[0]
  7079  	// match: (LoweredPanicBoundsRC [kind] {p} (MOVDconst [c]) mem)
  7080  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:c, Cy:p.C}} mem)
  7081  	for {
  7082  		kind := auxIntToInt64(v.AuxInt)
  7083  		p := auxToPanicBoundsC(v.Aux)
  7084  		if v_0.Op != OpARM64MOVDconst {
  7085  			break
  7086  		}
  7087  		c := auxIntToInt64(v_0.AuxInt)
  7088  		mem := v_1
  7089  		v.reset(OpARM64LoweredPanicBoundsCC)
  7090  		v.AuxInt = int64ToAuxInt(kind)
  7091  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: c, Cy: p.C})
  7092  		v.AddArg(mem)
  7093  		return true
  7094  	}
  7095  	return false
  7096  }
  7097  func rewriteValueARM64_OpARM64LoweredPanicBoundsRR(v *Value) bool {
  7098  	v_2 := v.Args[2]
  7099  	v_1 := v.Args[1]
  7100  	v_0 := v.Args[0]
  7101  	// match: (LoweredPanicBoundsRR [kind] x (MOVDconst [c]) mem)
  7102  	// result: (LoweredPanicBoundsRC [kind] x {PanicBoundsC{C:c}} mem)
  7103  	for {
  7104  		kind := auxIntToInt64(v.AuxInt)
  7105  		x := v_0
  7106  		if v_1.Op != OpARM64MOVDconst {
  7107  			break
  7108  		}
  7109  		c := auxIntToInt64(v_1.AuxInt)
  7110  		mem := v_2
  7111  		v.reset(OpARM64LoweredPanicBoundsRC)
  7112  		v.AuxInt = int64ToAuxInt(kind)
  7113  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  7114  		v.AddArg2(x, mem)
  7115  		return true
  7116  	}
  7117  	// match: (LoweredPanicBoundsRR [kind] (MOVDconst [c]) y mem)
  7118  	// result: (LoweredPanicBoundsCR [kind] {PanicBoundsC{C:c}} y mem)
  7119  	for {
  7120  		kind := auxIntToInt64(v.AuxInt)
  7121  		if v_0.Op != OpARM64MOVDconst {
  7122  			break
  7123  		}
  7124  		c := auxIntToInt64(v_0.AuxInt)
  7125  		y := v_1
  7126  		mem := v_2
  7127  		v.reset(OpARM64LoweredPanicBoundsCR)
  7128  		v.AuxInt = int64ToAuxInt(kind)
  7129  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  7130  		v.AddArg2(y, mem)
  7131  		return true
  7132  	}
  7133  	return false
  7134  }
  7135  func rewriteValueARM64_OpARM64MADD(v *Value) bool {
  7136  	v_2 := v.Args[2]
  7137  	v_1 := v.Args[1]
  7138  	v_0 := v.Args[0]
  7139  	b := v.Block
  7140  	// match: (MADD a x (MOVDconst [-1]))
  7141  	// result: (SUB a x)
  7142  	for {
  7143  		a := v_0
  7144  		x := v_1
  7145  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != -1 {
  7146  			break
  7147  		}
  7148  		v.reset(OpARM64SUB)
  7149  		v.AddArg2(a, x)
  7150  		return true
  7151  	}
  7152  	// match: (MADD a _ (MOVDconst [0]))
  7153  	// result: a
  7154  	for {
  7155  		a := v_0
  7156  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
  7157  			break
  7158  		}
  7159  		v.copyOf(a)
  7160  		return true
  7161  	}
  7162  	// match: (MADD a x (MOVDconst [1]))
  7163  	// result: (ADD a x)
  7164  	for {
  7165  		a := v_0
  7166  		x := v_1
  7167  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 1 {
  7168  			break
  7169  		}
  7170  		v.reset(OpARM64ADD)
  7171  		v.AddArg2(a, x)
  7172  		return true
  7173  	}
  7174  	// match: (MADD a x (MOVDconst [c]))
  7175  	// cond: isPowerOfTwo(c)
  7176  	// result: (ADDshiftLL a x [log64(c)])
  7177  	for {
  7178  		a := v_0
  7179  		x := v_1
  7180  		if v_2.Op != OpARM64MOVDconst {
  7181  			break
  7182  		}
  7183  		c := auxIntToInt64(v_2.AuxInt)
  7184  		if !(isPowerOfTwo(c)) {
  7185  			break
  7186  		}
  7187  		v.reset(OpARM64ADDshiftLL)
  7188  		v.AuxInt = int64ToAuxInt(log64(c))
  7189  		v.AddArg2(a, x)
  7190  		return true
  7191  	}
  7192  	// match: (MADD a x (MOVDconst [c]))
  7193  	// cond: isPowerOfTwo(c-1) && c>=3
  7194  	// result: (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
  7195  	for {
  7196  		a := v_0
  7197  		x := v_1
  7198  		if v_2.Op != OpARM64MOVDconst {
  7199  			break
  7200  		}
  7201  		c := auxIntToInt64(v_2.AuxInt)
  7202  		if !(isPowerOfTwo(c-1) && c >= 3) {
  7203  			break
  7204  		}
  7205  		v.reset(OpARM64ADD)
  7206  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7207  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
  7208  		v0.AddArg2(x, x)
  7209  		v.AddArg2(a, v0)
  7210  		return true
  7211  	}
  7212  	// match: (MADD a x (MOVDconst [c]))
  7213  	// cond: isPowerOfTwo(c+1) && c>=7
  7214  	// result: (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
  7215  	for {
  7216  		a := v_0
  7217  		x := v_1
  7218  		if v_2.Op != OpARM64MOVDconst {
  7219  			break
  7220  		}
  7221  		c := auxIntToInt64(v_2.AuxInt)
  7222  		if !(isPowerOfTwo(c+1) && c >= 7) {
  7223  			break
  7224  		}
  7225  		v.reset(OpARM64SUB)
  7226  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7227  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
  7228  		v0.AddArg2(x, x)
  7229  		v.AddArg2(a, v0)
  7230  		return true
  7231  	}
  7232  	// match: (MADD a x (MOVDconst [c]))
  7233  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
  7234  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
  7235  	for {
  7236  		a := v_0
  7237  		x := v_1
  7238  		if v_2.Op != OpARM64MOVDconst {
  7239  			break
  7240  		}
  7241  		c := auxIntToInt64(v_2.AuxInt)
  7242  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
  7243  			break
  7244  		}
  7245  		v.reset(OpARM64SUBshiftLL)
  7246  		v.AuxInt = int64ToAuxInt(log64(c / 3))
  7247  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7248  		v0.AuxInt = int64ToAuxInt(2)
  7249  		v0.AddArg2(x, x)
  7250  		v.AddArg2(a, v0)
  7251  		return true
  7252  	}
  7253  	// match: (MADD a x (MOVDconst [c]))
  7254  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
  7255  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
  7256  	for {
  7257  		a := v_0
  7258  		x := v_1
  7259  		if v_2.Op != OpARM64MOVDconst {
  7260  			break
  7261  		}
  7262  		c := auxIntToInt64(v_2.AuxInt)
  7263  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
  7264  			break
  7265  		}
  7266  		v.reset(OpARM64ADDshiftLL)
  7267  		v.AuxInt = int64ToAuxInt(log64(c / 5))
  7268  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7269  		v0.AuxInt = int64ToAuxInt(2)
  7270  		v0.AddArg2(x, x)
  7271  		v.AddArg2(a, v0)
  7272  		return true
  7273  	}
  7274  	// match: (MADD a x (MOVDconst [c]))
  7275  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
  7276  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
  7277  	for {
  7278  		a := v_0
  7279  		x := v_1
  7280  		if v_2.Op != OpARM64MOVDconst {
  7281  			break
  7282  		}
  7283  		c := auxIntToInt64(v_2.AuxInt)
  7284  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
  7285  			break
  7286  		}
  7287  		v.reset(OpARM64SUBshiftLL)
  7288  		v.AuxInt = int64ToAuxInt(log64(c / 7))
  7289  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7290  		v0.AuxInt = int64ToAuxInt(3)
  7291  		v0.AddArg2(x, x)
  7292  		v.AddArg2(a, v0)
  7293  		return true
  7294  	}
  7295  	// match: (MADD a x (MOVDconst [c]))
  7296  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
  7297  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
  7298  	for {
  7299  		a := v_0
  7300  		x := v_1
  7301  		if v_2.Op != OpARM64MOVDconst {
  7302  			break
  7303  		}
  7304  		c := auxIntToInt64(v_2.AuxInt)
  7305  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
  7306  			break
  7307  		}
  7308  		v.reset(OpARM64ADDshiftLL)
  7309  		v.AuxInt = int64ToAuxInt(log64(c / 9))
  7310  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7311  		v0.AuxInt = int64ToAuxInt(3)
  7312  		v0.AddArg2(x, x)
  7313  		v.AddArg2(a, v0)
  7314  		return true
  7315  	}
  7316  	// match: (MADD a (MOVDconst [-1]) x)
  7317  	// result: (SUB a x)
  7318  	for {
  7319  		a := v_0
  7320  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  7321  			break
  7322  		}
  7323  		x := v_2
  7324  		v.reset(OpARM64SUB)
  7325  		v.AddArg2(a, x)
  7326  		return true
  7327  	}
  7328  	// match: (MADD a (MOVDconst [0]) _)
  7329  	// result: a
  7330  	for {
  7331  		a := v_0
  7332  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7333  			break
  7334  		}
  7335  		v.copyOf(a)
  7336  		return true
  7337  	}
  7338  	// match: (MADD a (MOVDconst [1]) x)
  7339  	// result: (ADD a x)
  7340  	for {
  7341  		a := v_0
  7342  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
  7343  			break
  7344  		}
  7345  		x := v_2
  7346  		v.reset(OpARM64ADD)
  7347  		v.AddArg2(a, x)
  7348  		return true
  7349  	}
  7350  	// match: (MADD a (MOVDconst [c]) x)
  7351  	// cond: isPowerOfTwo(c)
  7352  	// result: (ADDshiftLL a x [log64(c)])
  7353  	for {
  7354  		a := v_0
  7355  		if v_1.Op != OpARM64MOVDconst {
  7356  			break
  7357  		}
  7358  		c := auxIntToInt64(v_1.AuxInt)
  7359  		x := v_2
  7360  		if !(isPowerOfTwo(c)) {
  7361  			break
  7362  		}
  7363  		v.reset(OpARM64ADDshiftLL)
  7364  		v.AuxInt = int64ToAuxInt(log64(c))
  7365  		v.AddArg2(a, x)
  7366  		return true
  7367  	}
  7368  	// match: (MADD a (MOVDconst [c]) x)
  7369  	// cond: isPowerOfTwo(c-1) && c>=3
  7370  	// result: (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
  7371  	for {
  7372  		a := v_0
  7373  		if v_1.Op != OpARM64MOVDconst {
  7374  			break
  7375  		}
  7376  		c := auxIntToInt64(v_1.AuxInt)
  7377  		x := v_2
  7378  		if !(isPowerOfTwo(c-1) && c >= 3) {
  7379  			break
  7380  		}
  7381  		v.reset(OpARM64ADD)
  7382  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7383  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
  7384  		v0.AddArg2(x, x)
  7385  		v.AddArg2(a, v0)
  7386  		return true
  7387  	}
  7388  	// match: (MADD a (MOVDconst [c]) x)
  7389  	// cond: isPowerOfTwo(c+1) && c>=7
  7390  	// result: (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
  7391  	for {
  7392  		a := v_0
  7393  		if v_1.Op != OpARM64MOVDconst {
  7394  			break
  7395  		}
  7396  		c := auxIntToInt64(v_1.AuxInt)
  7397  		x := v_2
  7398  		if !(isPowerOfTwo(c+1) && c >= 7) {
  7399  			break
  7400  		}
  7401  		v.reset(OpARM64SUB)
  7402  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7403  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
  7404  		v0.AddArg2(x, x)
  7405  		v.AddArg2(a, v0)
  7406  		return true
  7407  	}
  7408  	// match: (MADD a (MOVDconst [c]) x)
  7409  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
  7410  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
  7411  	for {
  7412  		a := v_0
  7413  		if v_1.Op != OpARM64MOVDconst {
  7414  			break
  7415  		}
  7416  		c := auxIntToInt64(v_1.AuxInt)
  7417  		x := v_2
  7418  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
  7419  			break
  7420  		}
  7421  		v.reset(OpARM64SUBshiftLL)
  7422  		v.AuxInt = int64ToAuxInt(log64(c / 3))
  7423  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7424  		v0.AuxInt = int64ToAuxInt(2)
  7425  		v0.AddArg2(x, x)
  7426  		v.AddArg2(a, v0)
  7427  		return true
  7428  	}
  7429  	// match: (MADD a (MOVDconst [c]) x)
  7430  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
  7431  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
  7432  	for {
  7433  		a := v_0
  7434  		if v_1.Op != OpARM64MOVDconst {
  7435  			break
  7436  		}
  7437  		c := auxIntToInt64(v_1.AuxInt)
  7438  		x := v_2
  7439  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
  7440  			break
  7441  		}
  7442  		v.reset(OpARM64ADDshiftLL)
  7443  		v.AuxInt = int64ToAuxInt(log64(c / 5))
  7444  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7445  		v0.AuxInt = int64ToAuxInt(2)
  7446  		v0.AddArg2(x, x)
  7447  		v.AddArg2(a, v0)
  7448  		return true
  7449  	}
  7450  	// match: (MADD a (MOVDconst [c]) x)
  7451  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
  7452  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
  7453  	for {
  7454  		a := v_0
  7455  		if v_1.Op != OpARM64MOVDconst {
  7456  			break
  7457  		}
  7458  		c := auxIntToInt64(v_1.AuxInt)
  7459  		x := v_2
  7460  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
  7461  			break
  7462  		}
  7463  		v.reset(OpARM64SUBshiftLL)
  7464  		v.AuxInt = int64ToAuxInt(log64(c / 7))
  7465  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7466  		v0.AuxInt = int64ToAuxInt(3)
  7467  		v0.AddArg2(x, x)
  7468  		v.AddArg2(a, v0)
  7469  		return true
  7470  	}
  7471  	// match: (MADD a (MOVDconst [c]) x)
  7472  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
  7473  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
  7474  	for {
  7475  		a := v_0
  7476  		if v_1.Op != OpARM64MOVDconst {
  7477  			break
  7478  		}
  7479  		c := auxIntToInt64(v_1.AuxInt)
  7480  		x := v_2
  7481  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
  7482  			break
  7483  		}
  7484  		v.reset(OpARM64ADDshiftLL)
  7485  		v.AuxInt = int64ToAuxInt(log64(c / 9))
  7486  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7487  		v0.AuxInt = int64ToAuxInt(3)
  7488  		v0.AddArg2(x, x)
  7489  		v.AddArg2(a, v0)
  7490  		return true
  7491  	}
  7492  	// match: (MADD (MOVDconst [c]) x y)
  7493  	// result: (ADDconst [c] (MUL <x.Type> x y))
  7494  	for {
  7495  		if v_0.Op != OpARM64MOVDconst {
  7496  			break
  7497  		}
  7498  		c := auxIntToInt64(v_0.AuxInt)
  7499  		x := v_1
  7500  		y := v_2
  7501  		v.reset(OpARM64ADDconst)
  7502  		v.AuxInt = int64ToAuxInt(c)
  7503  		v0 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  7504  		v0.AddArg2(x, y)
  7505  		v.AddArg(v0)
  7506  		return true
  7507  	}
  7508  	// match: (MADD a (MOVDconst [c]) (MOVDconst [d]))
  7509  	// result: (ADDconst [c*d] a)
  7510  	for {
  7511  		a := v_0
  7512  		if v_1.Op != OpARM64MOVDconst {
  7513  			break
  7514  		}
  7515  		c := auxIntToInt64(v_1.AuxInt)
  7516  		if v_2.Op != OpARM64MOVDconst {
  7517  			break
  7518  		}
  7519  		d := auxIntToInt64(v_2.AuxInt)
  7520  		v.reset(OpARM64ADDconst)
  7521  		v.AuxInt = int64ToAuxInt(c * d)
  7522  		v.AddArg(a)
  7523  		return true
  7524  	}
  7525  	return false
  7526  }
  7527  func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
  7528  	v_2 := v.Args[2]
  7529  	v_1 := v.Args[1]
  7530  	v_0 := v.Args[0]
  7531  	b := v.Block
  7532  	// match: (MADDW a x (MOVDconst [c]))
  7533  	// cond: int32(c)==-1
  7534  	// result: (MOVWUreg (SUB <a.Type> a x))
  7535  	for {
  7536  		a := v_0
  7537  		x := v_1
  7538  		if v_2.Op != OpARM64MOVDconst {
  7539  			break
  7540  		}
  7541  		c := auxIntToInt64(v_2.AuxInt)
  7542  		if !(int32(c) == -1) {
  7543  			break
  7544  		}
  7545  		v.reset(OpARM64MOVWUreg)
  7546  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7547  		v0.AddArg2(a, x)
  7548  		v.AddArg(v0)
  7549  		return true
  7550  	}
  7551  	// match: (MADDW a _ (MOVDconst [c]))
  7552  	// cond: int32(c)==0
  7553  	// result: (MOVWUreg a)
  7554  	for {
  7555  		a := v_0
  7556  		if v_2.Op != OpARM64MOVDconst {
  7557  			break
  7558  		}
  7559  		c := auxIntToInt64(v_2.AuxInt)
  7560  		if !(int32(c) == 0) {
  7561  			break
  7562  		}
  7563  		v.reset(OpARM64MOVWUreg)
  7564  		v.AddArg(a)
  7565  		return true
  7566  	}
  7567  	// match: (MADDW a x (MOVDconst [c]))
  7568  	// cond: int32(c)==1
  7569  	// result: (MOVWUreg (ADD <a.Type> a x))
  7570  	for {
  7571  		a := v_0
  7572  		x := v_1
  7573  		if v_2.Op != OpARM64MOVDconst {
  7574  			break
  7575  		}
  7576  		c := auxIntToInt64(v_2.AuxInt)
  7577  		if !(int32(c) == 1) {
  7578  			break
  7579  		}
  7580  		v.reset(OpARM64MOVWUreg)
  7581  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7582  		v0.AddArg2(a, x)
  7583  		v.AddArg(v0)
  7584  		return true
  7585  	}
  7586  	// match: (MADDW a x (MOVDconst [c]))
  7587  	// cond: isPowerOfTwo(c)
  7588  	// result: (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
  7589  	for {
  7590  		a := v_0
  7591  		x := v_1
  7592  		if v_2.Op != OpARM64MOVDconst {
  7593  			break
  7594  		}
  7595  		c := auxIntToInt64(v_2.AuxInt)
  7596  		if !(isPowerOfTwo(c)) {
  7597  			break
  7598  		}
  7599  		v.reset(OpARM64MOVWUreg)
  7600  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7601  		v0.AuxInt = int64ToAuxInt(log64(c))
  7602  		v0.AddArg2(a, x)
  7603  		v.AddArg(v0)
  7604  		return true
  7605  	}
  7606  	// match: (MADDW a x (MOVDconst [c]))
  7607  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
  7608  	// result: (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
  7609  	for {
  7610  		a := v_0
  7611  		x := v_1
  7612  		if v_2.Op != OpARM64MOVDconst {
  7613  			break
  7614  		}
  7615  		c := auxIntToInt64(v_2.AuxInt)
  7616  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
  7617  			break
  7618  		}
  7619  		v.reset(OpARM64MOVWUreg)
  7620  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7621  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7622  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
  7623  		v1.AddArg2(x, x)
  7624  		v0.AddArg2(a, v1)
  7625  		v.AddArg(v0)
  7626  		return true
  7627  	}
  7628  	// match: (MADDW a x (MOVDconst [c]))
  7629  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
  7630  	// result: (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
  7631  	for {
  7632  		a := v_0
  7633  		x := v_1
  7634  		if v_2.Op != OpARM64MOVDconst {
  7635  			break
  7636  		}
  7637  		c := auxIntToInt64(v_2.AuxInt)
  7638  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
  7639  			break
  7640  		}
  7641  		v.reset(OpARM64MOVWUreg)
  7642  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7643  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7644  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
  7645  		v1.AddArg2(x, x)
  7646  		v0.AddArg2(a, v1)
  7647  		v.AddArg(v0)
  7648  		return true
  7649  	}
  7650  	// match: (MADDW a x (MOVDconst [c]))
  7651  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
  7652  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
  7653  	for {
  7654  		a := v_0
  7655  		x := v_1
  7656  		if v_2.Op != OpARM64MOVDconst {
  7657  			break
  7658  		}
  7659  		c := auxIntToInt64(v_2.AuxInt)
  7660  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
  7661  			break
  7662  		}
  7663  		v.reset(OpARM64MOVWUreg)
  7664  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7665  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
  7666  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7667  		v1.AuxInt = int64ToAuxInt(2)
  7668  		v1.AddArg2(x, x)
  7669  		v0.AddArg2(a, v1)
  7670  		v.AddArg(v0)
  7671  		return true
  7672  	}
  7673  	// match: (MADDW a x (MOVDconst [c]))
  7674  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
  7675  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
  7676  	for {
  7677  		a := v_0
  7678  		x := v_1
  7679  		if v_2.Op != OpARM64MOVDconst {
  7680  			break
  7681  		}
  7682  		c := auxIntToInt64(v_2.AuxInt)
  7683  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
  7684  			break
  7685  		}
  7686  		v.reset(OpARM64MOVWUreg)
  7687  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7688  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
  7689  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7690  		v1.AuxInt = int64ToAuxInt(2)
  7691  		v1.AddArg2(x, x)
  7692  		v0.AddArg2(a, v1)
  7693  		v.AddArg(v0)
  7694  		return true
  7695  	}
  7696  	// match: (MADDW a x (MOVDconst [c]))
  7697  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
  7698  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
  7699  	for {
  7700  		a := v_0
  7701  		x := v_1
  7702  		if v_2.Op != OpARM64MOVDconst {
  7703  			break
  7704  		}
  7705  		c := auxIntToInt64(v_2.AuxInt)
  7706  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
  7707  			break
  7708  		}
  7709  		v.reset(OpARM64MOVWUreg)
  7710  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7711  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
  7712  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7713  		v1.AuxInt = int64ToAuxInt(3)
  7714  		v1.AddArg2(x, x)
  7715  		v0.AddArg2(a, v1)
  7716  		v.AddArg(v0)
  7717  		return true
  7718  	}
  7719  	// match: (MADDW a x (MOVDconst [c]))
  7720  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
  7721  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
  7722  	for {
  7723  		a := v_0
  7724  		x := v_1
  7725  		if v_2.Op != OpARM64MOVDconst {
  7726  			break
  7727  		}
  7728  		c := auxIntToInt64(v_2.AuxInt)
  7729  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
  7730  			break
  7731  		}
  7732  		v.reset(OpARM64MOVWUreg)
  7733  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7734  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
  7735  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7736  		v1.AuxInt = int64ToAuxInt(3)
  7737  		v1.AddArg2(x, x)
  7738  		v0.AddArg2(a, v1)
  7739  		v.AddArg(v0)
  7740  		return true
  7741  	}
  7742  	// match: (MADDW a (MOVDconst [c]) x)
  7743  	// cond: int32(c)==-1
  7744  	// result: (MOVWUreg (SUB <a.Type> a x))
  7745  	for {
  7746  		a := v_0
  7747  		if v_1.Op != OpARM64MOVDconst {
  7748  			break
  7749  		}
  7750  		c := auxIntToInt64(v_1.AuxInt)
  7751  		x := v_2
  7752  		if !(int32(c) == -1) {
  7753  			break
  7754  		}
  7755  		v.reset(OpARM64MOVWUreg)
  7756  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7757  		v0.AddArg2(a, x)
  7758  		v.AddArg(v0)
  7759  		return true
  7760  	}
  7761  	// match: (MADDW a (MOVDconst [c]) _)
  7762  	// cond: int32(c)==0
  7763  	// result: (MOVWUreg a)
  7764  	for {
  7765  		a := v_0
  7766  		if v_1.Op != OpARM64MOVDconst {
  7767  			break
  7768  		}
  7769  		c := auxIntToInt64(v_1.AuxInt)
  7770  		if !(int32(c) == 0) {
  7771  			break
  7772  		}
  7773  		v.reset(OpARM64MOVWUreg)
  7774  		v.AddArg(a)
  7775  		return true
  7776  	}
  7777  	// match: (MADDW a (MOVDconst [c]) x)
  7778  	// cond: int32(c)==1
  7779  	// result: (MOVWUreg (ADD <a.Type> a x))
  7780  	for {
  7781  		a := v_0
  7782  		if v_1.Op != OpARM64MOVDconst {
  7783  			break
  7784  		}
  7785  		c := auxIntToInt64(v_1.AuxInt)
  7786  		x := v_2
  7787  		if !(int32(c) == 1) {
  7788  			break
  7789  		}
  7790  		v.reset(OpARM64MOVWUreg)
  7791  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7792  		v0.AddArg2(a, x)
  7793  		v.AddArg(v0)
  7794  		return true
  7795  	}
  7796  	// match: (MADDW a (MOVDconst [c]) x)
  7797  	// cond: isPowerOfTwo(c)
  7798  	// result: (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
  7799  	for {
  7800  		a := v_0
  7801  		if v_1.Op != OpARM64MOVDconst {
  7802  			break
  7803  		}
  7804  		c := auxIntToInt64(v_1.AuxInt)
  7805  		x := v_2
  7806  		if !(isPowerOfTwo(c)) {
  7807  			break
  7808  		}
  7809  		v.reset(OpARM64MOVWUreg)
  7810  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7811  		v0.AuxInt = int64ToAuxInt(log64(c))
  7812  		v0.AddArg2(a, x)
  7813  		v.AddArg(v0)
  7814  		return true
  7815  	}
  7816  	// match: (MADDW a (MOVDconst [c]) x)
  7817  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
  7818  	// result: (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
  7819  	for {
  7820  		a := v_0
  7821  		if v_1.Op != OpARM64MOVDconst {
  7822  			break
  7823  		}
  7824  		c := auxIntToInt64(v_1.AuxInt)
  7825  		x := v_2
  7826  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
  7827  			break
  7828  		}
  7829  		v.reset(OpARM64MOVWUreg)
  7830  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7831  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7832  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
  7833  		v1.AddArg2(x, x)
  7834  		v0.AddArg2(a, v1)
  7835  		v.AddArg(v0)
  7836  		return true
  7837  	}
  7838  	// match: (MADDW a (MOVDconst [c]) x)
  7839  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
  7840  	// result: (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
  7841  	for {
  7842  		a := v_0
  7843  		if v_1.Op != OpARM64MOVDconst {
  7844  			break
  7845  		}
  7846  		c := auxIntToInt64(v_1.AuxInt)
  7847  		x := v_2
  7848  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
  7849  			break
  7850  		}
  7851  		v.reset(OpARM64MOVWUreg)
  7852  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7853  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7854  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
  7855  		v1.AddArg2(x, x)
  7856  		v0.AddArg2(a, v1)
  7857  		v.AddArg(v0)
  7858  		return true
  7859  	}
  7860  	// match: (MADDW a (MOVDconst [c]) x)
  7861  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
  7862  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
  7863  	for {
  7864  		a := v_0
  7865  		if v_1.Op != OpARM64MOVDconst {
  7866  			break
  7867  		}
  7868  		c := auxIntToInt64(v_1.AuxInt)
  7869  		x := v_2
  7870  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
  7871  			break
  7872  		}
  7873  		v.reset(OpARM64MOVWUreg)
  7874  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7875  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
  7876  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7877  		v1.AuxInt = int64ToAuxInt(2)
  7878  		v1.AddArg2(x, x)
  7879  		v0.AddArg2(a, v1)
  7880  		v.AddArg(v0)
  7881  		return true
  7882  	}
  7883  	// match: (MADDW a (MOVDconst [c]) x)
  7884  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
  7885  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
  7886  	for {
  7887  		a := v_0
  7888  		if v_1.Op != OpARM64MOVDconst {
  7889  			break
  7890  		}
  7891  		c := auxIntToInt64(v_1.AuxInt)
  7892  		x := v_2
  7893  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
  7894  			break
  7895  		}
  7896  		v.reset(OpARM64MOVWUreg)
  7897  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7898  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
  7899  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7900  		v1.AuxInt = int64ToAuxInt(2)
  7901  		v1.AddArg2(x, x)
  7902  		v0.AddArg2(a, v1)
  7903  		v.AddArg(v0)
  7904  		return true
  7905  	}
  7906  	// match: (MADDW a (MOVDconst [c]) x)
  7907  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
  7908  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
  7909  	for {
  7910  		a := v_0
  7911  		if v_1.Op != OpARM64MOVDconst {
  7912  			break
  7913  		}
  7914  		c := auxIntToInt64(v_1.AuxInt)
  7915  		x := v_2
  7916  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
  7917  			break
  7918  		}
  7919  		v.reset(OpARM64MOVWUreg)
  7920  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7921  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
  7922  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7923  		v1.AuxInt = int64ToAuxInt(3)
  7924  		v1.AddArg2(x, x)
  7925  		v0.AddArg2(a, v1)
  7926  		v.AddArg(v0)
  7927  		return true
  7928  	}
  7929  	// match: (MADDW a (MOVDconst [c]) x)
  7930  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
  7931  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
  7932  	for {
  7933  		a := v_0
  7934  		if v_1.Op != OpARM64MOVDconst {
  7935  			break
  7936  		}
  7937  		c := auxIntToInt64(v_1.AuxInt)
  7938  		x := v_2
  7939  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
  7940  			break
  7941  		}
  7942  		v.reset(OpARM64MOVWUreg)
  7943  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7944  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
  7945  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7946  		v1.AuxInt = int64ToAuxInt(3)
  7947  		v1.AddArg2(x, x)
  7948  		v0.AddArg2(a, v1)
  7949  		v.AddArg(v0)
  7950  		return true
  7951  	}
  7952  	// match: (MADDW (MOVDconst [c]) x y)
  7953  	// result: (MOVWUreg (ADDconst <x.Type> [c] (MULW <x.Type> x y)))
  7954  	for {
  7955  		if v_0.Op != OpARM64MOVDconst {
  7956  			break
  7957  		}
  7958  		c := auxIntToInt64(v_0.AuxInt)
  7959  		x := v_1
  7960  		y := v_2
  7961  		v.reset(OpARM64MOVWUreg)
  7962  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, x.Type)
  7963  		v0.AuxInt = int64ToAuxInt(c)
  7964  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  7965  		v1.AddArg2(x, y)
  7966  		v0.AddArg(v1)
  7967  		v.AddArg(v0)
  7968  		return true
  7969  	}
  7970  	// match: (MADDW a (MOVDconst [c]) (MOVDconst [d]))
  7971  	// result: (MOVWUreg (ADDconst <a.Type> [c*d] a))
  7972  	for {
  7973  		a := v_0
  7974  		if v_1.Op != OpARM64MOVDconst {
  7975  			break
  7976  		}
  7977  		c := auxIntToInt64(v_1.AuxInt)
  7978  		if v_2.Op != OpARM64MOVDconst {
  7979  			break
  7980  		}
  7981  		d := auxIntToInt64(v_2.AuxInt)
  7982  		v.reset(OpARM64MOVWUreg)
  7983  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, a.Type)
  7984  		v0.AuxInt = int64ToAuxInt(c * d)
  7985  		v0.AddArg(a)
  7986  		v.AddArg(v0)
  7987  		return true
  7988  	}
  7989  	return false
  7990  }
  7991  func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
  7992  	v_1 := v.Args[1]
  7993  	v_0 := v.Args[0]
  7994  	b := v.Block
  7995  	// match: (MNEG x (MOVDconst [-1]))
  7996  	// result: x
  7997  	for {
  7998  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7999  			x := v_0
  8000  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  8001  				continue
  8002  			}
  8003  			v.copyOf(x)
  8004  			return true
  8005  		}
  8006  		break
  8007  	}
  8008  	// match: (MNEG _ (MOVDconst [0]))
  8009  	// result: (MOVDconst [0])
  8010  	for {
  8011  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8012  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  8013  				continue
  8014  			}
  8015  			v.reset(OpARM64MOVDconst)
  8016  			v.AuxInt = int64ToAuxInt(0)
  8017  			return true
  8018  		}
  8019  		break
  8020  	}
  8021  	// match: (MNEG x (MOVDconst [1]))
  8022  	// result: (NEG x)
  8023  	for {
  8024  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8025  			x := v_0
  8026  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
  8027  				continue
  8028  			}
  8029  			v.reset(OpARM64NEG)
  8030  			v.AddArg(x)
  8031  			return true
  8032  		}
  8033  		break
  8034  	}
  8035  	// match: (MNEG x (MOVDconst [c]))
  8036  	// cond: isPowerOfTwo(c)
  8037  	// result: (NEG (SLLconst <x.Type> [log64(c)] x))
  8038  	for {
  8039  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8040  			x := v_0
  8041  			if v_1.Op != OpARM64MOVDconst {
  8042  				continue
  8043  			}
  8044  			c := auxIntToInt64(v_1.AuxInt)
  8045  			if !(isPowerOfTwo(c)) {
  8046  				continue
  8047  			}
  8048  			v.reset(OpARM64NEG)
  8049  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8050  			v0.AuxInt = int64ToAuxInt(log64(c))
  8051  			v0.AddArg(x)
  8052  			v.AddArg(v0)
  8053  			return true
  8054  		}
  8055  		break
  8056  	}
  8057  	// match: (MNEG x (MOVDconst [c]))
  8058  	// cond: isPowerOfTwo(c-1) && c >= 3
  8059  	// result: (NEG (ADDshiftLL <x.Type> x x [log64(c-1)]))
  8060  	for {
  8061  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8062  			x := v_0
  8063  			if v_1.Op != OpARM64MOVDconst {
  8064  				continue
  8065  			}
  8066  			c := auxIntToInt64(v_1.AuxInt)
  8067  			if !(isPowerOfTwo(c-1) && c >= 3) {
  8068  				continue
  8069  			}
  8070  			v.reset(OpARM64NEG)
  8071  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8072  			v0.AuxInt = int64ToAuxInt(log64(c - 1))
  8073  			v0.AddArg2(x, x)
  8074  			v.AddArg(v0)
  8075  			return true
  8076  		}
  8077  		break
  8078  	}
  8079  	// match: (MNEG x (MOVDconst [c]))
  8080  	// cond: isPowerOfTwo(c+1) && c >= 7
  8081  	// result: (NEG (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)]))
  8082  	for {
  8083  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8084  			x := v_0
  8085  			if v_1.Op != OpARM64MOVDconst {
  8086  				continue
  8087  			}
  8088  			c := auxIntToInt64(v_1.AuxInt)
  8089  			if !(isPowerOfTwo(c+1) && c >= 7) {
  8090  				continue
  8091  			}
  8092  			v.reset(OpARM64NEG)
  8093  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8094  			v0.AuxInt = int64ToAuxInt(log64(c + 1))
  8095  			v1 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8096  			v1.AddArg(x)
  8097  			v0.AddArg2(v1, x)
  8098  			v.AddArg(v0)
  8099  			return true
  8100  		}
  8101  		break
  8102  	}
  8103  	// match: (MNEG x (MOVDconst [c]))
  8104  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
  8105  	// result: (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2]))
  8106  	for {
  8107  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8108  			x := v_0
  8109  			if v_1.Op != OpARM64MOVDconst {
  8110  				continue
  8111  			}
  8112  			c := auxIntToInt64(v_1.AuxInt)
  8113  			if !(c%3 == 0 && isPowerOfTwo(c/3)) {
  8114  				continue
  8115  			}
  8116  			v.reset(OpARM64SLLconst)
  8117  			v.Type = x.Type
  8118  			v.AuxInt = int64ToAuxInt(log64(c / 3))
  8119  			v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  8120  			v0.AuxInt = int64ToAuxInt(2)
  8121  			v0.AddArg2(x, x)
  8122  			v.AddArg(v0)
  8123  			return true
  8124  		}
  8125  		break
  8126  	}
  8127  	// match: (MNEG x (MOVDconst [c]))
  8128  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
  8129  	// result: (NEG (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2])))
  8130  	for {
  8131  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8132  			x := v_0
  8133  			if v_1.Op != OpARM64MOVDconst {
  8134  				continue
  8135  			}
  8136  			c := auxIntToInt64(v_1.AuxInt)
  8137  			if !(c%5 == 0 && isPowerOfTwo(c/5)) {
  8138  				continue
  8139  			}
  8140  			v.reset(OpARM64NEG)
  8141  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8142  			v0.AuxInt = int64ToAuxInt(log64(c / 5))
  8143  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8144  			v1.AuxInt = int64ToAuxInt(2)
  8145  			v1.AddArg2(x, x)
  8146  			v0.AddArg(v1)
  8147  			v.AddArg(v0)
  8148  			return true
  8149  		}
  8150  		break
  8151  	}
  8152  	// match: (MNEG x (MOVDconst [c]))
  8153  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
  8154  	// result: (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3]))
  8155  	for {
  8156  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8157  			x := v_0
  8158  			if v_1.Op != OpARM64MOVDconst {
  8159  				continue
  8160  			}
  8161  			c := auxIntToInt64(v_1.AuxInt)
  8162  			if !(c%7 == 0 && isPowerOfTwo(c/7)) {
  8163  				continue
  8164  			}
  8165  			v.reset(OpARM64SLLconst)
  8166  			v.Type = x.Type
  8167  			v.AuxInt = int64ToAuxInt(log64(c / 7))
  8168  			v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  8169  			v0.AuxInt = int64ToAuxInt(3)
  8170  			v0.AddArg2(x, x)
  8171  			v.AddArg(v0)
  8172  			return true
  8173  		}
  8174  		break
  8175  	}
  8176  	// match: (MNEG x (MOVDconst [c]))
  8177  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
  8178  	// result: (NEG (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3])))
  8179  	for {
  8180  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8181  			x := v_0
  8182  			if v_1.Op != OpARM64MOVDconst {
  8183  				continue
  8184  			}
  8185  			c := auxIntToInt64(v_1.AuxInt)
  8186  			if !(c%9 == 0 && isPowerOfTwo(c/9)) {
  8187  				continue
  8188  			}
  8189  			v.reset(OpARM64NEG)
  8190  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8191  			v0.AuxInt = int64ToAuxInt(log64(c / 9))
  8192  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8193  			v1.AuxInt = int64ToAuxInt(3)
  8194  			v1.AddArg2(x, x)
  8195  			v0.AddArg(v1)
  8196  			v.AddArg(v0)
  8197  			return true
  8198  		}
  8199  		break
  8200  	}
  8201  	// match: (MNEG (MOVDconst [c]) (MOVDconst [d]))
  8202  	// result: (MOVDconst [-c*d])
  8203  	for {
  8204  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8205  			if v_0.Op != OpARM64MOVDconst {
  8206  				continue
  8207  			}
  8208  			c := auxIntToInt64(v_0.AuxInt)
  8209  			if v_1.Op != OpARM64MOVDconst {
  8210  				continue
  8211  			}
  8212  			d := auxIntToInt64(v_1.AuxInt)
  8213  			v.reset(OpARM64MOVDconst)
  8214  			v.AuxInt = int64ToAuxInt(-c * d)
  8215  			return true
  8216  		}
  8217  		break
  8218  	}
  8219  	return false
  8220  }
  8221  func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
  8222  	v_1 := v.Args[1]
  8223  	v_0 := v.Args[0]
  8224  	b := v.Block
  8225  	// match: (MNEGW x (MOVDconst [c]))
  8226  	// cond: int32(c)==-1
  8227  	// result: (MOVWUreg x)
  8228  	for {
  8229  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8230  			x := v_0
  8231  			if v_1.Op != OpARM64MOVDconst {
  8232  				continue
  8233  			}
  8234  			c := auxIntToInt64(v_1.AuxInt)
  8235  			if !(int32(c) == -1) {
  8236  				continue
  8237  			}
  8238  			v.reset(OpARM64MOVWUreg)
  8239  			v.AddArg(x)
  8240  			return true
  8241  		}
  8242  		break
  8243  	}
  8244  	// match: (MNEGW _ (MOVDconst [c]))
  8245  	// cond: int32(c)==0
  8246  	// result: (MOVDconst [0])
  8247  	for {
  8248  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8249  			if v_1.Op != OpARM64MOVDconst {
  8250  				continue
  8251  			}
  8252  			c := auxIntToInt64(v_1.AuxInt)
  8253  			if !(int32(c) == 0) {
  8254  				continue
  8255  			}
  8256  			v.reset(OpARM64MOVDconst)
  8257  			v.AuxInt = int64ToAuxInt(0)
  8258  			return true
  8259  		}
  8260  		break
  8261  	}
  8262  	// match: (MNEGW x (MOVDconst [c]))
  8263  	// cond: int32(c)==1
  8264  	// result: (MOVWUreg (NEG <x.Type> x))
  8265  	for {
  8266  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8267  			x := v_0
  8268  			if v_1.Op != OpARM64MOVDconst {
  8269  				continue
  8270  			}
  8271  			c := auxIntToInt64(v_1.AuxInt)
  8272  			if !(int32(c) == 1) {
  8273  				continue
  8274  			}
  8275  			v.reset(OpARM64MOVWUreg)
  8276  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8277  			v0.AddArg(x)
  8278  			v.AddArg(v0)
  8279  			return true
  8280  		}
  8281  		break
  8282  	}
  8283  	// match: (MNEGW x (MOVDconst [c]))
  8284  	// cond: isPowerOfTwo(c)
  8285  	// result: (NEG (SLLconst <x.Type> [log64(c)] x))
  8286  	for {
  8287  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8288  			x := v_0
  8289  			if v_1.Op != OpARM64MOVDconst {
  8290  				continue
  8291  			}
  8292  			c := auxIntToInt64(v_1.AuxInt)
  8293  			if !(isPowerOfTwo(c)) {
  8294  				continue
  8295  			}
  8296  			v.reset(OpARM64NEG)
  8297  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8298  			v0.AuxInt = int64ToAuxInt(log64(c))
  8299  			v0.AddArg(x)
  8300  			v.AddArg(v0)
  8301  			return true
  8302  		}
  8303  		break
  8304  	}
  8305  	// match: (MNEGW x (MOVDconst [c]))
  8306  	// cond: isPowerOfTwo(c-1) && int32(c) >= 3
  8307  	// result: (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> x x [log64(c-1)])))
  8308  	for {
  8309  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8310  			x := v_0
  8311  			if v_1.Op != OpARM64MOVDconst {
  8312  				continue
  8313  			}
  8314  			c := auxIntToInt64(v_1.AuxInt)
  8315  			if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
  8316  				continue
  8317  			}
  8318  			v.reset(OpARM64MOVWUreg)
  8319  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8320  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8321  			v1.AuxInt = int64ToAuxInt(log64(c - 1))
  8322  			v1.AddArg2(x, x)
  8323  			v0.AddArg(v1)
  8324  			v.AddArg(v0)
  8325  			return true
  8326  		}
  8327  		break
  8328  	}
  8329  	// match: (MNEGW x (MOVDconst [c]))
  8330  	// cond: isPowerOfTwo(c+1) && int32(c) >= 7
  8331  	// result: (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)])))
  8332  	for {
  8333  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8334  			x := v_0
  8335  			if v_1.Op != OpARM64MOVDconst {
  8336  				continue
  8337  			}
  8338  			c := auxIntToInt64(v_1.AuxInt)
  8339  			if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
  8340  				continue
  8341  			}
  8342  			v.reset(OpARM64MOVWUreg)
  8343  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8344  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8345  			v1.AuxInt = int64ToAuxInt(log64(c + 1))
  8346  			v2 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8347  			v2.AddArg(x)
  8348  			v1.AddArg2(v2, x)
  8349  			v0.AddArg(v1)
  8350  			v.AddArg(v0)
  8351  			return true
  8352  		}
  8353  		break
  8354  	}
  8355  	// match: (MNEGW x (MOVDconst [c]))
  8356  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
  8357  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2])))
  8358  	for {
  8359  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8360  			x := v_0
  8361  			if v_1.Op != OpARM64MOVDconst {
  8362  				continue
  8363  			}
  8364  			c := auxIntToInt64(v_1.AuxInt)
  8365  			if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
  8366  				continue
  8367  			}
  8368  			v.reset(OpARM64MOVWUreg)
  8369  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8370  			v0.AuxInt = int64ToAuxInt(log64(c / 3))
  8371  			v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  8372  			v1.AuxInt = int64ToAuxInt(2)
  8373  			v1.AddArg2(x, x)
  8374  			v0.AddArg(v1)
  8375  			v.AddArg(v0)
  8376  			return true
  8377  		}
  8378  		break
  8379  	}
  8380  	// match: (MNEGW x (MOVDconst [c]))
  8381  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
  8382  	// result: (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2]))))
  8383  	for {
  8384  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8385  			x := v_0
  8386  			if v_1.Op != OpARM64MOVDconst {
  8387  				continue
  8388  			}
  8389  			c := auxIntToInt64(v_1.AuxInt)
  8390  			if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
  8391  				continue
  8392  			}
  8393  			v.reset(OpARM64MOVWUreg)
  8394  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8395  			v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8396  			v1.AuxInt = int64ToAuxInt(log64(c / 5))
  8397  			v2 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8398  			v2.AuxInt = int64ToAuxInt(2)
  8399  			v2.AddArg2(x, x)
  8400  			v1.AddArg(v2)
  8401  			v0.AddArg(v1)
  8402  			v.AddArg(v0)
  8403  			return true
  8404  		}
  8405  		break
  8406  	}
  8407  	// match: (MNEGW x (MOVDconst [c]))
  8408  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
  8409  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3])))
  8410  	for {
  8411  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8412  			x := v_0
  8413  			if v_1.Op != OpARM64MOVDconst {
  8414  				continue
  8415  			}
  8416  			c := auxIntToInt64(v_1.AuxInt)
  8417  			if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
  8418  				continue
  8419  			}
  8420  			v.reset(OpARM64MOVWUreg)
  8421  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8422  			v0.AuxInt = int64ToAuxInt(log64(c / 7))
  8423  			v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  8424  			v1.AuxInt = int64ToAuxInt(3)
  8425  			v1.AddArg2(x, x)
  8426  			v0.AddArg(v1)
  8427  			v.AddArg(v0)
  8428  			return true
  8429  		}
  8430  		break
  8431  	}
  8432  	// match: (MNEGW x (MOVDconst [c]))
  8433  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
  8434  	// result: (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3]))))
  8435  	for {
  8436  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8437  			x := v_0
  8438  			if v_1.Op != OpARM64MOVDconst {
  8439  				continue
  8440  			}
  8441  			c := auxIntToInt64(v_1.AuxInt)
  8442  			if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
  8443  				continue
  8444  			}
  8445  			v.reset(OpARM64MOVWUreg)
  8446  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8447  			v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8448  			v1.AuxInt = int64ToAuxInt(log64(c / 9))
  8449  			v2 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8450  			v2.AuxInt = int64ToAuxInt(3)
  8451  			v2.AddArg2(x, x)
  8452  			v1.AddArg(v2)
  8453  			v0.AddArg(v1)
  8454  			v.AddArg(v0)
  8455  			return true
  8456  		}
  8457  		break
  8458  	}
  8459  	// match: (MNEGW (MOVDconst [c]) (MOVDconst [d]))
  8460  	// result: (MOVDconst [int64(uint32(-c*d))])
  8461  	for {
  8462  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8463  			if v_0.Op != OpARM64MOVDconst {
  8464  				continue
  8465  			}
  8466  			c := auxIntToInt64(v_0.AuxInt)
  8467  			if v_1.Op != OpARM64MOVDconst {
  8468  				continue
  8469  			}
  8470  			d := auxIntToInt64(v_1.AuxInt)
  8471  			v.reset(OpARM64MOVDconst)
  8472  			v.AuxInt = int64ToAuxInt(int64(uint32(-c * d)))
  8473  			return true
  8474  		}
  8475  		break
  8476  	}
  8477  	return false
  8478  }
  8479  func rewriteValueARM64_OpARM64MOD(v *Value) bool {
  8480  	v_1 := v.Args[1]
  8481  	v_0 := v.Args[0]
  8482  	// match: (MOD (MOVDconst [c]) (MOVDconst [d]))
  8483  	// cond: d != 0
  8484  	// result: (MOVDconst [c%d])
  8485  	for {
  8486  		if v_0.Op != OpARM64MOVDconst {
  8487  			break
  8488  		}
  8489  		c := auxIntToInt64(v_0.AuxInt)
  8490  		if v_1.Op != OpARM64MOVDconst {
  8491  			break
  8492  		}
  8493  		d := auxIntToInt64(v_1.AuxInt)
  8494  		if !(d != 0) {
  8495  			break
  8496  		}
  8497  		v.reset(OpARM64MOVDconst)
  8498  		v.AuxInt = int64ToAuxInt(c % d)
  8499  		return true
  8500  	}
  8501  	return false
  8502  }
  8503  func rewriteValueARM64_OpARM64MODW(v *Value) bool {
  8504  	v_1 := v.Args[1]
  8505  	v_0 := v.Args[0]
  8506  	// match: (MODW (MOVDconst [c]) (MOVDconst [d]))
  8507  	// cond: d != 0
  8508  	// result: (MOVDconst [int64(uint32(int32(c)%int32(d)))])
  8509  	for {
  8510  		if v_0.Op != OpARM64MOVDconst {
  8511  			break
  8512  		}
  8513  		c := auxIntToInt64(v_0.AuxInt)
  8514  		if v_1.Op != OpARM64MOVDconst {
  8515  			break
  8516  		}
  8517  		d := auxIntToInt64(v_1.AuxInt)
  8518  		if !(d != 0) {
  8519  			break
  8520  		}
  8521  		v.reset(OpARM64MOVDconst)
  8522  		v.AuxInt = int64ToAuxInt(int64(uint32(int32(c) % int32(d))))
  8523  		return true
  8524  	}
  8525  	return false
  8526  }
  8527  func rewriteValueARM64_OpARM64MOVBUload(v *Value) bool {
  8528  	v_1 := v.Args[1]
  8529  	v_0 := v.Args[0]
  8530  	b := v.Block
  8531  	config := b.Func.Config
  8532  	// match: (MOVBUload [off1] {sym} (ADDconst [off2] ptr) mem)
  8533  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8534  	// result: (MOVBUload [off1+int32(off2)] {sym} ptr mem)
  8535  	for {
  8536  		off1 := auxIntToInt32(v.AuxInt)
  8537  		sym := auxToSym(v.Aux)
  8538  		if v_0.Op != OpARM64ADDconst {
  8539  			break
  8540  		}
  8541  		off2 := auxIntToInt64(v_0.AuxInt)
  8542  		ptr := v_0.Args[0]
  8543  		mem := v_1
  8544  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8545  			break
  8546  		}
  8547  		v.reset(OpARM64MOVBUload)
  8548  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8549  		v.Aux = symToAux(sym)
  8550  		v.AddArg2(ptr, mem)
  8551  		return true
  8552  	}
  8553  	// match: (MOVBUload [off] {sym} (ADD ptr idx) mem)
  8554  	// cond: off == 0 && sym == nil
  8555  	// result: (MOVBUloadidx ptr idx mem)
  8556  	for {
  8557  		off := auxIntToInt32(v.AuxInt)
  8558  		sym := auxToSym(v.Aux)
  8559  		if v_0.Op != OpARM64ADD {
  8560  			break
  8561  		}
  8562  		idx := v_0.Args[1]
  8563  		ptr := v_0.Args[0]
  8564  		mem := v_1
  8565  		if !(off == 0 && sym == nil) {
  8566  			break
  8567  		}
  8568  		v.reset(OpARM64MOVBUloadidx)
  8569  		v.AddArg3(ptr, idx, mem)
  8570  		return true
  8571  	}
  8572  	// match: (MOVBUload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  8573  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8574  	// result: (MOVBUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8575  	for {
  8576  		off1 := auxIntToInt32(v.AuxInt)
  8577  		sym1 := auxToSym(v.Aux)
  8578  		if v_0.Op != OpARM64MOVDaddr {
  8579  			break
  8580  		}
  8581  		off2 := auxIntToInt32(v_0.AuxInt)
  8582  		sym2 := auxToSym(v_0.Aux)
  8583  		ptr := v_0.Args[0]
  8584  		mem := v_1
  8585  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8586  			break
  8587  		}
  8588  		v.reset(OpARM64MOVBUload)
  8589  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8590  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8591  		v.AddArg2(ptr, mem)
  8592  		return true
  8593  	}
  8594  	// match: (MOVBUload [off] {sym} (SB) _)
  8595  	// cond: symIsRO(sym)
  8596  	// result: (MOVDconst [int64(read8(sym, int64(off)))])
  8597  	for {
  8598  		off := auxIntToInt32(v.AuxInt)
  8599  		sym := auxToSym(v.Aux)
  8600  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  8601  			break
  8602  		}
  8603  		v.reset(OpARM64MOVDconst)
  8604  		v.AuxInt = int64ToAuxInt(int64(read8(sym, int64(off))))
  8605  		return true
  8606  	}
  8607  	return false
  8608  }
  8609  func rewriteValueARM64_OpARM64MOVBUloadidx(v *Value) bool {
  8610  	v_2 := v.Args[2]
  8611  	v_1 := v.Args[1]
  8612  	v_0 := v.Args[0]
  8613  	// match: (MOVBUloadidx ptr (MOVDconst [c]) mem)
  8614  	// cond: is32Bit(c)
  8615  	// result: (MOVBUload [int32(c)] ptr mem)
  8616  	for {
  8617  		ptr := v_0
  8618  		if v_1.Op != OpARM64MOVDconst {
  8619  			break
  8620  		}
  8621  		c := auxIntToInt64(v_1.AuxInt)
  8622  		mem := v_2
  8623  		if !(is32Bit(c)) {
  8624  			break
  8625  		}
  8626  		v.reset(OpARM64MOVBUload)
  8627  		v.AuxInt = int32ToAuxInt(int32(c))
  8628  		v.AddArg2(ptr, mem)
  8629  		return true
  8630  	}
  8631  	// match: (MOVBUloadidx (MOVDconst [c]) ptr mem)
  8632  	// cond: is32Bit(c)
  8633  	// result: (MOVBUload [int32(c)] ptr mem)
  8634  	for {
  8635  		if v_0.Op != OpARM64MOVDconst {
  8636  			break
  8637  		}
  8638  		c := auxIntToInt64(v_0.AuxInt)
  8639  		ptr := v_1
  8640  		mem := v_2
  8641  		if !(is32Bit(c)) {
  8642  			break
  8643  		}
  8644  		v.reset(OpARM64MOVBUload)
  8645  		v.AuxInt = int32ToAuxInt(int32(c))
  8646  		v.AddArg2(ptr, mem)
  8647  		return true
  8648  	}
  8649  	return false
  8650  }
  8651  func rewriteValueARM64_OpARM64MOVBUreg(v *Value) bool {
  8652  	v_0 := v.Args[0]
  8653  	// match: (MOVBUreg (ANDconst [c] x))
  8654  	// result: (ANDconst [c&(1<<8-1)] x)
  8655  	for {
  8656  		if v_0.Op != OpARM64ANDconst {
  8657  			break
  8658  		}
  8659  		c := auxIntToInt64(v_0.AuxInt)
  8660  		x := v_0.Args[0]
  8661  		v.reset(OpARM64ANDconst)
  8662  		v.AuxInt = int64ToAuxInt(c & (1<<8 - 1))
  8663  		v.AddArg(x)
  8664  		return true
  8665  	}
  8666  	// match: (MOVBUreg (MOVDconst [c]))
  8667  	// result: (MOVDconst [int64(uint8(c))])
  8668  	for {
  8669  		if v_0.Op != OpARM64MOVDconst {
  8670  			break
  8671  		}
  8672  		c := auxIntToInt64(v_0.AuxInt)
  8673  		v.reset(OpARM64MOVDconst)
  8674  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  8675  		return true
  8676  	}
  8677  	// match: (MOVBUreg x)
  8678  	// cond: v.Type.Size() <= 1
  8679  	// result: x
  8680  	for {
  8681  		x := v_0
  8682  		if !(v.Type.Size() <= 1) {
  8683  			break
  8684  		}
  8685  		v.copyOf(x)
  8686  		return true
  8687  	}
  8688  	// match: (MOVBUreg (SLLconst [lc] x))
  8689  	// cond: lc >= 8
  8690  	// result: (MOVDconst [0])
  8691  	for {
  8692  		if v_0.Op != OpARM64SLLconst {
  8693  			break
  8694  		}
  8695  		lc := auxIntToInt64(v_0.AuxInt)
  8696  		if !(lc >= 8) {
  8697  			break
  8698  		}
  8699  		v.reset(OpARM64MOVDconst)
  8700  		v.AuxInt = int64ToAuxInt(0)
  8701  		return true
  8702  	}
  8703  	// match: (MOVBUreg (SLLconst [lc] x))
  8704  	// cond: lc < 8
  8705  	// result: (UBFIZ [armBFAuxInt(lc, 8-lc)] x)
  8706  	for {
  8707  		if v_0.Op != OpARM64SLLconst {
  8708  			break
  8709  		}
  8710  		lc := auxIntToInt64(v_0.AuxInt)
  8711  		x := v_0.Args[0]
  8712  		if !(lc < 8) {
  8713  			break
  8714  		}
  8715  		v.reset(OpARM64UBFIZ)
  8716  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 8-lc))
  8717  		v.AddArg(x)
  8718  		return true
  8719  	}
  8720  	// match: (MOVBUreg (SRLconst [rc] x))
  8721  	// cond: rc < 8
  8722  	// result: (UBFX [armBFAuxInt(rc, 8)] x)
  8723  	for {
  8724  		if v_0.Op != OpARM64SRLconst {
  8725  			break
  8726  		}
  8727  		rc := auxIntToInt64(v_0.AuxInt)
  8728  		x := v_0.Args[0]
  8729  		if !(rc < 8) {
  8730  			break
  8731  		}
  8732  		v.reset(OpARM64UBFX)
  8733  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8))
  8734  		v.AddArg(x)
  8735  		return true
  8736  	}
  8737  	// match: (MOVBUreg (UBFX [bfc] x))
  8738  	// cond: bfc.width() <= 8
  8739  	// result: (UBFX [bfc] x)
  8740  	for {
  8741  		if v_0.Op != OpARM64UBFX {
  8742  			break
  8743  		}
  8744  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  8745  		x := v_0.Args[0]
  8746  		if !(bfc.width() <= 8) {
  8747  			break
  8748  		}
  8749  		v.reset(OpARM64UBFX)
  8750  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
  8751  		v.AddArg(x)
  8752  		return true
  8753  	}
  8754  	return false
  8755  }
  8756  func rewriteValueARM64_OpARM64MOVBload(v *Value) bool {
  8757  	v_1 := v.Args[1]
  8758  	v_0 := v.Args[0]
  8759  	b := v.Block
  8760  	config := b.Func.Config
  8761  	// match: (MOVBload [off1] {sym} (ADDconst [off2] ptr) mem)
  8762  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8763  	// result: (MOVBload [off1+int32(off2)] {sym} ptr mem)
  8764  	for {
  8765  		off1 := auxIntToInt32(v.AuxInt)
  8766  		sym := auxToSym(v.Aux)
  8767  		if v_0.Op != OpARM64ADDconst {
  8768  			break
  8769  		}
  8770  		off2 := auxIntToInt64(v_0.AuxInt)
  8771  		ptr := v_0.Args[0]
  8772  		mem := v_1
  8773  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8774  			break
  8775  		}
  8776  		v.reset(OpARM64MOVBload)
  8777  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8778  		v.Aux = symToAux(sym)
  8779  		v.AddArg2(ptr, mem)
  8780  		return true
  8781  	}
  8782  	// match: (MOVBload [off] {sym} (ADD ptr idx) mem)
  8783  	// cond: off == 0 && sym == nil
  8784  	// result: (MOVBloadidx ptr idx mem)
  8785  	for {
  8786  		off := auxIntToInt32(v.AuxInt)
  8787  		sym := auxToSym(v.Aux)
  8788  		if v_0.Op != OpARM64ADD {
  8789  			break
  8790  		}
  8791  		idx := v_0.Args[1]
  8792  		ptr := v_0.Args[0]
  8793  		mem := v_1
  8794  		if !(off == 0 && sym == nil) {
  8795  			break
  8796  		}
  8797  		v.reset(OpARM64MOVBloadidx)
  8798  		v.AddArg3(ptr, idx, mem)
  8799  		return true
  8800  	}
  8801  	// match: (MOVBload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  8802  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8803  	// result: (MOVBload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8804  	for {
  8805  		off1 := auxIntToInt32(v.AuxInt)
  8806  		sym1 := auxToSym(v.Aux)
  8807  		if v_0.Op != OpARM64MOVDaddr {
  8808  			break
  8809  		}
  8810  		off2 := auxIntToInt32(v_0.AuxInt)
  8811  		sym2 := auxToSym(v_0.Aux)
  8812  		ptr := v_0.Args[0]
  8813  		mem := v_1
  8814  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8815  			break
  8816  		}
  8817  		v.reset(OpARM64MOVBload)
  8818  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8819  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8820  		v.AddArg2(ptr, mem)
  8821  		return true
  8822  	}
  8823  	// match: (MOVBload [off] {sym} (SB) _)
  8824  	// cond: symIsRO(sym)
  8825  	// result: (MOVDconst [int64(int8(read8(sym, int64(off))))])
  8826  	for {
  8827  		off := auxIntToInt32(v.AuxInt)
  8828  		sym := auxToSym(v.Aux)
  8829  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  8830  			break
  8831  		}
  8832  		v.reset(OpARM64MOVDconst)
  8833  		v.AuxInt = int64ToAuxInt(int64(int8(read8(sym, int64(off)))))
  8834  		return true
  8835  	}
  8836  	return false
  8837  }
  8838  func rewriteValueARM64_OpARM64MOVBloadidx(v *Value) bool {
  8839  	v_2 := v.Args[2]
  8840  	v_1 := v.Args[1]
  8841  	v_0 := v.Args[0]
  8842  	// match: (MOVBloadidx ptr (MOVDconst [c]) mem)
  8843  	// cond: is32Bit(c)
  8844  	// result: (MOVBload [int32(c)] ptr mem)
  8845  	for {
  8846  		ptr := v_0
  8847  		if v_1.Op != OpARM64MOVDconst {
  8848  			break
  8849  		}
  8850  		c := auxIntToInt64(v_1.AuxInt)
  8851  		mem := v_2
  8852  		if !(is32Bit(c)) {
  8853  			break
  8854  		}
  8855  		v.reset(OpARM64MOVBload)
  8856  		v.AuxInt = int32ToAuxInt(int32(c))
  8857  		v.AddArg2(ptr, mem)
  8858  		return true
  8859  	}
  8860  	// match: (MOVBloadidx (MOVDconst [c]) ptr mem)
  8861  	// cond: is32Bit(c)
  8862  	// result: (MOVBload [int32(c)] ptr mem)
  8863  	for {
  8864  		if v_0.Op != OpARM64MOVDconst {
  8865  			break
  8866  		}
  8867  		c := auxIntToInt64(v_0.AuxInt)
  8868  		ptr := v_1
  8869  		mem := v_2
  8870  		if !(is32Bit(c)) {
  8871  			break
  8872  		}
  8873  		v.reset(OpARM64MOVBload)
  8874  		v.AuxInt = int32ToAuxInt(int32(c))
  8875  		v.AddArg2(ptr, mem)
  8876  		return true
  8877  	}
  8878  	return false
  8879  }
  8880  func rewriteValueARM64_OpARM64MOVBreg(v *Value) bool {
  8881  	v_0 := v.Args[0]
  8882  	// match: (MOVBreg (MOVDconst [c]))
  8883  	// result: (MOVDconst [int64(int8(c))])
  8884  	for {
  8885  		if v_0.Op != OpARM64MOVDconst {
  8886  			break
  8887  		}
  8888  		c := auxIntToInt64(v_0.AuxInt)
  8889  		v.reset(OpARM64MOVDconst)
  8890  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  8891  		return true
  8892  	}
  8893  	// match: (MOVBreg x)
  8894  	// cond: v.Type.Size() <= 1
  8895  	// result: x
  8896  	for {
  8897  		x := v_0
  8898  		if !(v.Type.Size() <= 1) {
  8899  			break
  8900  		}
  8901  		v.copyOf(x)
  8902  		return true
  8903  	}
  8904  	// match: (MOVBreg <t> (ANDconst x [c]))
  8905  	// cond: uint64(c) & uint64(0xffffffffffffff80) == 0
  8906  	// result: (ANDconst <t> x [c])
  8907  	for {
  8908  		t := v.Type
  8909  		if v_0.Op != OpARM64ANDconst {
  8910  			break
  8911  		}
  8912  		c := auxIntToInt64(v_0.AuxInt)
  8913  		x := v_0.Args[0]
  8914  		if !(uint64(c)&uint64(0xffffffffffffff80) == 0) {
  8915  			break
  8916  		}
  8917  		v.reset(OpARM64ANDconst)
  8918  		v.Type = t
  8919  		v.AuxInt = int64ToAuxInt(c)
  8920  		v.AddArg(x)
  8921  		return true
  8922  	}
  8923  	// match: (MOVBreg (SLLconst [lc] x))
  8924  	// cond: lc < 8
  8925  	// result: (SBFIZ [armBFAuxInt(lc, 8-lc)] x)
  8926  	for {
  8927  		if v_0.Op != OpARM64SLLconst {
  8928  			break
  8929  		}
  8930  		lc := auxIntToInt64(v_0.AuxInt)
  8931  		x := v_0.Args[0]
  8932  		if !(lc < 8) {
  8933  			break
  8934  		}
  8935  		v.reset(OpARM64SBFIZ)
  8936  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 8-lc))
  8937  		v.AddArg(x)
  8938  		return true
  8939  	}
  8940  	// match: (MOVBreg (SBFX [bfc] x))
  8941  	// cond: bfc.width() <= 8
  8942  	// result: (SBFX [bfc] x)
  8943  	for {
  8944  		if v_0.Op != OpARM64SBFX {
  8945  			break
  8946  		}
  8947  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  8948  		x := v_0.Args[0]
  8949  		if !(bfc.width() <= 8) {
  8950  			break
  8951  		}
  8952  		v.reset(OpARM64SBFX)
  8953  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
  8954  		v.AddArg(x)
  8955  		return true
  8956  	}
  8957  	return false
  8958  }
  8959  func rewriteValueARM64_OpARM64MOVBstore(v *Value) bool {
  8960  	v_2 := v.Args[2]
  8961  	v_1 := v.Args[1]
  8962  	v_0 := v.Args[0]
  8963  	b := v.Block
  8964  	config := b.Func.Config
  8965  	// match: (MOVBstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  8966  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8967  	// result: (MOVBstore [off1+int32(off2)] {sym} ptr val mem)
  8968  	for {
  8969  		off1 := auxIntToInt32(v.AuxInt)
  8970  		sym := auxToSym(v.Aux)
  8971  		if v_0.Op != OpARM64ADDconst {
  8972  			break
  8973  		}
  8974  		off2 := auxIntToInt64(v_0.AuxInt)
  8975  		ptr := v_0.Args[0]
  8976  		val := v_1
  8977  		mem := v_2
  8978  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8979  			break
  8980  		}
  8981  		v.reset(OpARM64MOVBstore)
  8982  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8983  		v.Aux = symToAux(sym)
  8984  		v.AddArg3(ptr, val, mem)
  8985  		return true
  8986  	}
  8987  	// match: (MOVBstore [off] {sym} (ADD ptr idx) val mem)
  8988  	// cond: off == 0 && sym == nil
  8989  	// result: (MOVBstoreidx ptr idx val mem)
  8990  	for {
  8991  		off := auxIntToInt32(v.AuxInt)
  8992  		sym := auxToSym(v.Aux)
  8993  		if v_0.Op != OpARM64ADD {
  8994  			break
  8995  		}
  8996  		idx := v_0.Args[1]
  8997  		ptr := v_0.Args[0]
  8998  		val := v_1
  8999  		mem := v_2
  9000  		if !(off == 0 && sym == nil) {
  9001  			break
  9002  		}
  9003  		v.reset(OpARM64MOVBstoreidx)
  9004  		v.AddArg4(ptr, idx, val, mem)
  9005  		return true
  9006  	}
  9007  	// match: (MOVBstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  9008  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9009  	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9010  	for {
  9011  		off1 := auxIntToInt32(v.AuxInt)
  9012  		sym1 := auxToSym(v.Aux)
  9013  		if v_0.Op != OpARM64MOVDaddr {
  9014  			break
  9015  		}
  9016  		off2 := auxIntToInt32(v_0.AuxInt)
  9017  		sym2 := auxToSym(v_0.Aux)
  9018  		ptr := v_0.Args[0]
  9019  		val := v_1
  9020  		mem := v_2
  9021  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9022  			break
  9023  		}
  9024  		v.reset(OpARM64MOVBstore)
  9025  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9026  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9027  		v.AddArg3(ptr, val, mem)
  9028  		return true
  9029  	}
  9030  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  9031  	// result: (MOVBstore [off] {sym} ptr x mem)
  9032  	for {
  9033  		off := auxIntToInt32(v.AuxInt)
  9034  		sym := auxToSym(v.Aux)
  9035  		ptr := v_0
  9036  		if v_1.Op != OpARM64MOVBreg {
  9037  			break
  9038  		}
  9039  		x := v_1.Args[0]
  9040  		mem := v_2
  9041  		v.reset(OpARM64MOVBstore)
  9042  		v.AuxInt = int32ToAuxInt(off)
  9043  		v.Aux = symToAux(sym)
  9044  		v.AddArg3(ptr, x, mem)
  9045  		return true
  9046  	}
  9047  	// match: (MOVBstore [off] {sym} ptr (MOVBUreg x) mem)
  9048  	// result: (MOVBstore [off] {sym} ptr x mem)
  9049  	for {
  9050  		off := auxIntToInt32(v.AuxInt)
  9051  		sym := auxToSym(v.Aux)
  9052  		ptr := v_0
  9053  		if v_1.Op != OpARM64MOVBUreg {
  9054  			break
  9055  		}
  9056  		x := v_1.Args[0]
  9057  		mem := v_2
  9058  		v.reset(OpARM64MOVBstore)
  9059  		v.AuxInt = int32ToAuxInt(off)
  9060  		v.Aux = symToAux(sym)
  9061  		v.AddArg3(ptr, x, mem)
  9062  		return true
  9063  	}
  9064  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  9065  	// result: (MOVBstore [off] {sym} ptr x mem)
  9066  	for {
  9067  		off := auxIntToInt32(v.AuxInt)
  9068  		sym := auxToSym(v.Aux)
  9069  		ptr := v_0
  9070  		if v_1.Op != OpARM64MOVHreg {
  9071  			break
  9072  		}
  9073  		x := v_1.Args[0]
  9074  		mem := v_2
  9075  		v.reset(OpARM64MOVBstore)
  9076  		v.AuxInt = int32ToAuxInt(off)
  9077  		v.Aux = symToAux(sym)
  9078  		v.AddArg3(ptr, x, mem)
  9079  		return true
  9080  	}
  9081  	// match: (MOVBstore [off] {sym} ptr (MOVHUreg x) mem)
  9082  	// result: (MOVBstore [off] {sym} ptr x mem)
  9083  	for {
  9084  		off := auxIntToInt32(v.AuxInt)
  9085  		sym := auxToSym(v.Aux)
  9086  		ptr := v_0
  9087  		if v_1.Op != OpARM64MOVHUreg {
  9088  			break
  9089  		}
  9090  		x := v_1.Args[0]
  9091  		mem := v_2
  9092  		v.reset(OpARM64MOVBstore)
  9093  		v.AuxInt = int32ToAuxInt(off)
  9094  		v.Aux = symToAux(sym)
  9095  		v.AddArg3(ptr, x, mem)
  9096  		return true
  9097  	}
  9098  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  9099  	// result: (MOVBstore [off] {sym} ptr x mem)
  9100  	for {
  9101  		off := auxIntToInt32(v.AuxInt)
  9102  		sym := auxToSym(v.Aux)
  9103  		ptr := v_0
  9104  		if v_1.Op != OpARM64MOVWreg {
  9105  			break
  9106  		}
  9107  		x := v_1.Args[0]
  9108  		mem := v_2
  9109  		v.reset(OpARM64MOVBstore)
  9110  		v.AuxInt = int32ToAuxInt(off)
  9111  		v.Aux = symToAux(sym)
  9112  		v.AddArg3(ptr, x, mem)
  9113  		return true
  9114  	}
  9115  	// match: (MOVBstore [off] {sym} ptr (MOVWUreg x) mem)
  9116  	// result: (MOVBstore [off] {sym} ptr x mem)
  9117  	for {
  9118  		off := auxIntToInt32(v.AuxInt)
  9119  		sym := auxToSym(v.Aux)
  9120  		ptr := v_0
  9121  		if v_1.Op != OpARM64MOVWUreg {
  9122  			break
  9123  		}
  9124  		x := v_1.Args[0]
  9125  		mem := v_2
  9126  		v.reset(OpARM64MOVBstore)
  9127  		v.AuxInt = int32ToAuxInt(off)
  9128  		v.Aux = symToAux(sym)
  9129  		v.AddArg3(ptr, x, mem)
  9130  		return true
  9131  	}
  9132  	return false
  9133  }
  9134  func rewriteValueARM64_OpARM64MOVBstoreidx(v *Value) bool {
  9135  	v_3 := v.Args[3]
  9136  	v_2 := v.Args[2]
  9137  	v_1 := v.Args[1]
  9138  	v_0 := v.Args[0]
  9139  	// match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
  9140  	// cond: is32Bit(c)
  9141  	// result: (MOVBstore [int32(c)] ptr val mem)
  9142  	for {
  9143  		ptr := v_0
  9144  		if v_1.Op != OpARM64MOVDconst {
  9145  			break
  9146  		}
  9147  		c := auxIntToInt64(v_1.AuxInt)
  9148  		val := v_2
  9149  		mem := v_3
  9150  		if !(is32Bit(c)) {
  9151  			break
  9152  		}
  9153  		v.reset(OpARM64MOVBstore)
  9154  		v.AuxInt = int32ToAuxInt(int32(c))
  9155  		v.AddArg3(ptr, val, mem)
  9156  		return true
  9157  	}
  9158  	// match: (MOVBstoreidx (MOVDconst [c]) idx val mem)
  9159  	// cond: is32Bit(c)
  9160  	// result: (MOVBstore [int32(c)] idx val mem)
  9161  	for {
  9162  		if v_0.Op != OpARM64MOVDconst {
  9163  			break
  9164  		}
  9165  		c := auxIntToInt64(v_0.AuxInt)
  9166  		idx := v_1
  9167  		val := v_2
  9168  		mem := v_3
  9169  		if !(is32Bit(c)) {
  9170  			break
  9171  		}
  9172  		v.reset(OpARM64MOVBstore)
  9173  		v.AuxInt = int32ToAuxInt(int32(c))
  9174  		v.AddArg3(idx, val, mem)
  9175  		return true
  9176  	}
  9177  	// match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
  9178  	// result: (MOVBstoreidx ptr idx x mem)
  9179  	for {
  9180  		ptr := v_0
  9181  		idx := v_1
  9182  		if v_2.Op != OpARM64MOVBreg {
  9183  			break
  9184  		}
  9185  		x := v_2.Args[0]
  9186  		mem := v_3
  9187  		v.reset(OpARM64MOVBstoreidx)
  9188  		v.AddArg4(ptr, idx, x, mem)
  9189  		return true
  9190  	}
  9191  	// match: (MOVBstoreidx ptr idx (MOVBUreg x) mem)
  9192  	// result: (MOVBstoreidx ptr idx x mem)
  9193  	for {
  9194  		ptr := v_0
  9195  		idx := v_1
  9196  		if v_2.Op != OpARM64MOVBUreg {
  9197  			break
  9198  		}
  9199  		x := v_2.Args[0]
  9200  		mem := v_3
  9201  		v.reset(OpARM64MOVBstoreidx)
  9202  		v.AddArg4(ptr, idx, x, mem)
  9203  		return true
  9204  	}
  9205  	// match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
  9206  	// result: (MOVBstoreidx ptr idx x mem)
  9207  	for {
  9208  		ptr := v_0
  9209  		idx := v_1
  9210  		if v_2.Op != OpARM64MOVHreg {
  9211  			break
  9212  		}
  9213  		x := v_2.Args[0]
  9214  		mem := v_3
  9215  		v.reset(OpARM64MOVBstoreidx)
  9216  		v.AddArg4(ptr, idx, x, mem)
  9217  		return true
  9218  	}
  9219  	// match: (MOVBstoreidx ptr idx (MOVHUreg x) mem)
  9220  	// result: (MOVBstoreidx ptr idx x mem)
  9221  	for {
  9222  		ptr := v_0
  9223  		idx := v_1
  9224  		if v_2.Op != OpARM64MOVHUreg {
  9225  			break
  9226  		}
  9227  		x := v_2.Args[0]
  9228  		mem := v_3
  9229  		v.reset(OpARM64MOVBstoreidx)
  9230  		v.AddArg4(ptr, idx, x, mem)
  9231  		return true
  9232  	}
  9233  	// match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
  9234  	// result: (MOVBstoreidx ptr idx x mem)
  9235  	for {
  9236  		ptr := v_0
  9237  		idx := v_1
  9238  		if v_2.Op != OpARM64MOVWreg {
  9239  			break
  9240  		}
  9241  		x := v_2.Args[0]
  9242  		mem := v_3
  9243  		v.reset(OpARM64MOVBstoreidx)
  9244  		v.AddArg4(ptr, idx, x, mem)
  9245  		return true
  9246  	}
  9247  	// match: (MOVBstoreidx ptr idx (MOVWUreg x) mem)
  9248  	// result: (MOVBstoreidx ptr idx x mem)
  9249  	for {
  9250  		ptr := v_0
  9251  		idx := v_1
  9252  		if v_2.Op != OpARM64MOVWUreg {
  9253  			break
  9254  		}
  9255  		x := v_2.Args[0]
  9256  		mem := v_3
  9257  		v.reset(OpARM64MOVBstoreidx)
  9258  		v.AddArg4(ptr, idx, x, mem)
  9259  		return true
  9260  	}
  9261  	return false
  9262  }
  9263  func rewriteValueARM64_OpARM64MOVDload(v *Value) bool {
  9264  	v_1 := v.Args[1]
  9265  	v_0 := v.Args[0]
  9266  	b := v.Block
  9267  	config := b.Func.Config
  9268  	// match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr val _))
  9269  	// result: (FMOVDfpgp val)
  9270  	for {
  9271  		off := auxIntToInt32(v.AuxInt)
  9272  		sym := auxToSym(v.Aux)
  9273  		ptr := v_0
  9274  		if v_1.Op != OpARM64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  9275  			break
  9276  		}
  9277  		val := v_1.Args[1]
  9278  		if ptr != v_1.Args[0] {
  9279  			break
  9280  		}
  9281  		v.reset(OpARM64FMOVDfpgp)
  9282  		v.AddArg(val)
  9283  		return true
  9284  	}
  9285  	// match: (MOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  9286  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9287  	// result: (MOVDload [off1+int32(off2)] {sym} ptr mem)
  9288  	for {
  9289  		off1 := auxIntToInt32(v.AuxInt)
  9290  		sym := auxToSym(v.Aux)
  9291  		if v_0.Op != OpARM64ADDconst {
  9292  			break
  9293  		}
  9294  		off2 := auxIntToInt64(v_0.AuxInt)
  9295  		ptr := v_0.Args[0]
  9296  		mem := v_1
  9297  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9298  			break
  9299  		}
  9300  		v.reset(OpARM64MOVDload)
  9301  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9302  		v.Aux = symToAux(sym)
  9303  		v.AddArg2(ptr, mem)
  9304  		return true
  9305  	}
  9306  	// match: (MOVDload [off] {sym} (ADD ptr idx) mem)
  9307  	// cond: off == 0 && sym == nil
  9308  	// result: (MOVDloadidx ptr idx mem)
  9309  	for {
  9310  		off := auxIntToInt32(v.AuxInt)
  9311  		sym := auxToSym(v.Aux)
  9312  		if v_0.Op != OpARM64ADD {
  9313  			break
  9314  		}
  9315  		idx := v_0.Args[1]
  9316  		ptr := v_0.Args[0]
  9317  		mem := v_1
  9318  		if !(off == 0 && sym == nil) {
  9319  			break
  9320  		}
  9321  		v.reset(OpARM64MOVDloadidx)
  9322  		v.AddArg3(ptr, idx, mem)
  9323  		return true
  9324  	}
  9325  	// match: (MOVDload [off] {sym} (ADDshiftLL [3] ptr idx) mem)
  9326  	// cond: off == 0 && sym == nil
  9327  	// result: (MOVDloadidx8 ptr idx mem)
  9328  	for {
  9329  		off := auxIntToInt32(v.AuxInt)
  9330  		sym := auxToSym(v.Aux)
  9331  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  9332  			break
  9333  		}
  9334  		idx := v_0.Args[1]
  9335  		ptr := v_0.Args[0]
  9336  		mem := v_1
  9337  		if !(off == 0 && sym == nil) {
  9338  			break
  9339  		}
  9340  		v.reset(OpARM64MOVDloadidx8)
  9341  		v.AddArg3(ptr, idx, mem)
  9342  		return true
  9343  	}
  9344  	// match: (MOVDload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  9345  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9346  	// result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9347  	for {
  9348  		off1 := auxIntToInt32(v.AuxInt)
  9349  		sym1 := auxToSym(v.Aux)
  9350  		if v_0.Op != OpARM64MOVDaddr {
  9351  			break
  9352  		}
  9353  		off2 := auxIntToInt32(v_0.AuxInt)
  9354  		sym2 := auxToSym(v_0.Aux)
  9355  		ptr := v_0.Args[0]
  9356  		mem := v_1
  9357  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9358  			break
  9359  		}
  9360  		v.reset(OpARM64MOVDload)
  9361  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9362  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9363  		v.AddArg2(ptr, mem)
  9364  		return true
  9365  	}
  9366  	// match: (MOVDload [off] {sym} (SB) _)
  9367  	// cond: symIsRO(sym)
  9368  	// result: (MOVDconst [int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  9369  	for {
  9370  		off := auxIntToInt32(v.AuxInt)
  9371  		sym := auxToSym(v.Aux)
  9372  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  9373  			break
  9374  		}
  9375  		v.reset(OpARM64MOVDconst)
  9376  		v.AuxInt = int64ToAuxInt(int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  9377  		return true
  9378  	}
  9379  	return false
  9380  }
  9381  func rewriteValueARM64_OpARM64MOVDloadidx(v *Value) bool {
  9382  	v_2 := v.Args[2]
  9383  	v_1 := v.Args[1]
  9384  	v_0 := v.Args[0]
  9385  	// match: (MOVDloadidx ptr (MOVDconst [c]) mem)
  9386  	// cond: is32Bit(c)
  9387  	// result: (MOVDload [int32(c)] ptr mem)
  9388  	for {
  9389  		ptr := v_0
  9390  		if v_1.Op != OpARM64MOVDconst {
  9391  			break
  9392  		}
  9393  		c := auxIntToInt64(v_1.AuxInt)
  9394  		mem := v_2
  9395  		if !(is32Bit(c)) {
  9396  			break
  9397  		}
  9398  		v.reset(OpARM64MOVDload)
  9399  		v.AuxInt = int32ToAuxInt(int32(c))
  9400  		v.AddArg2(ptr, mem)
  9401  		return true
  9402  	}
  9403  	// match: (MOVDloadidx (MOVDconst [c]) ptr mem)
  9404  	// cond: is32Bit(c)
  9405  	// result: (MOVDload [int32(c)] ptr mem)
  9406  	for {
  9407  		if v_0.Op != OpARM64MOVDconst {
  9408  			break
  9409  		}
  9410  		c := auxIntToInt64(v_0.AuxInt)
  9411  		ptr := v_1
  9412  		mem := v_2
  9413  		if !(is32Bit(c)) {
  9414  			break
  9415  		}
  9416  		v.reset(OpARM64MOVDload)
  9417  		v.AuxInt = int32ToAuxInt(int32(c))
  9418  		v.AddArg2(ptr, mem)
  9419  		return true
  9420  	}
  9421  	// match: (MOVDloadidx ptr (SLLconst [3] idx) mem)
  9422  	// result: (MOVDloadidx8 ptr idx mem)
  9423  	for {
  9424  		ptr := v_0
  9425  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  9426  			break
  9427  		}
  9428  		idx := v_1.Args[0]
  9429  		mem := v_2
  9430  		v.reset(OpARM64MOVDloadidx8)
  9431  		v.AddArg3(ptr, idx, mem)
  9432  		return true
  9433  	}
  9434  	// match: (MOVDloadidx (SLLconst [3] idx) ptr mem)
  9435  	// result: (MOVDloadidx8 ptr idx mem)
  9436  	for {
  9437  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  9438  			break
  9439  		}
  9440  		idx := v_0.Args[0]
  9441  		ptr := v_1
  9442  		mem := v_2
  9443  		v.reset(OpARM64MOVDloadidx8)
  9444  		v.AddArg3(ptr, idx, mem)
  9445  		return true
  9446  	}
  9447  	return false
  9448  }
  9449  func rewriteValueARM64_OpARM64MOVDloadidx8(v *Value) bool {
  9450  	v_2 := v.Args[2]
  9451  	v_1 := v.Args[1]
  9452  	v_0 := v.Args[0]
  9453  	// match: (MOVDloadidx8 ptr (MOVDconst [c]) mem)
  9454  	// cond: is32Bit(c<<3)
  9455  	// result: (MOVDload [int32(c)<<3] ptr mem)
  9456  	for {
  9457  		ptr := v_0
  9458  		if v_1.Op != OpARM64MOVDconst {
  9459  			break
  9460  		}
  9461  		c := auxIntToInt64(v_1.AuxInt)
  9462  		mem := v_2
  9463  		if !(is32Bit(c << 3)) {
  9464  			break
  9465  		}
  9466  		v.reset(OpARM64MOVDload)
  9467  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  9468  		v.AddArg2(ptr, mem)
  9469  		return true
  9470  	}
  9471  	return false
  9472  }
  9473  func rewriteValueARM64_OpARM64MOVDnop(v *Value) bool {
  9474  	v_0 := v.Args[0]
  9475  	// match: (MOVDnop (MOVDconst [c]))
  9476  	// result: (MOVDconst [c])
  9477  	for {
  9478  		if v_0.Op != OpARM64MOVDconst {
  9479  			break
  9480  		}
  9481  		c := auxIntToInt64(v_0.AuxInt)
  9482  		v.reset(OpARM64MOVDconst)
  9483  		v.AuxInt = int64ToAuxInt(c)
  9484  		return true
  9485  	}
  9486  	return false
  9487  }
  9488  func rewriteValueARM64_OpARM64MOVDreg(v *Value) bool {
  9489  	v_0 := v.Args[0]
  9490  	// match: (MOVDreg x)
  9491  	// cond: x.Uses == 1
  9492  	// result: (MOVDnop x)
  9493  	for {
  9494  		x := v_0
  9495  		if !(x.Uses == 1) {
  9496  			break
  9497  		}
  9498  		v.reset(OpARM64MOVDnop)
  9499  		v.AddArg(x)
  9500  		return true
  9501  	}
  9502  	// match: (MOVDreg (MOVDconst [c]))
  9503  	// result: (MOVDconst [c])
  9504  	for {
  9505  		if v_0.Op != OpARM64MOVDconst {
  9506  			break
  9507  		}
  9508  		c := auxIntToInt64(v_0.AuxInt)
  9509  		v.reset(OpARM64MOVDconst)
  9510  		v.AuxInt = int64ToAuxInt(c)
  9511  		return true
  9512  	}
  9513  	return false
  9514  }
  9515  func rewriteValueARM64_OpARM64MOVDstore(v *Value) bool {
  9516  	v_2 := v.Args[2]
  9517  	v_1 := v.Args[1]
  9518  	v_0 := v.Args[0]
  9519  	b := v.Block
  9520  	config := b.Func.Config
  9521  	// match: (MOVDstore [off] {sym} ptr (FMOVDfpgp val) mem)
  9522  	// result: (FMOVDstore [off] {sym} ptr val mem)
  9523  	for {
  9524  		off := auxIntToInt32(v.AuxInt)
  9525  		sym := auxToSym(v.Aux)
  9526  		ptr := v_0
  9527  		if v_1.Op != OpARM64FMOVDfpgp {
  9528  			break
  9529  		}
  9530  		val := v_1.Args[0]
  9531  		mem := v_2
  9532  		v.reset(OpARM64FMOVDstore)
  9533  		v.AuxInt = int32ToAuxInt(off)
  9534  		v.Aux = symToAux(sym)
  9535  		v.AddArg3(ptr, val, mem)
  9536  		return true
  9537  	}
  9538  	// match: (MOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  9539  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9540  	// result: (MOVDstore [off1+int32(off2)] {sym} ptr val mem)
  9541  	for {
  9542  		off1 := auxIntToInt32(v.AuxInt)
  9543  		sym := auxToSym(v.Aux)
  9544  		if v_0.Op != OpARM64ADDconst {
  9545  			break
  9546  		}
  9547  		off2 := auxIntToInt64(v_0.AuxInt)
  9548  		ptr := v_0.Args[0]
  9549  		val := v_1
  9550  		mem := v_2
  9551  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9552  			break
  9553  		}
  9554  		v.reset(OpARM64MOVDstore)
  9555  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9556  		v.Aux = symToAux(sym)
  9557  		v.AddArg3(ptr, val, mem)
  9558  		return true
  9559  	}
  9560  	// match: (MOVDstore [off] {sym} (ADD ptr idx) val mem)
  9561  	// cond: off == 0 && sym == nil
  9562  	// result: (MOVDstoreidx ptr idx val mem)
  9563  	for {
  9564  		off := auxIntToInt32(v.AuxInt)
  9565  		sym := auxToSym(v.Aux)
  9566  		if v_0.Op != OpARM64ADD {
  9567  			break
  9568  		}
  9569  		idx := v_0.Args[1]
  9570  		ptr := v_0.Args[0]
  9571  		val := v_1
  9572  		mem := v_2
  9573  		if !(off == 0 && sym == nil) {
  9574  			break
  9575  		}
  9576  		v.reset(OpARM64MOVDstoreidx)
  9577  		v.AddArg4(ptr, idx, val, mem)
  9578  		return true
  9579  	}
  9580  	// match: (MOVDstore [off] {sym} (ADDshiftLL [3] ptr idx) val mem)
  9581  	// cond: off == 0 && sym == nil
  9582  	// result: (MOVDstoreidx8 ptr idx val mem)
  9583  	for {
  9584  		off := auxIntToInt32(v.AuxInt)
  9585  		sym := auxToSym(v.Aux)
  9586  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  9587  			break
  9588  		}
  9589  		idx := v_0.Args[1]
  9590  		ptr := v_0.Args[0]
  9591  		val := v_1
  9592  		mem := v_2
  9593  		if !(off == 0 && sym == nil) {
  9594  			break
  9595  		}
  9596  		v.reset(OpARM64MOVDstoreidx8)
  9597  		v.AddArg4(ptr, idx, val, mem)
  9598  		return true
  9599  	}
  9600  	// match: (MOVDstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  9601  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9602  	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9603  	for {
  9604  		off1 := auxIntToInt32(v.AuxInt)
  9605  		sym1 := auxToSym(v.Aux)
  9606  		if v_0.Op != OpARM64MOVDaddr {
  9607  			break
  9608  		}
  9609  		off2 := auxIntToInt32(v_0.AuxInt)
  9610  		sym2 := auxToSym(v_0.Aux)
  9611  		ptr := v_0.Args[0]
  9612  		val := v_1
  9613  		mem := v_2
  9614  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9615  			break
  9616  		}
  9617  		v.reset(OpARM64MOVDstore)
  9618  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9619  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9620  		v.AddArg3(ptr, val, mem)
  9621  		return true
  9622  	}
  9623  	return false
  9624  }
  9625  func rewriteValueARM64_OpARM64MOVDstoreidx(v *Value) bool {
  9626  	v_3 := v.Args[3]
  9627  	v_2 := v.Args[2]
  9628  	v_1 := v.Args[1]
  9629  	v_0 := v.Args[0]
  9630  	// match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
  9631  	// cond: is32Bit(c)
  9632  	// result: (MOVDstore [int32(c)] ptr val mem)
  9633  	for {
  9634  		ptr := v_0
  9635  		if v_1.Op != OpARM64MOVDconst {
  9636  			break
  9637  		}
  9638  		c := auxIntToInt64(v_1.AuxInt)
  9639  		val := v_2
  9640  		mem := v_3
  9641  		if !(is32Bit(c)) {
  9642  			break
  9643  		}
  9644  		v.reset(OpARM64MOVDstore)
  9645  		v.AuxInt = int32ToAuxInt(int32(c))
  9646  		v.AddArg3(ptr, val, mem)
  9647  		return true
  9648  	}
  9649  	// match: (MOVDstoreidx (MOVDconst [c]) idx val mem)
  9650  	// cond: is32Bit(c)
  9651  	// result: (MOVDstore [int32(c)] idx val mem)
  9652  	for {
  9653  		if v_0.Op != OpARM64MOVDconst {
  9654  			break
  9655  		}
  9656  		c := auxIntToInt64(v_0.AuxInt)
  9657  		idx := v_1
  9658  		val := v_2
  9659  		mem := v_3
  9660  		if !(is32Bit(c)) {
  9661  			break
  9662  		}
  9663  		v.reset(OpARM64MOVDstore)
  9664  		v.AuxInt = int32ToAuxInt(int32(c))
  9665  		v.AddArg3(idx, val, mem)
  9666  		return true
  9667  	}
  9668  	// match: (MOVDstoreidx ptr (SLLconst [3] idx) val mem)
  9669  	// result: (MOVDstoreidx8 ptr idx val mem)
  9670  	for {
  9671  		ptr := v_0
  9672  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  9673  			break
  9674  		}
  9675  		idx := v_1.Args[0]
  9676  		val := v_2
  9677  		mem := v_3
  9678  		v.reset(OpARM64MOVDstoreidx8)
  9679  		v.AddArg4(ptr, idx, val, mem)
  9680  		return true
  9681  	}
  9682  	// match: (MOVDstoreidx (SLLconst [3] idx) ptr val mem)
  9683  	// result: (MOVDstoreidx8 ptr idx val mem)
  9684  	for {
  9685  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  9686  			break
  9687  		}
  9688  		idx := v_0.Args[0]
  9689  		ptr := v_1
  9690  		val := v_2
  9691  		mem := v_3
  9692  		v.reset(OpARM64MOVDstoreidx8)
  9693  		v.AddArg4(ptr, idx, val, mem)
  9694  		return true
  9695  	}
  9696  	return false
  9697  }
  9698  func rewriteValueARM64_OpARM64MOVDstoreidx8(v *Value) bool {
  9699  	v_3 := v.Args[3]
  9700  	v_2 := v.Args[2]
  9701  	v_1 := v.Args[1]
  9702  	v_0 := v.Args[0]
  9703  	// match: (MOVDstoreidx8 ptr (MOVDconst [c]) val mem)
  9704  	// cond: is32Bit(c<<3)
  9705  	// result: (MOVDstore [int32(c)<<3] ptr val mem)
  9706  	for {
  9707  		ptr := v_0
  9708  		if v_1.Op != OpARM64MOVDconst {
  9709  			break
  9710  		}
  9711  		c := auxIntToInt64(v_1.AuxInt)
  9712  		val := v_2
  9713  		mem := v_3
  9714  		if !(is32Bit(c << 3)) {
  9715  			break
  9716  		}
  9717  		v.reset(OpARM64MOVDstore)
  9718  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  9719  		v.AddArg3(ptr, val, mem)
  9720  		return true
  9721  	}
  9722  	return false
  9723  }
  9724  func rewriteValueARM64_OpARM64MOVHUload(v *Value) bool {
  9725  	v_1 := v.Args[1]
  9726  	v_0 := v.Args[0]
  9727  	b := v.Block
  9728  	config := b.Func.Config
  9729  	// match: (MOVHUload [off1] {sym} (ADDconst [off2] ptr) mem)
  9730  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9731  	// result: (MOVHUload [off1+int32(off2)] {sym} ptr mem)
  9732  	for {
  9733  		off1 := auxIntToInt32(v.AuxInt)
  9734  		sym := auxToSym(v.Aux)
  9735  		if v_0.Op != OpARM64ADDconst {
  9736  			break
  9737  		}
  9738  		off2 := auxIntToInt64(v_0.AuxInt)
  9739  		ptr := v_0.Args[0]
  9740  		mem := v_1
  9741  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9742  			break
  9743  		}
  9744  		v.reset(OpARM64MOVHUload)
  9745  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9746  		v.Aux = symToAux(sym)
  9747  		v.AddArg2(ptr, mem)
  9748  		return true
  9749  	}
  9750  	// match: (MOVHUload [off] {sym} (ADD ptr idx) mem)
  9751  	// cond: off == 0 && sym == nil
  9752  	// result: (MOVHUloadidx ptr idx mem)
  9753  	for {
  9754  		off := auxIntToInt32(v.AuxInt)
  9755  		sym := auxToSym(v.Aux)
  9756  		if v_0.Op != OpARM64ADD {
  9757  			break
  9758  		}
  9759  		idx := v_0.Args[1]
  9760  		ptr := v_0.Args[0]
  9761  		mem := v_1
  9762  		if !(off == 0 && sym == nil) {
  9763  			break
  9764  		}
  9765  		v.reset(OpARM64MOVHUloadidx)
  9766  		v.AddArg3(ptr, idx, mem)
  9767  		return true
  9768  	}
  9769  	// match: (MOVHUload [off] {sym} (ADDshiftLL [1] ptr idx) mem)
  9770  	// cond: off == 0 && sym == nil
  9771  	// result: (MOVHUloadidx2 ptr idx mem)
  9772  	for {
  9773  		off := auxIntToInt32(v.AuxInt)
  9774  		sym := auxToSym(v.Aux)
  9775  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
  9776  			break
  9777  		}
  9778  		idx := v_0.Args[1]
  9779  		ptr := v_0.Args[0]
  9780  		mem := v_1
  9781  		if !(off == 0 && sym == nil) {
  9782  			break
  9783  		}
  9784  		v.reset(OpARM64MOVHUloadidx2)
  9785  		v.AddArg3(ptr, idx, mem)
  9786  		return true
  9787  	}
  9788  	// match: (MOVHUload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  9789  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9790  	// result: (MOVHUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9791  	for {
  9792  		off1 := auxIntToInt32(v.AuxInt)
  9793  		sym1 := auxToSym(v.Aux)
  9794  		if v_0.Op != OpARM64MOVDaddr {
  9795  			break
  9796  		}
  9797  		off2 := auxIntToInt32(v_0.AuxInt)
  9798  		sym2 := auxToSym(v_0.Aux)
  9799  		ptr := v_0.Args[0]
  9800  		mem := v_1
  9801  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9802  			break
  9803  		}
  9804  		v.reset(OpARM64MOVHUload)
  9805  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9806  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9807  		v.AddArg2(ptr, mem)
  9808  		return true
  9809  	}
  9810  	// match: (MOVHUload [off] {sym} (SB) _)
  9811  	// cond: symIsRO(sym)
  9812  	// result: (MOVDconst [int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  9813  	for {
  9814  		off := auxIntToInt32(v.AuxInt)
  9815  		sym := auxToSym(v.Aux)
  9816  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  9817  			break
  9818  		}
  9819  		v.reset(OpARM64MOVDconst)
  9820  		v.AuxInt = int64ToAuxInt(int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  9821  		return true
  9822  	}
  9823  	return false
  9824  }
  9825  func rewriteValueARM64_OpARM64MOVHUloadidx(v *Value) bool {
  9826  	v_2 := v.Args[2]
  9827  	v_1 := v.Args[1]
  9828  	v_0 := v.Args[0]
  9829  	// match: (MOVHUloadidx ptr (MOVDconst [c]) mem)
  9830  	// cond: is32Bit(c)
  9831  	// result: (MOVHUload [int32(c)] ptr mem)
  9832  	for {
  9833  		ptr := v_0
  9834  		if v_1.Op != OpARM64MOVDconst {
  9835  			break
  9836  		}
  9837  		c := auxIntToInt64(v_1.AuxInt)
  9838  		mem := v_2
  9839  		if !(is32Bit(c)) {
  9840  			break
  9841  		}
  9842  		v.reset(OpARM64MOVHUload)
  9843  		v.AuxInt = int32ToAuxInt(int32(c))
  9844  		v.AddArg2(ptr, mem)
  9845  		return true
  9846  	}
  9847  	// match: (MOVHUloadidx (MOVDconst [c]) ptr mem)
  9848  	// cond: is32Bit(c)
  9849  	// result: (MOVHUload [int32(c)] ptr mem)
  9850  	for {
  9851  		if v_0.Op != OpARM64MOVDconst {
  9852  			break
  9853  		}
  9854  		c := auxIntToInt64(v_0.AuxInt)
  9855  		ptr := v_1
  9856  		mem := v_2
  9857  		if !(is32Bit(c)) {
  9858  			break
  9859  		}
  9860  		v.reset(OpARM64MOVHUload)
  9861  		v.AuxInt = int32ToAuxInt(int32(c))
  9862  		v.AddArg2(ptr, mem)
  9863  		return true
  9864  	}
  9865  	// match: (MOVHUloadidx ptr (SLLconst [1] idx) mem)
  9866  	// result: (MOVHUloadidx2 ptr idx mem)
  9867  	for {
  9868  		ptr := v_0
  9869  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
  9870  			break
  9871  		}
  9872  		idx := v_1.Args[0]
  9873  		mem := v_2
  9874  		v.reset(OpARM64MOVHUloadidx2)
  9875  		v.AddArg3(ptr, idx, mem)
  9876  		return true
  9877  	}
  9878  	// match: (MOVHUloadidx ptr (ADD idx idx) mem)
  9879  	// result: (MOVHUloadidx2 ptr idx mem)
  9880  	for {
  9881  		ptr := v_0
  9882  		if v_1.Op != OpARM64ADD {
  9883  			break
  9884  		}
  9885  		idx := v_1.Args[1]
  9886  		if idx != v_1.Args[0] {
  9887  			break
  9888  		}
  9889  		mem := v_2
  9890  		v.reset(OpARM64MOVHUloadidx2)
  9891  		v.AddArg3(ptr, idx, mem)
  9892  		return true
  9893  	}
  9894  	// match: (MOVHUloadidx (ADD idx idx) ptr mem)
  9895  	// result: (MOVHUloadidx2 ptr idx mem)
  9896  	for {
  9897  		if v_0.Op != OpARM64ADD {
  9898  			break
  9899  		}
  9900  		idx := v_0.Args[1]
  9901  		if idx != v_0.Args[0] {
  9902  			break
  9903  		}
  9904  		ptr := v_1
  9905  		mem := v_2
  9906  		v.reset(OpARM64MOVHUloadidx2)
  9907  		v.AddArg3(ptr, idx, mem)
  9908  		return true
  9909  	}
  9910  	return false
  9911  }
  9912  func rewriteValueARM64_OpARM64MOVHUloadidx2(v *Value) bool {
  9913  	v_2 := v.Args[2]
  9914  	v_1 := v.Args[1]
  9915  	v_0 := v.Args[0]
  9916  	// match: (MOVHUloadidx2 ptr (MOVDconst [c]) mem)
  9917  	// cond: is32Bit(c<<1)
  9918  	// result: (MOVHUload [int32(c)<<1] ptr mem)
  9919  	for {
  9920  		ptr := v_0
  9921  		if v_1.Op != OpARM64MOVDconst {
  9922  			break
  9923  		}
  9924  		c := auxIntToInt64(v_1.AuxInt)
  9925  		mem := v_2
  9926  		if !(is32Bit(c << 1)) {
  9927  			break
  9928  		}
  9929  		v.reset(OpARM64MOVHUload)
  9930  		v.AuxInt = int32ToAuxInt(int32(c) << 1)
  9931  		v.AddArg2(ptr, mem)
  9932  		return true
  9933  	}
  9934  	return false
  9935  }
  9936  func rewriteValueARM64_OpARM64MOVHUreg(v *Value) bool {
  9937  	v_0 := v.Args[0]
  9938  	// match: (MOVHUreg (ANDconst [c] x))
  9939  	// result: (ANDconst [c&(1<<16-1)] x)
  9940  	for {
  9941  		if v_0.Op != OpARM64ANDconst {
  9942  			break
  9943  		}
  9944  		c := auxIntToInt64(v_0.AuxInt)
  9945  		x := v_0.Args[0]
  9946  		v.reset(OpARM64ANDconst)
  9947  		v.AuxInt = int64ToAuxInt(c & (1<<16 - 1))
  9948  		v.AddArg(x)
  9949  		return true
  9950  	}
  9951  	// match: (MOVHUreg (MOVDconst [c]))
  9952  	// result: (MOVDconst [int64(uint16(c))])
  9953  	for {
  9954  		if v_0.Op != OpARM64MOVDconst {
  9955  			break
  9956  		}
  9957  		c := auxIntToInt64(v_0.AuxInt)
  9958  		v.reset(OpARM64MOVDconst)
  9959  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  9960  		return true
  9961  	}
  9962  	// match: (MOVHUreg x)
  9963  	// cond: v.Type.Size() <= 2
  9964  	// result: x
  9965  	for {
  9966  		x := v_0
  9967  		if !(v.Type.Size() <= 2) {
  9968  			break
  9969  		}
  9970  		v.copyOf(x)
  9971  		return true
  9972  	}
  9973  	// match: (MOVHUreg (SLLconst [lc] x))
  9974  	// cond: lc >= 16
  9975  	// result: (MOVDconst [0])
  9976  	for {
  9977  		if v_0.Op != OpARM64SLLconst {
  9978  			break
  9979  		}
  9980  		lc := auxIntToInt64(v_0.AuxInt)
  9981  		if !(lc >= 16) {
  9982  			break
  9983  		}
  9984  		v.reset(OpARM64MOVDconst)
  9985  		v.AuxInt = int64ToAuxInt(0)
  9986  		return true
  9987  	}
  9988  	// match: (MOVHUreg (SLLconst [lc] x))
  9989  	// cond: lc < 16
  9990  	// result: (UBFIZ [armBFAuxInt(lc, 16-lc)] x)
  9991  	for {
  9992  		if v_0.Op != OpARM64SLLconst {
  9993  			break
  9994  		}
  9995  		lc := auxIntToInt64(v_0.AuxInt)
  9996  		x := v_0.Args[0]
  9997  		if !(lc < 16) {
  9998  			break
  9999  		}
 10000  		v.reset(OpARM64UBFIZ)
 10001  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 16-lc))
 10002  		v.AddArg(x)
 10003  		return true
 10004  	}
 10005  	// match: (MOVHUreg (SRLconst [rc] x))
 10006  	// cond: rc < 16
 10007  	// result: (UBFX [armBFAuxInt(rc, 16)] x)
 10008  	for {
 10009  		if v_0.Op != OpARM64SRLconst {
 10010  			break
 10011  		}
 10012  		rc := auxIntToInt64(v_0.AuxInt)
 10013  		x := v_0.Args[0]
 10014  		if !(rc < 16) {
 10015  			break
 10016  		}
 10017  		v.reset(OpARM64UBFX)
 10018  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16))
 10019  		v.AddArg(x)
 10020  		return true
 10021  	}
 10022  	// match: (MOVHUreg (UBFX [bfc] x))
 10023  	// cond: bfc.width() <= 16
 10024  	// result: (UBFX [bfc] x)
 10025  	for {
 10026  		if v_0.Op != OpARM64UBFX {
 10027  			break
 10028  		}
 10029  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 10030  		x := v_0.Args[0]
 10031  		if !(bfc.width() <= 16) {
 10032  			break
 10033  		}
 10034  		v.reset(OpARM64UBFX)
 10035  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 10036  		v.AddArg(x)
 10037  		return true
 10038  	}
 10039  	return false
 10040  }
 10041  func rewriteValueARM64_OpARM64MOVHload(v *Value) bool {
 10042  	v_1 := v.Args[1]
 10043  	v_0 := v.Args[0]
 10044  	b := v.Block
 10045  	config := b.Func.Config
 10046  	// match: (MOVHload [off1] {sym} (ADDconst [off2] ptr) mem)
 10047  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10048  	// result: (MOVHload [off1+int32(off2)] {sym} ptr mem)
 10049  	for {
 10050  		off1 := auxIntToInt32(v.AuxInt)
 10051  		sym := auxToSym(v.Aux)
 10052  		if v_0.Op != OpARM64ADDconst {
 10053  			break
 10054  		}
 10055  		off2 := auxIntToInt64(v_0.AuxInt)
 10056  		ptr := v_0.Args[0]
 10057  		mem := v_1
 10058  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10059  			break
 10060  		}
 10061  		v.reset(OpARM64MOVHload)
 10062  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10063  		v.Aux = symToAux(sym)
 10064  		v.AddArg2(ptr, mem)
 10065  		return true
 10066  	}
 10067  	// match: (MOVHload [off] {sym} (ADD ptr idx) mem)
 10068  	// cond: off == 0 && sym == nil
 10069  	// result: (MOVHloadidx ptr idx mem)
 10070  	for {
 10071  		off := auxIntToInt32(v.AuxInt)
 10072  		sym := auxToSym(v.Aux)
 10073  		if v_0.Op != OpARM64ADD {
 10074  			break
 10075  		}
 10076  		idx := v_0.Args[1]
 10077  		ptr := v_0.Args[0]
 10078  		mem := v_1
 10079  		if !(off == 0 && sym == nil) {
 10080  			break
 10081  		}
 10082  		v.reset(OpARM64MOVHloadidx)
 10083  		v.AddArg3(ptr, idx, mem)
 10084  		return true
 10085  	}
 10086  	// match: (MOVHload [off] {sym} (ADDshiftLL [1] ptr idx) mem)
 10087  	// cond: off == 0 && sym == nil
 10088  	// result: (MOVHloadidx2 ptr idx mem)
 10089  	for {
 10090  		off := auxIntToInt32(v.AuxInt)
 10091  		sym := auxToSym(v.Aux)
 10092  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
 10093  			break
 10094  		}
 10095  		idx := v_0.Args[1]
 10096  		ptr := v_0.Args[0]
 10097  		mem := v_1
 10098  		if !(off == 0 && sym == nil) {
 10099  			break
 10100  		}
 10101  		v.reset(OpARM64MOVHloadidx2)
 10102  		v.AddArg3(ptr, idx, mem)
 10103  		return true
 10104  	}
 10105  	// match: (MOVHload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 10106  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10107  	// result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10108  	for {
 10109  		off1 := auxIntToInt32(v.AuxInt)
 10110  		sym1 := auxToSym(v.Aux)
 10111  		if v_0.Op != OpARM64MOVDaddr {
 10112  			break
 10113  		}
 10114  		off2 := auxIntToInt32(v_0.AuxInt)
 10115  		sym2 := auxToSym(v_0.Aux)
 10116  		ptr := v_0.Args[0]
 10117  		mem := v_1
 10118  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10119  			break
 10120  		}
 10121  		v.reset(OpARM64MOVHload)
 10122  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10123  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10124  		v.AddArg2(ptr, mem)
 10125  		return true
 10126  	}
 10127  	// match: (MOVHload [off] {sym} (SB) _)
 10128  	// cond: symIsRO(sym)
 10129  	// result: (MOVDconst [int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
 10130  	for {
 10131  		off := auxIntToInt32(v.AuxInt)
 10132  		sym := auxToSym(v.Aux)
 10133  		if v_0.Op != OpSB || !(symIsRO(sym)) {
 10134  			break
 10135  		}
 10136  		v.reset(OpARM64MOVDconst)
 10137  		v.AuxInt = int64ToAuxInt(int64(int16(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))))
 10138  		return true
 10139  	}
 10140  	return false
 10141  }
 10142  func rewriteValueARM64_OpARM64MOVHloadidx(v *Value) bool {
 10143  	v_2 := v.Args[2]
 10144  	v_1 := v.Args[1]
 10145  	v_0 := v.Args[0]
 10146  	// match: (MOVHloadidx ptr (MOVDconst [c]) mem)
 10147  	// cond: is32Bit(c)
 10148  	// result: (MOVHload [int32(c)] ptr mem)
 10149  	for {
 10150  		ptr := v_0
 10151  		if v_1.Op != OpARM64MOVDconst {
 10152  			break
 10153  		}
 10154  		c := auxIntToInt64(v_1.AuxInt)
 10155  		mem := v_2
 10156  		if !(is32Bit(c)) {
 10157  			break
 10158  		}
 10159  		v.reset(OpARM64MOVHload)
 10160  		v.AuxInt = int32ToAuxInt(int32(c))
 10161  		v.AddArg2(ptr, mem)
 10162  		return true
 10163  	}
 10164  	// match: (MOVHloadidx (MOVDconst [c]) ptr mem)
 10165  	// cond: is32Bit(c)
 10166  	// result: (MOVHload [int32(c)] ptr mem)
 10167  	for {
 10168  		if v_0.Op != OpARM64MOVDconst {
 10169  			break
 10170  		}
 10171  		c := auxIntToInt64(v_0.AuxInt)
 10172  		ptr := v_1
 10173  		mem := v_2
 10174  		if !(is32Bit(c)) {
 10175  			break
 10176  		}
 10177  		v.reset(OpARM64MOVHload)
 10178  		v.AuxInt = int32ToAuxInt(int32(c))
 10179  		v.AddArg2(ptr, mem)
 10180  		return true
 10181  	}
 10182  	// match: (MOVHloadidx ptr (SLLconst [1] idx) mem)
 10183  	// result: (MOVHloadidx2 ptr idx mem)
 10184  	for {
 10185  		ptr := v_0
 10186  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
 10187  			break
 10188  		}
 10189  		idx := v_1.Args[0]
 10190  		mem := v_2
 10191  		v.reset(OpARM64MOVHloadidx2)
 10192  		v.AddArg3(ptr, idx, mem)
 10193  		return true
 10194  	}
 10195  	// match: (MOVHloadidx ptr (ADD idx idx) mem)
 10196  	// result: (MOVHloadidx2 ptr idx mem)
 10197  	for {
 10198  		ptr := v_0
 10199  		if v_1.Op != OpARM64ADD {
 10200  			break
 10201  		}
 10202  		idx := v_1.Args[1]
 10203  		if idx != v_1.Args[0] {
 10204  			break
 10205  		}
 10206  		mem := v_2
 10207  		v.reset(OpARM64MOVHloadidx2)
 10208  		v.AddArg3(ptr, idx, mem)
 10209  		return true
 10210  	}
 10211  	// match: (MOVHloadidx (ADD idx idx) ptr mem)
 10212  	// result: (MOVHloadidx2 ptr idx mem)
 10213  	for {
 10214  		if v_0.Op != OpARM64ADD {
 10215  			break
 10216  		}
 10217  		idx := v_0.Args[1]
 10218  		if idx != v_0.Args[0] {
 10219  			break
 10220  		}
 10221  		ptr := v_1
 10222  		mem := v_2
 10223  		v.reset(OpARM64MOVHloadidx2)
 10224  		v.AddArg3(ptr, idx, mem)
 10225  		return true
 10226  	}
 10227  	return false
 10228  }
 10229  func rewriteValueARM64_OpARM64MOVHloadidx2(v *Value) bool {
 10230  	v_2 := v.Args[2]
 10231  	v_1 := v.Args[1]
 10232  	v_0 := v.Args[0]
 10233  	// match: (MOVHloadidx2 ptr (MOVDconst [c]) mem)
 10234  	// cond: is32Bit(c<<1)
 10235  	// result: (MOVHload [int32(c)<<1] ptr mem)
 10236  	for {
 10237  		ptr := v_0
 10238  		if v_1.Op != OpARM64MOVDconst {
 10239  			break
 10240  		}
 10241  		c := auxIntToInt64(v_1.AuxInt)
 10242  		mem := v_2
 10243  		if !(is32Bit(c << 1)) {
 10244  			break
 10245  		}
 10246  		v.reset(OpARM64MOVHload)
 10247  		v.AuxInt = int32ToAuxInt(int32(c) << 1)
 10248  		v.AddArg2(ptr, mem)
 10249  		return true
 10250  	}
 10251  	return false
 10252  }
 10253  func rewriteValueARM64_OpARM64MOVHreg(v *Value) bool {
 10254  	v_0 := v.Args[0]
 10255  	// match: (MOVHreg (MOVDconst [c]))
 10256  	// result: (MOVDconst [int64(int16(c))])
 10257  	for {
 10258  		if v_0.Op != OpARM64MOVDconst {
 10259  			break
 10260  		}
 10261  		c := auxIntToInt64(v_0.AuxInt)
 10262  		v.reset(OpARM64MOVDconst)
 10263  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
 10264  		return true
 10265  	}
 10266  	// match: (MOVHreg x)
 10267  	// cond: v.Type.Size() <= 2
 10268  	// result: x
 10269  	for {
 10270  		x := v_0
 10271  		if !(v.Type.Size() <= 2) {
 10272  			break
 10273  		}
 10274  		v.copyOf(x)
 10275  		return true
 10276  	}
 10277  	// match: (MOVHreg <t> (ANDconst x [c]))
 10278  	// cond: uint64(c) & uint64(0xffffffffffff8000) == 0
 10279  	// result: (ANDconst <t> x [c])
 10280  	for {
 10281  		t := v.Type
 10282  		if v_0.Op != OpARM64ANDconst {
 10283  			break
 10284  		}
 10285  		c := auxIntToInt64(v_0.AuxInt)
 10286  		x := v_0.Args[0]
 10287  		if !(uint64(c)&uint64(0xffffffffffff8000) == 0) {
 10288  			break
 10289  		}
 10290  		v.reset(OpARM64ANDconst)
 10291  		v.Type = t
 10292  		v.AuxInt = int64ToAuxInt(c)
 10293  		v.AddArg(x)
 10294  		return true
 10295  	}
 10296  	// match: (MOVHreg (SLLconst [lc] x))
 10297  	// cond: lc < 16
 10298  	// result: (SBFIZ [armBFAuxInt(lc, 16-lc)] x)
 10299  	for {
 10300  		if v_0.Op != OpARM64SLLconst {
 10301  			break
 10302  		}
 10303  		lc := auxIntToInt64(v_0.AuxInt)
 10304  		x := v_0.Args[0]
 10305  		if !(lc < 16) {
 10306  			break
 10307  		}
 10308  		v.reset(OpARM64SBFIZ)
 10309  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 16-lc))
 10310  		v.AddArg(x)
 10311  		return true
 10312  	}
 10313  	// match: (MOVHreg (SBFX [bfc] x))
 10314  	// cond: bfc.width() <= 16
 10315  	// result: (SBFX [bfc] x)
 10316  	for {
 10317  		if v_0.Op != OpARM64SBFX {
 10318  			break
 10319  		}
 10320  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 10321  		x := v_0.Args[0]
 10322  		if !(bfc.width() <= 16) {
 10323  			break
 10324  		}
 10325  		v.reset(OpARM64SBFX)
 10326  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 10327  		v.AddArg(x)
 10328  		return true
 10329  	}
 10330  	return false
 10331  }
 10332  func rewriteValueARM64_OpARM64MOVHstore(v *Value) bool {
 10333  	v_2 := v.Args[2]
 10334  	v_1 := v.Args[1]
 10335  	v_0 := v.Args[0]
 10336  	b := v.Block
 10337  	config := b.Func.Config
 10338  	// match: (MOVHstore [off1] {sym} (ADDconst [off2] ptr) val mem)
 10339  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10340  	// result: (MOVHstore [off1+int32(off2)] {sym} ptr val mem)
 10341  	for {
 10342  		off1 := auxIntToInt32(v.AuxInt)
 10343  		sym := auxToSym(v.Aux)
 10344  		if v_0.Op != OpARM64ADDconst {
 10345  			break
 10346  		}
 10347  		off2 := auxIntToInt64(v_0.AuxInt)
 10348  		ptr := v_0.Args[0]
 10349  		val := v_1
 10350  		mem := v_2
 10351  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10352  			break
 10353  		}
 10354  		v.reset(OpARM64MOVHstore)
 10355  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10356  		v.Aux = symToAux(sym)
 10357  		v.AddArg3(ptr, val, mem)
 10358  		return true
 10359  	}
 10360  	// match: (MOVHstore [off] {sym} (ADD ptr idx) val mem)
 10361  	// cond: off == 0 && sym == nil
 10362  	// result: (MOVHstoreidx ptr idx val mem)
 10363  	for {
 10364  		off := auxIntToInt32(v.AuxInt)
 10365  		sym := auxToSym(v.Aux)
 10366  		if v_0.Op != OpARM64ADD {
 10367  			break
 10368  		}
 10369  		idx := v_0.Args[1]
 10370  		ptr := v_0.Args[0]
 10371  		val := v_1
 10372  		mem := v_2
 10373  		if !(off == 0 && sym == nil) {
 10374  			break
 10375  		}
 10376  		v.reset(OpARM64MOVHstoreidx)
 10377  		v.AddArg4(ptr, idx, val, mem)
 10378  		return true
 10379  	}
 10380  	// match: (MOVHstore [off] {sym} (ADDshiftLL [1] ptr idx) val mem)
 10381  	// cond: off == 0 && sym == nil
 10382  	// result: (MOVHstoreidx2 ptr idx val mem)
 10383  	for {
 10384  		off := auxIntToInt32(v.AuxInt)
 10385  		sym := auxToSym(v.Aux)
 10386  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
 10387  			break
 10388  		}
 10389  		idx := v_0.Args[1]
 10390  		ptr := v_0.Args[0]
 10391  		val := v_1
 10392  		mem := v_2
 10393  		if !(off == 0 && sym == nil) {
 10394  			break
 10395  		}
 10396  		v.reset(OpARM64MOVHstoreidx2)
 10397  		v.AddArg4(ptr, idx, val, mem)
 10398  		return true
 10399  	}
 10400  	// match: (MOVHstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
 10401  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10402  	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 10403  	for {
 10404  		off1 := auxIntToInt32(v.AuxInt)
 10405  		sym1 := auxToSym(v.Aux)
 10406  		if v_0.Op != OpARM64MOVDaddr {
 10407  			break
 10408  		}
 10409  		off2 := auxIntToInt32(v_0.AuxInt)
 10410  		sym2 := auxToSym(v_0.Aux)
 10411  		ptr := v_0.Args[0]
 10412  		val := v_1
 10413  		mem := v_2
 10414  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10415  			break
 10416  		}
 10417  		v.reset(OpARM64MOVHstore)
 10418  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10419  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10420  		v.AddArg3(ptr, val, mem)
 10421  		return true
 10422  	}
 10423  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
 10424  	// result: (MOVHstore [off] {sym} ptr x mem)
 10425  	for {
 10426  		off := auxIntToInt32(v.AuxInt)
 10427  		sym := auxToSym(v.Aux)
 10428  		ptr := v_0
 10429  		if v_1.Op != OpARM64MOVHreg {
 10430  			break
 10431  		}
 10432  		x := v_1.Args[0]
 10433  		mem := v_2
 10434  		v.reset(OpARM64MOVHstore)
 10435  		v.AuxInt = int32ToAuxInt(off)
 10436  		v.Aux = symToAux(sym)
 10437  		v.AddArg3(ptr, x, mem)
 10438  		return true
 10439  	}
 10440  	// match: (MOVHstore [off] {sym} ptr (MOVHUreg x) mem)
 10441  	// result: (MOVHstore [off] {sym} ptr x mem)
 10442  	for {
 10443  		off := auxIntToInt32(v.AuxInt)
 10444  		sym := auxToSym(v.Aux)
 10445  		ptr := v_0
 10446  		if v_1.Op != OpARM64MOVHUreg {
 10447  			break
 10448  		}
 10449  		x := v_1.Args[0]
 10450  		mem := v_2
 10451  		v.reset(OpARM64MOVHstore)
 10452  		v.AuxInt = int32ToAuxInt(off)
 10453  		v.Aux = symToAux(sym)
 10454  		v.AddArg3(ptr, x, mem)
 10455  		return true
 10456  	}
 10457  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
 10458  	// result: (MOVHstore [off] {sym} ptr x mem)
 10459  	for {
 10460  		off := auxIntToInt32(v.AuxInt)
 10461  		sym := auxToSym(v.Aux)
 10462  		ptr := v_0
 10463  		if v_1.Op != OpARM64MOVWreg {
 10464  			break
 10465  		}
 10466  		x := v_1.Args[0]
 10467  		mem := v_2
 10468  		v.reset(OpARM64MOVHstore)
 10469  		v.AuxInt = int32ToAuxInt(off)
 10470  		v.Aux = symToAux(sym)
 10471  		v.AddArg3(ptr, x, mem)
 10472  		return true
 10473  	}
 10474  	// match: (MOVHstore [off] {sym} ptr (MOVWUreg x) mem)
 10475  	// result: (MOVHstore [off] {sym} ptr x mem)
 10476  	for {
 10477  		off := auxIntToInt32(v.AuxInt)
 10478  		sym := auxToSym(v.Aux)
 10479  		ptr := v_0
 10480  		if v_1.Op != OpARM64MOVWUreg {
 10481  			break
 10482  		}
 10483  		x := v_1.Args[0]
 10484  		mem := v_2
 10485  		v.reset(OpARM64MOVHstore)
 10486  		v.AuxInt = int32ToAuxInt(off)
 10487  		v.Aux = symToAux(sym)
 10488  		v.AddArg3(ptr, x, mem)
 10489  		return true
 10490  	}
 10491  	return false
 10492  }
 10493  func rewriteValueARM64_OpARM64MOVHstoreidx(v *Value) bool {
 10494  	v_3 := v.Args[3]
 10495  	v_2 := v.Args[2]
 10496  	v_1 := v.Args[1]
 10497  	v_0 := v.Args[0]
 10498  	// match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
 10499  	// cond: is32Bit(c)
 10500  	// result: (MOVHstore [int32(c)] ptr val mem)
 10501  	for {
 10502  		ptr := v_0
 10503  		if v_1.Op != OpARM64MOVDconst {
 10504  			break
 10505  		}
 10506  		c := auxIntToInt64(v_1.AuxInt)
 10507  		val := v_2
 10508  		mem := v_3
 10509  		if !(is32Bit(c)) {
 10510  			break
 10511  		}
 10512  		v.reset(OpARM64MOVHstore)
 10513  		v.AuxInt = int32ToAuxInt(int32(c))
 10514  		v.AddArg3(ptr, val, mem)
 10515  		return true
 10516  	}
 10517  	// match: (MOVHstoreidx (MOVDconst [c]) idx val mem)
 10518  	// cond: is32Bit(c)
 10519  	// result: (MOVHstore [int32(c)] idx val mem)
 10520  	for {
 10521  		if v_0.Op != OpARM64MOVDconst {
 10522  			break
 10523  		}
 10524  		c := auxIntToInt64(v_0.AuxInt)
 10525  		idx := v_1
 10526  		val := v_2
 10527  		mem := v_3
 10528  		if !(is32Bit(c)) {
 10529  			break
 10530  		}
 10531  		v.reset(OpARM64MOVHstore)
 10532  		v.AuxInt = int32ToAuxInt(int32(c))
 10533  		v.AddArg3(idx, val, mem)
 10534  		return true
 10535  	}
 10536  	// match: (MOVHstoreidx ptr (SLLconst [1] idx) val mem)
 10537  	// result: (MOVHstoreidx2 ptr idx val mem)
 10538  	for {
 10539  		ptr := v_0
 10540  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
 10541  			break
 10542  		}
 10543  		idx := v_1.Args[0]
 10544  		val := v_2
 10545  		mem := v_3
 10546  		v.reset(OpARM64MOVHstoreidx2)
 10547  		v.AddArg4(ptr, idx, val, mem)
 10548  		return true
 10549  	}
 10550  	// match: (MOVHstoreidx ptr (ADD idx idx) val mem)
 10551  	// result: (MOVHstoreidx2 ptr idx val mem)
 10552  	for {
 10553  		ptr := v_0
 10554  		if v_1.Op != OpARM64ADD {
 10555  			break
 10556  		}
 10557  		idx := v_1.Args[1]
 10558  		if idx != v_1.Args[0] {
 10559  			break
 10560  		}
 10561  		val := v_2
 10562  		mem := v_3
 10563  		v.reset(OpARM64MOVHstoreidx2)
 10564  		v.AddArg4(ptr, idx, val, mem)
 10565  		return true
 10566  	}
 10567  	// match: (MOVHstoreidx (SLLconst [1] idx) ptr val mem)
 10568  	// result: (MOVHstoreidx2 ptr idx val mem)
 10569  	for {
 10570  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 1 {
 10571  			break
 10572  		}
 10573  		idx := v_0.Args[0]
 10574  		ptr := v_1
 10575  		val := v_2
 10576  		mem := v_3
 10577  		v.reset(OpARM64MOVHstoreidx2)
 10578  		v.AddArg4(ptr, idx, val, mem)
 10579  		return true
 10580  	}
 10581  	// match: (MOVHstoreidx (ADD idx idx) ptr val mem)
 10582  	// result: (MOVHstoreidx2 ptr idx val mem)
 10583  	for {
 10584  		if v_0.Op != OpARM64ADD {
 10585  			break
 10586  		}
 10587  		idx := v_0.Args[1]
 10588  		if idx != v_0.Args[0] {
 10589  			break
 10590  		}
 10591  		ptr := v_1
 10592  		val := v_2
 10593  		mem := v_3
 10594  		v.reset(OpARM64MOVHstoreidx2)
 10595  		v.AddArg4(ptr, idx, val, mem)
 10596  		return true
 10597  	}
 10598  	// match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
 10599  	// result: (MOVHstoreidx ptr idx x mem)
 10600  	for {
 10601  		ptr := v_0
 10602  		idx := v_1
 10603  		if v_2.Op != OpARM64MOVHreg {
 10604  			break
 10605  		}
 10606  		x := v_2.Args[0]
 10607  		mem := v_3
 10608  		v.reset(OpARM64MOVHstoreidx)
 10609  		v.AddArg4(ptr, idx, x, mem)
 10610  		return true
 10611  	}
 10612  	// match: (MOVHstoreidx ptr idx (MOVHUreg x) mem)
 10613  	// result: (MOVHstoreidx ptr idx x mem)
 10614  	for {
 10615  		ptr := v_0
 10616  		idx := v_1
 10617  		if v_2.Op != OpARM64MOVHUreg {
 10618  			break
 10619  		}
 10620  		x := v_2.Args[0]
 10621  		mem := v_3
 10622  		v.reset(OpARM64MOVHstoreidx)
 10623  		v.AddArg4(ptr, idx, x, mem)
 10624  		return true
 10625  	}
 10626  	// match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
 10627  	// result: (MOVHstoreidx ptr idx x mem)
 10628  	for {
 10629  		ptr := v_0
 10630  		idx := v_1
 10631  		if v_2.Op != OpARM64MOVWreg {
 10632  			break
 10633  		}
 10634  		x := v_2.Args[0]
 10635  		mem := v_3
 10636  		v.reset(OpARM64MOVHstoreidx)
 10637  		v.AddArg4(ptr, idx, x, mem)
 10638  		return true
 10639  	}
 10640  	// match: (MOVHstoreidx ptr idx (MOVWUreg x) mem)
 10641  	// result: (MOVHstoreidx ptr idx x mem)
 10642  	for {
 10643  		ptr := v_0
 10644  		idx := v_1
 10645  		if v_2.Op != OpARM64MOVWUreg {
 10646  			break
 10647  		}
 10648  		x := v_2.Args[0]
 10649  		mem := v_3
 10650  		v.reset(OpARM64MOVHstoreidx)
 10651  		v.AddArg4(ptr, idx, x, mem)
 10652  		return true
 10653  	}
 10654  	return false
 10655  }
 10656  func rewriteValueARM64_OpARM64MOVHstoreidx2(v *Value) bool {
 10657  	v_3 := v.Args[3]
 10658  	v_2 := v.Args[2]
 10659  	v_1 := v.Args[1]
 10660  	v_0 := v.Args[0]
 10661  	// match: (MOVHstoreidx2 ptr (MOVDconst [c]) val mem)
 10662  	// cond: is32Bit(c<<1)
 10663  	// result: (MOVHstore [int32(c)<<1] ptr val mem)
 10664  	for {
 10665  		ptr := v_0
 10666  		if v_1.Op != OpARM64MOVDconst {
 10667  			break
 10668  		}
 10669  		c := auxIntToInt64(v_1.AuxInt)
 10670  		val := v_2
 10671  		mem := v_3
 10672  		if !(is32Bit(c << 1)) {
 10673  			break
 10674  		}
 10675  		v.reset(OpARM64MOVHstore)
 10676  		v.AuxInt = int32ToAuxInt(int32(c) << 1)
 10677  		v.AddArg3(ptr, val, mem)
 10678  		return true
 10679  	}
 10680  	// match: (MOVHstoreidx2 ptr idx (MOVHreg x) mem)
 10681  	// result: (MOVHstoreidx2 ptr idx x mem)
 10682  	for {
 10683  		ptr := v_0
 10684  		idx := v_1
 10685  		if v_2.Op != OpARM64MOVHreg {
 10686  			break
 10687  		}
 10688  		x := v_2.Args[0]
 10689  		mem := v_3
 10690  		v.reset(OpARM64MOVHstoreidx2)
 10691  		v.AddArg4(ptr, idx, x, mem)
 10692  		return true
 10693  	}
 10694  	// match: (MOVHstoreidx2 ptr idx (MOVHUreg x) mem)
 10695  	// result: (MOVHstoreidx2 ptr idx x mem)
 10696  	for {
 10697  		ptr := v_0
 10698  		idx := v_1
 10699  		if v_2.Op != OpARM64MOVHUreg {
 10700  			break
 10701  		}
 10702  		x := v_2.Args[0]
 10703  		mem := v_3
 10704  		v.reset(OpARM64MOVHstoreidx2)
 10705  		v.AddArg4(ptr, idx, x, mem)
 10706  		return true
 10707  	}
 10708  	// match: (MOVHstoreidx2 ptr idx (MOVWreg x) mem)
 10709  	// result: (MOVHstoreidx2 ptr idx x mem)
 10710  	for {
 10711  		ptr := v_0
 10712  		idx := v_1
 10713  		if v_2.Op != OpARM64MOVWreg {
 10714  			break
 10715  		}
 10716  		x := v_2.Args[0]
 10717  		mem := v_3
 10718  		v.reset(OpARM64MOVHstoreidx2)
 10719  		v.AddArg4(ptr, idx, x, mem)
 10720  		return true
 10721  	}
 10722  	// match: (MOVHstoreidx2 ptr idx (MOVWUreg x) mem)
 10723  	// result: (MOVHstoreidx2 ptr idx x mem)
 10724  	for {
 10725  		ptr := v_0
 10726  		idx := v_1
 10727  		if v_2.Op != OpARM64MOVWUreg {
 10728  			break
 10729  		}
 10730  		x := v_2.Args[0]
 10731  		mem := v_3
 10732  		v.reset(OpARM64MOVHstoreidx2)
 10733  		v.AddArg4(ptr, idx, x, mem)
 10734  		return true
 10735  	}
 10736  	return false
 10737  }
 10738  func rewriteValueARM64_OpARM64MOVWUload(v *Value) bool {
 10739  	v_1 := v.Args[1]
 10740  	v_0 := v.Args[0]
 10741  	b := v.Block
 10742  	config := b.Func.Config
 10743  	// match: (MOVWUload [off] {sym} ptr (FMOVSstore [off] {sym} ptr val _))
 10744  	// result: (FMOVSfpgp val)
 10745  	for {
 10746  		off := auxIntToInt32(v.AuxInt)
 10747  		sym := auxToSym(v.Aux)
 10748  		ptr := v_0
 10749  		if v_1.Op != OpARM64FMOVSstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
 10750  			break
 10751  		}
 10752  		val := v_1.Args[1]
 10753  		if ptr != v_1.Args[0] {
 10754  			break
 10755  		}
 10756  		v.reset(OpARM64FMOVSfpgp)
 10757  		v.AddArg(val)
 10758  		return true
 10759  	}
 10760  	// match: (MOVWUload [off1] {sym} (ADDconst [off2] ptr) mem)
 10761  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10762  	// result: (MOVWUload [off1+int32(off2)] {sym} ptr mem)
 10763  	for {
 10764  		off1 := auxIntToInt32(v.AuxInt)
 10765  		sym := auxToSym(v.Aux)
 10766  		if v_0.Op != OpARM64ADDconst {
 10767  			break
 10768  		}
 10769  		off2 := auxIntToInt64(v_0.AuxInt)
 10770  		ptr := v_0.Args[0]
 10771  		mem := v_1
 10772  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10773  			break
 10774  		}
 10775  		v.reset(OpARM64MOVWUload)
 10776  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10777  		v.Aux = symToAux(sym)
 10778  		v.AddArg2(ptr, mem)
 10779  		return true
 10780  	}
 10781  	// match: (MOVWUload [off] {sym} (ADD ptr idx) mem)
 10782  	// cond: off == 0 && sym == nil
 10783  	// result: (MOVWUloadidx ptr idx mem)
 10784  	for {
 10785  		off := auxIntToInt32(v.AuxInt)
 10786  		sym := auxToSym(v.Aux)
 10787  		if v_0.Op != OpARM64ADD {
 10788  			break
 10789  		}
 10790  		idx := v_0.Args[1]
 10791  		ptr := v_0.Args[0]
 10792  		mem := v_1
 10793  		if !(off == 0 && sym == nil) {
 10794  			break
 10795  		}
 10796  		v.reset(OpARM64MOVWUloadidx)
 10797  		v.AddArg3(ptr, idx, mem)
 10798  		return true
 10799  	}
 10800  	// match: (MOVWUload [off] {sym} (ADDshiftLL [2] ptr idx) mem)
 10801  	// cond: off == 0 && sym == nil
 10802  	// result: (MOVWUloadidx4 ptr idx mem)
 10803  	for {
 10804  		off := auxIntToInt32(v.AuxInt)
 10805  		sym := auxToSym(v.Aux)
 10806  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
 10807  			break
 10808  		}
 10809  		idx := v_0.Args[1]
 10810  		ptr := v_0.Args[0]
 10811  		mem := v_1
 10812  		if !(off == 0 && sym == nil) {
 10813  			break
 10814  		}
 10815  		v.reset(OpARM64MOVWUloadidx4)
 10816  		v.AddArg3(ptr, idx, mem)
 10817  		return true
 10818  	}
 10819  	// match: (MOVWUload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 10820  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10821  	// result: (MOVWUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10822  	for {
 10823  		off1 := auxIntToInt32(v.AuxInt)
 10824  		sym1 := auxToSym(v.Aux)
 10825  		if v_0.Op != OpARM64MOVDaddr {
 10826  			break
 10827  		}
 10828  		off2 := auxIntToInt32(v_0.AuxInt)
 10829  		sym2 := auxToSym(v_0.Aux)
 10830  		ptr := v_0.Args[0]
 10831  		mem := v_1
 10832  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10833  			break
 10834  		}
 10835  		v.reset(OpARM64MOVWUload)
 10836  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10837  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10838  		v.AddArg2(ptr, mem)
 10839  		return true
 10840  	}
 10841  	// match: (MOVWUload [off] {sym} (SB) _)
 10842  	// cond: symIsRO(sym)
 10843  	// result: (MOVDconst [int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
 10844  	for {
 10845  		off := auxIntToInt32(v.AuxInt)
 10846  		sym := auxToSym(v.Aux)
 10847  		if v_0.Op != OpSB || !(symIsRO(sym)) {
 10848  			break
 10849  		}
 10850  		v.reset(OpARM64MOVDconst)
 10851  		v.AuxInt = int64ToAuxInt(int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
 10852  		return true
 10853  	}
 10854  	return false
 10855  }
 10856  func rewriteValueARM64_OpARM64MOVWUloadidx(v *Value) bool {
 10857  	v_2 := v.Args[2]
 10858  	v_1 := v.Args[1]
 10859  	v_0 := v.Args[0]
 10860  	// match: (MOVWUloadidx ptr (MOVDconst [c]) mem)
 10861  	// cond: is32Bit(c)
 10862  	// result: (MOVWUload [int32(c)] ptr mem)
 10863  	for {
 10864  		ptr := v_0
 10865  		if v_1.Op != OpARM64MOVDconst {
 10866  			break
 10867  		}
 10868  		c := auxIntToInt64(v_1.AuxInt)
 10869  		mem := v_2
 10870  		if !(is32Bit(c)) {
 10871  			break
 10872  		}
 10873  		v.reset(OpARM64MOVWUload)
 10874  		v.AuxInt = int32ToAuxInt(int32(c))
 10875  		v.AddArg2(ptr, mem)
 10876  		return true
 10877  	}
 10878  	// match: (MOVWUloadidx (MOVDconst [c]) ptr mem)
 10879  	// cond: is32Bit(c)
 10880  	// result: (MOVWUload [int32(c)] ptr mem)
 10881  	for {
 10882  		if v_0.Op != OpARM64MOVDconst {
 10883  			break
 10884  		}
 10885  		c := auxIntToInt64(v_0.AuxInt)
 10886  		ptr := v_1
 10887  		mem := v_2
 10888  		if !(is32Bit(c)) {
 10889  			break
 10890  		}
 10891  		v.reset(OpARM64MOVWUload)
 10892  		v.AuxInt = int32ToAuxInt(int32(c))
 10893  		v.AddArg2(ptr, mem)
 10894  		return true
 10895  	}
 10896  	// match: (MOVWUloadidx ptr (SLLconst [2] idx) mem)
 10897  	// result: (MOVWUloadidx4 ptr idx mem)
 10898  	for {
 10899  		ptr := v_0
 10900  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
 10901  			break
 10902  		}
 10903  		idx := v_1.Args[0]
 10904  		mem := v_2
 10905  		v.reset(OpARM64MOVWUloadidx4)
 10906  		v.AddArg3(ptr, idx, mem)
 10907  		return true
 10908  	}
 10909  	// match: (MOVWUloadidx (SLLconst [2] idx) ptr mem)
 10910  	// result: (MOVWUloadidx4 ptr idx mem)
 10911  	for {
 10912  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
 10913  			break
 10914  		}
 10915  		idx := v_0.Args[0]
 10916  		ptr := v_1
 10917  		mem := v_2
 10918  		v.reset(OpARM64MOVWUloadidx4)
 10919  		v.AddArg3(ptr, idx, mem)
 10920  		return true
 10921  	}
 10922  	return false
 10923  }
 10924  func rewriteValueARM64_OpARM64MOVWUloadidx4(v *Value) bool {
 10925  	v_2 := v.Args[2]
 10926  	v_1 := v.Args[1]
 10927  	v_0 := v.Args[0]
 10928  	// match: (MOVWUloadidx4 ptr (MOVDconst [c]) mem)
 10929  	// cond: is32Bit(c<<2)
 10930  	// result: (MOVWUload [int32(c)<<2] ptr mem)
 10931  	for {
 10932  		ptr := v_0
 10933  		if v_1.Op != OpARM64MOVDconst {
 10934  			break
 10935  		}
 10936  		c := auxIntToInt64(v_1.AuxInt)
 10937  		mem := v_2
 10938  		if !(is32Bit(c << 2)) {
 10939  			break
 10940  		}
 10941  		v.reset(OpARM64MOVWUload)
 10942  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
 10943  		v.AddArg2(ptr, mem)
 10944  		return true
 10945  	}
 10946  	return false
 10947  }
 10948  func rewriteValueARM64_OpARM64MOVWUreg(v *Value) bool {
 10949  	v_0 := v.Args[0]
 10950  	// match: (MOVWUreg (ANDconst [c] x))
 10951  	// result: (ANDconst [c&(1<<32-1)] x)
 10952  	for {
 10953  		if v_0.Op != OpARM64ANDconst {
 10954  			break
 10955  		}
 10956  		c := auxIntToInt64(v_0.AuxInt)
 10957  		x := v_0.Args[0]
 10958  		v.reset(OpARM64ANDconst)
 10959  		v.AuxInt = int64ToAuxInt(c & (1<<32 - 1))
 10960  		v.AddArg(x)
 10961  		return true
 10962  	}
 10963  	// match: (MOVWUreg (MOVDconst [c]))
 10964  	// result: (MOVDconst [int64(uint32(c))])
 10965  	for {
 10966  		if v_0.Op != OpARM64MOVDconst {
 10967  			break
 10968  		}
 10969  		c := auxIntToInt64(v_0.AuxInt)
 10970  		v.reset(OpARM64MOVDconst)
 10971  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
 10972  		return true
 10973  	}
 10974  	// match: (MOVWUreg x)
 10975  	// cond: v.Type.Size() <= 4
 10976  	// result: x
 10977  	for {
 10978  		x := v_0
 10979  		if !(v.Type.Size() <= 4) {
 10980  			break
 10981  		}
 10982  		v.copyOf(x)
 10983  		return true
 10984  	}
 10985  	// match: (MOVWUreg (SLLconst [lc] x))
 10986  	// cond: lc >= 32
 10987  	// result: (MOVDconst [0])
 10988  	for {
 10989  		if v_0.Op != OpARM64SLLconst {
 10990  			break
 10991  		}
 10992  		lc := auxIntToInt64(v_0.AuxInt)
 10993  		if !(lc >= 32) {
 10994  			break
 10995  		}
 10996  		v.reset(OpARM64MOVDconst)
 10997  		v.AuxInt = int64ToAuxInt(0)
 10998  		return true
 10999  	}
 11000  	// match: (MOVWUreg (SLLconst [lc] x))
 11001  	// cond: lc < 32
 11002  	// result: (UBFIZ [armBFAuxInt(lc, 32-lc)] x)
 11003  	for {
 11004  		if v_0.Op != OpARM64SLLconst {
 11005  			break
 11006  		}
 11007  		lc := auxIntToInt64(v_0.AuxInt)
 11008  		x := v_0.Args[0]
 11009  		if !(lc < 32) {
 11010  			break
 11011  		}
 11012  		v.reset(OpARM64UBFIZ)
 11013  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 32-lc))
 11014  		v.AddArg(x)
 11015  		return true
 11016  	}
 11017  	// match: (MOVWUreg (SRLconst [rc] x))
 11018  	// cond: rc < 32
 11019  	// result: (UBFX [armBFAuxInt(rc, 32)] x)
 11020  	for {
 11021  		if v_0.Op != OpARM64SRLconst {
 11022  			break
 11023  		}
 11024  		rc := auxIntToInt64(v_0.AuxInt)
 11025  		x := v_0.Args[0]
 11026  		if !(rc < 32) {
 11027  			break
 11028  		}
 11029  		v.reset(OpARM64UBFX)
 11030  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32))
 11031  		v.AddArg(x)
 11032  		return true
 11033  	}
 11034  	// match: (MOVWUreg (UBFX [bfc] x))
 11035  	// cond: bfc.width() <= 32
 11036  	// result: (UBFX [bfc] x)
 11037  	for {
 11038  		if v_0.Op != OpARM64UBFX {
 11039  			break
 11040  		}
 11041  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 11042  		x := v_0.Args[0]
 11043  		if !(bfc.width() <= 32) {
 11044  			break
 11045  		}
 11046  		v.reset(OpARM64UBFX)
 11047  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 11048  		v.AddArg(x)
 11049  		return true
 11050  	}
 11051  	return false
 11052  }
 11053  func rewriteValueARM64_OpARM64MOVWload(v *Value) bool {
 11054  	v_1 := v.Args[1]
 11055  	v_0 := v.Args[0]
 11056  	b := v.Block
 11057  	config := b.Func.Config
 11058  	// match: (MOVWload [off1] {sym} (ADDconst [off2] ptr) mem)
 11059  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11060  	// result: (MOVWload [off1+int32(off2)] {sym} ptr mem)
 11061  	for {
 11062  		off1 := auxIntToInt32(v.AuxInt)
 11063  		sym := auxToSym(v.Aux)
 11064  		if v_0.Op != OpARM64ADDconst {
 11065  			break
 11066  		}
 11067  		off2 := auxIntToInt64(v_0.AuxInt)
 11068  		ptr := v_0.Args[0]
 11069  		mem := v_1
 11070  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11071  			break
 11072  		}
 11073  		v.reset(OpARM64MOVWload)
 11074  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11075  		v.Aux = symToAux(sym)
 11076  		v.AddArg2(ptr, mem)
 11077  		return true
 11078  	}
 11079  	// match: (MOVWload [off] {sym} (ADD ptr idx) mem)
 11080  	// cond: off == 0 && sym == nil
 11081  	// result: (MOVWloadidx ptr idx mem)
 11082  	for {
 11083  		off := auxIntToInt32(v.AuxInt)
 11084  		sym := auxToSym(v.Aux)
 11085  		if v_0.Op != OpARM64ADD {
 11086  			break
 11087  		}
 11088  		idx := v_0.Args[1]
 11089  		ptr := v_0.Args[0]
 11090  		mem := v_1
 11091  		if !(off == 0 && sym == nil) {
 11092  			break
 11093  		}
 11094  		v.reset(OpARM64MOVWloadidx)
 11095  		v.AddArg3(ptr, idx, mem)
 11096  		return true
 11097  	}
 11098  	// match: (MOVWload [off] {sym} (ADDshiftLL [2] ptr idx) mem)
 11099  	// cond: off == 0 && sym == nil
 11100  	// result: (MOVWloadidx4 ptr idx mem)
 11101  	for {
 11102  		off := auxIntToInt32(v.AuxInt)
 11103  		sym := auxToSym(v.Aux)
 11104  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
 11105  			break
 11106  		}
 11107  		idx := v_0.Args[1]
 11108  		ptr := v_0.Args[0]
 11109  		mem := v_1
 11110  		if !(off == 0 && sym == nil) {
 11111  			break
 11112  		}
 11113  		v.reset(OpARM64MOVWloadidx4)
 11114  		v.AddArg3(ptr, idx, mem)
 11115  		return true
 11116  	}
 11117  	// match: (MOVWload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 11118  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11119  	// result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 11120  	for {
 11121  		off1 := auxIntToInt32(v.AuxInt)
 11122  		sym1 := auxToSym(v.Aux)
 11123  		if v_0.Op != OpARM64MOVDaddr {
 11124  			break
 11125  		}
 11126  		off2 := auxIntToInt32(v_0.AuxInt)
 11127  		sym2 := auxToSym(v_0.Aux)
 11128  		ptr := v_0.Args[0]
 11129  		mem := v_1
 11130  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11131  			break
 11132  		}
 11133  		v.reset(OpARM64MOVWload)
 11134  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11135  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11136  		v.AddArg2(ptr, mem)
 11137  		return true
 11138  	}
 11139  	// match: (MOVWload [off] {sym} (SB) _)
 11140  	// cond: symIsRO(sym)
 11141  	// result: (MOVDconst [int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))])
 11142  	for {
 11143  		off := auxIntToInt32(v.AuxInt)
 11144  		sym := auxToSym(v.Aux)
 11145  		if v_0.Op != OpSB || !(symIsRO(sym)) {
 11146  			break
 11147  		}
 11148  		v.reset(OpARM64MOVDconst)
 11149  		v.AuxInt = int64ToAuxInt(int64(int32(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))))
 11150  		return true
 11151  	}
 11152  	return false
 11153  }
 11154  func rewriteValueARM64_OpARM64MOVWloadidx(v *Value) bool {
 11155  	v_2 := v.Args[2]
 11156  	v_1 := v.Args[1]
 11157  	v_0 := v.Args[0]
 11158  	// match: (MOVWloadidx ptr (MOVDconst [c]) mem)
 11159  	// cond: is32Bit(c)
 11160  	// result: (MOVWload [int32(c)] ptr mem)
 11161  	for {
 11162  		ptr := v_0
 11163  		if v_1.Op != OpARM64MOVDconst {
 11164  			break
 11165  		}
 11166  		c := auxIntToInt64(v_1.AuxInt)
 11167  		mem := v_2
 11168  		if !(is32Bit(c)) {
 11169  			break
 11170  		}
 11171  		v.reset(OpARM64MOVWload)
 11172  		v.AuxInt = int32ToAuxInt(int32(c))
 11173  		v.AddArg2(ptr, mem)
 11174  		return true
 11175  	}
 11176  	// match: (MOVWloadidx (MOVDconst [c]) ptr mem)
 11177  	// cond: is32Bit(c)
 11178  	// result: (MOVWload [int32(c)] ptr mem)
 11179  	for {
 11180  		if v_0.Op != OpARM64MOVDconst {
 11181  			break
 11182  		}
 11183  		c := auxIntToInt64(v_0.AuxInt)
 11184  		ptr := v_1
 11185  		mem := v_2
 11186  		if !(is32Bit(c)) {
 11187  			break
 11188  		}
 11189  		v.reset(OpARM64MOVWload)
 11190  		v.AuxInt = int32ToAuxInt(int32(c))
 11191  		v.AddArg2(ptr, mem)
 11192  		return true
 11193  	}
 11194  	// match: (MOVWloadidx ptr (SLLconst [2] idx) mem)
 11195  	// result: (MOVWloadidx4 ptr idx mem)
 11196  	for {
 11197  		ptr := v_0
 11198  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
 11199  			break
 11200  		}
 11201  		idx := v_1.Args[0]
 11202  		mem := v_2
 11203  		v.reset(OpARM64MOVWloadidx4)
 11204  		v.AddArg3(ptr, idx, mem)
 11205  		return true
 11206  	}
 11207  	// match: (MOVWloadidx (SLLconst [2] idx) ptr mem)
 11208  	// result: (MOVWloadidx4 ptr idx mem)
 11209  	for {
 11210  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
 11211  			break
 11212  		}
 11213  		idx := v_0.Args[0]
 11214  		ptr := v_1
 11215  		mem := v_2
 11216  		v.reset(OpARM64MOVWloadidx4)
 11217  		v.AddArg3(ptr, idx, mem)
 11218  		return true
 11219  	}
 11220  	return false
 11221  }
 11222  func rewriteValueARM64_OpARM64MOVWloadidx4(v *Value) bool {
 11223  	v_2 := v.Args[2]
 11224  	v_1 := v.Args[1]
 11225  	v_0 := v.Args[0]
 11226  	// match: (MOVWloadidx4 ptr (MOVDconst [c]) mem)
 11227  	// cond: is32Bit(c<<2)
 11228  	// result: (MOVWload [int32(c)<<2] ptr mem)
 11229  	for {
 11230  		ptr := v_0
 11231  		if v_1.Op != OpARM64MOVDconst {
 11232  			break
 11233  		}
 11234  		c := auxIntToInt64(v_1.AuxInt)
 11235  		mem := v_2
 11236  		if !(is32Bit(c << 2)) {
 11237  			break
 11238  		}
 11239  		v.reset(OpARM64MOVWload)
 11240  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
 11241  		v.AddArg2(ptr, mem)
 11242  		return true
 11243  	}
 11244  	return false
 11245  }
 11246  func rewriteValueARM64_OpARM64MOVWreg(v *Value) bool {
 11247  	v_0 := v.Args[0]
 11248  	// match: (MOVWreg (MOVDconst [c]))
 11249  	// result: (MOVDconst [int64(int32(c))])
 11250  	for {
 11251  		if v_0.Op != OpARM64MOVDconst {
 11252  			break
 11253  		}
 11254  		c := auxIntToInt64(v_0.AuxInt)
 11255  		v.reset(OpARM64MOVDconst)
 11256  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
 11257  		return true
 11258  	}
 11259  	// match: (MOVWreg x)
 11260  	// cond: v.Type.Size() <= 4
 11261  	// result: x
 11262  	for {
 11263  		x := v_0
 11264  		if !(v.Type.Size() <= 4) {
 11265  			break
 11266  		}
 11267  		v.copyOf(x)
 11268  		return true
 11269  	}
 11270  	// match: (MOVWreg <t> (ANDconst x [c]))
 11271  	// cond: uint64(c) & uint64(0xffffffff80000000) == 0
 11272  	// result: (ANDconst <t> x [c])
 11273  	for {
 11274  		t := v.Type
 11275  		if v_0.Op != OpARM64ANDconst {
 11276  			break
 11277  		}
 11278  		c := auxIntToInt64(v_0.AuxInt)
 11279  		x := v_0.Args[0]
 11280  		if !(uint64(c)&uint64(0xffffffff80000000) == 0) {
 11281  			break
 11282  		}
 11283  		v.reset(OpARM64ANDconst)
 11284  		v.Type = t
 11285  		v.AuxInt = int64ToAuxInt(c)
 11286  		v.AddArg(x)
 11287  		return true
 11288  	}
 11289  	// match: (MOVWreg (SLLconst [lc] x))
 11290  	// cond: lc < 32
 11291  	// result: (SBFIZ [armBFAuxInt(lc, 32-lc)] x)
 11292  	for {
 11293  		if v_0.Op != OpARM64SLLconst {
 11294  			break
 11295  		}
 11296  		lc := auxIntToInt64(v_0.AuxInt)
 11297  		x := v_0.Args[0]
 11298  		if !(lc < 32) {
 11299  			break
 11300  		}
 11301  		v.reset(OpARM64SBFIZ)
 11302  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 32-lc))
 11303  		v.AddArg(x)
 11304  		return true
 11305  	}
 11306  	// match: (MOVWreg (SBFX [bfc] x))
 11307  	// cond: bfc.width() <= 32
 11308  	// result: (SBFX [bfc] x)
 11309  	for {
 11310  		if v_0.Op != OpARM64SBFX {
 11311  			break
 11312  		}
 11313  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 11314  		x := v_0.Args[0]
 11315  		if !(bfc.width() <= 32) {
 11316  			break
 11317  		}
 11318  		v.reset(OpARM64SBFX)
 11319  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 11320  		v.AddArg(x)
 11321  		return true
 11322  	}
 11323  	return false
 11324  }
 11325  func rewriteValueARM64_OpARM64MOVWstore(v *Value) bool {
 11326  	v_2 := v.Args[2]
 11327  	v_1 := v.Args[1]
 11328  	v_0 := v.Args[0]
 11329  	b := v.Block
 11330  	config := b.Func.Config
 11331  	// match: (MOVWstore [off] {sym} ptr (FMOVSfpgp val) mem)
 11332  	// result: (FMOVSstore [off] {sym} ptr val mem)
 11333  	for {
 11334  		off := auxIntToInt32(v.AuxInt)
 11335  		sym := auxToSym(v.Aux)
 11336  		ptr := v_0
 11337  		if v_1.Op != OpARM64FMOVSfpgp {
 11338  			break
 11339  		}
 11340  		val := v_1.Args[0]
 11341  		mem := v_2
 11342  		v.reset(OpARM64FMOVSstore)
 11343  		v.AuxInt = int32ToAuxInt(off)
 11344  		v.Aux = symToAux(sym)
 11345  		v.AddArg3(ptr, val, mem)
 11346  		return true
 11347  	}
 11348  	// match: (MOVWstore [off1] {sym} (ADDconst [off2] ptr) val mem)
 11349  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11350  	// result: (MOVWstore [off1+int32(off2)] {sym} ptr val mem)
 11351  	for {
 11352  		off1 := auxIntToInt32(v.AuxInt)
 11353  		sym := auxToSym(v.Aux)
 11354  		if v_0.Op != OpARM64ADDconst {
 11355  			break
 11356  		}
 11357  		off2 := auxIntToInt64(v_0.AuxInt)
 11358  		ptr := v_0.Args[0]
 11359  		val := v_1
 11360  		mem := v_2
 11361  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11362  			break
 11363  		}
 11364  		v.reset(OpARM64MOVWstore)
 11365  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11366  		v.Aux = symToAux(sym)
 11367  		v.AddArg3(ptr, val, mem)
 11368  		return true
 11369  	}
 11370  	// match: (MOVWstore [off] {sym} (ADD ptr idx) val mem)
 11371  	// cond: off == 0 && sym == nil
 11372  	// result: (MOVWstoreidx ptr idx val mem)
 11373  	for {
 11374  		off := auxIntToInt32(v.AuxInt)
 11375  		sym := auxToSym(v.Aux)
 11376  		if v_0.Op != OpARM64ADD {
 11377  			break
 11378  		}
 11379  		idx := v_0.Args[1]
 11380  		ptr := v_0.Args[0]
 11381  		val := v_1
 11382  		mem := v_2
 11383  		if !(off == 0 && sym == nil) {
 11384  			break
 11385  		}
 11386  		v.reset(OpARM64MOVWstoreidx)
 11387  		v.AddArg4(ptr, idx, val, mem)
 11388  		return true
 11389  	}
 11390  	// match: (MOVWstore [off] {sym} (ADDshiftLL [2] ptr idx) val mem)
 11391  	// cond: off == 0 && sym == nil
 11392  	// result: (MOVWstoreidx4 ptr idx val mem)
 11393  	for {
 11394  		off := auxIntToInt32(v.AuxInt)
 11395  		sym := auxToSym(v.Aux)
 11396  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
 11397  			break
 11398  		}
 11399  		idx := v_0.Args[1]
 11400  		ptr := v_0.Args[0]
 11401  		val := v_1
 11402  		mem := v_2
 11403  		if !(off == 0 && sym == nil) {
 11404  			break
 11405  		}
 11406  		v.reset(OpARM64MOVWstoreidx4)
 11407  		v.AddArg4(ptr, idx, val, mem)
 11408  		return true
 11409  	}
 11410  	// match: (MOVWstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
 11411  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11412  	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 11413  	for {
 11414  		off1 := auxIntToInt32(v.AuxInt)
 11415  		sym1 := auxToSym(v.Aux)
 11416  		if v_0.Op != OpARM64MOVDaddr {
 11417  			break
 11418  		}
 11419  		off2 := auxIntToInt32(v_0.AuxInt)
 11420  		sym2 := auxToSym(v_0.Aux)
 11421  		ptr := v_0.Args[0]
 11422  		val := v_1
 11423  		mem := v_2
 11424  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11425  			break
 11426  		}
 11427  		v.reset(OpARM64MOVWstore)
 11428  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11429  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11430  		v.AddArg3(ptr, val, mem)
 11431  		return true
 11432  	}
 11433  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
 11434  	// result: (MOVWstore [off] {sym} ptr x mem)
 11435  	for {
 11436  		off := auxIntToInt32(v.AuxInt)
 11437  		sym := auxToSym(v.Aux)
 11438  		ptr := v_0
 11439  		if v_1.Op != OpARM64MOVWreg {
 11440  			break
 11441  		}
 11442  		x := v_1.Args[0]
 11443  		mem := v_2
 11444  		v.reset(OpARM64MOVWstore)
 11445  		v.AuxInt = int32ToAuxInt(off)
 11446  		v.Aux = symToAux(sym)
 11447  		v.AddArg3(ptr, x, mem)
 11448  		return true
 11449  	}
 11450  	// match: (MOVWstore [off] {sym} ptr (MOVWUreg x) mem)
 11451  	// result: (MOVWstore [off] {sym} ptr x mem)
 11452  	for {
 11453  		off := auxIntToInt32(v.AuxInt)
 11454  		sym := auxToSym(v.Aux)
 11455  		ptr := v_0
 11456  		if v_1.Op != OpARM64MOVWUreg {
 11457  			break
 11458  		}
 11459  		x := v_1.Args[0]
 11460  		mem := v_2
 11461  		v.reset(OpARM64MOVWstore)
 11462  		v.AuxInt = int32ToAuxInt(off)
 11463  		v.Aux = symToAux(sym)
 11464  		v.AddArg3(ptr, x, mem)
 11465  		return true
 11466  	}
 11467  	return false
 11468  }
 11469  func rewriteValueARM64_OpARM64MOVWstoreidx(v *Value) bool {
 11470  	v_3 := v.Args[3]
 11471  	v_2 := v.Args[2]
 11472  	v_1 := v.Args[1]
 11473  	v_0 := v.Args[0]
 11474  	// match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
 11475  	// cond: is32Bit(c)
 11476  	// result: (MOVWstore [int32(c)] ptr val mem)
 11477  	for {
 11478  		ptr := v_0
 11479  		if v_1.Op != OpARM64MOVDconst {
 11480  			break
 11481  		}
 11482  		c := auxIntToInt64(v_1.AuxInt)
 11483  		val := v_2
 11484  		mem := v_3
 11485  		if !(is32Bit(c)) {
 11486  			break
 11487  		}
 11488  		v.reset(OpARM64MOVWstore)
 11489  		v.AuxInt = int32ToAuxInt(int32(c))
 11490  		v.AddArg3(ptr, val, mem)
 11491  		return true
 11492  	}
 11493  	// match: (MOVWstoreidx (MOVDconst [c]) idx val mem)
 11494  	// cond: is32Bit(c)
 11495  	// result: (MOVWstore [int32(c)] idx val mem)
 11496  	for {
 11497  		if v_0.Op != OpARM64MOVDconst {
 11498  			break
 11499  		}
 11500  		c := auxIntToInt64(v_0.AuxInt)
 11501  		idx := v_1
 11502  		val := v_2
 11503  		mem := v_3
 11504  		if !(is32Bit(c)) {
 11505  			break
 11506  		}
 11507  		v.reset(OpARM64MOVWstore)
 11508  		v.AuxInt = int32ToAuxInt(int32(c))
 11509  		v.AddArg3(idx, val, mem)
 11510  		return true
 11511  	}
 11512  	// match: (MOVWstoreidx ptr (SLLconst [2] idx) val mem)
 11513  	// result: (MOVWstoreidx4 ptr idx val mem)
 11514  	for {
 11515  		ptr := v_0
 11516  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
 11517  			break
 11518  		}
 11519  		idx := v_1.Args[0]
 11520  		val := v_2
 11521  		mem := v_3
 11522  		v.reset(OpARM64MOVWstoreidx4)
 11523  		v.AddArg4(ptr, idx, val, mem)
 11524  		return true
 11525  	}
 11526  	// match: (MOVWstoreidx (SLLconst [2] idx) ptr val mem)
 11527  	// result: (MOVWstoreidx4 ptr idx val mem)
 11528  	for {
 11529  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
 11530  			break
 11531  		}
 11532  		idx := v_0.Args[0]
 11533  		ptr := v_1
 11534  		val := v_2
 11535  		mem := v_3
 11536  		v.reset(OpARM64MOVWstoreidx4)
 11537  		v.AddArg4(ptr, idx, val, mem)
 11538  		return true
 11539  	}
 11540  	// match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
 11541  	// result: (MOVWstoreidx ptr idx x mem)
 11542  	for {
 11543  		ptr := v_0
 11544  		idx := v_1
 11545  		if v_2.Op != OpARM64MOVWreg {
 11546  			break
 11547  		}
 11548  		x := v_2.Args[0]
 11549  		mem := v_3
 11550  		v.reset(OpARM64MOVWstoreidx)
 11551  		v.AddArg4(ptr, idx, x, mem)
 11552  		return true
 11553  	}
 11554  	// match: (MOVWstoreidx ptr idx (MOVWUreg x) mem)
 11555  	// result: (MOVWstoreidx ptr idx x mem)
 11556  	for {
 11557  		ptr := v_0
 11558  		idx := v_1
 11559  		if v_2.Op != OpARM64MOVWUreg {
 11560  			break
 11561  		}
 11562  		x := v_2.Args[0]
 11563  		mem := v_3
 11564  		v.reset(OpARM64MOVWstoreidx)
 11565  		v.AddArg4(ptr, idx, x, mem)
 11566  		return true
 11567  	}
 11568  	return false
 11569  }
 11570  func rewriteValueARM64_OpARM64MOVWstoreidx4(v *Value) bool {
 11571  	v_3 := v.Args[3]
 11572  	v_2 := v.Args[2]
 11573  	v_1 := v.Args[1]
 11574  	v_0 := v.Args[0]
 11575  	// match: (MOVWstoreidx4 ptr (MOVDconst [c]) val mem)
 11576  	// cond: is32Bit(c<<2)
 11577  	// result: (MOVWstore [int32(c)<<2] ptr val mem)
 11578  	for {
 11579  		ptr := v_0
 11580  		if v_1.Op != OpARM64MOVDconst {
 11581  			break
 11582  		}
 11583  		c := auxIntToInt64(v_1.AuxInt)
 11584  		val := v_2
 11585  		mem := v_3
 11586  		if !(is32Bit(c << 2)) {
 11587  			break
 11588  		}
 11589  		v.reset(OpARM64MOVWstore)
 11590  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
 11591  		v.AddArg3(ptr, val, mem)
 11592  		return true
 11593  	}
 11594  	// match: (MOVWstoreidx4 ptr idx (MOVWreg x) mem)
 11595  	// result: (MOVWstoreidx4 ptr idx x mem)
 11596  	for {
 11597  		ptr := v_0
 11598  		idx := v_1
 11599  		if v_2.Op != OpARM64MOVWreg {
 11600  			break
 11601  		}
 11602  		x := v_2.Args[0]
 11603  		mem := v_3
 11604  		v.reset(OpARM64MOVWstoreidx4)
 11605  		v.AddArg4(ptr, idx, x, mem)
 11606  		return true
 11607  	}
 11608  	// match: (MOVWstoreidx4 ptr idx (MOVWUreg x) mem)
 11609  	// result: (MOVWstoreidx4 ptr idx x mem)
 11610  	for {
 11611  		ptr := v_0
 11612  		idx := v_1
 11613  		if v_2.Op != OpARM64MOVWUreg {
 11614  			break
 11615  		}
 11616  		x := v_2.Args[0]
 11617  		mem := v_3
 11618  		v.reset(OpARM64MOVWstoreidx4)
 11619  		v.AddArg4(ptr, idx, x, mem)
 11620  		return true
 11621  	}
 11622  	return false
 11623  }
 11624  func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
 11625  	v_2 := v.Args[2]
 11626  	v_1 := v.Args[1]
 11627  	v_0 := v.Args[0]
 11628  	b := v.Block
 11629  	// match: (MSUB a x (MOVDconst [-1]))
 11630  	// result: (ADD a x)
 11631  	for {
 11632  		a := v_0
 11633  		x := v_1
 11634  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != -1 {
 11635  			break
 11636  		}
 11637  		v.reset(OpARM64ADD)
 11638  		v.AddArg2(a, x)
 11639  		return true
 11640  	}
 11641  	// match: (MSUB a _ (MOVDconst [0]))
 11642  	// result: a
 11643  	for {
 11644  		a := v_0
 11645  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
 11646  			break
 11647  		}
 11648  		v.copyOf(a)
 11649  		return true
 11650  	}
 11651  	// match: (MSUB a x (MOVDconst [1]))
 11652  	// result: (SUB a x)
 11653  	for {
 11654  		a := v_0
 11655  		x := v_1
 11656  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 1 {
 11657  			break
 11658  		}
 11659  		v.reset(OpARM64SUB)
 11660  		v.AddArg2(a, x)
 11661  		return true
 11662  	}
 11663  	// match: (MSUB a x (MOVDconst [c]))
 11664  	// cond: isPowerOfTwo(c)
 11665  	// result: (SUBshiftLL a x [log64(c)])
 11666  	for {
 11667  		a := v_0
 11668  		x := v_1
 11669  		if v_2.Op != OpARM64MOVDconst {
 11670  			break
 11671  		}
 11672  		c := auxIntToInt64(v_2.AuxInt)
 11673  		if !(isPowerOfTwo(c)) {
 11674  			break
 11675  		}
 11676  		v.reset(OpARM64SUBshiftLL)
 11677  		v.AuxInt = int64ToAuxInt(log64(c))
 11678  		v.AddArg2(a, x)
 11679  		return true
 11680  	}
 11681  	// match: (MSUB a x (MOVDconst [c]))
 11682  	// cond: isPowerOfTwo(c-1) && c>=3
 11683  	// result: (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
 11684  	for {
 11685  		a := v_0
 11686  		x := v_1
 11687  		if v_2.Op != OpARM64MOVDconst {
 11688  			break
 11689  		}
 11690  		c := auxIntToInt64(v_2.AuxInt)
 11691  		if !(isPowerOfTwo(c-1) && c >= 3) {
 11692  			break
 11693  		}
 11694  		v.reset(OpARM64SUB)
 11695  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11696  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
 11697  		v0.AddArg2(x, x)
 11698  		v.AddArg2(a, v0)
 11699  		return true
 11700  	}
 11701  	// match: (MSUB a x (MOVDconst [c]))
 11702  	// cond: isPowerOfTwo(c+1) && c>=7
 11703  	// result: (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
 11704  	for {
 11705  		a := v_0
 11706  		x := v_1
 11707  		if v_2.Op != OpARM64MOVDconst {
 11708  			break
 11709  		}
 11710  		c := auxIntToInt64(v_2.AuxInt)
 11711  		if !(isPowerOfTwo(c+1) && c >= 7) {
 11712  			break
 11713  		}
 11714  		v.reset(OpARM64ADD)
 11715  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11716  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
 11717  		v0.AddArg2(x, x)
 11718  		v.AddArg2(a, v0)
 11719  		return true
 11720  	}
 11721  	// match: (MSUB a x (MOVDconst [c]))
 11722  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
 11723  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
 11724  	for {
 11725  		a := v_0
 11726  		x := v_1
 11727  		if v_2.Op != OpARM64MOVDconst {
 11728  			break
 11729  		}
 11730  		c := auxIntToInt64(v_2.AuxInt)
 11731  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
 11732  			break
 11733  		}
 11734  		v.reset(OpARM64ADDshiftLL)
 11735  		v.AuxInt = int64ToAuxInt(log64(c / 3))
 11736  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11737  		v0.AuxInt = int64ToAuxInt(2)
 11738  		v0.AddArg2(x, x)
 11739  		v.AddArg2(a, v0)
 11740  		return true
 11741  	}
 11742  	// match: (MSUB a x (MOVDconst [c]))
 11743  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
 11744  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
 11745  	for {
 11746  		a := v_0
 11747  		x := v_1
 11748  		if v_2.Op != OpARM64MOVDconst {
 11749  			break
 11750  		}
 11751  		c := auxIntToInt64(v_2.AuxInt)
 11752  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
 11753  			break
 11754  		}
 11755  		v.reset(OpARM64SUBshiftLL)
 11756  		v.AuxInt = int64ToAuxInt(log64(c / 5))
 11757  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11758  		v0.AuxInt = int64ToAuxInt(2)
 11759  		v0.AddArg2(x, x)
 11760  		v.AddArg2(a, v0)
 11761  		return true
 11762  	}
 11763  	// match: (MSUB a x (MOVDconst [c]))
 11764  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
 11765  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
 11766  	for {
 11767  		a := v_0
 11768  		x := v_1
 11769  		if v_2.Op != OpARM64MOVDconst {
 11770  			break
 11771  		}
 11772  		c := auxIntToInt64(v_2.AuxInt)
 11773  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
 11774  			break
 11775  		}
 11776  		v.reset(OpARM64ADDshiftLL)
 11777  		v.AuxInt = int64ToAuxInt(log64(c / 7))
 11778  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11779  		v0.AuxInt = int64ToAuxInt(3)
 11780  		v0.AddArg2(x, x)
 11781  		v.AddArg2(a, v0)
 11782  		return true
 11783  	}
 11784  	// match: (MSUB a x (MOVDconst [c]))
 11785  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
 11786  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
 11787  	for {
 11788  		a := v_0
 11789  		x := v_1
 11790  		if v_2.Op != OpARM64MOVDconst {
 11791  			break
 11792  		}
 11793  		c := auxIntToInt64(v_2.AuxInt)
 11794  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
 11795  			break
 11796  		}
 11797  		v.reset(OpARM64SUBshiftLL)
 11798  		v.AuxInt = int64ToAuxInt(log64(c / 9))
 11799  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11800  		v0.AuxInt = int64ToAuxInt(3)
 11801  		v0.AddArg2(x, x)
 11802  		v.AddArg2(a, v0)
 11803  		return true
 11804  	}
 11805  	// match: (MSUB a (MOVDconst [-1]) x)
 11806  	// result: (ADD a x)
 11807  	for {
 11808  		a := v_0
 11809  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
 11810  			break
 11811  		}
 11812  		x := v_2
 11813  		v.reset(OpARM64ADD)
 11814  		v.AddArg2(a, x)
 11815  		return true
 11816  	}
 11817  	// match: (MSUB a (MOVDconst [0]) _)
 11818  	// result: a
 11819  	for {
 11820  		a := v_0
 11821  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 11822  			break
 11823  		}
 11824  		v.copyOf(a)
 11825  		return true
 11826  	}
 11827  	// match: (MSUB a (MOVDconst [1]) x)
 11828  	// result: (SUB a x)
 11829  	for {
 11830  		a := v_0
 11831  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 11832  			break
 11833  		}
 11834  		x := v_2
 11835  		v.reset(OpARM64SUB)
 11836  		v.AddArg2(a, x)
 11837  		return true
 11838  	}
 11839  	// match: (MSUB a (MOVDconst [c]) x)
 11840  	// cond: isPowerOfTwo(c)
 11841  	// result: (SUBshiftLL a x [log64(c)])
 11842  	for {
 11843  		a := v_0
 11844  		if v_1.Op != OpARM64MOVDconst {
 11845  			break
 11846  		}
 11847  		c := auxIntToInt64(v_1.AuxInt)
 11848  		x := v_2
 11849  		if !(isPowerOfTwo(c)) {
 11850  			break
 11851  		}
 11852  		v.reset(OpARM64SUBshiftLL)
 11853  		v.AuxInt = int64ToAuxInt(log64(c))
 11854  		v.AddArg2(a, x)
 11855  		return true
 11856  	}
 11857  	// match: (MSUB a (MOVDconst [c]) x)
 11858  	// cond: isPowerOfTwo(c-1) && c>=3
 11859  	// result: (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
 11860  	for {
 11861  		a := v_0
 11862  		if v_1.Op != OpARM64MOVDconst {
 11863  			break
 11864  		}
 11865  		c := auxIntToInt64(v_1.AuxInt)
 11866  		x := v_2
 11867  		if !(isPowerOfTwo(c-1) && c >= 3) {
 11868  			break
 11869  		}
 11870  		v.reset(OpARM64SUB)
 11871  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11872  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
 11873  		v0.AddArg2(x, x)
 11874  		v.AddArg2(a, v0)
 11875  		return true
 11876  	}
 11877  	// match: (MSUB a (MOVDconst [c]) x)
 11878  	// cond: isPowerOfTwo(c+1) && c>=7
 11879  	// result: (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
 11880  	for {
 11881  		a := v_0
 11882  		if v_1.Op != OpARM64MOVDconst {
 11883  			break
 11884  		}
 11885  		c := auxIntToInt64(v_1.AuxInt)
 11886  		x := v_2
 11887  		if !(isPowerOfTwo(c+1) && c >= 7) {
 11888  			break
 11889  		}
 11890  		v.reset(OpARM64ADD)
 11891  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11892  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
 11893  		v0.AddArg2(x, x)
 11894  		v.AddArg2(a, v0)
 11895  		return true
 11896  	}
 11897  	// match: (MSUB a (MOVDconst [c]) x)
 11898  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
 11899  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
 11900  	for {
 11901  		a := v_0
 11902  		if v_1.Op != OpARM64MOVDconst {
 11903  			break
 11904  		}
 11905  		c := auxIntToInt64(v_1.AuxInt)
 11906  		x := v_2
 11907  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
 11908  			break
 11909  		}
 11910  		v.reset(OpARM64ADDshiftLL)
 11911  		v.AuxInt = int64ToAuxInt(log64(c / 3))
 11912  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11913  		v0.AuxInt = int64ToAuxInt(2)
 11914  		v0.AddArg2(x, x)
 11915  		v.AddArg2(a, v0)
 11916  		return true
 11917  	}
 11918  	// match: (MSUB a (MOVDconst [c]) x)
 11919  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
 11920  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
 11921  	for {
 11922  		a := v_0
 11923  		if v_1.Op != OpARM64MOVDconst {
 11924  			break
 11925  		}
 11926  		c := auxIntToInt64(v_1.AuxInt)
 11927  		x := v_2
 11928  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
 11929  			break
 11930  		}
 11931  		v.reset(OpARM64SUBshiftLL)
 11932  		v.AuxInt = int64ToAuxInt(log64(c / 5))
 11933  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11934  		v0.AuxInt = int64ToAuxInt(2)
 11935  		v0.AddArg2(x, x)
 11936  		v.AddArg2(a, v0)
 11937  		return true
 11938  	}
 11939  	// match: (MSUB a (MOVDconst [c]) x)
 11940  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
 11941  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
 11942  	for {
 11943  		a := v_0
 11944  		if v_1.Op != OpARM64MOVDconst {
 11945  			break
 11946  		}
 11947  		c := auxIntToInt64(v_1.AuxInt)
 11948  		x := v_2
 11949  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
 11950  			break
 11951  		}
 11952  		v.reset(OpARM64ADDshiftLL)
 11953  		v.AuxInt = int64ToAuxInt(log64(c / 7))
 11954  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 11955  		v0.AuxInt = int64ToAuxInt(3)
 11956  		v0.AddArg2(x, x)
 11957  		v.AddArg2(a, v0)
 11958  		return true
 11959  	}
 11960  	// match: (MSUB a (MOVDconst [c]) x)
 11961  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
 11962  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
 11963  	for {
 11964  		a := v_0
 11965  		if v_1.Op != OpARM64MOVDconst {
 11966  			break
 11967  		}
 11968  		c := auxIntToInt64(v_1.AuxInt)
 11969  		x := v_2
 11970  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
 11971  			break
 11972  		}
 11973  		v.reset(OpARM64SUBshiftLL)
 11974  		v.AuxInt = int64ToAuxInt(log64(c / 9))
 11975  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 11976  		v0.AuxInt = int64ToAuxInt(3)
 11977  		v0.AddArg2(x, x)
 11978  		v.AddArg2(a, v0)
 11979  		return true
 11980  	}
 11981  	// match: (MSUB (MOVDconst [c]) x y)
 11982  	// result: (ADDconst [c] (MNEG <x.Type> x y))
 11983  	for {
 11984  		if v_0.Op != OpARM64MOVDconst {
 11985  			break
 11986  		}
 11987  		c := auxIntToInt64(v_0.AuxInt)
 11988  		x := v_1
 11989  		y := v_2
 11990  		v.reset(OpARM64ADDconst)
 11991  		v.AuxInt = int64ToAuxInt(c)
 11992  		v0 := b.NewValue0(v.Pos, OpARM64MNEG, x.Type)
 11993  		v0.AddArg2(x, y)
 11994  		v.AddArg(v0)
 11995  		return true
 11996  	}
 11997  	// match: (MSUB a (MOVDconst [c]) (MOVDconst [d]))
 11998  	// result: (SUBconst [c*d] a)
 11999  	for {
 12000  		a := v_0
 12001  		if v_1.Op != OpARM64MOVDconst {
 12002  			break
 12003  		}
 12004  		c := auxIntToInt64(v_1.AuxInt)
 12005  		if v_2.Op != OpARM64MOVDconst {
 12006  			break
 12007  		}
 12008  		d := auxIntToInt64(v_2.AuxInt)
 12009  		v.reset(OpARM64SUBconst)
 12010  		v.AuxInt = int64ToAuxInt(c * d)
 12011  		v.AddArg(a)
 12012  		return true
 12013  	}
 12014  	return false
 12015  }
 12016  func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
 12017  	v_2 := v.Args[2]
 12018  	v_1 := v.Args[1]
 12019  	v_0 := v.Args[0]
 12020  	b := v.Block
 12021  	// match: (MSUBW a x (MOVDconst [c]))
 12022  	// cond: int32(c)==-1
 12023  	// result: (MOVWUreg (ADD <a.Type> a x))
 12024  	for {
 12025  		a := v_0
 12026  		x := v_1
 12027  		if v_2.Op != OpARM64MOVDconst {
 12028  			break
 12029  		}
 12030  		c := auxIntToInt64(v_2.AuxInt)
 12031  		if !(int32(c) == -1) {
 12032  			break
 12033  		}
 12034  		v.reset(OpARM64MOVWUreg)
 12035  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 12036  		v0.AddArg2(a, x)
 12037  		v.AddArg(v0)
 12038  		return true
 12039  	}
 12040  	// match: (MSUBW a _ (MOVDconst [c]))
 12041  	// cond: int32(c)==0
 12042  	// result: (MOVWUreg a)
 12043  	for {
 12044  		a := v_0
 12045  		if v_2.Op != OpARM64MOVDconst {
 12046  			break
 12047  		}
 12048  		c := auxIntToInt64(v_2.AuxInt)
 12049  		if !(int32(c) == 0) {
 12050  			break
 12051  		}
 12052  		v.reset(OpARM64MOVWUreg)
 12053  		v.AddArg(a)
 12054  		return true
 12055  	}
 12056  	// match: (MSUBW a x (MOVDconst [c]))
 12057  	// cond: int32(c)==1
 12058  	// result: (MOVWUreg (SUB <a.Type> a x))
 12059  	for {
 12060  		a := v_0
 12061  		x := v_1
 12062  		if v_2.Op != OpARM64MOVDconst {
 12063  			break
 12064  		}
 12065  		c := auxIntToInt64(v_2.AuxInt)
 12066  		if !(int32(c) == 1) {
 12067  			break
 12068  		}
 12069  		v.reset(OpARM64MOVWUreg)
 12070  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 12071  		v0.AddArg2(a, x)
 12072  		v.AddArg(v0)
 12073  		return true
 12074  	}
 12075  	// match: (MSUBW a x (MOVDconst [c]))
 12076  	// cond: isPowerOfTwo(c)
 12077  	// result: (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
 12078  	for {
 12079  		a := v_0
 12080  		x := v_1
 12081  		if v_2.Op != OpARM64MOVDconst {
 12082  			break
 12083  		}
 12084  		c := auxIntToInt64(v_2.AuxInt)
 12085  		if !(isPowerOfTwo(c)) {
 12086  			break
 12087  		}
 12088  		v.reset(OpARM64MOVWUreg)
 12089  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12090  		v0.AuxInt = int64ToAuxInt(log64(c))
 12091  		v0.AddArg2(a, x)
 12092  		v.AddArg(v0)
 12093  		return true
 12094  	}
 12095  	// match: (MSUBW a x (MOVDconst [c]))
 12096  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
 12097  	// result: (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
 12098  	for {
 12099  		a := v_0
 12100  		x := v_1
 12101  		if v_2.Op != OpARM64MOVDconst {
 12102  			break
 12103  		}
 12104  		c := auxIntToInt64(v_2.AuxInt)
 12105  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
 12106  			break
 12107  		}
 12108  		v.reset(OpARM64MOVWUreg)
 12109  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 12110  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12111  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
 12112  		v1.AddArg2(x, x)
 12113  		v0.AddArg2(a, v1)
 12114  		v.AddArg(v0)
 12115  		return true
 12116  	}
 12117  	// match: (MSUBW a x (MOVDconst [c]))
 12118  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
 12119  	// result: (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
 12120  	for {
 12121  		a := v_0
 12122  		x := v_1
 12123  		if v_2.Op != OpARM64MOVDconst {
 12124  			break
 12125  		}
 12126  		c := auxIntToInt64(v_2.AuxInt)
 12127  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
 12128  			break
 12129  		}
 12130  		v.reset(OpARM64MOVWUreg)
 12131  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 12132  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12133  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
 12134  		v1.AddArg2(x, x)
 12135  		v0.AddArg2(a, v1)
 12136  		v.AddArg(v0)
 12137  		return true
 12138  	}
 12139  	// match: (MSUBW a x (MOVDconst [c]))
 12140  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
 12141  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
 12142  	for {
 12143  		a := v_0
 12144  		x := v_1
 12145  		if v_2.Op != OpARM64MOVDconst {
 12146  			break
 12147  		}
 12148  		c := auxIntToInt64(v_2.AuxInt)
 12149  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
 12150  			break
 12151  		}
 12152  		v.reset(OpARM64MOVWUreg)
 12153  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 12154  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
 12155  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12156  		v1.AuxInt = int64ToAuxInt(2)
 12157  		v1.AddArg2(x, x)
 12158  		v0.AddArg2(a, v1)
 12159  		v.AddArg(v0)
 12160  		return true
 12161  	}
 12162  	// match: (MSUBW a x (MOVDconst [c]))
 12163  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
 12164  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
 12165  	for {
 12166  		a := v_0
 12167  		x := v_1
 12168  		if v_2.Op != OpARM64MOVDconst {
 12169  			break
 12170  		}
 12171  		c := auxIntToInt64(v_2.AuxInt)
 12172  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
 12173  			break
 12174  		}
 12175  		v.reset(OpARM64MOVWUreg)
 12176  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12177  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
 12178  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12179  		v1.AuxInt = int64ToAuxInt(2)
 12180  		v1.AddArg2(x, x)
 12181  		v0.AddArg2(a, v1)
 12182  		v.AddArg(v0)
 12183  		return true
 12184  	}
 12185  	// match: (MSUBW a x (MOVDconst [c]))
 12186  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
 12187  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
 12188  	for {
 12189  		a := v_0
 12190  		x := v_1
 12191  		if v_2.Op != OpARM64MOVDconst {
 12192  			break
 12193  		}
 12194  		c := auxIntToInt64(v_2.AuxInt)
 12195  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
 12196  			break
 12197  		}
 12198  		v.reset(OpARM64MOVWUreg)
 12199  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 12200  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
 12201  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12202  		v1.AuxInt = int64ToAuxInt(3)
 12203  		v1.AddArg2(x, x)
 12204  		v0.AddArg2(a, v1)
 12205  		v.AddArg(v0)
 12206  		return true
 12207  	}
 12208  	// match: (MSUBW a x (MOVDconst [c]))
 12209  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
 12210  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
 12211  	for {
 12212  		a := v_0
 12213  		x := v_1
 12214  		if v_2.Op != OpARM64MOVDconst {
 12215  			break
 12216  		}
 12217  		c := auxIntToInt64(v_2.AuxInt)
 12218  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
 12219  			break
 12220  		}
 12221  		v.reset(OpARM64MOVWUreg)
 12222  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12223  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
 12224  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12225  		v1.AuxInt = int64ToAuxInt(3)
 12226  		v1.AddArg2(x, x)
 12227  		v0.AddArg2(a, v1)
 12228  		v.AddArg(v0)
 12229  		return true
 12230  	}
 12231  	// match: (MSUBW a (MOVDconst [c]) x)
 12232  	// cond: int32(c)==-1
 12233  	// result: (MOVWUreg (ADD <a.Type> a x))
 12234  	for {
 12235  		a := v_0
 12236  		if v_1.Op != OpARM64MOVDconst {
 12237  			break
 12238  		}
 12239  		c := auxIntToInt64(v_1.AuxInt)
 12240  		x := v_2
 12241  		if !(int32(c) == -1) {
 12242  			break
 12243  		}
 12244  		v.reset(OpARM64MOVWUreg)
 12245  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 12246  		v0.AddArg2(a, x)
 12247  		v.AddArg(v0)
 12248  		return true
 12249  	}
 12250  	// match: (MSUBW a (MOVDconst [c]) _)
 12251  	// cond: int32(c)==0
 12252  	// result: (MOVWUreg a)
 12253  	for {
 12254  		a := v_0
 12255  		if v_1.Op != OpARM64MOVDconst {
 12256  			break
 12257  		}
 12258  		c := auxIntToInt64(v_1.AuxInt)
 12259  		if !(int32(c) == 0) {
 12260  			break
 12261  		}
 12262  		v.reset(OpARM64MOVWUreg)
 12263  		v.AddArg(a)
 12264  		return true
 12265  	}
 12266  	// match: (MSUBW a (MOVDconst [c]) x)
 12267  	// cond: int32(c)==1
 12268  	// result: (MOVWUreg (SUB <a.Type> a x))
 12269  	for {
 12270  		a := v_0
 12271  		if v_1.Op != OpARM64MOVDconst {
 12272  			break
 12273  		}
 12274  		c := auxIntToInt64(v_1.AuxInt)
 12275  		x := v_2
 12276  		if !(int32(c) == 1) {
 12277  			break
 12278  		}
 12279  		v.reset(OpARM64MOVWUreg)
 12280  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 12281  		v0.AddArg2(a, x)
 12282  		v.AddArg(v0)
 12283  		return true
 12284  	}
 12285  	// match: (MSUBW a (MOVDconst [c]) x)
 12286  	// cond: isPowerOfTwo(c)
 12287  	// result: (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
 12288  	for {
 12289  		a := v_0
 12290  		if v_1.Op != OpARM64MOVDconst {
 12291  			break
 12292  		}
 12293  		c := auxIntToInt64(v_1.AuxInt)
 12294  		x := v_2
 12295  		if !(isPowerOfTwo(c)) {
 12296  			break
 12297  		}
 12298  		v.reset(OpARM64MOVWUreg)
 12299  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12300  		v0.AuxInt = int64ToAuxInt(log64(c))
 12301  		v0.AddArg2(a, x)
 12302  		v.AddArg(v0)
 12303  		return true
 12304  	}
 12305  	// match: (MSUBW a (MOVDconst [c]) x)
 12306  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
 12307  	// result: (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
 12308  	for {
 12309  		a := v_0
 12310  		if v_1.Op != OpARM64MOVDconst {
 12311  			break
 12312  		}
 12313  		c := auxIntToInt64(v_1.AuxInt)
 12314  		x := v_2
 12315  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
 12316  			break
 12317  		}
 12318  		v.reset(OpARM64MOVWUreg)
 12319  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 12320  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12321  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
 12322  		v1.AddArg2(x, x)
 12323  		v0.AddArg2(a, v1)
 12324  		v.AddArg(v0)
 12325  		return true
 12326  	}
 12327  	// match: (MSUBW a (MOVDconst [c]) x)
 12328  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
 12329  	// result: (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
 12330  	for {
 12331  		a := v_0
 12332  		if v_1.Op != OpARM64MOVDconst {
 12333  			break
 12334  		}
 12335  		c := auxIntToInt64(v_1.AuxInt)
 12336  		x := v_2
 12337  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
 12338  			break
 12339  		}
 12340  		v.reset(OpARM64MOVWUreg)
 12341  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 12342  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12343  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
 12344  		v1.AddArg2(x, x)
 12345  		v0.AddArg2(a, v1)
 12346  		v.AddArg(v0)
 12347  		return true
 12348  	}
 12349  	// match: (MSUBW a (MOVDconst [c]) x)
 12350  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
 12351  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
 12352  	for {
 12353  		a := v_0
 12354  		if v_1.Op != OpARM64MOVDconst {
 12355  			break
 12356  		}
 12357  		c := auxIntToInt64(v_1.AuxInt)
 12358  		x := v_2
 12359  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
 12360  			break
 12361  		}
 12362  		v.reset(OpARM64MOVWUreg)
 12363  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 12364  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
 12365  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12366  		v1.AuxInt = int64ToAuxInt(2)
 12367  		v1.AddArg2(x, x)
 12368  		v0.AddArg2(a, v1)
 12369  		v.AddArg(v0)
 12370  		return true
 12371  	}
 12372  	// match: (MSUBW a (MOVDconst [c]) x)
 12373  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
 12374  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
 12375  	for {
 12376  		a := v_0
 12377  		if v_1.Op != OpARM64MOVDconst {
 12378  			break
 12379  		}
 12380  		c := auxIntToInt64(v_1.AuxInt)
 12381  		x := v_2
 12382  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
 12383  			break
 12384  		}
 12385  		v.reset(OpARM64MOVWUreg)
 12386  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12387  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
 12388  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12389  		v1.AuxInt = int64ToAuxInt(2)
 12390  		v1.AddArg2(x, x)
 12391  		v0.AddArg2(a, v1)
 12392  		v.AddArg(v0)
 12393  		return true
 12394  	}
 12395  	// match: (MSUBW a (MOVDconst [c]) x)
 12396  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
 12397  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
 12398  	for {
 12399  		a := v_0
 12400  		if v_1.Op != OpARM64MOVDconst {
 12401  			break
 12402  		}
 12403  		c := auxIntToInt64(v_1.AuxInt)
 12404  		x := v_2
 12405  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
 12406  			break
 12407  		}
 12408  		v.reset(OpARM64MOVWUreg)
 12409  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 12410  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
 12411  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12412  		v1.AuxInt = int64ToAuxInt(3)
 12413  		v1.AddArg2(x, x)
 12414  		v0.AddArg2(a, v1)
 12415  		v.AddArg(v0)
 12416  		return true
 12417  	}
 12418  	// match: (MSUBW a (MOVDconst [c]) x)
 12419  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
 12420  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
 12421  	for {
 12422  		a := v_0
 12423  		if v_1.Op != OpARM64MOVDconst {
 12424  			break
 12425  		}
 12426  		c := auxIntToInt64(v_1.AuxInt)
 12427  		x := v_2
 12428  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
 12429  			break
 12430  		}
 12431  		v.reset(OpARM64MOVWUreg)
 12432  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12433  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
 12434  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12435  		v1.AuxInt = int64ToAuxInt(3)
 12436  		v1.AddArg2(x, x)
 12437  		v0.AddArg2(a, v1)
 12438  		v.AddArg(v0)
 12439  		return true
 12440  	}
 12441  	// match: (MSUBW (MOVDconst [c]) x y)
 12442  	// result: (MOVWUreg (ADDconst <x.Type> [c] (MNEGW <x.Type> x y)))
 12443  	for {
 12444  		if v_0.Op != OpARM64MOVDconst {
 12445  			break
 12446  		}
 12447  		c := auxIntToInt64(v_0.AuxInt)
 12448  		x := v_1
 12449  		y := v_2
 12450  		v.reset(OpARM64MOVWUreg)
 12451  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, x.Type)
 12452  		v0.AuxInt = int64ToAuxInt(c)
 12453  		v1 := b.NewValue0(v.Pos, OpARM64MNEGW, x.Type)
 12454  		v1.AddArg2(x, y)
 12455  		v0.AddArg(v1)
 12456  		v.AddArg(v0)
 12457  		return true
 12458  	}
 12459  	// match: (MSUBW a (MOVDconst [c]) (MOVDconst [d]))
 12460  	// result: (MOVWUreg (SUBconst <a.Type> [c*d] a))
 12461  	for {
 12462  		a := v_0
 12463  		if v_1.Op != OpARM64MOVDconst {
 12464  			break
 12465  		}
 12466  		c := auxIntToInt64(v_1.AuxInt)
 12467  		if v_2.Op != OpARM64MOVDconst {
 12468  			break
 12469  		}
 12470  		d := auxIntToInt64(v_2.AuxInt)
 12471  		v.reset(OpARM64MOVWUreg)
 12472  		v0 := b.NewValue0(v.Pos, OpARM64SUBconst, a.Type)
 12473  		v0.AuxInt = int64ToAuxInt(c * d)
 12474  		v0.AddArg(a)
 12475  		v.AddArg(v0)
 12476  		return true
 12477  	}
 12478  	return false
 12479  }
 12480  func rewriteValueARM64_OpARM64MUL(v *Value) bool {
 12481  	v_1 := v.Args[1]
 12482  	v_0 := v.Args[0]
 12483  	b := v.Block
 12484  	config := b.Func.Config
 12485  	// match: (MUL (NEG x) y)
 12486  	// result: (MNEG x y)
 12487  	for {
 12488  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12489  			if v_0.Op != OpARM64NEG {
 12490  				continue
 12491  			}
 12492  			x := v_0.Args[0]
 12493  			y := v_1
 12494  			v.reset(OpARM64MNEG)
 12495  			v.AddArg2(x, y)
 12496  			return true
 12497  		}
 12498  		break
 12499  	}
 12500  	// match: (MUL _ (MOVDconst [0]))
 12501  	// result: (MOVDconst [0])
 12502  	for {
 12503  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12504  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 12505  				continue
 12506  			}
 12507  			v.reset(OpARM64MOVDconst)
 12508  			v.AuxInt = int64ToAuxInt(0)
 12509  			return true
 12510  		}
 12511  		break
 12512  	}
 12513  	// match: (MUL x (MOVDconst [1]))
 12514  	// result: x
 12515  	for {
 12516  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12517  			x := v_0
 12518  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 12519  				continue
 12520  			}
 12521  			v.copyOf(x)
 12522  			return true
 12523  		}
 12524  		break
 12525  	}
 12526  	// match: (MUL x (MOVDconst [c]))
 12527  	// cond: canMulStrengthReduce(config, c)
 12528  	// result: {mulStrengthReduce(v, x, c)}
 12529  	for {
 12530  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12531  			x := v_0
 12532  			if v_1.Op != OpARM64MOVDconst {
 12533  				continue
 12534  			}
 12535  			c := auxIntToInt64(v_1.AuxInt)
 12536  			if !(canMulStrengthReduce(config, c)) {
 12537  				continue
 12538  			}
 12539  			v.copyOf(mulStrengthReduce(v, x, c))
 12540  			return true
 12541  		}
 12542  		break
 12543  	}
 12544  	// match: (MUL (MOVDconst [c]) (MOVDconst [d]))
 12545  	// result: (MOVDconst [c*d])
 12546  	for {
 12547  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12548  			if v_0.Op != OpARM64MOVDconst {
 12549  				continue
 12550  			}
 12551  			c := auxIntToInt64(v_0.AuxInt)
 12552  			if v_1.Op != OpARM64MOVDconst {
 12553  				continue
 12554  			}
 12555  			d := auxIntToInt64(v_1.AuxInt)
 12556  			v.reset(OpARM64MOVDconst)
 12557  			v.AuxInt = int64ToAuxInt(c * d)
 12558  			return true
 12559  		}
 12560  		break
 12561  	}
 12562  	// match: (MUL r:(MOVWUreg x) s:(MOVWUreg y))
 12563  	// cond: r.Uses == 1 && s.Uses == 1
 12564  	// result: (UMULL x y)
 12565  	for {
 12566  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12567  			r := v_0
 12568  			if r.Op != OpARM64MOVWUreg {
 12569  				continue
 12570  			}
 12571  			x := r.Args[0]
 12572  			s := v_1
 12573  			if s.Op != OpARM64MOVWUreg {
 12574  				continue
 12575  			}
 12576  			y := s.Args[0]
 12577  			if !(r.Uses == 1 && s.Uses == 1) {
 12578  				continue
 12579  			}
 12580  			v.reset(OpARM64UMULL)
 12581  			v.AddArg2(x, y)
 12582  			return true
 12583  		}
 12584  		break
 12585  	}
 12586  	// match: (MUL r:(MOVWreg x) s:(MOVWreg y))
 12587  	// cond: r.Uses == 1 && s.Uses == 1
 12588  	// result: (MULL x y)
 12589  	for {
 12590  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12591  			r := v_0
 12592  			if r.Op != OpARM64MOVWreg {
 12593  				continue
 12594  			}
 12595  			x := r.Args[0]
 12596  			s := v_1
 12597  			if s.Op != OpARM64MOVWreg {
 12598  				continue
 12599  			}
 12600  			y := s.Args[0]
 12601  			if !(r.Uses == 1 && s.Uses == 1) {
 12602  				continue
 12603  			}
 12604  			v.reset(OpARM64MULL)
 12605  			v.AddArg2(x, y)
 12606  			return true
 12607  		}
 12608  		break
 12609  	}
 12610  	return false
 12611  }
 12612  func rewriteValueARM64_OpARM64MULW(v *Value) bool {
 12613  	v_1 := v.Args[1]
 12614  	v_0 := v.Args[0]
 12615  	b := v.Block
 12616  	config := b.Func.Config
 12617  	// match: (MULW (NEG x) y)
 12618  	// result: (MNEGW x y)
 12619  	for {
 12620  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12621  			if v_0.Op != OpARM64NEG {
 12622  				continue
 12623  			}
 12624  			x := v_0.Args[0]
 12625  			y := v_1
 12626  			v.reset(OpARM64MNEGW)
 12627  			v.AddArg2(x, y)
 12628  			return true
 12629  		}
 12630  		break
 12631  	}
 12632  	// match: (MULW _ (MOVDconst [c]))
 12633  	// cond: int32(c)==0
 12634  	// result: (MOVDconst [0])
 12635  	for {
 12636  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12637  			if v_1.Op != OpARM64MOVDconst {
 12638  				continue
 12639  			}
 12640  			c := auxIntToInt64(v_1.AuxInt)
 12641  			if !(int32(c) == 0) {
 12642  				continue
 12643  			}
 12644  			v.reset(OpARM64MOVDconst)
 12645  			v.AuxInt = int64ToAuxInt(0)
 12646  			return true
 12647  		}
 12648  		break
 12649  	}
 12650  	// match: (MULW x (MOVDconst [c]))
 12651  	// cond: int32(c)==1
 12652  	// result: (MOVWUreg x)
 12653  	for {
 12654  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12655  			x := v_0
 12656  			if v_1.Op != OpARM64MOVDconst {
 12657  				continue
 12658  			}
 12659  			c := auxIntToInt64(v_1.AuxInt)
 12660  			if !(int32(c) == 1) {
 12661  				continue
 12662  			}
 12663  			v.reset(OpARM64MOVWUreg)
 12664  			v.AddArg(x)
 12665  			return true
 12666  		}
 12667  		break
 12668  	}
 12669  	// match: (MULW x (MOVDconst [c]))
 12670  	// cond: v.Type.Size() <= 4 && canMulStrengthReduce32(config, int32(c))
 12671  	// result: {mulStrengthReduce32(v, x, int32(c))}
 12672  	for {
 12673  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12674  			x := v_0
 12675  			if v_1.Op != OpARM64MOVDconst {
 12676  				continue
 12677  			}
 12678  			c := auxIntToInt64(v_1.AuxInt)
 12679  			if !(v.Type.Size() <= 4 && canMulStrengthReduce32(config, int32(c))) {
 12680  				continue
 12681  			}
 12682  			v.copyOf(mulStrengthReduce32(v, x, int32(c)))
 12683  			return true
 12684  		}
 12685  		break
 12686  	}
 12687  	// match: (MULW (MOVDconst [c]) (MOVDconst [d]))
 12688  	// result: (MOVDconst [int64(uint32(c*d))])
 12689  	for {
 12690  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12691  			if v_0.Op != OpARM64MOVDconst {
 12692  				continue
 12693  			}
 12694  			c := auxIntToInt64(v_0.AuxInt)
 12695  			if v_1.Op != OpARM64MOVDconst {
 12696  				continue
 12697  			}
 12698  			d := auxIntToInt64(v_1.AuxInt)
 12699  			v.reset(OpARM64MOVDconst)
 12700  			v.AuxInt = int64ToAuxInt(int64(uint32(c * d)))
 12701  			return true
 12702  		}
 12703  		break
 12704  	}
 12705  	return false
 12706  }
 12707  func rewriteValueARM64_OpARM64MVN(v *Value) bool {
 12708  	v_0 := v.Args[0]
 12709  	// match: (MVN (XOR x y))
 12710  	// result: (EON x y)
 12711  	for {
 12712  		if v_0.Op != OpARM64XOR {
 12713  			break
 12714  		}
 12715  		y := v_0.Args[1]
 12716  		x := v_0.Args[0]
 12717  		v.reset(OpARM64EON)
 12718  		v.AddArg2(x, y)
 12719  		return true
 12720  	}
 12721  	// match: (MVN (MOVDconst [c]))
 12722  	// result: (MOVDconst [^c])
 12723  	for {
 12724  		if v_0.Op != OpARM64MOVDconst {
 12725  			break
 12726  		}
 12727  		c := auxIntToInt64(v_0.AuxInt)
 12728  		v.reset(OpARM64MOVDconst)
 12729  		v.AuxInt = int64ToAuxInt(^c)
 12730  		return true
 12731  	}
 12732  	// match: (MVN x:(SLLconst [c] y))
 12733  	// cond: clobberIfDead(x)
 12734  	// result: (MVNshiftLL [c] y)
 12735  	for {
 12736  		x := v_0
 12737  		if x.Op != OpARM64SLLconst {
 12738  			break
 12739  		}
 12740  		c := auxIntToInt64(x.AuxInt)
 12741  		y := x.Args[0]
 12742  		if !(clobberIfDead(x)) {
 12743  			break
 12744  		}
 12745  		v.reset(OpARM64MVNshiftLL)
 12746  		v.AuxInt = int64ToAuxInt(c)
 12747  		v.AddArg(y)
 12748  		return true
 12749  	}
 12750  	// match: (MVN x:(SRLconst [c] y))
 12751  	// cond: clobberIfDead(x)
 12752  	// result: (MVNshiftRL [c] y)
 12753  	for {
 12754  		x := v_0
 12755  		if x.Op != OpARM64SRLconst {
 12756  			break
 12757  		}
 12758  		c := auxIntToInt64(x.AuxInt)
 12759  		y := x.Args[0]
 12760  		if !(clobberIfDead(x)) {
 12761  			break
 12762  		}
 12763  		v.reset(OpARM64MVNshiftRL)
 12764  		v.AuxInt = int64ToAuxInt(c)
 12765  		v.AddArg(y)
 12766  		return true
 12767  	}
 12768  	// match: (MVN x:(SRAconst [c] y))
 12769  	// cond: clobberIfDead(x)
 12770  	// result: (MVNshiftRA [c] y)
 12771  	for {
 12772  		x := v_0
 12773  		if x.Op != OpARM64SRAconst {
 12774  			break
 12775  		}
 12776  		c := auxIntToInt64(x.AuxInt)
 12777  		y := x.Args[0]
 12778  		if !(clobberIfDead(x)) {
 12779  			break
 12780  		}
 12781  		v.reset(OpARM64MVNshiftRA)
 12782  		v.AuxInt = int64ToAuxInt(c)
 12783  		v.AddArg(y)
 12784  		return true
 12785  	}
 12786  	// match: (MVN x:(RORconst [c] y))
 12787  	// cond: clobberIfDead(x)
 12788  	// result: (MVNshiftRO [c] y)
 12789  	for {
 12790  		x := v_0
 12791  		if x.Op != OpARM64RORconst {
 12792  			break
 12793  		}
 12794  		c := auxIntToInt64(x.AuxInt)
 12795  		y := x.Args[0]
 12796  		if !(clobberIfDead(x)) {
 12797  			break
 12798  		}
 12799  		v.reset(OpARM64MVNshiftRO)
 12800  		v.AuxInt = int64ToAuxInt(c)
 12801  		v.AddArg(y)
 12802  		return true
 12803  	}
 12804  	return false
 12805  }
 12806  func rewriteValueARM64_OpARM64MVNshiftLL(v *Value) bool {
 12807  	v_0 := v.Args[0]
 12808  	// match: (MVNshiftLL (MOVDconst [c]) [d])
 12809  	// result: (MOVDconst [^int64(uint64(c)<<uint64(d))])
 12810  	for {
 12811  		d := auxIntToInt64(v.AuxInt)
 12812  		if v_0.Op != OpARM64MOVDconst {
 12813  			break
 12814  		}
 12815  		c := auxIntToInt64(v_0.AuxInt)
 12816  		v.reset(OpARM64MOVDconst)
 12817  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
 12818  		return true
 12819  	}
 12820  	return false
 12821  }
 12822  func rewriteValueARM64_OpARM64MVNshiftRA(v *Value) bool {
 12823  	v_0 := v.Args[0]
 12824  	// match: (MVNshiftRA (MOVDconst [c]) [d])
 12825  	// result: (MOVDconst [^(c>>uint64(d))])
 12826  	for {
 12827  		d := auxIntToInt64(v.AuxInt)
 12828  		if v_0.Op != OpARM64MOVDconst {
 12829  			break
 12830  		}
 12831  		c := auxIntToInt64(v_0.AuxInt)
 12832  		v.reset(OpARM64MOVDconst)
 12833  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
 12834  		return true
 12835  	}
 12836  	return false
 12837  }
 12838  func rewriteValueARM64_OpARM64MVNshiftRL(v *Value) bool {
 12839  	v_0 := v.Args[0]
 12840  	// match: (MVNshiftRL (MOVDconst [c]) [d])
 12841  	// result: (MOVDconst [^int64(uint64(c)>>uint64(d))])
 12842  	for {
 12843  		d := auxIntToInt64(v.AuxInt)
 12844  		if v_0.Op != OpARM64MOVDconst {
 12845  			break
 12846  		}
 12847  		c := auxIntToInt64(v_0.AuxInt)
 12848  		v.reset(OpARM64MOVDconst)
 12849  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
 12850  		return true
 12851  	}
 12852  	return false
 12853  }
 12854  func rewriteValueARM64_OpARM64MVNshiftRO(v *Value) bool {
 12855  	v_0 := v.Args[0]
 12856  	// match: (MVNshiftRO (MOVDconst [c]) [d])
 12857  	// result: (MOVDconst [^rotateRight64(c, d)])
 12858  	for {
 12859  		d := auxIntToInt64(v.AuxInt)
 12860  		if v_0.Op != OpARM64MOVDconst {
 12861  			break
 12862  		}
 12863  		c := auxIntToInt64(v_0.AuxInt)
 12864  		v.reset(OpARM64MOVDconst)
 12865  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
 12866  		return true
 12867  	}
 12868  	return false
 12869  }
 12870  func rewriteValueARM64_OpARM64NEG(v *Value) bool {
 12871  	v_0 := v.Args[0]
 12872  	// match: (NEG (MUL x y))
 12873  	// result: (MNEG x y)
 12874  	for {
 12875  		if v_0.Op != OpARM64MUL {
 12876  			break
 12877  		}
 12878  		y := v_0.Args[1]
 12879  		x := v_0.Args[0]
 12880  		v.reset(OpARM64MNEG)
 12881  		v.AddArg2(x, y)
 12882  		return true
 12883  	}
 12884  	// match: (NEG (MULW x y))
 12885  	// cond: v.Type.Size() <= 4
 12886  	// result: (MNEGW x y)
 12887  	for {
 12888  		if v_0.Op != OpARM64MULW {
 12889  			break
 12890  		}
 12891  		y := v_0.Args[1]
 12892  		x := v_0.Args[0]
 12893  		if !(v.Type.Size() <= 4) {
 12894  			break
 12895  		}
 12896  		v.reset(OpARM64MNEGW)
 12897  		v.AddArg2(x, y)
 12898  		return true
 12899  	}
 12900  	// match: (NEG (SUB x y))
 12901  	// result: (SUB y x)
 12902  	for {
 12903  		if v_0.Op != OpARM64SUB {
 12904  			break
 12905  		}
 12906  		y := v_0.Args[1]
 12907  		x := v_0.Args[0]
 12908  		v.reset(OpARM64SUB)
 12909  		v.AddArg2(y, x)
 12910  		return true
 12911  	}
 12912  	// match: (NEG (NEG x))
 12913  	// result: x
 12914  	for {
 12915  		if v_0.Op != OpARM64NEG {
 12916  			break
 12917  		}
 12918  		x := v_0.Args[0]
 12919  		v.copyOf(x)
 12920  		return true
 12921  	}
 12922  	// match: (NEG (MOVDconst [c]))
 12923  	// result: (MOVDconst [-c])
 12924  	for {
 12925  		if v_0.Op != OpARM64MOVDconst {
 12926  			break
 12927  		}
 12928  		c := auxIntToInt64(v_0.AuxInt)
 12929  		v.reset(OpARM64MOVDconst)
 12930  		v.AuxInt = int64ToAuxInt(-c)
 12931  		return true
 12932  	}
 12933  	// match: (NEG x:(SLLconst [c] y))
 12934  	// cond: clobberIfDead(x)
 12935  	// result: (NEGshiftLL [c] y)
 12936  	for {
 12937  		x := v_0
 12938  		if x.Op != OpARM64SLLconst {
 12939  			break
 12940  		}
 12941  		c := auxIntToInt64(x.AuxInt)
 12942  		y := x.Args[0]
 12943  		if !(clobberIfDead(x)) {
 12944  			break
 12945  		}
 12946  		v.reset(OpARM64NEGshiftLL)
 12947  		v.AuxInt = int64ToAuxInt(c)
 12948  		v.AddArg(y)
 12949  		return true
 12950  	}
 12951  	// match: (NEG x:(SRLconst [c] y))
 12952  	// cond: clobberIfDead(x)
 12953  	// result: (NEGshiftRL [c] y)
 12954  	for {
 12955  		x := v_0
 12956  		if x.Op != OpARM64SRLconst {
 12957  			break
 12958  		}
 12959  		c := auxIntToInt64(x.AuxInt)
 12960  		y := x.Args[0]
 12961  		if !(clobberIfDead(x)) {
 12962  			break
 12963  		}
 12964  		v.reset(OpARM64NEGshiftRL)
 12965  		v.AuxInt = int64ToAuxInt(c)
 12966  		v.AddArg(y)
 12967  		return true
 12968  	}
 12969  	// match: (NEG x:(SRAconst [c] y))
 12970  	// cond: clobberIfDead(x)
 12971  	// result: (NEGshiftRA [c] y)
 12972  	for {
 12973  		x := v_0
 12974  		if x.Op != OpARM64SRAconst {
 12975  			break
 12976  		}
 12977  		c := auxIntToInt64(x.AuxInt)
 12978  		y := x.Args[0]
 12979  		if !(clobberIfDead(x)) {
 12980  			break
 12981  		}
 12982  		v.reset(OpARM64NEGshiftRA)
 12983  		v.AuxInt = int64ToAuxInt(c)
 12984  		v.AddArg(y)
 12985  		return true
 12986  	}
 12987  	return false
 12988  }
 12989  func rewriteValueARM64_OpARM64NEGshiftLL(v *Value) bool {
 12990  	v_0 := v.Args[0]
 12991  	// match: (NEGshiftLL (MOVDconst [c]) [d])
 12992  	// result: (MOVDconst [-int64(uint64(c)<<uint64(d))])
 12993  	for {
 12994  		d := auxIntToInt64(v.AuxInt)
 12995  		if v_0.Op != OpARM64MOVDconst {
 12996  			break
 12997  		}
 12998  		c := auxIntToInt64(v_0.AuxInt)
 12999  		v.reset(OpARM64MOVDconst)
 13000  		v.AuxInt = int64ToAuxInt(-int64(uint64(c) << uint64(d)))
 13001  		return true
 13002  	}
 13003  	return false
 13004  }
 13005  func rewriteValueARM64_OpARM64NEGshiftRA(v *Value) bool {
 13006  	v_0 := v.Args[0]
 13007  	// match: (NEGshiftRA (MOVDconst [c]) [d])
 13008  	// result: (MOVDconst [-(c>>uint64(d))])
 13009  	for {
 13010  		d := auxIntToInt64(v.AuxInt)
 13011  		if v_0.Op != OpARM64MOVDconst {
 13012  			break
 13013  		}
 13014  		c := auxIntToInt64(v_0.AuxInt)
 13015  		v.reset(OpARM64MOVDconst)
 13016  		v.AuxInt = int64ToAuxInt(-(c >> uint64(d)))
 13017  		return true
 13018  	}
 13019  	return false
 13020  }
 13021  func rewriteValueARM64_OpARM64NEGshiftRL(v *Value) bool {
 13022  	v_0 := v.Args[0]
 13023  	// match: (NEGshiftRL (MOVDconst [c]) [d])
 13024  	// result: (MOVDconst [-int64(uint64(c)>>uint64(d))])
 13025  	for {
 13026  		d := auxIntToInt64(v.AuxInt)
 13027  		if v_0.Op != OpARM64MOVDconst {
 13028  			break
 13029  		}
 13030  		c := auxIntToInt64(v_0.AuxInt)
 13031  		v.reset(OpARM64MOVDconst)
 13032  		v.AuxInt = int64ToAuxInt(-int64(uint64(c) >> uint64(d)))
 13033  		return true
 13034  	}
 13035  	return false
 13036  }
 13037  func rewriteValueARM64_OpARM64NotEqual(v *Value) bool {
 13038  	v_0 := v.Args[0]
 13039  	b := v.Block
 13040  	// match: (NotEqual (CMPconst [0] z:(AND x y)))
 13041  	// cond: z.Uses == 1
 13042  	// result: (NotEqual (TST x y))
 13043  	for {
 13044  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 13045  			break
 13046  		}
 13047  		z := v_0.Args[0]
 13048  		if z.Op != OpARM64AND {
 13049  			break
 13050  		}
 13051  		y := z.Args[1]
 13052  		x := z.Args[0]
 13053  		if !(z.Uses == 1) {
 13054  			break
 13055  		}
 13056  		v.reset(OpARM64NotEqual)
 13057  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
 13058  		v0.AddArg2(x, y)
 13059  		v.AddArg(v0)
 13060  		return true
 13061  	}
 13062  	// match: (NotEqual (CMPWconst [0] x:(ANDconst [c] y)))
 13063  	// cond: x.Uses == 1
 13064  	// result: (NotEqual (TSTWconst [int32(c)] y))
 13065  	for {
 13066  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 13067  			break
 13068  		}
 13069  		x := v_0.Args[0]
 13070  		if x.Op != OpARM64ANDconst {
 13071  			break
 13072  		}
 13073  		c := auxIntToInt64(x.AuxInt)
 13074  		y := x.Args[0]
 13075  		if !(x.Uses == 1) {
 13076  			break
 13077  		}
 13078  		v.reset(OpARM64NotEqual)
 13079  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
 13080  		v0.AuxInt = int32ToAuxInt(int32(c))
 13081  		v0.AddArg(y)
 13082  		v.AddArg(v0)
 13083  		return true
 13084  	}
 13085  	// match: (NotEqual (CMPWconst [0] z:(AND x y)))
 13086  	// cond: z.Uses == 1
 13087  	// result: (NotEqual (TSTW x y))
 13088  	for {
 13089  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 13090  			break
 13091  		}
 13092  		z := v_0.Args[0]
 13093  		if z.Op != OpARM64AND {
 13094  			break
 13095  		}
 13096  		y := z.Args[1]
 13097  		x := z.Args[0]
 13098  		if !(z.Uses == 1) {
 13099  			break
 13100  		}
 13101  		v.reset(OpARM64NotEqual)
 13102  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
 13103  		v0.AddArg2(x, y)
 13104  		v.AddArg(v0)
 13105  		return true
 13106  	}
 13107  	// match: (NotEqual (CMPconst [0] x:(ANDconst [c] y)))
 13108  	// cond: x.Uses == 1
 13109  	// result: (NotEqual (TSTconst [c] y))
 13110  	for {
 13111  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 13112  			break
 13113  		}
 13114  		x := v_0.Args[0]
 13115  		if x.Op != OpARM64ANDconst {
 13116  			break
 13117  		}
 13118  		c := auxIntToInt64(x.AuxInt)
 13119  		y := x.Args[0]
 13120  		if !(x.Uses == 1) {
 13121  			break
 13122  		}
 13123  		v.reset(OpARM64NotEqual)
 13124  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
 13125  		v0.AuxInt = int64ToAuxInt(c)
 13126  		v0.AddArg(y)
 13127  		v.AddArg(v0)
 13128  		return true
 13129  	}
 13130  	// match: (NotEqual (CMP x z:(NEG y)))
 13131  	// cond: z.Uses == 1
 13132  	// result: (NotEqual (CMN x y))
 13133  	for {
 13134  		if v_0.Op != OpARM64CMP {
 13135  			break
 13136  		}
 13137  		_ = v_0.Args[1]
 13138  		x := v_0.Args[0]
 13139  		z := v_0.Args[1]
 13140  		if z.Op != OpARM64NEG {
 13141  			break
 13142  		}
 13143  		y := z.Args[0]
 13144  		if !(z.Uses == 1) {
 13145  			break
 13146  		}
 13147  		v.reset(OpARM64NotEqual)
 13148  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
 13149  		v0.AddArg2(x, y)
 13150  		v.AddArg(v0)
 13151  		return true
 13152  	}
 13153  	// match: (NotEqual (CMPW x z:(NEG y)))
 13154  	// cond: z.Uses == 1
 13155  	// result: (NotEqual (CMNW x y))
 13156  	for {
 13157  		if v_0.Op != OpARM64CMPW {
 13158  			break
 13159  		}
 13160  		_ = v_0.Args[1]
 13161  		x := v_0.Args[0]
 13162  		z := v_0.Args[1]
 13163  		if z.Op != OpARM64NEG {
 13164  			break
 13165  		}
 13166  		y := z.Args[0]
 13167  		if !(z.Uses == 1) {
 13168  			break
 13169  		}
 13170  		v.reset(OpARM64NotEqual)
 13171  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
 13172  		v0.AddArg2(x, y)
 13173  		v.AddArg(v0)
 13174  		return true
 13175  	}
 13176  	// match: (NotEqual (CMPconst [0] x:(ADDconst [c] y)))
 13177  	// cond: x.Uses == 1
 13178  	// result: (NotEqual (CMNconst [c] y))
 13179  	for {
 13180  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 13181  			break
 13182  		}
 13183  		x := v_0.Args[0]
 13184  		if x.Op != OpARM64ADDconst {
 13185  			break
 13186  		}
 13187  		c := auxIntToInt64(x.AuxInt)
 13188  		y := x.Args[0]
 13189  		if !(x.Uses == 1) {
 13190  			break
 13191  		}
 13192  		v.reset(OpARM64NotEqual)
 13193  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
 13194  		v0.AuxInt = int64ToAuxInt(c)
 13195  		v0.AddArg(y)
 13196  		v.AddArg(v0)
 13197  		return true
 13198  	}
 13199  	// match: (NotEqual (CMPWconst [0] x:(ADDconst [c] y)))
 13200  	// cond: x.Uses == 1
 13201  	// result: (NotEqual (CMNWconst [int32(c)] y))
 13202  	for {
 13203  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 13204  			break
 13205  		}
 13206  		x := v_0.Args[0]
 13207  		if x.Op != OpARM64ADDconst {
 13208  			break
 13209  		}
 13210  		c := auxIntToInt64(x.AuxInt)
 13211  		y := x.Args[0]
 13212  		if !(x.Uses == 1) {
 13213  			break
 13214  		}
 13215  		v.reset(OpARM64NotEqual)
 13216  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
 13217  		v0.AuxInt = int32ToAuxInt(int32(c))
 13218  		v0.AddArg(y)
 13219  		v.AddArg(v0)
 13220  		return true
 13221  	}
 13222  	// match: (NotEqual (CMPconst [0] z:(ADD x y)))
 13223  	// cond: z.Uses == 1
 13224  	// result: (NotEqual (CMN x y))
 13225  	for {
 13226  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 13227  			break
 13228  		}
 13229  		z := v_0.Args[0]
 13230  		if z.Op != OpARM64ADD {
 13231  			break
 13232  		}
 13233  		y := z.Args[1]
 13234  		x := z.Args[0]
 13235  		if !(z.Uses == 1) {
 13236  			break
 13237  		}
 13238  		v.reset(OpARM64NotEqual)
 13239  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
 13240  		v0.AddArg2(x, y)
 13241  		v.AddArg(v0)
 13242  		return true
 13243  	}
 13244  	// match: (NotEqual (CMPWconst [0] z:(ADD x y)))
 13245  	// cond: z.Uses == 1
 13246  	// result: (NotEqual (CMNW x y))
 13247  	for {
 13248  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 13249  			break
 13250  		}
 13251  		z := v_0.Args[0]
 13252  		if z.Op != OpARM64ADD {
 13253  			break
 13254  		}
 13255  		y := z.Args[1]
 13256  		x := z.Args[0]
 13257  		if !(z.Uses == 1) {
 13258  			break
 13259  		}
 13260  		v.reset(OpARM64NotEqual)
 13261  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
 13262  		v0.AddArg2(x, y)
 13263  		v.AddArg(v0)
 13264  		return true
 13265  	}
 13266  	// match: (NotEqual (CMPconst [0] z:(MADD a x y)))
 13267  	// cond: z.Uses == 1
 13268  	// result: (NotEqual (CMN a (MUL <x.Type> x y)))
 13269  	for {
 13270  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 13271  			break
 13272  		}
 13273  		z := v_0.Args[0]
 13274  		if z.Op != OpARM64MADD {
 13275  			break
 13276  		}
 13277  		y := z.Args[2]
 13278  		a := z.Args[0]
 13279  		x := z.Args[1]
 13280  		if !(z.Uses == 1) {
 13281  			break
 13282  		}
 13283  		v.reset(OpARM64NotEqual)
 13284  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
 13285  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
 13286  		v1.AddArg2(x, y)
 13287  		v0.AddArg2(a, v1)
 13288  		v.AddArg(v0)
 13289  		return true
 13290  	}
 13291  	// match: (NotEqual (CMPconst [0] z:(MSUB a x y)))
 13292  	// cond: z.Uses == 1
 13293  	// result: (NotEqual (CMP a (MUL <x.Type> x y)))
 13294  	for {
 13295  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 13296  			break
 13297  		}
 13298  		z := v_0.Args[0]
 13299  		if z.Op != OpARM64MSUB {
 13300  			break
 13301  		}
 13302  		y := z.Args[2]
 13303  		a := z.Args[0]
 13304  		x := z.Args[1]
 13305  		if !(z.Uses == 1) {
 13306  			break
 13307  		}
 13308  		v.reset(OpARM64NotEqual)
 13309  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 13310  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
 13311  		v1.AddArg2(x, y)
 13312  		v0.AddArg2(a, v1)
 13313  		v.AddArg(v0)
 13314  		return true
 13315  	}
 13316  	// match: (NotEqual (CMPWconst [0] z:(MADDW a x y)))
 13317  	// cond: z.Uses == 1
 13318  	// result: (NotEqual (CMNW a (MULW <x.Type> x y)))
 13319  	for {
 13320  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 13321  			break
 13322  		}
 13323  		z := v_0.Args[0]
 13324  		if z.Op != OpARM64MADDW {
 13325  			break
 13326  		}
 13327  		y := z.Args[2]
 13328  		a := z.Args[0]
 13329  		x := z.Args[1]
 13330  		if !(z.Uses == 1) {
 13331  			break
 13332  		}
 13333  		v.reset(OpARM64NotEqual)
 13334  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
 13335  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
 13336  		v1.AddArg2(x, y)
 13337  		v0.AddArg2(a, v1)
 13338  		v.AddArg(v0)
 13339  		return true
 13340  	}
 13341  	// match: (NotEqual (CMPWconst [0] z:(MSUBW a x y)))
 13342  	// cond: z.Uses == 1
 13343  	// result: (NotEqual (CMPW a (MULW <x.Type> x y)))
 13344  	for {
 13345  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 13346  			break
 13347  		}
 13348  		z := v_0.Args[0]
 13349  		if z.Op != OpARM64MSUBW {
 13350  			break
 13351  		}
 13352  		y := z.Args[2]
 13353  		a := z.Args[0]
 13354  		x := z.Args[1]
 13355  		if !(z.Uses == 1) {
 13356  			break
 13357  		}
 13358  		v.reset(OpARM64NotEqual)
 13359  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 13360  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
 13361  		v1.AddArg2(x, y)
 13362  		v0.AddArg2(a, v1)
 13363  		v.AddArg(v0)
 13364  		return true
 13365  	}
 13366  	// match: (NotEqual (FlagConstant [fc]))
 13367  	// result: (MOVDconst [b2i(fc.ne())])
 13368  	for {
 13369  		if v_0.Op != OpARM64FlagConstant {
 13370  			break
 13371  		}
 13372  		fc := auxIntToFlagConstant(v_0.AuxInt)
 13373  		v.reset(OpARM64MOVDconst)
 13374  		v.AuxInt = int64ToAuxInt(b2i(fc.ne()))
 13375  		return true
 13376  	}
 13377  	// match: (NotEqual (InvertFlags x))
 13378  	// result: (NotEqual x)
 13379  	for {
 13380  		if v_0.Op != OpARM64InvertFlags {
 13381  			break
 13382  		}
 13383  		x := v_0.Args[0]
 13384  		v.reset(OpARM64NotEqual)
 13385  		v.AddArg(x)
 13386  		return true
 13387  	}
 13388  	return false
 13389  }
 13390  func rewriteValueARM64_OpARM64OR(v *Value) bool {
 13391  	v_1 := v.Args[1]
 13392  	v_0 := v.Args[0]
 13393  	// match: (OR x (MOVDconst [c]))
 13394  	// result: (ORconst [c] x)
 13395  	for {
 13396  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13397  			x := v_0
 13398  			if v_1.Op != OpARM64MOVDconst {
 13399  				continue
 13400  			}
 13401  			c := auxIntToInt64(v_1.AuxInt)
 13402  			v.reset(OpARM64ORconst)
 13403  			v.AuxInt = int64ToAuxInt(c)
 13404  			v.AddArg(x)
 13405  			return true
 13406  		}
 13407  		break
 13408  	}
 13409  	// match: (OR x x)
 13410  	// result: x
 13411  	for {
 13412  		x := v_0
 13413  		if x != v_1 {
 13414  			break
 13415  		}
 13416  		v.copyOf(x)
 13417  		return true
 13418  	}
 13419  	// match: (OR x (MVN y))
 13420  	// result: (ORN x y)
 13421  	for {
 13422  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13423  			x := v_0
 13424  			if v_1.Op != OpARM64MVN {
 13425  				continue
 13426  			}
 13427  			y := v_1.Args[0]
 13428  			v.reset(OpARM64ORN)
 13429  			v.AddArg2(x, y)
 13430  			return true
 13431  		}
 13432  		break
 13433  	}
 13434  	// match: (OR x0 x1:(SLLconst [c] y))
 13435  	// cond: clobberIfDead(x1)
 13436  	// result: (ORshiftLL x0 y [c])
 13437  	for {
 13438  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13439  			x0 := v_0
 13440  			x1 := v_1
 13441  			if x1.Op != OpARM64SLLconst {
 13442  				continue
 13443  			}
 13444  			c := auxIntToInt64(x1.AuxInt)
 13445  			y := x1.Args[0]
 13446  			if !(clobberIfDead(x1)) {
 13447  				continue
 13448  			}
 13449  			v.reset(OpARM64ORshiftLL)
 13450  			v.AuxInt = int64ToAuxInt(c)
 13451  			v.AddArg2(x0, y)
 13452  			return true
 13453  		}
 13454  		break
 13455  	}
 13456  	// match: (OR x0 x1:(SRLconst [c] y))
 13457  	// cond: clobberIfDead(x1)
 13458  	// result: (ORshiftRL x0 y [c])
 13459  	for {
 13460  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13461  			x0 := v_0
 13462  			x1 := v_1
 13463  			if x1.Op != OpARM64SRLconst {
 13464  				continue
 13465  			}
 13466  			c := auxIntToInt64(x1.AuxInt)
 13467  			y := x1.Args[0]
 13468  			if !(clobberIfDead(x1)) {
 13469  				continue
 13470  			}
 13471  			v.reset(OpARM64ORshiftRL)
 13472  			v.AuxInt = int64ToAuxInt(c)
 13473  			v.AddArg2(x0, y)
 13474  			return true
 13475  		}
 13476  		break
 13477  	}
 13478  	// match: (OR x0 x1:(SRAconst [c] y))
 13479  	// cond: clobberIfDead(x1)
 13480  	// result: (ORshiftRA x0 y [c])
 13481  	for {
 13482  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13483  			x0 := v_0
 13484  			x1 := v_1
 13485  			if x1.Op != OpARM64SRAconst {
 13486  				continue
 13487  			}
 13488  			c := auxIntToInt64(x1.AuxInt)
 13489  			y := x1.Args[0]
 13490  			if !(clobberIfDead(x1)) {
 13491  				continue
 13492  			}
 13493  			v.reset(OpARM64ORshiftRA)
 13494  			v.AuxInt = int64ToAuxInt(c)
 13495  			v.AddArg2(x0, y)
 13496  			return true
 13497  		}
 13498  		break
 13499  	}
 13500  	// match: (OR x0 x1:(RORconst [c] y))
 13501  	// cond: clobberIfDead(x1)
 13502  	// result: (ORshiftRO x0 y [c])
 13503  	for {
 13504  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13505  			x0 := v_0
 13506  			x1 := v_1
 13507  			if x1.Op != OpARM64RORconst {
 13508  				continue
 13509  			}
 13510  			c := auxIntToInt64(x1.AuxInt)
 13511  			y := x1.Args[0]
 13512  			if !(clobberIfDead(x1)) {
 13513  				continue
 13514  			}
 13515  			v.reset(OpARM64ORshiftRO)
 13516  			v.AuxInt = int64ToAuxInt(c)
 13517  			v.AddArg2(x0, y)
 13518  			return true
 13519  		}
 13520  		break
 13521  	}
 13522  	// match: (OR (UBFIZ [bfc] x) (ANDconst [ac] y))
 13523  	// cond: ac == ^((1<<uint(bfc.width())-1) << uint(bfc.lsb()))
 13524  	// result: (BFI [bfc] y x)
 13525  	for {
 13526  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13527  			if v_0.Op != OpARM64UBFIZ {
 13528  				continue
 13529  			}
 13530  			bfc := auxIntToArm64BitField(v_0.AuxInt)
 13531  			x := v_0.Args[0]
 13532  			if v_1.Op != OpARM64ANDconst {
 13533  				continue
 13534  			}
 13535  			ac := auxIntToInt64(v_1.AuxInt)
 13536  			y := v_1.Args[0]
 13537  			if !(ac == ^((1<<uint(bfc.width()) - 1) << uint(bfc.lsb()))) {
 13538  				continue
 13539  			}
 13540  			v.reset(OpARM64BFI)
 13541  			v.AuxInt = arm64BitFieldToAuxInt(bfc)
 13542  			v.AddArg2(y, x)
 13543  			return true
 13544  		}
 13545  		break
 13546  	}
 13547  	// match: (OR (UBFX [bfc] x) (ANDconst [ac] y))
 13548  	// cond: ac == ^(1<<uint(bfc.width())-1)
 13549  	// result: (BFXIL [bfc] y x)
 13550  	for {
 13551  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13552  			if v_0.Op != OpARM64UBFX {
 13553  				continue
 13554  			}
 13555  			bfc := auxIntToArm64BitField(v_0.AuxInt)
 13556  			x := v_0.Args[0]
 13557  			if v_1.Op != OpARM64ANDconst {
 13558  				continue
 13559  			}
 13560  			ac := auxIntToInt64(v_1.AuxInt)
 13561  			y := v_1.Args[0]
 13562  			if !(ac == ^(1<<uint(bfc.width()) - 1)) {
 13563  				continue
 13564  			}
 13565  			v.reset(OpARM64BFXIL)
 13566  			v.AuxInt = arm64BitFieldToAuxInt(bfc)
 13567  			v.AddArg2(y, x)
 13568  			return true
 13569  		}
 13570  		break
 13571  	}
 13572  	return false
 13573  }
 13574  func rewriteValueARM64_OpARM64ORN(v *Value) bool {
 13575  	v_1 := v.Args[1]
 13576  	v_0 := v.Args[0]
 13577  	// match: (ORN x (MOVDconst [c]))
 13578  	// result: (ORconst [^c] x)
 13579  	for {
 13580  		x := v_0
 13581  		if v_1.Op != OpARM64MOVDconst {
 13582  			break
 13583  		}
 13584  		c := auxIntToInt64(v_1.AuxInt)
 13585  		v.reset(OpARM64ORconst)
 13586  		v.AuxInt = int64ToAuxInt(^c)
 13587  		v.AddArg(x)
 13588  		return true
 13589  	}
 13590  	// match: (ORN x x)
 13591  	// result: (MOVDconst [-1])
 13592  	for {
 13593  		x := v_0
 13594  		if x != v_1 {
 13595  			break
 13596  		}
 13597  		v.reset(OpARM64MOVDconst)
 13598  		v.AuxInt = int64ToAuxInt(-1)
 13599  		return true
 13600  	}
 13601  	// match: (ORN x0 x1:(SLLconst [c] y))
 13602  	// cond: clobberIfDead(x1)
 13603  	// result: (ORNshiftLL x0 y [c])
 13604  	for {
 13605  		x0 := v_0
 13606  		x1 := v_1
 13607  		if x1.Op != OpARM64SLLconst {
 13608  			break
 13609  		}
 13610  		c := auxIntToInt64(x1.AuxInt)
 13611  		y := x1.Args[0]
 13612  		if !(clobberIfDead(x1)) {
 13613  			break
 13614  		}
 13615  		v.reset(OpARM64ORNshiftLL)
 13616  		v.AuxInt = int64ToAuxInt(c)
 13617  		v.AddArg2(x0, y)
 13618  		return true
 13619  	}
 13620  	// match: (ORN x0 x1:(SRLconst [c] y))
 13621  	// cond: clobberIfDead(x1)
 13622  	// result: (ORNshiftRL x0 y [c])
 13623  	for {
 13624  		x0 := v_0
 13625  		x1 := v_1
 13626  		if x1.Op != OpARM64SRLconst {
 13627  			break
 13628  		}
 13629  		c := auxIntToInt64(x1.AuxInt)
 13630  		y := x1.Args[0]
 13631  		if !(clobberIfDead(x1)) {
 13632  			break
 13633  		}
 13634  		v.reset(OpARM64ORNshiftRL)
 13635  		v.AuxInt = int64ToAuxInt(c)
 13636  		v.AddArg2(x0, y)
 13637  		return true
 13638  	}
 13639  	// match: (ORN x0 x1:(SRAconst [c] y))
 13640  	// cond: clobberIfDead(x1)
 13641  	// result: (ORNshiftRA x0 y [c])
 13642  	for {
 13643  		x0 := v_0
 13644  		x1 := v_1
 13645  		if x1.Op != OpARM64SRAconst {
 13646  			break
 13647  		}
 13648  		c := auxIntToInt64(x1.AuxInt)
 13649  		y := x1.Args[0]
 13650  		if !(clobberIfDead(x1)) {
 13651  			break
 13652  		}
 13653  		v.reset(OpARM64ORNshiftRA)
 13654  		v.AuxInt = int64ToAuxInt(c)
 13655  		v.AddArg2(x0, y)
 13656  		return true
 13657  	}
 13658  	// match: (ORN x0 x1:(RORconst [c] y))
 13659  	// cond: clobberIfDead(x1)
 13660  	// result: (ORNshiftRO x0 y [c])
 13661  	for {
 13662  		x0 := v_0
 13663  		x1 := v_1
 13664  		if x1.Op != OpARM64RORconst {
 13665  			break
 13666  		}
 13667  		c := auxIntToInt64(x1.AuxInt)
 13668  		y := x1.Args[0]
 13669  		if !(clobberIfDead(x1)) {
 13670  			break
 13671  		}
 13672  		v.reset(OpARM64ORNshiftRO)
 13673  		v.AuxInt = int64ToAuxInt(c)
 13674  		v.AddArg2(x0, y)
 13675  		return true
 13676  	}
 13677  	return false
 13678  }
 13679  func rewriteValueARM64_OpARM64ORNshiftLL(v *Value) bool {
 13680  	v_1 := v.Args[1]
 13681  	v_0 := v.Args[0]
 13682  	// match: (ORNshiftLL x (MOVDconst [c]) [d])
 13683  	// result: (ORconst x [^int64(uint64(c)<<uint64(d))])
 13684  	for {
 13685  		d := auxIntToInt64(v.AuxInt)
 13686  		x := v_0
 13687  		if v_1.Op != OpARM64MOVDconst {
 13688  			break
 13689  		}
 13690  		c := auxIntToInt64(v_1.AuxInt)
 13691  		v.reset(OpARM64ORconst)
 13692  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
 13693  		v.AddArg(x)
 13694  		return true
 13695  	}
 13696  	// match: (ORNshiftLL (SLLconst x [c]) x [c])
 13697  	// result: (MOVDconst [-1])
 13698  	for {
 13699  		c := auxIntToInt64(v.AuxInt)
 13700  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 13701  			break
 13702  		}
 13703  		x := v_0.Args[0]
 13704  		if x != v_1 {
 13705  			break
 13706  		}
 13707  		v.reset(OpARM64MOVDconst)
 13708  		v.AuxInt = int64ToAuxInt(-1)
 13709  		return true
 13710  	}
 13711  	return false
 13712  }
 13713  func rewriteValueARM64_OpARM64ORNshiftRA(v *Value) bool {
 13714  	v_1 := v.Args[1]
 13715  	v_0 := v.Args[0]
 13716  	// match: (ORNshiftRA x (MOVDconst [c]) [d])
 13717  	// result: (ORconst x [^(c>>uint64(d))])
 13718  	for {
 13719  		d := auxIntToInt64(v.AuxInt)
 13720  		x := v_0
 13721  		if v_1.Op != OpARM64MOVDconst {
 13722  			break
 13723  		}
 13724  		c := auxIntToInt64(v_1.AuxInt)
 13725  		v.reset(OpARM64ORconst)
 13726  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
 13727  		v.AddArg(x)
 13728  		return true
 13729  	}
 13730  	// match: (ORNshiftRA (SRAconst x [c]) x [c])
 13731  	// result: (MOVDconst [-1])
 13732  	for {
 13733  		c := auxIntToInt64(v.AuxInt)
 13734  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
 13735  			break
 13736  		}
 13737  		x := v_0.Args[0]
 13738  		if x != v_1 {
 13739  			break
 13740  		}
 13741  		v.reset(OpARM64MOVDconst)
 13742  		v.AuxInt = int64ToAuxInt(-1)
 13743  		return true
 13744  	}
 13745  	return false
 13746  }
 13747  func rewriteValueARM64_OpARM64ORNshiftRL(v *Value) bool {
 13748  	v_1 := v.Args[1]
 13749  	v_0 := v.Args[0]
 13750  	// match: (ORNshiftRL x (MOVDconst [c]) [d])
 13751  	// result: (ORconst x [^int64(uint64(c)>>uint64(d))])
 13752  	for {
 13753  		d := auxIntToInt64(v.AuxInt)
 13754  		x := v_0
 13755  		if v_1.Op != OpARM64MOVDconst {
 13756  			break
 13757  		}
 13758  		c := auxIntToInt64(v_1.AuxInt)
 13759  		v.reset(OpARM64ORconst)
 13760  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
 13761  		v.AddArg(x)
 13762  		return true
 13763  	}
 13764  	// match: (ORNshiftRL (SRLconst x [c]) x [c])
 13765  	// result: (MOVDconst [-1])
 13766  	for {
 13767  		c := auxIntToInt64(v.AuxInt)
 13768  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 13769  			break
 13770  		}
 13771  		x := v_0.Args[0]
 13772  		if x != v_1 {
 13773  			break
 13774  		}
 13775  		v.reset(OpARM64MOVDconst)
 13776  		v.AuxInt = int64ToAuxInt(-1)
 13777  		return true
 13778  	}
 13779  	return false
 13780  }
 13781  func rewriteValueARM64_OpARM64ORNshiftRO(v *Value) bool {
 13782  	v_1 := v.Args[1]
 13783  	v_0 := v.Args[0]
 13784  	// match: (ORNshiftRO x (MOVDconst [c]) [d])
 13785  	// result: (ORconst x [^rotateRight64(c, d)])
 13786  	for {
 13787  		d := auxIntToInt64(v.AuxInt)
 13788  		x := v_0
 13789  		if v_1.Op != OpARM64MOVDconst {
 13790  			break
 13791  		}
 13792  		c := auxIntToInt64(v_1.AuxInt)
 13793  		v.reset(OpARM64ORconst)
 13794  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
 13795  		v.AddArg(x)
 13796  		return true
 13797  	}
 13798  	// match: (ORNshiftRO (RORconst x [c]) x [c])
 13799  	// result: (MOVDconst [-1])
 13800  	for {
 13801  		c := auxIntToInt64(v.AuxInt)
 13802  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
 13803  			break
 13804  		}
 13805  		x := v_0.Args[0]
 13806  		if x != v_1 {
 13807  			break
 13808  		}
 13809  		v.reset(OpARM64MOVDconst)
 13810  		v.AuxInt = int64ToAuxInt(-1)
 13811  		return true
 13812  	}
 13813  	return false
 13814  }
 13815  func rewriteValueARM64_OpARM64ORconst(v *Value) bool {
 13816  	v_0 := v.Args[0]
 13817  	// match: (ORconst [0] x)
 13818  	// result: x
 13819  	for {
 13820  		if auxIntToInt64(v.AuxInt) != 0 {
 13821  			break
 13822  		}
 13823  		x := v_0
 13824  		v.copyOf(x)
 13825  		return true
 13826  	}
 13827  	// match: (ORconst [-1] _)
 13828  	// result: (MOVDconst [-1])
 13829  	for {
 13830  		if auxIntToInt64(v.AuxInt) != -1 {
 13831  			break
 13832  		}
 13833  		v.reset(OpARM64MOVDconst)
 13834  		v.AuxInt = int64ToAuxInt(-1)
 13835  		return true
 13836  	}
 13837  	// match: (ORconst [c] (MOVDconst [d]))
 13838  	// result: (MOVDconst [c|d])
 13839  	for {
 13840  		c := auxIntToInt64(v.AuxInt)
 13841  		if v_0.Op != OpARM64MOVDconst {
 13842  			break
 13843  		}
 13844  		d := auxIntToInt64(v_0.AuxInt)
 13845  		v.reset(OpARM64MOVDconst)
 13846  		v.AuxInt = int64ToAuxInt(c | d)
 13847  		return true
 13848  	}
 13849  	// match: (ORconst [c] (ORconst [d] x))
 13850  	// result: (ORconst [c|d] x)
 13851  	for {
 13852  		c := auxIntToInt64(v.AuxInt)
 13853  		if v_0.Op != OpARM64ORconst {
 13854  			break
 13855  		}
 13856  		d := auxIntToInt64(v_0.AuxInt)
 13857  		x := v_0.Args[0]
 13858  		v.reset(OpARM64ORconst)
 13859  		v.AuxInt = int64ToAuxInt(c | d)
 13860  		v.AddArg(x)
 13861  		return true
 13862  	}
 13863  	// match: (ORconst [c1] (ANDconst [c2] x))
 13864  	// cond: c2|c1 == ^0
 13865  	// result: (ORconst [c1] x)
 13866  	for {
 13867  		c1 := auxIntToInt64(v.AuxInt)
 13868  		if v_0.Op != OpARM64ANDconst {
 13869  			break
 13870  		}
 13871  		c2 := auxIntToInt64(v_0.AuxInt)
 13872  		x := v_0.Args[0]
 13873  		if !(c2|c1 == ^0) {
 13874  			break
 13875  		}
 13876  		v.reset(OpARM64ORconst)
 13877  		v.AuxInt = int64ToAuxInt(c1)
 13878  		v.AddArg(x)
 13879  		return true
 13880  	}
 13881  	return false
 13882  }
 13883  func rewriteValueARM64_OpARM64ORshiftLL(v *Value) bool {
 13884  	v_1 := v.Args[1]
 13885  	v_0 := v.Args[0]
 13886  	b := v.Block
 13887  	typ := &b.Func.Config.Types
 13888  	// match: (ORshiftLL (MOVDconst [c]) x [d])
 13889  	// result: (ORconst [c] (SLLconst <x.Type> x [d]))
 13890  	for {
 13891  		d := auxIntToInt64(v.AuxInt)
 13892  		if v_0.Op != OpARM64MOVDconst {
 13893  			break
 13894  		}
 13895  		c := auxIntToInt64(v_0.AuxInt)
 13896  		x := v_1
 13897  		v.reset(OpARM64ORconst)
 13898  		v.AuxInt = int64ToAuxInt(c)
 13899  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 13900  		v0.AuxInt = int64ToAuxInt(d)
 13901  		v0.AddArg(x)
 13902  		v.AddArg(v0)
 13903  		return true
 13904  	}
 13905  	// match: (ORshiftLL x (MOVDconst [c]) [d])
 13906  	// result: (ORconst x [int64(uint64(c)<<uint64(d))])
 13907  	for {
 13908  		d := auxIntToInt64(v.AuxInt)
 13909  		x := v_0
 13910  		if v_1.Op != OpARM64MOVDconst {
 13911  			break
 13912  		}
 13913  		c := auxIntToInt64(v_1.AuxInt)
 13914  		v.reset(OpARM64ORconst)
 13915  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 13916  		v.AddArg(x)
 13917  		return true
 13918  	}
 13919  	// match: (ORshiftLL y:(SLLconst x [c]) x [c])
 13920  	// result: y
 13921  	for {
 13922  		c := auxIntToInt64(v.AuxInt)
 13923  		y := v_0
 13924  		if y.Op != OpARM64SLLconst || auxIntToInt64(y.AuxInt) != c {
 13925  			break
 13926  		}
 13927  		x := y.Args[0]
 13928  		if x != v_1 {
 13929  			break
 13930  		}
 13931  		v.copyOf(y)
 13932  		return true
 13933  	}
 13934  	// match: (ORshiftLL <typ.UInt16> [8] (UBFX <typ.UInt16> [armBFAuxInt(8, 8)] x) x)
 13935  	// result: (REV16W x)
 13936  	for {
 13937  		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) {
 13938  			break
 13939  		}
 13940  		x := v_0.Args[0]
 13941  		if x != v_1 {
 13942  			break
 13943  		}
 13944  		v.reset(OpARM64REV16W)
 13945  		v.AddArg(x)
 13946  		return true
 13947  	}
 13948  	// match: (ORshiftLL [8] (UBFX [armBFAuxInt(8, 24)] (ANDconst [c1] x)) (ANDconst [c2] x))
 13949  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
 13950  	// result: (REV16W x)
 13951  	for {
 13952  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
 13953  			break
 13954  		}
 13955  		v_0_0 := v_0.Args[0]
 13956  		if v_0_0.Op != OpARM64ANDconst {
 13957  			break
 13958  		}
 13959  		c1 := auxIntToInt64(v_0_0.AuxInt)
 13960  		x := v_0_0.Args[0]
 13961  		if v_1.Op != OpARM64ANDconst {
 13962  			break
 13963  		}
 13964  		c2 := auxIntToInt64(v_1.AuxInt)
 13965  		if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
 13966  			break
 13967  		}
 13968  		v.reset(OpARM64REV16W)
 13969  		v.AddArg(x)
 13970  		return true
 13971  	}
 13972  	// match: (ORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 13973  	// cond: (uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff)
 13974  	// result: (REV16 x)
 13975  	for {
 13976  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 13977  			break
 13978  		}
 13979  		v_0_0 := v_0.Args[0]
 13980  		if v_0_0.Op != OpARM64ANDconst {
 13981  			break
 13982  		}
 13983  		c1 := auxIntToInt64(v_0_0.AuxInt)
 13984  		x := v_0_0.Args[0]
 13985  		if v_1.Op != OpARM64ANDconst {
 13986  			break
 13987  		}
 13988  		c2 := auxIntToInt64(v_1.AuxInt)
 13989  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
 13990  			break
 13991  		}
 13992  		v.reset(OpARM64REV16)
 13993  		v.AddArg(x)
 13994  		return true
 13995  	}
 13996  	// match: (ORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 13997  	// cond: (uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff)
 13998  	// result: (REV16 (ANDconst <x.Type> [0xffffffff] x))
 13999  	for {
 14000  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 14001  			break
 14002  		}
 14003  		v_0_0 := v_0.Args[0]
 14004  		if v_0_0.Op != OpARM64ANDconst {
 14005  			break
 14006  		}
 14007  		c1 := auxIntToInt64(v_0_0.AuxInt)
 14008  		x := v_0_0.Args[0]
 14009  		if v_1.Op != OpARM64ANDconst {
 14010  			break
 14011  		}
 14012  		c2 := auxIntToInt64(v_1.AuxInt)
 14013  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
 14014  			break
 14015  		}
 14016  		v.reset(OpARM64REV16)
 14017  		v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
 14018  		v0.AuxInt = int64ToAuxInt(0xffffffff)
 14019  		v0.AddArg(x)
 14020  		v.AddArg(v0)
 14021  		return true
 14022  	}
 14023  	// match: ( ORshiftLL [c] (SRLconst x [64-c]) x2)
 14024  	// result: (EXTRconst [64-c] x2 x)
 14025  	for {
 14026  		c := auxIntToInt64(v.AuxInt)
 14027  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
 14028  			break
 14029  		}
 14030  		x := v_0.Args[0]
 14031  		x2 := v_1
 14032  		v.reset(OpARM64EXTRconst)
 14033  		v.AuxInt = int64ToAuxInt(64 - c)
 14034  		v.AddArg2(x2, x)
 14035  		return true
 14036  	}
 14037  	// match: ( ORshiftLL <t> [c] (UBFX [bfc] x) x2)
 14038  	// cond: c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)
 14039  	// result: (EXTRWconst [32-c] x2 x)
 14040  	for {
 14041  		t := v.Type
 14042  		c := auxIntToInt64(v.AuxInt)
 14043  		if v_0.Op != OpARM64UBFX {
 14044  			break
 14045  		}
 14046  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14047  		x := v_0.Args[0]
 14048  		x2 := v_1
 14049  		if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
 14050  			break
 14051  		}
 14052  		v.reset(OpARM64EXTRWconst)
 14053  		v.AuxInt = int64ToAuxInt(32 - c)
 14054  		v.AddArg2(x2, x)
 14055  		return true
 14056  	}
 14057  	// match: (ORshiftLL [s] (ANDconst [xc] x) (ANDconst [yc] y))
 14058  	// cond: xc == ^(yc << s) && yc & (yc+1) == 0 && yc > 0 && s+log64(yc+1) <= 64
 14059  	// result: (BFI [armBFAuxInt(s, log64(yc+1))] x y)
 14060  	for {
 14061  		s := auxIntToInt64(v.AuxInt)
 14062  		if v_0.Op != OpARM64ANDconst {
 14063  			break
 14064  		}
 14065  		xc := auxIntToInt64(v_0.AuxInt)
 14066  		x := v_0.Args[0]
 14067  		if v_1.Op != OpARM64ANDconst {
 14068  			break
 14069  		}
 14070  		yc := auxIntToInt64(v_1.AuxInt)
 14071  		y := v_1.Args[0]
 14072  		if !(xc == ^(yc<<s) && yc&(yc+1) == 0 && yc > 0 && s+log64(yc+1) <= 64) {
 14073  			break
 14074  		}
 14075  		v.reset(OpARM64BFI)
 14076  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(s, log64(yc+1)))
 14077  		v.AddArg2(x, y)
 14078  		return true
 14079  	}
 14080  	// match: (ORshiftLL [sc] (UBFX [bfc] x) (SRLconst [sc] y))
 14081  	// cond: sc == bfc.width()
 14082  	// result: (BFXIL [bfc] y x)
 14083  	for {
 14084  		sc := auxIntToInt64(v.AuxInt)
 14085  		if v_0.Op != OpARM64UBFX {
 14086  			break
 14087  		}
 14088  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14089  		x := v_0.Args[0]
 14090  		if v_1.Op != OpARM64SRLconst || auxIntToInt64(v_1.AuxInt) != sc {
 14091  			break
 14092  		}
 14093  		y := v_1.Args[0]
 14094  		if !(sc == bfc.width()) {
 14095  			break
 14096  		}
 14097  		v.reset(OpARM64BFXIL)
 14098  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 14099  		v.AddArg2(y, x)
 14100  		return true
 14101  	}
 14102  	return false
 14103  }
 14104  func rewriteValueARM64_OpARM64ORshiftRA(v *Value) bool {
 14105  	v_1 := v.Args[1]
 14106  	v_0 := v.Args[0]
 14107  	b := v.Block
 14108  	// match: (ORshiftRA (MOVDconst [c]) x [d])
 14109  	// result: (ORconst [c] (SRAconst <x.Type> x [d]))
 14110  	for {
 14111  		d := auxIntToInt64(v.AuxInt)
 14112  		if v_0.Op != OpARM64MOVDconst {
 14113  			break
 14114  		}
 14115  		c := auxIntToInt64(v_0.AuxInt)
 14116  		x := v_1
 14117  		v.reset(OpARM64ORconst)
 14118  		v.AuxInt = int64ToAuxInt(c)
 14119  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
 14120  		v0.AuxInt = int64ToAuxInt(d)
 14121  		v0.AddArg(x)
 14122  		v.AddArg(v0)
 14123  		return true
 14124  	}
 14125  	// match: (ORshiftRA x (MOVDconst [c]) [d])
 14126  	// result: (ORconst x [c>>uint64(d)])
 14127  	for {
 14128  		d := auxIntToInt64(v.AuxInt)
 14129  		x := v_0
 14130  		if v_1.Op != OpARM64MOVDconst {
 14131  			break
 14132  		}
 14133  		c := auxIntToInt64(v_1.AuxInt)
 14134  		v.reset(OpARM64ORconst)
 14135  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 14136  		v.AddArg(x)
 14137  		return true
 14138  	}
 14139  	// match: (ORshiftRA y:(SRAconst x [c]) x [c])
 14140  	// result: y
 14141  	for {
 14142  		c := auxIntToInt64(v.AuxInt)
 14143  		y := v_0
 14144  		if y.Op != OpARM64SRAconst || auxIntToInt64(y.AuxInt) != c {
 14145  			break
 14146  		}
 14147  		x := y.Args[0]
 14148  		if x != v_1 {
 14149  			break
 14150  		}
 14151  		v.copyOf(y)
 14152  		return true
 14153  	}
 14154  	return false
 14155  }
 14156  func rewriteValueARM64_OpARM64ORshiftRL(v *Value) bool {
 14157  	v_1 := v.Args[1]
 14158  	v_0 := v.Args[0]
 14159  	b := v.Block
 14160  	// match: (ORshiftRL (MOVDconst [c]) x [d])
 14161  	// result: (ORconst [c] (SRLconst <x.Type> x [d]))
 14162  	for {
 14163  		d := auxIntToInt64(v.AuxInt)
 14164  		if v_0.Op != OpARM64MOVDconst {
 14165  			break
 14166  		}
 14167  		c := auxIntToInt64(v_0.AuxInt)
 14168  		x := v_1
 14169  		v.reset(OpARM64ORconst)
 14170  		v.AuxInt = int64ToAuxInt(c)
 14171  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
 14172  		v0.AuxInt = int64ToAuxInt(d)
 14173  		v0.AddArg(x)
 14174  		v.AddArg(v0)
 14175  		return true
 14176  	}
 14177  	// match: (ORshiftRL x (MOVDconst [c]) [d])
 14178  	// result: (ORconst x [int64(uint64(c)>>uint64(d))])
 14179  	for {
 14180  		d := auxIntToInt64(v.AuxInt)
 14181  		x := v_0
 14182  		if v_1.Op != OpARM64MOVDconst {
 14183  			break
 14184  		}
 14185  		c := auxIntToInt64(v_1.AuxInt)
 14186  		v.reset(OpARM64ORconst)
 14187  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 14188  		v.AddArg(x)
 14189  		return true
 14190  	}
 14191  	// match: (ORshiftRL y:(SRLconst x [c]) x [c])
 14192  	// result: y
 14193  	for {
 14194  		c := auxIntToInt64(v.AuxInt)
 14195  		y := v_0
 14196  		if y.Op != OpARM64SRLconst || auxIntToInt64(y.AuxInt) != c {
 14197  			break
 14198  		}
 14199  		x := y.Args[0]
 14200  		if x != v_1 {
 14201  			break
 14202  		}
 14203  		v.copyOf(y)
 14204  		return true
 14205  	}
 14206  	// match: (ORshiftRL [rc] (ANDconst [ac] x) (SLLconst [lc] y))
 14207  	// cond: lc > rc && ac == ^((1<<uint(64-lc)-1) << uint64(lc-rc))
 14208  	// result: (BFI [armBFAuxInt(lc-rc, 64-lc)] x y)
 14209  	for {
 14210  		rc := auxIntToInt64(v.AuxInt)
 14211  		if v_0.Op != OpARM64ANDconst {
 14212  			break
 14213  		}
 14214  		ac := auxIntToInt64(v_0.AuxInt)
 14215  		x := v_0.Args[0]
 14216  		if v_1.Op != OpARM64SLLconst {
 14217  			break
 14218  		}
 14219  		lc := auxIntToInt64(v_1.AuxInt)
 14220  		y := v_1.Args[0]
 14221  		if !(lc > rc && ac == ^((1<<uint(64-lc)-1)<<uint64(lc-rc))) {
 14222  			break
 14223  		}
 14224  		v.reset(OpARM64BFI)
 14225  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
 14226  		v.AddArg2(x, y)
 14227  		return true
 14228  	}
 14229  	// match: (ORshiftRL [rc] (ANDconst [ac] y) (SLLconst [lc] x))
 14230  	// cond: lc < rc && ac == ^((1<<uint(64-rc)-1))
 14231  	// result: (BFXIL [armBFAuxInt(rc-lc, 64-rc)] y x)
 14232  	for {
 14233  		rc := auxIntToInt64(v.AuxInt)
 14234  		if v_0.Op != OpARM64ANDconst {
 14235  			break
 14236  		}
 14237  		ac := auxIntToInt64(v_0.AuxInt)
 14238  		y := v_0.Args[0]
 14239  		if v_1.Op != OpARM64SLLconst {
 14240  			break
 14241  		}
 14242  		lc := auxIntToInt64(v_1.AuxInt)
 14243  		x := v_1.Args[0]
 14244  		if !(lc < rc && ac == ^(1<<uint(64-rc)-1)) {
 14245  			break
 14246  		}
 14247  		v.reset(OpARM64BFXIL)
 14248  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
 14249  		v.AddArg2(y, x)
 14250  		return true
 14251  	}
 14252  	return false
 14253  }
 14254  func rewriteValueARM64_OpARM64ORshiftRO(v *Value) bool {
 14255  	v_1 := v.Args[1]
 14256  	v_0 := v.Args[0]
 14257  	b := v.Block
 14258  	// match: (ORshiftRO (MOVDconst [c]) x [d])
 14259  	// result: (ORconst [c] (RORconst <x.Type> x [d]))
 14260  	for {
 14261  		d := auxIntToInt64(v.AuxInt)
 14262  		if v_0.Op != OpARM64MOVDconst {
 14263  			break
 14264  		}
 14265  		c := auxIntToInt64(v_0.AuxInt)
 14266  		x := v_1
 14267  		v.reset(OpARM64ORconst)
 14268  		v.AuxInt = int64ToAuxInt(c)
 14269  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
 14270  		v0.AuxInt = int64ToAuxInt(d)
 14271  		v0.AddArg(x)
 14272  		v.AddArg(v0)
 14273  		return true
 14274  	}
 14275  	// match: (ORshiftRO x (MOVDconst [c]) [d])
 14276  	// result: (ORconst x [rotateRight64(c, d)])
 14277  	for {
 14278  		d := auxIntToInt64(v.AuxInt)
 14279  		x := v_0
 14280  		if v_1.Op != OpARM64MOVDconst {
 14281  			break
 14282  		}
 14283  		c := auxIntToInt64(v_1.AuxInt)
 14284  		v.reset(OpARM64ORconst)
 14285  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
 14286  		v.AddArg(x)
 14287  		return true
 14288  	}
 14289  	// match: (ORshiftRO y:(RORconst x [c]) x [c])
 14290  	// result: y
 14291  	for {
 14292  		c := auxIntToInt64(v.AuxInt)
 14293  		y := v_0
 14294  		if y.Op != OpARM64RORconst || auxIntToInt64(y.AuxInt) != c {
 14295  			break
 14296  		}
 14297  		x := y.Args[0]
 14298  		if x != v_1 {
 14299  			break
 14300  		}
 14301  		v.copyOf(y)
 14302  		return true
 14303  	}
 14304  	return false
 14305  }
 14306  func rewriteValueARM64_OpARM64REV(v *Value) bool {
 14307  	v_0 := v.Args[0]
 14308  	// match: (REV (REV p))
 14309  	// result: p
 14310  	for {
 14311  		if v_0.Op != OpARM64REV {
 14312  			break
 14313  		}
 14314  		p := v_0.Args[0]
 14315  		v.copyOf(p)
 14316  		return true
 14317  	}
 14318  	return false
 14319  }
 14320  func rewriteValueARM64_OpARM64REVW(v *Value) bool {
 14321  	v_0 := v.Args[0]
 14322  	// match: (REVW (REVW p))
 14323  	// result: p
 14324  	for {
 14325  		if v_0.Op != OpARM64REVW {
 14326  			break
 14327  		}
 14328  		p := v_0.Args[0]
 14329  		v.copyOf(p)
 14330  		return true
 14331  	}
 14332  	return false
 14333  }
 14334  func rewriteValueARM64_OpARM64ROR(v *Value) bool {
 14335  	v_1 := v.Args[1]
 14336  	v_0 := v.Args[0]
 14337  	// match: (ROR x (MOVDconst [c]))
 14338  	// result: (RORconst x [c&63])
 14339  	for {
 14340  		x := v_0
 14341  		if v_1.Op != OpARM64MOVDconst {
 14342  			break
 14343  		}
 14344  		c := auxIntToInt64(v_1.AuxInt)
 14345  		v.reset(OpARM64RORconst)
 14346  		v.AuxInt = int64ToAuxInt(c & 63)
 14347  		v.AddArg(x)
 14348  		return true
 14349  	}
 14350  	return false
 14351  }
 14352  func rewriteValueARM64_OpARM64RORW(v *Value) bool {
 14353  	v_1 := v.Args[1]
 14354  	v_0 := v.Args[0]
 14355  	// match: (RORW x (MOVDconst [c]))
 14356  	// result: (RORWconst x [c&31])
 14357  	for {
 14358  		x := v_0
 14359  		if v_1.Op != OpARM64MOVDconst {
 14360  			break
 14361  		}
 14362  		c := auxIntToInt64(v_1.AuxInt)
 14363  		v.reset(OpARM64RORWconst)
 14364  		v.AuxInt = int64ToAuxInt(c & 31)
 14365  		v.AddArg(x)
 14366  		return true
 14367  	}
 14368  	return false
 14369  }
 14370  func rewriteValueARM64_OpARM64SBCSflags(v *Value) bool {
 14371  	v_2 := v.Args[2]
 14372  	v_1 := v.Args[1]
 14373  	v_0 := v.Args[0]
 14374  	b := v.Block
 14375  	typ := &b.Func.Config.Types
 14376  	// match: (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags (NEG <typ.UInt64> (NGCzerocarry <typ.UInt64> bo)))))
 14377  	// result: (SBCSflags x y bo)
 14378  	for {
 14379  		x := v_0
 14380  		y := v_1
 14381  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
 14382  			break
 14383  		}
 14384  		v_2_0 := v_2.Args[0]
 14385  		if v_2_0.Op != OpARM64NEGSflags {
 14386  			break
 14387  		}
 14388  		v_2_0_0 := v_2_0.Args[0]
 14389  		if v_2_0_0.Op != OpARM64NEG || v_2_0_0.Type != typ.UInt64 {
 14390  			break
 14391  		}
 14392  		v_2_0_0_0 := v_2_0_0.Args[0]
 14393  		if v_2_0_0_0.Op != OpARM64NGCzerocarry || v_2_0_0_0.Type != typ.UInt64 {
 14394  			break
 14395  		}
 14396  		bo := v_2_0_0_0.Args[0]
 14397  		v.reset(OpARM64SBCSflags)
 14398  		v.AddArg3(x, y, bo)
 14399  		return true
 14400  	}
 14401  	// match: (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags (MOVDconst [0]))))
 14402  	// result: (SUBSflags x y)
 14403  	for {
 14404  		x := v_0
 14405  		y := v_1
 14406  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
 14407  			break
 14408  		}
 14409  		v_2_0 := v_2.Args[0]
 14410  		if v_2_0.Op != OpARM64NEGSflags {
 14411  			break
 14412  		}
 14413  		v_2_0_0 := v_2_0.Args[0]
 14414  		if v_2_0_0.Op != OpARM64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
 14415  			break
 14416  		}
 14417  		v.reset(OpARM64SUBSflags)
 14418  		v.AddArg2(x, y)
 14419  		return true
 14420  	}
 14421  	return false
 14422  }
 14423  func rewriteValueARM64_OpARM64SBFX(v *Value) bool {
 14424  	v_0 := v.Args[0]
 14425  	// match: (SBFX [bfc] s:(SLLconst [sc] x))
 14426  	// cond: s.Uses == 1 && sc <= bfc.lsb()
 14427  	// result: (SBFX [armBFAuxInt(bfc.lsb() - sc, bfc.width())] x)
 14428  	for {
 14429  		bfc := auxIntToArm64BitField(v.AuxInt)
 14430  		s := v_0
 14431  		if s.Op != OpARM64SLLconst {
 14432  			break
 14433  		}
 14434  		sc := auxIntToInt64(s.AuxInt)
 14435  		x := s.Args[0]
 14436  		if !(s.Uses == 1 && sc <= bfc.lsb()) {
 14437  			break
 14438  		}
 14439  		v.reset(OpARM64SBFX)
 14440  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 14441  		v.AddArg(x)
 14442  		return true
 14443  	}
 14444  	// match: (SBFX [bfc] s:(SLLconst [sc] x))
 14445  	// cond: s.Uses == 1 && sc > bfc.lsb()
 14446  	// result: (SBFIZ [armBFAuxInt(sc - bfc.lsb(), bfc.width() - (sc-bfc.lsb()))] x)
 14447  	for {
 14448  		bfc := auxIntToArm64BitField(v.AuxInt)
 14449  		s := v_0
 14450  		if s.Op != OpARM64SLLconst {
 14451  			break
 14452  		}
 14453  		sc := auxIntToInt64(s.AuxInt)
 14454  		x := s.Args[0]
 14455  		if !(s.Uses == 1 && sc > bfc.lsb()) {
 14456  			break
 14457  		}
 14458  		v.reset(OpARM64SBFIZ)
 14459  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.width()-(sc-bfc.lsb())))
 14460  		v.AddArg(x)
 14461  		return true
 14462  	}
 14463  	return false
 14464  }
 14465  func rewriteValueARM64_OpARM64SLL(v *Value) bool {
 14466  	v_1 := v.Args[1]
 14467  	v_0 := v.Args[0]
 14468  	// match: (SLL x (MOVDconst [c]))
 14469  	// result: (SLLconst x [c&63])
 14470  	for {
 14471  		x := v_0
 14472  		if v_1.Op != OpARM64MOVDconst {
 14473  			break
 14474  		}
 14475  		c := auxIntToInt64(v_1.AuxInt)
 14476  		v.reset(OpARM64SLLconst)
 14477  		v.AuxInt = int64ToAuxInt(c & 63)
 14478  		v.AddArg(x)
 14479  		return true
 14480  	}
 14481  	// match: (SLL x (ANDconst [63] y))
 14482  	// result: (SLL x y)
 14483  	for {
 14484  		x := v_0
 14485  		if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
 14486  			break
 14487  		}
 14488  		y := v_1.Args[0]
 14489  		v.reset(OpARM64SLL)
 14490  		v.AddArg2(x, y)
 14491  		return true
 14492  	}
 14493  	return false
 14494  }
 14495  func rewriteValueARM64_OpARM64SLLconst(v *Value) bool {
 14496  	v_0 := v.Args[0]
 14497  	// match: (SLLconst [c] (MOVDconst [d]))
 14498  	// result: (MOVDconst [d<<uint64(c)])
 14499  	for {
 14500  		c := auxIntToInt64(v.AuxInt)
 14501  		if v_0.Op != OpARM64MOVDconst {
 14502  			break
 14503  		}
 14504  		d := auxIntToInt64(v_0.AuxInt)
 14505  		v.reset(OpARM64MOVDconst)
 14506  		v.AuxInt = int64ToAuxInt(d << uint64(c))
 14507  		return true
 14508  	}
 14509  	// match: (SLLconst [c] (SRLconst [c] x))
 14510  	// cond: 0 < c && c < 64
 14511  	// result: (ANDconst [^(1<<uint(c)-1)] x)
 14512  	for {
 14513  		c := auxIntToInt64(v.AuxInt)
 14514  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 14515  			break
 14516  		}
 14517  		x := v_0.Args[0]
 14518  		if !(0 < c && c < 64) {
 14519  			break
 14520  		}
 14521  		v.reset(OpARM64ANDconst)
 14522  		v.AuxInt = int64ToAuxInt(^(1<<uint(c) - 1))
 14523  		v.AddArg(x)
 14524  		return true
 14525  	}
 14526  	// match: (SLLconst [lc] (MOVWreg x))
 14527  	// result: (SBFIZ [armBFAuxInt(lc, min(32, 64-lc))] x)
 14528  	for {
 14529  		lc := auxIntToInt64(v.AuxInt)
 14530  		if v_0.Op != OpARM64MOVWreg {
 14531  			break
 14532  		}
 14533  		x := v_0.Args[0]
 14534  		v.reset(OpARM64SBFIZ)
 14535  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(32, 64-lc)))
 14536  		v.AddArg(x)
 14537  		return true
 14538  	}
 14539  	// match: (SLLconst [lc] (MOVHreg x))
 14540  	// result: (SBFIZ [armBFAuxInt(lc, min(16, 64-lc))] x)
 14541  	for {
 14542  		lc := auxIntToInt64(v.AuxInt)
 14543  		if v_0.Op != OpARM64MOVHreg {
 14544  			break
 14545  		}
 14546  		x := v_0.Args[0]
 14547  		v.reset(OpARM64SBFIZ)
 14548  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(16, 64-lc)))
 14549  		v.AddArg(x)
 14550  		return true
 14551  	}
 14552  	// match: (SLLconst [lc] (MOVBreg x))
 14553  	// result: (SBFIZ [armBFAuxInt(lc, min(8, 64-lc))] x)
 14554  	for {
 14555  		lc := auxIntToInt64(v.AuxInt)
 14556  		if v_0.Op != OpARM64MOVBreg {
 14557  			break
 14558  		}
 14559  		x := v_0.Args[0]
 14560  		v.reset(OpARM64SBFIZ)
 14561  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(8, 64-lc)))
 14562  		v.AddArg(x)
 14563  		return true
 14564  	}
 14565  	// match: (SLLconst [lc] (MOVWUreg x))
 14566  	// result: (UBFIZ [armBFAuxInt(lc, min(32, 64-lc))] x)
 14567  	for {
 14568  		lc := auxIntToInt64(v.AuxInt)
 14569  		if v_0.Op != OpARM64MOVWUreg {
 14570  			break
 14571  		}
 14572  		x := v_0.Args[0]
 14573  		v.reset(OpARM64UBFIZ)
 14574  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(32, 64-lc)))
 14575  		v.AddArg(x)
 14576  		return true
 14577  	}
 14578  	// match: (SLLconst [lc] (MOVHUreg x))
 14579  	// result: (UBFIZ [armBFAuxInt(lc, min(16, 64-lc))] x)
 14580  	for {
 14581  		lc := auxIntToInt64(v.AuxInt)
 14582  		if v_0.Op != OpARM64MOVHUreg {
 14583  			break
 14584  		}
 14585  		x := v_0.Args[0]
 14586  		v.reset(OpARM64UBFIZ)
 14587  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(16, 64-lc)))
 14588  		v.AddArg(x)
 14589  		return true
 14590  	}
 14591  	// match: (SLLconst [lc] (MOVBUreg x))
 14592  	// result: (UBFIZ [armBFAuxInt(lc, min(8, 64-lc))] x)
 14593  	for {
 14594  		lc := auxIntToInt64(v.AuxInt)
 14595  		if v_0.Op != OpARM64MOVBUreg {
 14596  			break
 14597  		}
 14598  		x := v_0.Args[0]
 14599  		v.reset(OpARM64UBFIZ)
 14600  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(8, 64-lc)))
 14601  		v.AddArg(x)
 14602  		return true
 14603  	}
 14604  	// match: (SLLconst [sc] (ANDconst [ac] x))
 14605  	// cond: isARM64BFMask(sc, ac, 0)
 14606  	// result: (UBFIZ [armBFAuxInt(sc, arm64BFWidth(ac, 0))] x)
 14607  	for {
 14608  		sc := auxIntToInt64(v.AuxInt)
 14609  		if v_0.Op != OpARM64ANDconst {
 14610  			break
 14611  		}
 14612  		ac := auxIntToInt64(v_0.AuxInt)
 14613  		x := v_0.Args[0]
 14614  		if !(isARM64BFMask(sc, ac, 0)) {
 14615  			break
 14616  		}
 14617  		v.reset(OpARM64UBFIZ)
 14618  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, 0)))
 14619  		v.AddArg(x)
 14620  		return true
 14621  	}
 14622  	// match: (SLLconst [sc] (UBFIZ [bfc] x))
 14623  	// cond: sc+bfc.width()+bfc.lsb() < 64
 14624  	// result: (UBFIZ [armBFAuxInt(bfc.lsb()+sc, bfc.width())] x)
 14625  	for {
 14626  		sc := auxIntToInt64(v.AuxInt)
 14627  		if v_0.Op != OpARM64UBFIZ {
 14628  			break
 14629  		}
 14630  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14631  		x := v_0.Args[0]
 14632  		if !(sc+bfc.width()+bfc.lsb() < 64) {
 14633  			break
 14634  		}
 14635  		v.reset(OpARM64UBFIZ)
 14636  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()))
 14637  		v.AddArg(x)
 14638  		return true
 14639  	}
 14640  	return false
 14641  }
 14642  func rewriteValueARM64_OpARM64SRA(v *Value) bool {
 14643  	v_1 := v.Args[1]
 14644  	v_0 := v.Args[0]
 14645  	// match: (SRA x (MOVDconst [c]))
 14646  	// result: (SRAconst x [c&63])
 14647  	for {
 14648  		x := v_0
 14649  		if v_1.Op != OpARM64MOVDconst {
 14650  			break
 14651  		}
 14652  		c := auxIntToInt64(v_1.AuxInt)
 14653  		v.reset(OpARM64SRAconst)
 14654  		v.AuxInt = int64ToAuxInt(c & 63)
 14655  		v.AddArg(x)
 14656  		return true
 14657  	}
 14658  	// match: (SRA x (ANDconst [63] y))
 14659  	// result: (SRA x y)
 14660  	for {
 14661  		x := v_0
 14662  		if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
 14663  			break
 14664  		}
 14665  		y := v_1.Args[0]
 14666  		v.reset(OpARM64SRA)
 14667  		v.AddArg2(x, y)
 14668  		return true
 14669  	}
 14670  	return false
 14671  }
 14672  func rewriteValueARM64_OpARM64SRAconst(v *Value) bool {
 14673  	v_0 := v.Args[0]
 14674  	// match: (SRAconst [c] (MOVDconst [d]))
 14675  	// result: (MOVDconst [d>>uint64(c)])
 14676  	for {
 14677  		c := auxIntToInt64(v.AuxInt)
 14678  		if v_0.Op != OpARM64MOVDconst {
 14679  			break
 14680  		}
 14681  		d := auxIntToInt64(v_0.AuxInt)
 14682  		v.reset(OpARM64MOVDconst)
 14683  		v.AuxInt = int64ToAuxInt(d >> uint64(c))
 14684  		return true
 14685  	}
 14686  	// match: (SRAconst [rc] (SLLconst [lc] x))
 14687  	// cond: lc > rc
 14688  	// result: (SBFIZ [armBFAuxInt(lc-rc, 64-lc)] x)
 14689  	for {
 14690  		rc := auxIntToInt64(v.AuxInt)
 14691  		if v_0.Op != OpARM64SLLconst {
 14692  			break
 14693  		}
 14694  		lc := auxIntToInt64(v_0.AuxInt)
 14695  		x := v_0.Args[0]
 14696  		if !(lc > rc) {
 14697  			break
 14698  		}
 14699  		v.reset(OpARM64SBFIZ)
 14700  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
 14701  		v.AddArg(x)
 14702  		return true
 14703  	}
 14704  	// match: (SRAconst [rc] (SLLconst [lc] x))
 14705  	// cond: lc <= rc
 14706  	// result: (SBFX [armBFAuxInt(rc-lc, 64-rc)] x)
 14707  	for {
 14708  		rc := auxIntToInt64(v.AuxInt)
 14709  		if v_0.Op != OpARM64SLLconst {
 14710  			break
 14711  		}
 14712  		lc := auxIntToInt64(v_0.AuxInt)
 14713  		x := v_0.Args[0]
 14714  		if !(lc <= rc) {
 14715  			break
 14716  		}
 14717  		v.reset(OpARM64SBFX)
 14718  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
 14719  		v.AddArg(x)
 14720  		return true
 14721  	}
 14722  	// match: (SRAconst [rc] (MOVWreg x))
 14723  	// cond: rc < 32
 14724  	// result: (SBFX [armBFAuxInt(rc, 32-rc)] x)
 14725  	for {
 14726  		rc := auxIntToInt64(v.AuxInt)
 14727  		if v_0.Op != OpARM64MOVWreg {
 14728  			break
 14729  		}
 14730  		x := v_0.Args[0]
 14731  		if !(rc < 32) {
 14732  			break
 14733  		}
 14734  		v.reset(OpARM64SBFX)
 14735  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32-rc))
 14736  		v.AddArg(x)
 14737  		return true
 14738  	}
 14739  	// match: (SRAconst [rc] (MOVHreg x))
 14740  	// cond: rc < 16
 14741  	// result: (SBFX [armBFAuxInt(rc, 16-rc)] x)
 14742  	for {
 14743  		rc := auxIntToInt64(v.AuxInt)
 14744  		if v_0.Op != OpARM64MOVHreg {
 14745  			break
 14746  		}
 14747  		x := v_0.Args[0]
 14748  		if !(rc < 16) {
 14749  			break
 14750  		}
 14751  		v.reset(OpARM64SBFX)
 14752  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16-rc))
 14753  		v.AddArg(x)
 14754  		return true
 14755  	}
 14756  	// match: (SRAconst [rc] (MOVBreg x))
 14757  	// cond: rc < 8
 14758  	// result: (SBFX [armBFAuxInt(rc, 8-rc)] x)
 14759  	for {
 14760  		rc := auxIntToInt64(v.AuxInt)
 14761  		if v_0.Op != OpARM64MOVBreg {
 14762  			break
 14763  		}
 14764  		x := v_0.Args[0]
 14765  		if !(rc < 8) {
 14766  			break
 14767  		}
 14768  		v.reset(OpARM64SBFX)
 14769  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8-rc))
 14770  		v.AddArg(x)
 14771  		return true
 14772  	}
 14773  	// match: (SRAconst [sc] (SBFIZ [bfc] x))
 14774  	// cond: sc < bfc.lsb()
 14775  	// result: (SBFIZ [armBFAuxInt(bfc.lsb()-sc, bfc.width())] x)
 14776  	for {
 14777  		sc := auxIntToInt64(v.AuxInt)
 14778  		if v_0.Op != OpARM64SBFIZ {
 14779  			break
 14780  		}
 14781  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14782  		x := v_0.Args[0]
 14783  		if !(sc < bfc.lsb()) {
 14784  			break
 14785  		}
 14786  		v.reset(OpARM64SBFIZ)
 14787  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 14788  		v.AddArg(x)
 14789  		return true
 14790  	}
 14791  	// match: (SRAconst [sc] (SBFIZ [bfc] x))
 14792  	// cond: sc >= bfc.lsb() && sc < bfc.lsb()+bfc.width()
 14793  	// result: (SBFX [armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc)] x)
 14794  	for {
 14795  		sc := auxIntToInt64(v.AuxInt)
 14796  		if v_0.Op != OpARM64SBFIZ {
 14797  			break
 14798  		}
 14799  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 14800  		x := v_0.Args[0]
 14801  		if !(sc >= bfc.lsb() && sc < bfc.lsb()+bfc.width()) {
 14802  			break
 14803  		}
 14804  		v.reset(OpARM64SBFX)
 14805  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc))
 14806  		v.AddArg(x)
 14807  		return true
 14808  	}
 14809  	return false
 14810  }
 14811  func rewriteValueARM64_OpARM64SRL(v *Value) bool {
 14812  	v_1 := v.Args[1]
 14813  	v_0 := v.Args[0]
 14814  	// match: (SRL x (MOVDconst [c]))
 14815  	// result: (SRLconst x [c&63])
 14816  	for {
 14817  		x := v_0
 14818  		if v_1.Op != OpARM64MOVDconst {
 14819  			break
 14820  		}
 14821  		c := auxIntToInt64(v_1.AuxInt)
 14822  		v.reset(OpARM64SRLconst)
 14823  		v.AuxInt = int64ToAuxInt(c & 63)
 14824  		v.AddArg(x)
 14825  		return true
 14826  	}
 14827  	// match: (SRL x (ANDconst [63] y))
 14828  	// result: (SRL x y)
 14829  	for {
 14830  		x := v_0
 14831  		if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
 14832  			break
 14833  		}
 14834  		y := v_1.Args[0]
 14835  		v.reset(OpARM64SRL)
 14836  		v.AddArg2(x, y)
 14837  		return true
 14838  	}
 14839  	return false
 14840  }
 14841  func rewriteValueARM64_OpARM64SRLconst(v *Value) bool {
 14842  	v_0 := v.Args[0]
 14843  	// match: (SRLconst [c] (MOVDconst [d]))
 14844  	// result: (MOVDconst [int64(uint64(d)>>uint64(c))])
 14845  	for {
 14846  		c := auxIntToInt64(v.AuxInt)
 14847  		if v_0.Op != OpARM64MOVDconst {
 14848  			break
 14849  		}
 14850  		d := auxIntToInt64(v_0.AuxInt)
 14851  		v.reset(OpARM64MOVDconst)
 14852  		v.AuxInt = int64ToAuxInt(int64(uint64(d) >> uint64(c)))
 14853  		return true
 14854  	}
 14855  	// match: (SRLconst [c] (SLLconst [c] x))
 14856  	// cond: 0 < c && c < 64
 14857  	// result: (ANDconst [1<<uint(64-c)-1] x)
 14858  	for {
 14859  		c := auxIntToInt64(v.AuxInt)
 14860  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 14861  			break
 14862  		}
 14863  		x := v_0.Args[0]
 14864  		if !(0 < c && c < 64) {
 14865  			break
 14866  		}
 14867  		v.reset(OpARM64ANDconst)
 14868  		v.AuxInt = int64ToAuxInt(1<<uint(64-c) - 1)
 14869  		v.AddArg(x)
 14870  		return true
 14871  	}
 14872  	// match: (SRLconst [rc] (MOVWUreg x))
 14873  	// cond: rc >= 32
 14874  	// result: (MOVDconst [0])
 14875  	for {
 14876  		rc := auxIntToInt64(v.AuxInt)
 14877  		if v_0.Op != OpARM64MOVWUreg {
 14878  			break
 14879  		}
 14880  		if !(rc >= 32) {
 14881  			break
 14882  		}
 14883  		v.reset(OpARM64MOVDconst)
 14884  		v.AuxInt = int64ToAuxInt(0)
 14885  		return true
 14886  	}
 14887  	// match: (SRLconst [rc] (MOVHUreg x))
 14888  	// cond: rc >= 16
 14889  	// result: (MOVDconst [0])
 14890  	for {
 14891  		rc := auxIntToInt64(v.AuxInt)
 14892  		if v_0.Op != OpARM64MOVHUreg {
 14893  			break
 14894  		}
 14895  		if !(rc >= 16) {
 14896  			break
 14897  		}
 14898  		v.reset(OpARM64MOVDconst)
 14899  		v.AuxInt = int64ToAuxInt(0)
 14900  		return true
 14901  	}
 14902  	// match: (SRLconst [rc] (MOVBUreg x))
 14903  	// cond: rc >= 8
 14904  	// result: (MOVDconst [0])
 14905  	for {
 14906  		rc := auxIntToInt64(v.AuxInt)
 14907  		if v_0.Op != OpARM64MOVBUreg {
 14908  			break
 14909  		}
 14910  		if !(rc >= 8) {
 14911  			break
 14912  		}
 14913  		v.reset(OpARM64MOVDconst)
 14914  		v.AuxInt = int64ToAuxInt(0)
 14915  		return true
 14916  	}
 14917  	// match: (SRLconst [rc] (SLLconst [lc] x))
 14918  	// cond: lc > rc
 14919  	// result: (UBFIZ [armBFAuxInt(lc-rc, 64-lc)] x)
 14920  	for {
 14921  		rc := auxIntToInt64(v.AuxInt)
 14922  		if v_0.Op != OpARM64SLLconst {
 14923  			break
 14924  		}
 14925  		lc := auxIntToInt64(v_0.AuxInt)
 14926  		x := v_0.Args[0]
 14927  		if !(lc > rc) {
 14928  			break
 14929  		}
 14930  		v.reset(OpARM64UBFIZ)
 14931  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
 14932  		v.AddArg(x)
 14933  		return true
 14934  	}
 14935  	// match: (SRLconst [rc] (SLLconst [lc] x))
 14936  	// cond: lc < rc
 14937  	// result: (UBFX [armBFAuxInt(rc-lc, 64-rc)] x)
 14938  	for {
 14939  		rc := auxIntToInt64(v.AuxInt)
 14940  		if v_0.Op != OpARM64SLLconst {
 14941  			break
 14942  		}
 14943  		lc := auxIntToInt64(v_0.AuxInt)
 14944  		x := v_0.Args[0]
 14945  		if !(lc < rc) {
 14946  			break
 14947  		}
 14948  		v.reset(OpARM64UBFX)
 14949  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
 14950  		v.AddArg(x)
 14951  		return true
 14952  	}
 14953  	// match: (SRLconst [rc] (MOVWUreg x))
 14954  	// cond: rc < 32
 14955  	// result: (UBFX [armBFAuxInt(rc, 32-rc)] x)
 14956  	for {
 14957  		rc := auxIntToInt64(v.AuxInt)
 14958  		if v_0.Op != OpARM64MOVWUreg {
 14959  			break
 14960  		}
 14961  		x := v_0.Args[0]
 14962  		if !(rc < 32) {
 14963  			break
 14964  		}
 14965  		v.reset(OpARM64UBFX)
 14966  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32-rc))
 14967  		v.AddArg(x)
 14968  		return true
 14969  	}
 14970  	// match: (SRLconst [rc] (MOVHUreg x))
 14971  	// cond: rc < 16
 14972  	// result: (UBFX [armBFAuxInt(rc, 16-rc)] x)
 14973  	for {
 14974  		rc := auxIntToInt64(v.AuxInt)
 14975  		if v_0.Op != OpARM64MOVHUreg {
 14976  			break
 14977  		}
 14978  		x := v_0.Args[0]
 14979  		if !(rc < 16) {
 14980  			break
 14981  		}
 14982  		v.reset(OpARM64UBFX)
 14983  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16-rc))
 14984  		v.AddArg(x)
 14985  		return true
 14986  	}
 14987  	// match: (SRLconst [rc] (MOVBUreg x))
 14988  	// cond: rc < 8
 14989  	// result: (UBFX [armBFAuxInt(rc, 8-rc)] x)
 14990  	for {
 14991  		rc := auxIntToInt64(v.AuxInt)
 14992  		if v_0.Op != OpARM64MOVBUreg {
 14993  			break
 14994  		}
 14995  		x := v_0.Args[0]
 14996  		if !(rc < 8) {
 14997  			break
 14998  		}
 14999  		v.reset(OpARM64UBFX)
 15000  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8-rc))
 15001  		v.AddArg(x)
 15002  		return true
 15003  	}
 15004  	// match: (SRLconst [sc] (ANDconst [ac] x))
 15005  	// cond: isARM64BFMask(sc, ac, sc)
 15006  	// result: (UBFX [armBFAuxInt(sc, arm64BFWidth(ac, sc))] x)
 15007  	for {
 15008  		sc := auxIntToInt64(v.AuxInt)
 15009  		if v_0.Op != OpARM64ANDconst {
 15010  			break
 15011  		}
 15012  		ac := auxIntToInt64(v_0.AuxInt)
 15013  		x := v_0.Args[0]
 15014  		if !(isARM64BFMask(sc, ac, sc)) {
 15015  			break
 15016  		}
 15017  		v.reset(OpARM64UBFX)
 15018  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, sc)))
 15019  		v.AddArg(x)
 15020  		return true
 15021  	}
 15022  	// match: (SRLconst [sc] (UBFX [bfc] x))
 15023  	// cond: sc < bfc.width()
 15024  	// result: (UBFX [armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc)] x)
 15025  	for {
 15026  		sc := auxIntToInt64(v.AuxInt)
 15027  		if v_0.Op != OpARM64UBFX {
 15028  			break
 15029  		}
 15030  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 15031  		x := v_0.Args[0]
 15032  		if !(sc < bfc.width()) {
 15033  			break
 15034  		}
 15035  		v.reset(OpARM64UBFX)
 15036  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc))
 15037  		v.AddArg(x)
 15038  		return true
 15039  	}
 15040  	// match: (SRLconst [sc] (UBFIZ [bfc] x))
 15041  	// cond: sc == bfc.lsb()
 15042  	// result: (ANDconst [1<<uint(bfc.width())-1] x)
 15043  	for {
 15044  		sc := auxIntToInt64(v.AuxInt)
 15045  		if v_0.Op != OpARM64UBFIZ {
 15046  			break
 15047  		}
 15048  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 15049  		x := v_0.Args[0]
 15050  		if !(sc == bfc.lsb()) {
 15051  			break
 15052  		}
 15053  		v.reset(OpARM64ANDconst)
 15054  		v.AuxInt = int64ToAuxInt(1<<uint(bfc.width()) - 1)
 15055  		v.AddArg(x)
 15056  		return true
 15057  	}
 15058  	// match: (SRLconst [sc] (UBFIZ [bfc] x))
 15059  	// cond: sc < bfc.lsb()
 15060  	// result: (UBFIZ [armBFAuxInt(bfc.lsb()-sc, bfc.width())] x)
 15061  	for {
 15062  		sc := auxIntToInt64(v.AuxInt)
 15063  		if v_0.Op != OpARM64UBFIZ {
 15064  			break
 15065  		}
 15066  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 15067  		x := v_0.Args[0]
 15068  		if !(sc < bfc.lsb()) {
 15069  			break
 15070  		}
 15071  		v.reset(OpARM64UBFIZ)
 15072  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 15073  		v.AddArg(x)
 15074  		return true
 15075  	}
 15076  	// match: (SRLconst [sc] (UBFIZ [bfc] x))
 15077  	// cond: sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()
 15078  	// result: (UBFX [armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc)] x)
 15079  	for {
 15080  		sc := auxIntToInt64(v.AuxInt)
 15081  		if v_0.Op != OpARM64UBFIZ {
 15082  			break
 15083  		}
 15084  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 15085  		x := v_0.Args[0]
 15086  		if !(sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()) {
 15087  			break
 15088  		}
 15089  		v.reset(OpARM64UBFX)
 15090  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc))
 15091  		v.AddArg(x)
 15092  		return true
 15093  	}
 15094  	return false
 15095  }
 15096  func rewriteValueARM64_OpARM64STP(v *Value) bool {
 15097  	v_3 := v.Args[3]
 15098  	v_2 := v.Args[2]
 15099  	v_1 := v.Args[1]
 15100  	v_0 := v.Args[0]
 15101  	b := v.Block
 15102  	config := b.Func.Config
 15103  	// match: (STP [off1] {sym} (ADDconst [off2] ptr) val1 val2 mem)
 15104  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 15105  	// result: (STP [off1+int32(off2)] {sym} ptr val1 val2 mem)
 15106  	for {
 15107  		off1 := auxIntToInt32(v.AuxInt)
 15108  		sym := auxToSym(v.Aux)
 15109  		if v_0.Op != OpARM64ADDconst {
 15110  			break
 15111  		}
 15112  		off2 := auxIntToInt64(v_0.AuxInt)
 15113  		ptr := v_0.Args[0]
 15114  		val1 := v_1
 15115  		val2 := v_2
 15116  		mem := v_3
 15117  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 15118  			break
 15119  		}
 15120  		v.reset(OpARM64STP)
 15121  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 15122  		v.Aux = symToAux(sym)
 15123  		v.AddArg4(ptr, val1, val2, mem)
 15124  		return true
 15125  	}
 15126  	// match: (STP [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val1 val2 mem)
 15127  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 15128  	// result: (STP [off1+off2] {mergeSym(sym1,sym2)} ptr val1 val2 mem)
 15129  	for {
 15130  		off1 := auxIntToInt32(v.AuxInt)
 15131  		sym1 := auxToSym(v.Aux)
 15132  		if v_0.Op != OpARM64MOVDaddr {
 15133  			break
 15134  		}
 15135  		off2 := auxIntToInt32(v_0.AuxInt)
 15136  		sym2 := auxToSym(v_0.Aux)
 15137  		ptr := v_0.Args[0]
 15138  		val1 := v_1
 15139  		val2 := v_2
 15140  		mem := v_3
 15141  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 15142  			break
 15143  		}
 15144  		v.reset(OpARM64STP)
 15145  		v.AuxInt = int32ToAuxInt(off1 + off2)
 15146  		v.Aux = symToAux(mergeSym(sym1, sym2))
 15147  		v.AddArg4(ptr, val1, val2, mem)
 15148  		return true
 15149  	}
 15150  	return false
 15151  }
 15152  func rewriteValueARM64_OpARM64SUB(v *Value) bool {
 15153  	v_1 := v.Args[1]
 15154  	v_0 := v.Args[0]
 15155  	b := v.Block
 15156  	// match: (SUB x (MOVDconst [c]))
 15157  	// result: (SUBconst [c] x)
 15158  	for {
 15159  		x := v_0
 15160  		if v_1.Op != OpARM64MOVDconst {
 15161  			break
 15162  		}
 15163  		c := auxIntToInt64(v_1.AuxInt)
 15164  		v.reset(OpARM64SUBconst)
 15165  		v.AuxInt = int64ToAuxInt(c)
 15166  		v.AddArg(x)
 15167  		return true
 15168  	}
 15169  	// match: (SUB a l:(MUL x y))
 15170  	// cond: l.Uses==1 && clobber(l)
 15171  	// result: (MSUB a x y)
 15172  	for {
 15173  		a := v_0
 15174  		l := v_1
 15175  		if l.Op != OpARM64MUL {
 15176  			break
 15177  		}
 15178  		y := l.Args[1]
 15179  		x := l.Args[0]
 15180  		if !(l.Uses == 1 && clobber(l)) {
 15181  			break
 15182  		}
 15183  		v.reset(OpARM64MSUB)
 15184  		v.AddArg3(a, x, y)
 15185  		return true
 15186  	}
 15187  	// match: (SUB a l:(MNEG x y))
 15188  	// cond: l.Uses==1 && clobber(l)
 15189  	// result: (MADD a x y)
 15190  	for {
 15191  		a := v_0
 15192  		l := v_1
 15193  		if l.Op != OpARM64MNEG {
 15194  			break
 15195  		}
 15196  		y := l.Args[1]
 15197  		x := l.Args[0]
 15198  		if !(l.Uses == 1 && clobber(l)) {
 15199  			break
 15200  		}
 15201  		v.reset(OpARM64MADD)
 15202  		v.AddArg3(a, x, y)
 15203  		return true
 15204  	}
 15205  	// match: (SUB a l:(MULW x y))
 15206  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
 15207  	// result: (MSUBW a x y)
 15208  	for {
 15209  		a := v_0
 15210  		l := v_1
 15211  		if l.Op != OpARM64MULW {
 15212  			break
 15213  		}
 15214  		y := l.Args[1]
 15215  		x := l.Args[0]
 15216  		if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
 15217  			break
 15218  		}
 15219  		v.reset(OpARM64MSUBW)
 15220  		v.AddArg3(a, x, y)
 15221  		return true
 15222  	}
 15223  	// match: (SUB a l:(MNEGW x y))
 15224  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
 15225  	// result: (MADDW a x y)
 15226  	for {
 15227  		a := v_0
 15228  		l := v_1
 15229  		if l.Op != OpARM64MNEGW {
 15230  			break
 15231  		}
 15232  		y := l.Args[1]
 15233  		x := l.Args[0]
 15234  		if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
 15235  			break
 15236  		}
 15237  		v.reset(OpARM64MADDW)
 15238  		v.AddArg3(a, x, y)
 15239  		return true
 15240  	}
 15241  	// match: (SUB <t> a p:(ADDconst [c] m:(MUL _ _)))
 15242  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15243  	// result: (SUBconst [c] (SUB <v.Type> a m))
 15244  	for {
 15245  		t := v.Type
 15246  		a := v_0
 15247  		p := v_1
 15248  		if p.Op != OpARM64ADDconst {
 15249  			break
 15250  		}
 15251  		c := auxIntToInt64(p.AuxInt)
 15252  		m := p.Args[0]
 15253  		if m.Op != OpARM64MUL || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15254  			break
 15255  		}
 15256  		v.reset(OpARM64SUBconst)
 15257  		v.AuxInt = int64ToAuxInt(c)
 15258  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15259  		v0.AddArg2(a, m)
 15260  		v.AddArg(v0)
 15261  		return true
 15262  	}
 15263  	// match: (SUB <t> a p:(ADDconst [c] m:(MULW _ _)))
 15264  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15265  	// result: (SUBconst [c] (SUB <v.Type> a m))
 15266  	for {
 15267  		t := v.Type
 15268  		a := v_0
 15269  		p := v_1
 15270  		if p.Op != OpARM64ADDconst {
 15271  			break
 15272  		}
 15273  		c := auxIntToInt64(p.AuxInt)
 15274  		m := p.Args[0]
 15275  		if m.Op != OpARM64MULW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15276  			break
 15277  		}
 15278  		v.reset(OpARM64SUBconst)
 15279  		v.AuxInt = int64ToAuxInt(c)
 15280  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15281  		v0.AddArg2(a, m)
 15282  		v.AddArg(v0)
 15283  		return true
 15284  	}
 15285  	// match: (SUB <t> a p:(ADDconst [c] m:(MNEG _ _)))
 15286  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15287  	// result: (SUBconst [c] (SUB <v.Type> a m))
 15288  	for {
 15289  		t := v.Type
 15290  		a := v_0
 15291  		p := v_1
 15292  		if p.Op != OpARM64ADDconst {
 15293  			break
 15294  		}
 15295  		c := auxIntToInt64(p.AuxInt)
 15296  		m := p.Args[0]
 15297  		if m.Op != OpARM64MNEG || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15298  			break
 15299  		}
 15300  		v.reset(OpARM64SUBconst)
 15301  		v.AuxInt = int64ToAuxInt(c)
 15302  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15303  		v0.AddArg2(a, m)
 15304  		v.AddArg(v0)
 15305  		return true
 15306  	}
 15307  	// match: (SUB <t> a p:(ADDconst [c] m:(MNEGW _ _)))
 15308  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15309  	// result: (SUBconst [c] (SUB <v.Type> a m))
 15310  	for {
 15311  		t := v.Type
 15312  		a := v_0
 15313  		p := v_1
 15314  		if p.Op != OpARM64ADDconst {
 15315  			break
 15316  		}
 15317  		c := auxIntToInt64(p.AuxInt)
 15318  		m := p.Args[0]
 15319  		if m.Op != OpARM64MNEGW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15320  			break
 15321  		}
 15322  		v.reset(OpARM64SUBconst)
 15323  		v.AuxInt = int64ToAuxInt(c)
 15324  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15325  		v0.AddArg2(a, m)
 15326  		v.AddArg(v0)
 15327  		return true
 15328  	}
 15329  	// match: (SUB <t> a p:(SUBconst [c] m:(MUL _ _)))
 15330  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15331  	// result: (ADDconst [c] (SUB <v.Type> a m))
 15332  	for {
 15333  		t := v.Type
 15334  		a := v_0
 15335  		p := v_1
 15336  		if p.Op != OpARM64SUBconst {
 15337  			break
 15338  		}
 15339  		c := auxIntToInt64(p.AuxInt)
 15340  		m := p.Args[0]
 15341  		if m.Op != OpARM64MUL || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15342  			break
 15343  		}
 15344  		v.reset(OpARM64ADDconst)
 15345  		v.AuxInt = int64ToAuxInt(c)
 15346  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15347  		v0.AddArg2(a, m)
 15348  		v.AddArg(v0)
 15349  		return true
 15350  	}
 15351  	// match: (SUB <t> a p:(SUBconst [c] m:(MULW _ _)))
 15352  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15353  	// result: (ADDconst [c] (SUB <v.Type> a m))
 15354  	for {
 15355  		t := v.Type
 15356  		a := v_0
 15357  		p := v_1
 15358  		if p.Op != OpARM64SUBconst {
 15359  			break
 15360  		}
 15361  		c := auxIntToInt64(p.AuxInt)
 15362  		m := p.Args[0]
 15363  		if m.Op != OpARM64MULW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15364  			break
 15365  		}
 15366  		v.reset(OpARM64ADDconst)
 15367  		v.AuxInt = int64ToAuxInt(c)
 15368  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15369  		v0.AddArg2(a, m)
 15370  		v.AddArg(v0)
 15371  		return true
 15372  	}
 15373  	// match: (SUB <t> a p:(SUBconst [c] m:(MNEG _ _)))
 15374  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15375  	// result: (ADDconst [c] (SUB <v.Type> a m))
 15376  	for {
 15377  		t := v.Type
 15378  		a := v_0
 15379  		p := v_1
 15380  		if p.Op != OpARM64SUBconst {
 15381  			break
 15382  		}
 15383  		c := auxIntToInt64(p.AuxInt)
 15384  		m := p.Args[0]
 15385  		if m.Op != OpARM64MNEG || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15386  			break
 15387  		}
 15388  		v.reset(OpARM64ADDconst)
 15389  		v.AuxInt = int64ToAuxInt(c)
 15390  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15391  		v0.AddArg2(a, m)
 15392  		v.AddArg(v0)
 15393  		return true
 15394  	}
 15395  	// match: (SUB <t> a p:(SUBconst [c] m:(MNEGW _ _)))
 15396  	// cond: p.Uses==1 && m.Uses==1 && !t.IsPtrShaped()
 15397  	// result: (ADDconst [c] (SUB <v.Type> a m))
 15398  	for {
 15399  		t := v.Type
 15400  		a := v_0
 15401  		p := v_1
 15402  		if p.Op != OpARM64SUBconst {
 15403  			break
 15404  		}
 15405  		c := auxIntToInt64(p.AuxInt)
 15406  		m := p.Args[0]
 15407  		if m.Op != OpARM64MNEGW || !(p.Uses == 1 && m.Uses == 1 && !t.IsPtrShaped()) {
 15408  			break
 15409  		}
 15410  		v.reset(OpARM64ADDconst)
 15411  		v.AuxInt = int64ToAuxInt(c)
 15412  		v0 := b.NewValue0(v.Pos, OpARM64SUB, v.Type)
 15413  		v0.AddArg2(a, m)
 15414  		v.AddArg(v0)
 15415  		return true
 15416  	}
 15417  	// match: (SUB x (NEG y))
 15418  	// result: (ADD x y)
 15419  	for {
 15420  		x := v_0
 15421  		if v_1.Op != OpARM64NEG {
 15422  			break
 15423  		}
 15424  		y := v_1.Args[0]
 15425  		v.reset(OpARM64ADD)
 15426  		v.AddArg2(x, y)
 15427  		return true
 15428  	}
 15429  	// match: (SUB x x)
 15430  	// result: (MOVDconst [0])
 15431  	for {
 15432  		x := v_0
 15433  		if x != v_1 {
 15434  			break
 15435  		}
 15436  		v.reset(OpARM64MOVDconst)
 15437  		v.AuxInt = int64ToAuxInt(0)
 15438  		return true
 15439  	}
 15440  	// match: (SUB x (SUB y z))
 15441  	// result: (SUB (ADD <v.Type> x z) y)
 15442  	for {
 15443  		x := v_0
 15444  		if v_1.Op != OpARM64SUB {
 15445  			break
 15446  		}
 15447  		z := v_1.Args[1]
 15448  		y := v_1.Args[0]
 15449  		v.reset(OpARM64SUB)
 15450  		v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
 15451  		v0.AddArg2(x, z)
 15452  		v.AddArg2(v0, y)
 15453  		return true
 15454  	}
 15455  	// match: (SUB (SUB x y) z)
 15456  	// result: (SUB x (ADD <y.Type> y z))
 15457  	for {
 15458  		if v_0.Op != OpARM64SUB {
 15459  			break
 15460  		}
 15461  		y := v_0.Args[1]
 15462  		x := v_0.Args[0]
 15463  		z := v_1
 15464  		v.reset(OpARM64SUB)
 15465  		v0 := b.NewValue0(v.Pos, OpARM64ADD, y.Type)
 15466  		v0.AddArg2(y, z)
 15467  		v.AddArg2(x, v0)
 15468  		return true
 15469  	}
 15470  	// match: (SUB x0 x1:(SLLconst [c] y))
 15471  	// cond: clobberIfDead(x1)
 15472  	// result: (SUBshiftLL x0 y [c])
 15473  	for {
 15474  		x0 := v_0
 15475  		x1 := v_1
 15476  		if x1.Op != OpARM64SLLconst {
 15477  			break
 15478  		}
 15479  		c := auxIntToInt64(x1.AuxInt)
 15480  		y := x1.Args[0]
 15481  		if !(clobberIfDead(x1)) {
 15482  			break
 15483  		}
 15484  		v.reset(OpARM64SUBshiftLL)
 15485  		v.AuxInt = int64ToAuxInt(c)
 15486  		v.AddArg2(x0, y)
 15487  		return true
 15488  	}
 15489  	// match: (SUB x0 x1:(SRLconst [c] y))
 15490  	// cond: clobberIfDead(x1)
 15491  	// result: (SUBshiftRL x0 y [c])
 15492  	for {
 15493  		x0 := v_0
 15494  		x1 := v_1
 15495  		if x1.Op != OpARM64SRLconst {
 15496  			break
 15497  		}
 15498  		c := auxIntToInt64(x1.AuxInt)
 15499  		y := x1.Args[0]
 15500  		if !(clobberIfDead(x1)) {
 15501  			break
 15502  		}
 15503  		v.reset(OpARM64SUBshiftRL)
 15504  		v.AuxInt = int64ToAuxInt(c)
 15505  		v.AddArg2(x0, y)
 15506  		return true
 15507  	}
 15508  	// match: (SUB x0 x1:(SRAconst [c] y))
 15509  	// cond: clobberIfDead(x1)
 15510  	// result: (SUBshiftRA x0 y [c])
 15511  	for {
 15512  		x0 := v_0
 15513  		x1 := v_1
 15514  		if x1.Op != OpARM64SRAconst {
 15515  			break
 15516  		}
 15517  		c := auxIntToInt64(x1.AuxInt)
 15518  		y := x1.Args[0]
 15519  		if !(clobberIfDead(x1)) {
 15520  			break
 15521  		}
 15522  		v.reset(OpARM64SUBshiftRA)
 15523  		v.AuxInt = int64ToAuxInt(c)
 15524  		v.AddArg2(x0, y)
 15525  		return true
 15526  	}
 15527  	return false
 15528  }
 15529  func rewriteValueARM64_OpARM64SUBconst(v *Value) bool {
 15530  	v_0 := v.Args[0]
 15531  	// match: (SUBconst [0] x)
 15532  	// result: x
 15533  	for {
 15534  		if auxIntToInt64(v.AuxInt) != 0 {
 15535  			break
 15536  		}
 15537  		x := v_0
 15538  		v.copyOf(x)
 15539  		return true
 15540  	}
 15541  	// match: (SUBconst [c] (MOVDconst [d]))
 15542  	// result: (MOVDconst [d-c])
 15543  	for {
 15544  		c := auxIntToInt64(v.AuxInt)
 15545  		if v_0.Op != OpARM64MOVDconst {
 15546  			break
 15547  		}
 15548  		d := auxIntToInt64(v_0.AuxInt)
 15549  		v.reset(OpARM64MOVDconst)
 15550  		v.AuxInt = int64ToAuxInt(d - c)
 15551  		return true
 15552  	}
 15553  	// match: (SUBconst [c] (SUBconst [d] x))
 15554  	// result: (ADDconst [-c-d] x)
 15555  	for {
 15556  		c := auxIntToInt64(v.AuxInt)
 15557  		if v_0.Op != OpARM64SUBconst {
 15558  			break
 15559  		}
 15560  		d := auxIntToInt64(v_0.AuxInt)
 15561  		x := v_0.Args[0]
 15562  		v.reset(OpARM64ADDconst)
 15563  		v.AuxInt = int64ToAuxInt(-c - d)
 15564  		v.AddArg(x)
 15565  		return true
 15566  	}
 15567  	// match: (SUBconst [c] (ADDconst [d] x))
 15568  	// result: (ADDconst [-c+d] x)
 15569  	for {
 15570  		c := auxIntToInt64(v.AuxInt)
 15571  		if v_0.Op != OpARM64ADDconst {
 15572  			break
 15573  		}
 15574  		d := auxIntToInt64(v_0.AuxInt)
 15575  		x := v_0.Args[0]
 15576  		v.reset(OpARM64ADDconst)
 15577  		v.AuxInt = int64ToAuxInt(-c + d)
 15578  		v.AddArg(x)
 15579  		return true
 15580  	}
 15581  	return false
 15582  }
 15583  func rewriteValueARM64_OpARM64SUBshiftLL(v *Value) bool {
 15584  	v_1 := v.Args[1]
 15585  	v_0 := v.Args[0]
 15586  	// match: (SUBshiftLL x (MOVDconst [c]) [d])
 15587  	// result: (SUBconst x [int64(uint64(c)<<uint64(d))])
 15588  	for {
 15589  		d := auxIntToInt64(v.AuxInt)
 15590  		x := v_0
 15591  		if v_1.Op != OpARM64MOVDconst {
 15592  			break
 15593  		}
 15594  		c := auxIntToInt64(v_1.AuxInt)
 15595  		v.reset(OpARM64SUBconst)
 15596  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 15597  		v.AddArg(x)
 15598  		return true
 15599  	}
 15600  	// match: (SUBshiftLL (SLLconst x [c]) x [c])
 15601  	// result: (MOVDconst [0])
 15602  	for {
 15603  		c := auxIntToInt64(v.AuxInt)
 15604  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 15605  			break
 15606  		}
 15607  		x := v_0.Args[0]
 15608  		if x != v_1 {
 15609  			break
 15610  		}
 15611  		v.reset(OpARM64MOVDconst)
 15612  		v.AuxInt = int64ToAuxInt(0)
 15613  		return true
 15614  	}
 15615  	return false
 15616  }
 15617  func rewriteValueARM64_OpARM64SUBshiftRA(v *Value) bool {
 15618  	v_1 := v.Args[1]
 15619  	v_0 := v.Args[0]
 15620  	// match: (SUBshiftRA x (MOVDconst [c]) [d])
 15621  	// result: (SUBconst x [c>>uint64(d)])
 15622  	for {
 15623  		d := auxIntToInt64(v.AuxInt)
 15624  		x := v_0
 15625  		if v_1.Op != OpARM64MOVDconst {
 15626  			break
 15627  		}
 15628  		c := auxIntToInt64(v_1.AuxInt)
 15629  		v.reset(OpARM64SUBconst)
 15630  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 15631  		v.AddArg(x)
 15632  		return true
 15633  	}
 15634  	// match: (SUBshiftRA (SRAconst x [c]) x [c])
 15635  	// result: (MOVDconst [0])
 15636  	for {
 15637  		c := auxIntToInt64(v.AuxInt)
 15638  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
 15639  			break
 15640  		}
 15641  		x := v_0.Args[0]
 15642  		if x != v_1 {
 15643  			break
 15644  		}
 15645  		v.reset(OpARM64MOVDconst)
 15646  		v.AuxInt = int64ToAuxInt(0)
 15647  		return true
 15648  	}
 15649  	return false
 15650  }
 15651  func rewriteValueARM64_OpARM64SUBshiftRL(v *Value) bool {
 15652  	v_1 := v.Args[1]
 15653  	v_0 := v.Args[0]
 15654  	// match: (SUBshiftRL x (MOVDconst [c]) [d])
 15655  	// result: (SUBconst x [int64(uint64(c)>>uint64(d))])
 15656  	for {
 15657  		d := auxIntToInt64(v.AuxInt)
 15658  		x := v_0
 15659  		if v_1.Op != OpARM64MOVDconst {
 15660  			break
 15661  		}
 15662  		c := auxIntToInt64(v_1.AuxInt)
 15663  		v.reset(OpARM64SUBconst)
 15664  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 15665  		v.AddArg(x)
 15666  		return true
 15667  	}
 15668  	// match: (SUBshiftRL (SRLconst x [c]) x [c])
 15669  	// result: (MOVDconst [0])
 15670  	for {
 15671  		c := auxIntToInt64(v.AuxInt)
 15672  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 15673  			break
 15674  		}
 15675  		x := v_0.Args[0]
 15676  		if x != v_1 {
 15677  			break
 15678  		}
 15679  		v.reset(OpARM64MOVDconst)
 15680  		v.AuxInt = int64ToAuxInt(0)
 15681  		return true
 15682  	}
 15683  	return false
 15684  }
 15685  func rewriteValueARM64_OpARM64TST(v *Value) bool {
 15686  	v_1 := v.Args[1]
 15687  	v_0 := v.Args[0]
 15688  	// match: (TST x (MOVDconst [c]))
 15689  	// result: (TSTconst [c] x)
 15690  	for {
 15691  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15692  			x := v_0
 15693  			if v_1.Op != OpARM64MOVDconst {
 15694  				continue
 15695  			}
 15696  			c := auxIntToInt64(v_1.AuxInt)
 15697  			v.reset(OpARM64TSTconst)
 15698  			v.AuxInt = int64ToAuxInt(c)
 15699  			v.AddArg(x)
 15700  			return true
 15701  		}
 15702  		break
 15703  	}
 15704  	// match: (TST x0 x1:(SLLconst [c] y))
 15705  	// cond: clobberIfDead(x1)
 15706  	// result: (TSTshiftLL x0 y [c])
 15707  	for {
 15708  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15709  			x0 := v_0
 15710  			x1 := v_1
 15711  			if x1.Op != OpARM64SLLconst {
 15712  				continue
 15713  			}
 15714  			c := auxIntToInt64(x1.AuxInt)
 15715  			y := x1.Args[0]
 15716  			if !(clobberIfDead(x1)) {
 15717  				continue
 15718  			}
 15719  			v.reset(OpARM64TSTshiftLL)
 15720  			v.AuxInt = int64ToAuxInt(c)
 15721  			v.AddArg2(x0, y)
 15722  			return true
 15723  		}
 15724  		break
 15725  	}
 15726  	// match: (TST x0 x1:(SRLconst [c] y))
 15727  	// cond: clobberIfDead(x1)
 15728  	// result: (TSTshiftRL x0 y [c])
 15729  	for {
 15730  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15731  			x0 := v_0
 15732  			x1 := v_1
 15733  			if x1.Op != OpARM64SRLconst {
 15734  				continue
 15735  			}
 15736  			c := auxIntToInt64(x1.AuxInt)
 15737  			y := x1.Args[0]
 15738  			if !(clobberIfDead(x1)) {
 15739  				continue
 15740  			}
 15741  			v.reset(OpARM64TSTshiftRL)
 15742  			v.AuxInt = int64ToAuxInt(c)
 15743  			v.AddArg2(x0, y)
 15744  			return true
 15745  		}
 15746  		break
 15747  	}
 15748  	// match: (TST x0 x1:(SRAconst [c] y))
 15749  	// cond: clobberIfDead(x1)
 15750  	// result: (TSTshiftRA x0 y [c])
 15751  	for {
 15752  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15753  			x0 := v_0
 15754  			x1 := v_1
 15755  			if x1.Op != OpARM64SRAconst {
 15756  				continue
 15757  			}
 15758  			c := auxIntToInt64(x1.AuxInt)
 15759  			y := x1.Args[0]
 15760  			if !(clobberIfDead(x1)) {
 15761  				continue
 15762  			}
 15763  			v.reset(OpARM64TSTshiftRA)
 15764  			v.AuxInt = int64ToAuxInt(c)
 15765  			v.AddArg2(x0, y)
 15766  			return true
 15767  		}
 15768  		break
 15769  	}
 15770  	// match: (TST x0 x1:(RORconst [c] y))
 15771  	// cond: clobberIfDead(x1)
 15772  	// result: (TSTshiftRO x0 y [c])
 15773  	for {
 15774  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15775  			x0 := v_0
 15776  			x1 := v_1
 15777  			if x1.Op != OpARM64RORconst {
 15778  				continue
 15779  			}
 15780  			c := auxIntToInt64(x1.AuxInt)
 15781  			y := x1.Args[0]
 15782  			if !(clobberIfDead(x1)) {
 15783  				continue
 15784  			}
 15785  			v.reset(OpARM64TSTshiftRO)
 15786  			v.AuxInt = int64ToAuxInt(c)
 15787  			v.AddArg2(x0, y)
 15788  			return true
 15789  		}
 15790  		break
 15791  	}
 15792  	return false
 15793  }
 15794  func rewriteValueARM64_OpARM64TSTW(v *Value) bool {
 15795  	v_1 := v.Args[1]
 15796  	v_0 := v.Args[0]
 15797  	// match: (TSTW x (MOVDconst [c]))
 15798  	// result: (TSTWconst [int32(c)] x)
 15799  	for {
 15800  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 15801  			x := v_0
 15802  			if v_1.Op != OpARM64MOVDconst {
 15803  				continue
 15804  			}
 15805  			c := auxIntToInt64(v_1.AuxInt)
 15806  			v.reset(OpARM64TSTWconst)
 15807  			v.AuxInt = int32ToAuxInt(int32(c))
 15808  			v.AddArg(x)
 15809  			return true
 15810  		}
 15811  		break
 15812  	}
 15813  	return false
 15814  }
 15815  func rewriteValueARM64_OpARM64TSTWconst(v *Value) bool {
 15816  	v_0 := v.Args[0]
 15817  	// match: (TSTWconst (MOVDconst [x]) [y])
 15818  	// result: (FlagConstant [logicFlags32(int32(x)&y)])
 15819  	for {
 15820  		y := auxIntToInt32(v.AuxInt)
 15821  		if v_0.Op != OpARM64MOVDconst {
 15822  			break
 15823  		}
 15824  		x := auxIntToInt64(v_0.AuxInt)
 15825  		v.reset(OpARM64FlagConstant)
 15826  		v.AuxInt = flagConstantToAuxInt(logicFlags32(int32(x) & y))
 15827  		return true
 15828  	}
 15829  	return false
 15830  }
 15831  func rewriteValueARM64_OpARM64TSTconst(v *Value) bool {
 15832  	v_0 := v.Args[0]
 15833  	// match: (TSTconst (MOVDconst [x]) [y])
 15834  	// result: (FlagConstant [logicFlags64(x&y)])
 15835  	for {
 15836  		y := auxIntToInt64(v.AuxInt)
 15837  		if v_0.Op != OpARM64MOVDconst {
 15838  			break
 15839  		}
 15840  		x := auxIntToInt64(v_0.AuxInt)
 15841  		v.reset(OpARM64FlagConstant)
 15842  		v.AuxInt = flagConstantToAuxInt(logicFlags64(x & y))
 15843  		return true
 15844  	}
 15845  	return false
 15846  }
 15847  func rewriteValueARM64_OpARM64TSTshiftLL(v *Value) bool {
 15848  	v_1 := v.Args[1]
 15849  	v_0 := v.Args[0]
 15850  	b := v.Block
 15851  	// match: (TSTshiftLL (MOVDconst [c]) x [d])
 15852  	// result: (TSTconst [c] (SLLconst <x.Type> x [d]))
 15853  	for {
 15854  		d := auxIntToInt64(v.AuxInt)
 15855  		if v_0.Op != OpARM64MOVDconst {
 15856  			break
 15857  		}
 15858  		c := auxIntToInt64(v_0.AuxInt)
 15859  		x := v_1
 15860  		v.reset(OpARM64TSTconst)
 15861  		v.AuxInt = int64ToAuxInt(c)
 15862  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 15863  		v0.AuxInt = int64ToAuxInt(d)
 15864  		v0.AddArg(x)
 15865  		v.AddArg(v0)
 15866  		return true
 15867  	}
 15868  	// match: (TSTshiftLL x (MOVDconst [c]) [d])
 15869  	// result: (TSTconst x [int64(uint64(c)<<uint64(d))])
 15870  	for {
 15871  		d := auxIntToInt64(v.AuxInt)
 15872  		x := v_0
 15873  		if v_1.Op != OpARM64MOVDconst {
 15874  			break
 15875  		}
 15876  		c := auxIntToInt64(v_1.AuxInt)
 15877  		v.reset(OpARM64TSTconst)
 15878  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 15879  		v.AddArg(x)
 15880  		return true
 15881  	}
 15882  	return false
 15883  }
 15884  func rewriteValueARM64_OpARM64TSTshiftRA(v *Value) bool {
 15885  	v_1 := v.Args[1]
 15886  	v_0 := v.Args[0]
 15887  	b := v.Block
 15888  	// match: (TSTshiftRA (MOVDconst [c]) x [d])
 15889  	// result: (TSTconst [c] (SRAconst <x.Type> x [d]))
 15890  	for {
 15891  		d := auxIntToInt64(v.AuxInt)
 15892  		if v_0.Op != OpARM64MOVDconst {
 15893  			break
 15894  		}
 15895  		c := auxIntToInt64(v_0.AuxInt)
 15896  		x := v_1
 15897  		v.reset(OpARM64TSTconst)
 15898  		v.AuxInt = int64ToAuxInt(c)
 15899  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
 15900  		v0.AuxInt = int64ToAuxInt(d)
 15901  		v0.AddArg(x)
 15902  		v.AddArg(v0)
 15903  		return true
 15904  	}
 15905  	// match: (TSTshiftRA x (MOVDconst [c]) [d])
 15906  	// result: (TSTconst x [c>>uint64(d)])
 15907  	for {
 15908  		d := auxIntToInt64(v.AuxInt)
 15909  		x := v_0
 15910  		if v_1.Op != OpARM64MOVDconst {
 15911  			break
 15912  		}
 15913  		c := auxIntToInt64(v_1.AuxInt)
 15914  		v.reset(OpARM64TSTconst)
 15915  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 15916  		v.AddArg(x)
 15917  		return true
 15918  	}
 15919  	return false
 15920  }
 15921  func rewriteValueARM64_OpARM64TSTshiftRL(v *Value) bool {
 15922  	v_1 := v.Args[1]
 15923  	v_0 := v.Args[0]
 15924  	b := v.Block
 15925  	// match: (TSTshiftRL (MOVDconst [c]) x [d])
 15926  	// result: (TSTconst [c] (SRLconst <x.Type> x [d]))
 15927  	for {
 15928  		d := auxIntToInt64(v.AuxInt)
 15929  		if v_0.Op != OpARM64MOVDconst {
 15930  			break
 15931  		}
 15932  		c := auxIntToInt64(v_0.AuxInt)
 15933  		x := v_1
 15934  		v.reset(OpARM64TSTconst)
 15935  		v.AuxInt = int64ToAuxInt(c)
 15936  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
 15937  		v0.AuxInt = int64ToAuxInt(d)
 15938  		v0.AddArg(x)
 15939  		v.AddArg(v0)
 15940  		return true
 15941  	}
 15942  	// match: (TSTshiftRL x (MOVDconst [c]) [d])
 15943  	// result: (TSTconst x [int64(uint64(c)>>uint64(d))])
 15944  	for {
 15945  		d := auxIntToInt64(v.AuxInt)
 15946  		x := v_0
 15947  		if v_1.Op != OpARM64MOVDconst {
 15948  			break
 15949  		}
 15950  		c := auxIntToInt64(v_1.AuxInt)
 15951  		v.reset(OpARM64TSTconst)
 15952  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 15953  		v.AddArg(x)
 15954  		return true
 15955  	}
 15956  	return false
 15957  }
 15958  func rewriteValueARM64_OpARM64TSTshiftRO(v *Value) bool {
 15959  	v_1 := v.Args[1]
 15960  	v_0 := v.Args[0]
 15961  	b := v.Block
 15962  	// match: (TSTshiftRO (MOVDconst [c]) x [d])
 15963  	// result: (TSTconst [c] (RORconst <x.Type> x [d]))
 15964  	for {
 15965  		d := auxIntToInt64(v.AuxInt)
 15966  		if v_0.Op != OpARM64MOVDconst {
 15967  			break
 15968  		}
 15969  		c := auxIntToInt64(v_0.AuxInt)
 15970  		x := v_1
 15971  		v.reset(OpARM64TSTconst)
 15972  		v.AuxInt = int64ToAuxInt(c)
 15973  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
 15974  		v0.AuxInt = int64ToAuxInt(d)
 15975  		v0.AddArg(x)
 15976  		v.AddArg(v0)
 15977  		return true
 15978  	}
 15979  	// match: (TSTshiftRO x (MOVDconst [c]) [d])
 15980  	// result: (TSTconst x [rotateRight64(c, d)])
 15981  	for {
 15982  		d := auxIntToInt64(v.AuxInt)
 15983  		x := v_0
 15984  		if v_1.Op != OpARM64MOVDconst {
 15985  			break
 15986  		}
 15987  		c := auxIntToInt64(v_1.AuxInt)
 15988  		v.reset(OpARM64TSTconst)
 15989  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
 15990  		v.AddArg(x)
 15991  		return true
 15992  	}
 15993  	return false
 15994  }
 15995  func rewriteValueARM64_OpARM64UBFIZ(v *Value) bool {
 15996  	v_0 := v.Args[0]
 15997  	// match: (UBFIZ [bfc] (SLLconst [sc] x))
 15998  	// cond: sc < bfc.width()
 15999  	// result: (UBFIZ [armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc)] x)
 16000  	for {
 16001  		bfc := auxIntToArm64BitField(v.AuxInt)
 16002  		if v_0.Op != OpARM64SLLconst {
 16003  			break
 16004  		}
 16005  		sc := auxIntToInt64(v_0.AuxInt)
 16006  		x := v_0.Args[0]
 16007  		if !(sc < bfc.width()) {
 16008  			break
 16009  		}
 16010  		v.reset(OpARM64UBFIZ)
 16011  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc))
 16012  		v.AddArg(x)
 16013  		return true
 16014  	}
 16015  	return false
 16016  }
 16017  func rewriteValueARM64_OpARM64UBFX(v *Value) bool {
 16018  	v_0 := v.Args[0]
 16019  	// match: (UBFX [bfc] (ANDconst [c] x))
 16020  	// cond: isARM64BFMask(0, c, 0) && bfc.lsb() + bfc.width() <= arm64BFWidth(c, 0)
 16021  	// result: (UBFX [bfc] x)
 16022  	for {
 16023  		bfc := auxIntToArm64BitField(v.AuxInt)
 16024  		if v_0.Op != OpARM64ANDconst {
 16025  			break
 16026  		}
 16027  		c := auxIntToInt64(v_0.AuxInt)
 16028  		x := v_0.Args[0]
 16029  		if !(isARM64BFMask(0, c, 0) && bfc.lsb()+bfc.width() <= arm64BFWidth(c, 0)) {
 16030  			break
 16031  		}
 16032  		v.reset(OpARM64UBFX)
 16033  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 16034  		v.AddArg(x)
 16035  		return true
 16036  	}
 16037  	// match: (UBFX [bfc] e:(MOVWUreg x))
 16038  	// cond: e.Uses == 1 && bfc.lsb() < 32
 16039  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), 32-bfc.lsb()))] x)
 16040  	for {
 16041  		bfc := auxIntToArm64BitField(v.AuxInt)
 16042  		e := v_0
 16043  		if e.Op != OpARM64MOVWUreg {
 16044  			break
 16045  		}
 16046  		x := e.Args[0]
 16047  		if !(e.Uses == 1 && bfc.lsb() < 32) {
 16048  			break
 16049  		}
 16050  		v.reset(OpARM64UBFX)
 16051  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), 32-bfc.lsb())))
 16052  		v.AddArg(x)
 16053  		return true
 16054  	}
 16055  	// match: (UBFX [bfc] e:(MOVHUreg x))
 16056  	// cond: e.Uses == 1 && bfc.lsb() < 16
 16057  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), 16-bfc.lsb()))] x)
 16058  	for {
 16059  		bfc := auxIntToArm64BitField(v.AuxInt)
 16060  		e := v_0
 16061  		if e.Op != OpARM64MOVHUreg {
 16062  			break
 16063  		}
 16064  		x := e.Args[0]
 16065  		if !(e.Uses == 1 && bfc.lsb() < 16) {
 16066  			break
 16067  		}
 16068  		v.reset(OpARM64UBFX)
 16069  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), 16-bfc.lsb())))
 16070  		v.AddArg(x)
 16071  		return true
 16072  	}
 16073  	// match: (UBFX [bfc] e:(MOVBUreg x))
 16074  	// cond: e.Uses == 1 && bfc.lsb() < 8
 16075  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), 8-bfc.lsb()))] x)
 16076  	for {
 16077  		bfc := auxIntToArm64BitField(v.AuxInt)
 16078  		e := v_0
 16079  		if e.Op != OpARM64MOVBUreg {
 16080  			break
 16081  		}
 16082  		x := e.Args[0]
 16083  		if !(e.Uses == 1 && bfc.lsb() < 8) {
 16084  			break
 16085  		}
 16086  		v.reset(OpARM64UBFX)
 16087  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), 8-bfc.lsb())))
 16088  		v.AddArg(x)
 16089  		return true
 16090  	}
 16091  	// match: (UBFX [bfc] (SRLconst [sc] x))
 16092  	// cond: sc+bfc.width()+bfc.lsb() < 64
 16093  	// result: (UBFX [armBFAuxInt(bfc.lsb()+sc, bfc.width())] x)
 16094  	for {
 16095  		bfc := auxIntToArm64BitField(v.AuxInt)
 16096  		if v_0.Op != OpARM64SRLconst {
 16097  			break
 16098  		}
 16099  		sc := auxIntToInt64(v_0.AuxInt)
 16100  		x := v_0.Args[0]
 16101  		if !(sc+bfc.width()+bfc.lsb() < 64) {
 16102  			break
 16103  		}
 16104  		v.reset(OpARM64UBFX)
 16105  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()))
 16106  		v.AddArg(x)
 16107  		return true
 16108  	}
 16109  	// match: (UBFX [bfc] (SLLconst [sc] x))
 16110  	// cond: sc == bfc.lsb()
 16111  	// result: (ANDconst [1<<uint(bfc.width())-1] x)
 16112  	for {
 16113  		bfc := auxIntToArm64BitField(v.AuxInt)
 16114  		if v_0.Op != OpARM64SLLconst {
 16115  			break
 16116  		}
 16117  		sc := auxIntToInt64(v_0.AuxInt)
 16118  		x := v_0.Args[0]
 16119  		if !(sc == bfc.lsb()) {
 16120  			break
 16121  		}
 16122  		v.reset(OpARM64ANDconst)
 16123  		v.AuxInt = int64ToAuxInt(1<<uint(bfc.width()) - 1)
 16124  		v.AddArg(x)
 16125  		return true
 16126  	}
 16127  	// match: (UBFX [bfc] (SLLconst [sc] x))
 16128  	// cond: sc < bfc.lsb()
 16129  	// result: (UBFX [armBFAuxInt(bfc.lsb()-sc, bfc.width())] x)
 16130  	for {
 16131  		bfc := auxIntToArm64BitField(v.AuxInt)
 16132  		if v_0.Op != OpARM64SLLconst {
 16133  			break
 16134  		}
 16135  		sc := auxIntToInt64(v_0.AuxInt)
 16136  		x := v_0.Args[0]
 16137  		if !(sc < bfc.lsb()) {
 16138  			break
 16139  		}
 16140  		v.reset(OpARM64UBFX)
 16141  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 16142  		v.AddArg(x)
 16143  		return true
 16144  	}
 16145  	// match: (UBFX [bfc] (SLLconst [sc] x))
 16146  	// cond: sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()
 16147  	// result: (UBFIZ [armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc)] x)
 16148  	for {
 16149  		bfc := auxIntToArm64BitField(v.AuxInt)
 16150  		if v_0.Op != OpARM64SLLconst {
 16151  			break
 16152  		}
 16153  		sc := auxIntToInt64(v_0.AuxInt)
 16154  		x := v_0.Args[0]
 16155  		if !(sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()) {
 16156  			break
 16157  		}
 16158  		v.reset(OpARM64UBFIZ)
 16159  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc))
 16160  		v.AddArg(x)
 16161  		return true
 16162  	}
 16163  	return false
 16164  }
 16165  func rewriteValueARM64_OpARM64UDIV(v *Value) bool {
 16166  	v_1 := v.Args[1]
 16167  	v_0 := v.Args[0]
 16168  	// match: (UDIV x (MOVDconst [1]))
 16169  	// result: x
 16170  	for {
 16171  		x := v_0
 16172  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 16173  			break
 16174  		}
 16175  		v.copyOf(x)
 16176  		return true
 16177  	}
 16178  	// match: (UDIV x (MOVDconst [c]))
 16179  	// cond: isPowerOfTwo(c)
 16180  	// result: (SRLconst [log64(c)] x)
 16181  	for {
 16182  		x := v_0
 16183  		if v_1.Op != OpARM64MOVDconst {
 16184  			break
 16185  		}
 16186  		c := auxIntToInt64(v_1.AuxInt)
 16187  		if !(isPowerOfTwo(c)) {
 16188  			break
 16189  		}
 16190  		v.reset(OpARM64SRLconst)
 16191  		v.AuxInt = int64ToAuxInt(log64(c))
 16192  		v.AddArg(x)
 16193  		return true
 16194  	}
 16195  	// match: (UDIV (MOVDconst [c]) (MOVDconst [d]))
 16196  	// cond: d != 0
 16197  	// result: (MOVDconst [int64(uint64(c)/uint64(d))])
 16198  	for {
 16199  		if v_0.Op != OpARM64MOVDconst {
 16200  			break
 16201  		}
 16202  		c := auxIntToInt64(v_0.AuxInt)
 16203  		if v_1.Op != OpARM64MOVDconst {
 16204  			break
 16205  		}
 16206  		d := auxIntToInt64(v_1.AuxInt)
 16207  		if !(d != 0) {
 16208  			break
 16209  		}
 16210  		v.reset(OpARM64MOVDconst)
 16211  		v.AuxInt = int64ToAuxInt(int64(uint64(c) / uint64(d)))
 16212  		return true
 16213  	}
 16214  	return false
 16215  }
 16216  func rewriteValueARM64_OpARM64UDIVW(v *Value) bool {
 16217  	v_1 := v.Args[1]
 16218  	v_0 := v.Args[0]
 16219  	b := v.Block
 16220  	// match: (UDIVW x (MOVDconst [c]))
 16221  	// cond: uint32(c)==1
 16222  	// result: (MOVWUreg x)
 16223  	for {
 16224  		x := v_0
 16225  		if v_1.Op != OpARM64MOVDconst {
 16226  			break
 16227  		}
 16228  		c := auxIntToInt64(v_1.AuxInt)
 16229  		if !(uint32(c) == 1) {
 16230  			break
 16231  		}
 16232  		v.reset(OpARM64MOVWUreg)
 16233  		v.AddArg(x)
 16234  		return true
 16235  	}
 16236  	// match: (UDIVW x (MOVDconst [c]))
 16237  	// cond: isPowerOfTwo(c) && is32Bit(c)
 16238  	// result: (SRLconst [log64(c)] (MOVWUreg <v.Type> x))
 16239  	for {
 16240  		x := v_0
 16241  		if v_1.Op != OpARM64MOVDconst {
 16242  			break
 16243  		}
 16244  		c := auxIntToInt64(v_1.AuxInt)
 16245  		if !(isPowerOfTwo(c) && is32Bit(c)) {
 16246  			break
 16247  		}
 16248  		v.reset(OpARM64SRLconst)
 16249  		v.AuxInt = int64ToAuxInt(log64(c))
 16250  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUreg, v.Type)
 16251  		v0.AddArg(x)
 16252  		v.AddArg(v0)
 16253  		return true
 16254  	}
 16255  	// match: (UDIVW (MOVDconst [c]) (MOVDconst [d]))
 16256  	// cond: d != 0
 16257  	// result: (MOVDconst [int64(uint32(c)/uint32(d))])
 16258  	for {
 16259  		if v_0.Op != OpARM64MOVDconst {
 16260  			break
 16261  		}
 16262  		c := auxIntToInt64(v_0.AuxInt)
 16263  		if v_1.Op != OpARM64MOVDconst {
 16264  			break
 16265  		}
 16266  		d := auxIntToInt64(v_1.AuxInt)
 16267  		if !(d != 0) {
 16268  			break
 16269  		}
 16270  		v.reset(OpARM64MOVDconst)
 16271  		v.AuxInt = int64ToAuxInt(int64(uint32(c) / uint32(d)))
 16272  		return true
 16273  	}
 16274  	return false
 16275  }
 16276  func rewriteValueARM64_OpARM64UMOD(v *Value) bool {
 16277  	v_1 := v.Args[1]
 16278  	v_0 := v.Args[0]
 16279  	b := v.Block
 16280  	typ := &b.Func.Config.Types
 16281  	// match: (UMOD <typ.UInt64> x y)
 16282  	// result: (MSUB <typ.UInt64> x y (UDIV <typ.UInt64> x y))
 16283  	for {
 16284  		if v.Type != typ.UInt64 {
 16285  			break
 16286  		}
 16287  		x := v_0
 16288  		y := v_1
 16289  		v.reset(OpARM64MSUB)
 16290  		v.Type = typ.UInt64
 16291  		v0 := b.NewValue0(v.Pos, OpARM64UDIV, typ.UInt64)
 16292  		v0.AddArg2(x, y)
 16293  		v.AddArg3(x, y, v0)
 16294  		return true
 16295  	}
 16296  	// match: (UMOD _ (MOVDconst [1]))
 16297  	// result: (MOVDconst [0])
 16298  	for {
 16299  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 16300  			break
 16301  		}
 16302  		v.reset(OpARM64MOVDconst)
 16303  		v.AuxInt = int64ToAuxInt(0)
 16304  		return true
 16305  	}
 16306  	// match: (UMOD x (MOVDconst [c]))
 16307  	// cond: isPowerOfTwo(c)
 16308  	// result: (ANDconst [c-1] x)
 16309  	for {
 16310  		x := v_0
 16311  		if v_1.Op != OpARM64MOVDconst {
 16312  			break
 16313  		}
 16314  		c := auxIntToInt64(v_1.AuxInt)
 16315  		if !(isPowerOfTwo(c)) {
 16316  			break
 16317  		}
 16318  		v.reset(OpARM64ANDconst)
 16319  		v.AuxInt = int64ToAuxInt(c - 1)
 16320  		v.AddArg(x)
 16321  		return true
 16322  	}
 16323  	// match: (UMOD (MOVDconst [c]) (MOVDconst [d]))
 16324  	// cond: d != 0
 16325  	// result: (MOVDconst [int64(uint64(c)%uint64(d))])
 16326  	for {
 16327  		if v_0.Op != OpARM64MOVDconst {
 16328  			break
 16329  		}
 16330  		c := auxIntToInt64(v_0.AuxInt)
 16331  		if v_1.Op != OpARM64MOVDconst {
 16332  			break
 16333  		}
 16334  		d := auxIntToInt64(v_1.AuxInt)
 16335  		if !(d != 0) {
 16336  			break
 16337  		}
 16338  		v.reset(OpARM64MOVDconst)
 16339  		v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
 16340  		return true
 16341  	}
 16342  	return false
 16343  }
 16344  func rewriteValueARM64_OpARM64UMODW(v *Value) bool {
 16345  	v_1 := v.Args[1]
 16346  	v_0 := v.Args[0]
 16347  	b := v.Block
 16348  	typ := &b.Func.Config.Types
 16349  	// match: (UMODW <typ.UInt32> x y)
 16350  	// result: (MSUBW <typ.UInt32> x y (UDIVW <typ.UInt32> x y))
 16351  	for {
 16352  		if v.Type != typ.UInt32 {
 16353  			break
 16354  		}
 16355  		x := v_0
 16356  		y := v_1
 16357  		v.reset(OpARM64MSUBW)
 16358  		v.Type = typ.UInt32
 16359  		v0 := b.NewValue0(v.Pos, OpARM64UDIVW, typ.UInt32)
 16360  		v0.AddArg2(x, y)
 16361  		v.AddArg3(x, y, v0)
 16362  		return true
 16363  	}
 16364  	// match: (UMODW _ (MOVDconst [c]))
 16365  	// cond: uint32(c)==1
 16366  	// result: (MOVDconst [0])
 16367  	for {
 16368  		if v_1.Op != OpARM64MOVDconst {
 16369  			break
 16370  		}
 16371  		c := auxIntToInt64(v_1.AuxInt)
 16372  		if !(uint32(c) == 1) {
 16373  			break
 16374  		}
 16375  		v.reset(OpARM64MOVDconst)
 16376  		v.AuxInt = int64ToAuxInt(0)
 16377  		return true
 16378  	}
 16379  	// match: (UMODW x (MOVDconst [c]))
 16380  	// cond: isPowerOfTwo(c) && is32Bit(c)
 16381  	// result: (ANDconst [c-1] x)
 16382  	for {
 16383  		x := v_0
 16384  		if v_1.Op != OpARM64MOVDconst {
 16385  			break
 16386  		}
 16387  		c := auxIntToInt64(v_1.AuxInt)
 16388  		if !(isPowerOfTwo(c) && is32Bit(c)) {
 16389  			break
 16390  		}
 16391  		v.reset(OpARM64ANDconst)
 16392  		v.AuxInt = int64ToAuxInt(c - 1)
 16393  		v.AddArg(x)
 16394  		return true
 16395  	}
 16396  	// match: (UMODW (MOVDconst [c]) (MOVDconst [d]))
 16397  	// cond: d != 0
 16398  	// result: (MOVDconst [int64(uint32(c)%uint32(d))])
 16399  	for {
 16400  		if v_0.Op != OpARM64MOVDconst {
 16401  			break
 16402  		}
 16403  		c := auxIntToInt64(v_0.AuxInt)
 16404  		if v_1.Op != OpARM64MOVDconst {
 16405  			break
 16406  		}
 16407  		d := auxIntToInt64(v_1.AuxInt)
 16408  		if !(d != 0) {
 16409  			break
 16410  		}
 16411  		v.reset(OpARM64MOVDconst)
 16412  		v.AuxInt = int64ToAuxInt(int64(uint32(c) % uint32(d)))
 16413  		return true
 16414  	}
 16415  	return false
 16416  }
 16417  func rewriteValueARM64_OpARM64XOR(v *Value) bool {
 16418  	v_1 := v.Args[1]
 16419  	v_0 := v.Args[0]
 16420  	// match: (XOR x (MOVDconst [c]))
 16421  	// result: (XORconst [c] x)
 16422  	for {
 16423  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16424  			x := v_0
 16425  			if v_1.Op != OpARM64MOVDconst {
 16426  				continue
 16427  			}
 16428  			c := auxIntToInt64(v_1.AuxInt)
 16429  			v.reset(OpARM64XORconst)
 16430  			v.AuxInt = int64ToAuxInt(c)
 16431  			v.AddArg(x)
 16432  			return true
 16433  		}
 16434  		break
 16435  	}
 16436  	// match: (XOR x x)
 16437  	// result: (MOVDconst [0])
 16438  	for {
 16439  		x := v_0
 16440  		if x != v_1 {
 16441  			break
 16442  		}
 16443  		v.reset(OpARM64MOVDconst)
 16444  		v.AuxInt = int64ToAuxInt(0)
 16445  		return true
 16446  	}
 16447  	// match: (XOR x (MVN y))
 16448  	// result: (EON x y)
 16449  	for {
 16450  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16451  			x := v_0
 16452  			if v_1.Op != OpARM64MVN {
 16453  				continue
 16454  			}
 16455  			y := v_1.Args[0]
 16456  			v.reset(OpARM64EON)
 16457  			v.AddArg2(x, y)
 16458  			return true
 16459  		}
 16460  		break
 16461  	}
 16462  	// match: (XOR x0 x1:(SLLconst [c] y))
 16463  	// cond: clobberIfDead(x1)
 16464  	// result: (XORshiftLL x0 y [c])
 16465  	for {
 16466  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16467  			x0 := v_0
 16468  			x1 := v_1
 16469  			if x1.Op != OpARM64SLLconst {
 16470  				continue
 16471  			}
 16472  			c := auxIntToInt64(x1.AuxInt)
 16473  			y := x1.Args[0]
 16474  			if !(clobberIfDead(x1)) {
 16475  				continue
 16476  			}
 16477  			v.reset(OpARM64XORshiftLL)
 16478  			v.AuxInt = int64ToAuxInt(c)
 16479  			v.AddArg2(x0, y)
 16480  			return true
 16481  		}
 16482  		break
 16483  	}
 16484  	// match: (XOR x0 x1:(SRLconst [c] y))
 16485  	// cond: clobberIfDead(x1)
 16486  	// result: (XORshiftRL x0 y [c])
 16487  	for {
 16488  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16489  			x0 := v_0
 16490  			x1 := v_1
 16491  			if x1.Op != OpARM64SRLconst {
 16492  				continue
 16493  			}
 16494  			c := auxIntToInt64(x1.AuxInt)
 16495  			y := x1.Args[0]
 16496  			if !(clobberIfDead(x1)) {
 16497  				continue
 16498  			}
 16499  			v.reset(OpARM64XORshiftRL)
 16500  			v.AuxInt = int64ToAuxInt(c)
 16501  			v.AddArg2(x0, y)
 16502  			return true
 16503  		}
 16504  		break
 16505  	}
 16506  	// match: (XOR x0 x1:(SRAconst [c] y))
 16507  	// cond: clobberIfDead(x1)
 16508  	// result: (XORshiftRA x0 y [c])
 16509  	for {
 16510  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16511  			x0 := v_0
 16512  			x1 := v_1
 16513  			if x1.Op != OpARM64SRAconst {
 16514  				continue
 16515  			}
 16516  			c := auxIntToInt64(x1.AuxInt)
 16517  			y := x1.Args[0]
 16518  			if !(clobberIfDead(x1)) {
 16519  				continue
 16520  			}
 16521  			v.reset(OpARM64XORshiftRA)
 16522  			v.AuxInt = int64ToAuxInt(c)
 16523  			v.AddArg2(x0, y)
 16524  			return true
 16525  		}
 16526  		break
 16527  	}
 16528  	// match: (XOR x0 x1:(RORconst [c] y))
 16529  	// cond: clobberIfDead(x1)
 16530  	// result: (XORshiftRO x0 y [c])
 16531  	for {
 16532  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16533  			x0 := v_0
 16534  			x1 := v_1
 16535  			if x1.Op != OpARM64RORconst {
 16536  				continue
 16537  			}
 16538  			c := auxIntToInt64(x1.AuxInt)
 16539  			y := x1.Args[0]
 16540  			if !(clobberIfDead(x1)) {
 16541  				continue
 16542  			}
 16543  			v.reset(OpARM64XORshiftRO)
 16544  			v.AuxInt = int64ToAuxInt(c)
 16545  			v.AddArg2(x0, y)
 16546  			return true
 16547  		}
 16548  		break
 16549  	}
 16550  	return false
 16551  }
 16552  func rewriteValueARM64_OpARM64XORconst(v *Value) bool {
 16553  	v_0 := v.Args[0]
 16554  	// match: (XORconst [0] x)
 16555  	// result: x
 16556  	for {
 16557  		if auxIntToInt64(v.AuxInt) != 0 {
 16558  			break
 16559  		}
 16560  		x := v_0
 16561  		v.copyOf(x)
 16562  		return true
 16563  	}
 16564  	// match: (XORconst [-1] x)
 16565  	// result: (MVN x)
 16566  	for {
 16567  		if auxIntToInt64(v.AuxInt) != -1 {
 16568  			break
 16569  		}
 16570  		x := v_0
 16571  		v.reset(OpARM64MVN)
 16572  		v.AddArg(x)
 16573  		return true
 16574  	}
 16575  	// match: (XORconst [c] (MOVDconst [d]))
 16576  	// result: (MOVDconst [c^d])
 16577  	for {
 16578  		c := auxIntToInt64(v.AuxInt)
 16579  		if v_0.Op != OpARM64MOVDconst {
 16580  			break
 16581  		}
 16582  		d := auxIntToInt64(v_0.AuxInt)
 16583  		v.reset(OpARM64MOVDconst)
 16584  		v.AuxInt = int64ToAuxInt(c ^ d)
 16585  		return true
 16586  	}
 16587  	// match: (XORconst [c] (XORconst [d] x))
 16588  	// result: (XORconst [c^d] x)
 16589  	for {
 16590  		c := auxIntToInt64(v.AuxInt)
 16591  		if v_0.Op != OpARM64XORconst {
 16592  			break
 16593  		}
 16594  		d := auxIntToInt64(v_0.AuxInt)
 16595  		x := v_0.Args[0]
 16596  		v.reset(OpARM64XORconst)
 16597  		v.AuxInt = int64ToAuxInt(c ^ d)
 16598  		v.AddArg(x)
 16599  		return true
 16600  	}
 16601  	return false
 16602  }
 16603  func rewriteValueARM64_OpARM64XORshiftLL(v *Value) bool {
 16604  	v_1 := v.Args[1]
 16605  	v_0 := v.Args[0]
 16606  	b := v.Block
 16607  	typ := &b.Func.Config.Types
 16608  	// match: (XORshiftLL (MOVDconst [c]) x [d])
 16609  	// result: (XORconst [c] (SLLconst <x.Type> x [d]))
 16610  	for {
 16611  		d := auxIntToInt64(v.AuxInt)
 16612  		if v_0.Op != OpARM64MOVDconst {
 16613  			break
 16614  		}
 16615  		c := auxIntToInt64(v_0.AuxInt)
 16616  		x := v_1
 16617  		v.reset(OpARM64XORconst)
 16618  		v.AuxInt = int64ToAuxInt(c)
 16619  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 16620  		v0.AuxInt = int64ToAuxInt(d)
 16621  		v0.AddArg(x)
 16622  		v.AddArg(v0)
 16623  		return true
 16624  	}
 16625  	// match: (XORshiftLL x (MOVDconst [c]) [d])
 16626  	// result: (XORconst x [int64(uint64(c)<<uint64(d))])
 16627  	for {
 16628  		d := auxIntToInt64(v.AuxInt)
 16629  		x := v_0
 16630  		if v_1.Op != OpARM64MOVDconst {
 16631  			break
 16632  		}
 16633  		c := auxIntToInt64(v_1.AuxInt)
 16634  		v.reset(OpARM64XORconst)
 16635  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 16636  		v.AddArg(x)
 16637  		return true
 16638  	}
 16639  	// match: (XORshiftLL (SLLconst x [c]) x [c])
 16640  	// result: (MOVDconst [0])
 16641  	for {
 16642  		c := auxIntToInt64(v.AuxInt)
 16643  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 16644  			break
 16645  		}
 16646  		x := v_0.Args[0]
 16647  		if x != v_1 {
 16648  			break
 16649  		}
 16650  		v.reset(OpARM64MOVDconst)
 16651  		v.AuxInt = int64ToAuxInt(0)
 16652  		return true
 16653  	}
 16654  	// match: (XORshiftLL <typ.UInt16> [8] (UBFX <typ.UInt16> [armBFAuxInt(8, 8)] x) x)
 16655  	// result: (REV16W x)
 16656  	for {
 16657  		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) {
 16658  			break
 16659  		}
 16660  		x := v_0.Args[0]
 16661  		if x != v_1 {
 16662  			break
 16663  		}
 16664  		v.reset(OpARM64REV16W)
 16665  		v.AddArg(x)
 16666  		return true
 16667  	}
 16668  	// match: (XORshiftLL [8] (UBFX [armBFAuxInt(8, 24)] (ANDconst [c1] x)) (ANDconst [c2] x))
 16669  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
 16670  	// result: (REV16W x)
 16671  	for {
 16672  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
 16673  			break
 16674  		}
 16675  		v_0_0 := v_0.Args[0]
 16676  		if v_0_0.Op != OpARM64ANDconst {
 16677  			break
 16678  		}
 16679  		c1 := auxIntToInt64(v_0_0.AuxInt)
 16680  		x := v_0_0.Args[0]
 16681  		if v_1.Op != OpARM64ANDconst {
 16682  			break
 16683  		}
 16684  		c2 := auxIntToInt64(v_1.AuxInt)
 16685  		if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
 16686  			break
 16687  		}
 16688  		v.reset(OpARM64REV16W)
 16689  		v.AddArg(x)
 16690  		return true
 16691  	}
 16692  	// match: (XORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 16693  	// cond: (uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff)
 16694  	// result: (REV16 x)
 16695  	for {
 16696  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 16697  			break
 16698  		}
 16699  		v_0_0 := v_0.Args[0]
 16700  		if v_0_0.Op != OpARM64ANDconst {
 16701  			break
 16702  		}
 16703  		c1 := auxIntToInt64(v_0_0.AuxInt)
 16704  		x := v_0_0.Args[0]
 16705  		if v_1.Op != OpARM64ANDconst {
 16706  			break
 16707  		}
 16708  		c2 := auxIntToInt64(v_1.AuxInt)
 16709  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
 16710  			break
 16711  		}
 16712  		v.reset(OpARM64REV16)
 16713  		v.AddArg(x)
 16714  		return true
 16715  	}
 16716  	// match: (XORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 16717  	// cond: (uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff)
 16718  	// result: (REV16 (ANDconst <x.Type> [0xffffffff] x))
 16719  	for {
 16720  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 16721  			break
 16722  		}
 16723  		v_0_0 := v_0.Args[0]
 16724  		if v_0_0.Op != OpARM64ANDconst {
 16725  			break
 16726  		}
 16727  		c1 := auxIntToInt64(v_0_0.AuxInt)
 16728  		x := v_0_0.Args[0]
 16729  		if v_1.Op != OpARM64ANDconst {
 16730  			break
 16731  		}
 16732  		c2 := auxIntToInt64(v_1.AuxInt)
 16733  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
 16734  			break
 16735  		}
 16736  		v.reset(OpARM64REV16)
 16737  		v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
 16738  		v0.AuxInt = int64ToAuxInt(0xffffffff)
 16739  		v0.AddArg(x)
 16740  		v.AddArg(v0)
 16741  		return true
 16742  	}
 16743  	// match: (XORshiftLL [c] (SRLconst x [64-c]) x2)
 16744  	// result: (EXTRconst [64-c] x2 x)
 16745  	for {
 16746  		c := auxIntToInt64(v.AuxInt)
 16747  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
 16748  			break
 16749  		}
 16750  		x := v_0.Args[0]
 16751  		x2 := v_1
 16752  		v.reset(OpARM64EXTRconst)
 16753  		v.AuxInt = int64ToAuxInt(64 - c)
 16754  		v.AddArg2(x2, x)
 16755  		return true
 16756  	}
 16757  	// match: (XORshiftLL <t> [c] (UBFX [bfc] x) x2)
 16758  	// cond: c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)
 16759  	// result: (EXTRWconst [32-c] x2 x)
 16760  	for {
 16761  		t := v.Type
 16762  		c := auxIntToInt64(v.AuxInt)
 16763  		if v_0.Op != OpARM64UBFX {
 16764  			break
 16765  		}
 16766  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 16767  		x := v_0.Args[0]
 16768  		x2 := v_1
 16769  		if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
 16770  			break
 16771  		}
 16772  		v.reset(OpARM64EXTRWconst)
 16773  		v.AuxInt = int64ToAuxInt(32 - c)
 16774  		v.AddArg2(x2, x)
 16775  		return true
 16776  	}
 16777  	return false
 16778  }
 16779  func rewriteValueARM64_OpARM64XORshiftRA(v *Value) bool {
 16780  	v_1 := v.Args[1]
 16781  	v_0 := v.Args[0]
 16782  	b := v.Block
 16783  	// match: (XORshiftRA (MOVDconst [c]) x [d])
 16784  	// result: (XORconst [c] (SRAconst <x.Type> x [d]))
 16785  	for {
 16786  		d := auxIntToInt64(v.AuxInt)
 16787  		if v_0.Op != OpARM64MOVDconst {
 16788  			break
 16789  		}
 16790  		c := auxIntToInt64(v_0.AuxInt)
 16791  		x := v_1
 16792  		v.reset(OpARM64XORconst)
 16793  		v.AuxInt = int64ToAuxInt(c)
 16794  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
 16795  		v0.AuxInt = int64ToAuxInt(d)
 16796  		v0.AddArg(x)
 16797  		v.AddArg(v0)
 16798  		return true
 16799  	}
 16800  	// match: (XORshiftRA x (MOVDconst [c]) [d])
 16801  	// result: (XORconst x [c>>uint64(d)])
 16802  	for {
 16803  		d := auxIntToInt64(v.AuxInt)
 16804  		x := v_0
 16805  		if v_1.Op != OpARM64MOVDconst {
 16806  			break
 16807  		}
 16808  		c := auxIntToInt64(v_1.AuxInt)
 16809  		v.reset(OpARM64XORconst)
 16810  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 16811  		v.AddArg(x)
 16812  		return true
 16813  	}
 16814  	// match: (XORshiftRA (SRAconst x [c]) x [c])
 16815  	// result: (MOVDconst [0])
 16816  	for {
 16817  		c := auxIntToInt64(v.AuxInt)
 16818  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
 16819  			break
 16820  		}
 16821  		x := v_0.Args[0]
 16822  		if x != v_1 {
 16823  			break
 16824  		}
 16825  		v.reset(OpARM64MOVDconst)
 16826  		v.AuxInt = int64ToAuxInt(0)
 16827  		return true
 16828  	}
 16829  	return false
 16830  }
 16831  func rewriteValueARM64_OpARM64XORshiftRL(v *Value) bool {
 16832  	v_1 := v.Args[1]
 16833  	v_0 := v.Args[0]
 16834  	b := v.Block
 16835  	// match: (XORshiftRL (MOVDconst [c]) x [d])
 16836  	// result: (XORconst [c] (SRLconst <x.Type> x [d]))
 16837  	for {
 16838  		d := auxIntToInt64(v.AuxInt)
 16839  		if v_0.Op != OpARM64MOVDconst {
 16840  			break
 16841  		}
 16842  		c := auxIntToInt64(v_0.AuxInt)
 16843  		x := v_1
 16844  		v.reset(OpARM64XORconst)
 16845  		v.AuxInt = int64ToAuxInt(c)
 16846  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
 16847  		v0.AuxInt = int64ToAuxInt(d)
 16848  		v0.AddArg(x)
 16849  		v.AddArg(v0)
 16850  		return true
 16851  	}
 16852  	// match: (XORshiftRL x (MOVDconst [c]) [d])
 16853  	// result: (XORconst x [int64(uint64(c)>>uint64(d))])
 16854  	for {
 16855  		d := auxIntToInt64(v.AuxInt)
 16856  		x := v_0
 16857  		if v_1.Op != OpARM64MOVDconst {
 16858  			break
 16859  		}
 16860  		c := auxIntToInt64(v_1.AuxInt)
 16861  		v.reset(OpARM64XORconst)
 16862  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 16863  		v.AddArg(x)
 16864  		return true
 16865  	}
 16866  	// match: (XORshiftRL (SRLconst x [c]) x [c])
 16867  	// result: (MOVDconst [0])
 16868  	for {
 16869  		c := auxIntToInt64(v.AuxInt)
 16870  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 16871  			break
 16872  		}
 16873  		x := v_0.Args[0]
 16874  		if x != v_1 {
 16875  			break
 16876  		}
 16877  		v.reset(OpARM64MOVDconst)
 16878  		v.AuxInt = int64ToAuxInt(0)
 16879  		return true
 16880  	}
 16881  	return false
 16882  }
 16883  func rewriteValueARM64_OpARM64XORshiftRO(v *Value) bool {
 16884  	v_1 := v.Args[1]
 16885  	v_0 := v.Args[0]
 16886  	b := v.Block
 16887  	// match: (XORshiftRO (MOVDconst [c]) x [d])
 16888  	// result: (XORconst [c] (RORconst <x.Type> x [d]))
 16889  	for {
 16890  		d := auxIntToInt64(v.AuxInt)
 16891  		if v_0.Op != OpARM64MOVDconst {
 16892  			break
 16893  		}
 16894  		c := auxIntToInt64(v_0.AuxInt)
 16895  		x := v_1
 16896  		v.reset(OpARM64XORconst)
 16897  		v.AuxInt = int64ToAuxInt(c)
 16898  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
 16899  		v0.AuxInt = int64ToAuxInt(d)
 16900  		v0.AddArg(x)
 16901  		v.AddArg(v0)
 16902  		return true
 16903  	}
 16904  	// match: (XORshiftRO x (MOVDconst [c]) [d])
 16905  	// result: (XORconst x [rotateRight64(c, d)])
 16906  	for {
 16907  		d := auxIntToInt64(v.AuxInt)
 16908  		x := v_0
 16909  		if v_1.Op != OpARM64MOVDconst {
 16910  			break
 16911  		}
 16912  		c := auxIntToInt64(v_1.AuxInt)
 16913  		v.reset(OpARM64XORconst)
 16914  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
 16915  		v.AddArg(x)
 16916  		return true
 16917  	}
 16918  	// match: (XORshiftRO (RORconst x [c]) x [c])
 16919  	// result: (MOVDconst [0])
 16920  	for {
 16921  		c := auxIntToInt64(v.AuxInt)
 16922  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
 16923  			break
 16924  		}
 16925  		x := v_0.Args[0]
 16926  		if x != v_1 {
 16927  			break
 16928  		}
 16929  		v.reset(OpARM64MOVDconst)
 16930  		v.AuxInt = int64ToAuxInt(0)
 16931  		return true
 16932  	}
 16933  	return false
 16934  }
 16935  func rewriteValueARM64_OpAddr(v *Value) bool {
 16936  	v_0 := v.Args[0]
 16937  	// match: (Addr {sym} base)
 16938  	// result: (MOVDaddr {sym} base)
 16939  	for {
 16940  		sym := auxToSym(v.Aux)
 16941  		base := v_0
 16942  		v.reset(OpARM64MOVDaddr)
 16943  		v.Aux = symToAux(sym)
 16944  		v.AddArg(base)
 16945  		return true
 16946  	}
 16947  }
 16948  func rewriteValueARM64_OpAvg64u(v *Value) bool {
 16949  	v_1 := v.Args[1]
 16950  	v_0 := v.Args[0]
 16951  	b := v.Block
 16952  	// match: (Avg64u <t> x y)
 16953  	// result: (ADD (SRLconst <t> (SUB <t> x y) [1]) y)
 16954  	for {
 16955  		t := v.Type
 16956  		x := v_0
 16957  		y := v_1
 16958  		v.reset(OpARM64ADD)
 16959  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, t)
 16960  		v0.AuxInt = int64ToAuxInt(1)
 16961  		v1 := b.NewValue0(v.Pos, OpARM64SUB, t)
 16962  		v1.AddArg2(x, y)
 16963  		v0.AddArg(v1)
 16964  		v.AddArg2(v0, y)
 16965  		return true
 16966  	}
 16967  }
 16968  func rewriteValueARM64_OpBitLen16(v *Value) bool {
 16969  	v_0 := v.Args[0]
 16970  	b := v.Block
 16971  	typ := &b.Func.Config.Types
 16972  	// match: (BitLen16 x)
 16973  	// result: (BitLen64 (ZeroExt16to64 x))
 16974  	for {
 16975  		x := v_0
 16976  		v.reset(OpBitLen64)
 16977  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 16978  		v0.AddArg(x)
 16979  		v.AddArg(v0)
 16980  		return true
 16981  	}
 16982  }
 16983  func rewriteValueARM64_OpBitLen32(v *Value) bool {
 16984  	v_0 := v.Args[0]
 16985  	b := v.Block
 16986  	typ := &b.Func.Config.Types
 16987  	// match: (BitLen32 x)
 16988  	// result: (SUB (MOVDconst [32]) (CLZW <typ.Int> x))
 16989  	for {
 16990  		x := v_0
 16991  		v.reset(OpARM64SUB)
 16992  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 16993  		v0.AuxInt = int64ToAuxInt(32)
 16994  		v1 := b.NewValue0(v.Pos, OpARM64CLZW, typ.Int)
 16995  		v1.AddArg(x)
 16996  		v.AddArg2(v0, v1)
 16997  		return true
 16998  	}
 16999  }
 17000  func rewriteValueARM64_OpBitLen64(v *Value) bool {
 17001  	v_0 := v.Args[0]
 17002  	b := v.Block
 17003  	typ := &b.Func.Config.Types
 17004  	// match: (BitLen64 x)
 17005  	// result: (SUB (MOVDconst [64]) (CLZ <typ.Int> x))
 17006  	for {
 17007  		x := v_0
 17008  		v.reset(OpARM64SUB)
 17009  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17010  		v0.AuxInt = int64ToAuxInt(64)
 17011  		v1 := b.NewValue0(v.Pos, OpARM64CLZ, typ.Int)
 17012  		v1.AddArg(x)
 17013  		v.AddArg2(v0, v1)
 17014  		return true
 17015  	}
 17016  }
 17017  func rewriteValueARM64_OpBitLen8(v *Value) bool {
 17018  	v_0 := v.Args[0]
 17019  	b := v.Block
 17020  	typ := &b.Func.Config.Types
 17021  	// match: (BitLen8 x)
 17022  	// result: (BitLen64 (ZeroExt8to64 x))
 17023  	for {
 17024  		x := v_0
 17025  		v.reset(OpBitLen64)
 17026  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 17027  		v0.AddArg(x)
 17028  		v.AddArg(v0)
 17029  		return true
 17030  	}
 17031  }
 17032  func rewriteValueARM64_OpBitRev16(v *Value) bool {
 17033  	v_0 := v.Args[0]
 17034  	b := v.Block
 17035  	typ := &b.Func.Config.Types
 17036  	// match: (BitRev16 x)
 17037  	// result: (SRLconst [48] (RBIT <typ.UInt64> x))
 17038  	for {
 17039  		x := v_0
 17040  		v.reset(OpARM64SRLconst)
 17041  		v.AuxInt = int64ToAuxInt(48)
 17042  		v0 := b.NewValue0(v.Pos, OpARM64RBIT, typ.UInt64)
 17043  		v0.AddArg(x)
 17044  		v.AddArg(v0)
 17045  		return true
 17046  	}
 17047  }
 17048  func rewriteValueARM64_OpBitRev8(v *Value) bool {
 17049  	v_0 := v.Args[0]
 17050  	b := v.Block
 17051  	typ := &b.Func.Config.Types
 17052  	// match: (BitRev8 x)
 17053  	// result: (SRLconst [56] (RBIT <typ.UInt64> x))
 17054  	for {
 17055  		x := v_0
 17056  		v.reset(OpARM64SRLconst)
 17057  		v.AuxInt = int64ToAuxInt(56)
 17058  		v0 := b.NewValue0(v.Pos, OpARM64RBIT, typ.UInt64)
 17059  		v0.AddArg(x)
 17060  		v.AddArg(v0)
 17061  		return true
 17062  	}
 17063  }
 17064  func rewriteValueARM64_OpCondSelect(v *Value) bool {
 17065  	v_2 := v.Args[2]
 17066  	v_1 := v.Args[1]
 17067  	v_0 := v.Args[0]
 17068  	b := v.Block
 17069  	// match: (CondSelect x y boolval)
 17070  	// cond: flagArg(boolval) != nil
 17071  	// result: (CSEL [boolval.Op] x y flagArg(boolval))
 17072  	for {
 17073  		x := v_0
 17074  		y := v_1
 17075  		boolval := v_2
 17076  		if !(flagArg(boolval) != nil) {
 17077  			break
 17078  		}
 17079  		v.reset(OpARM64CSEL)
 17080  		v.AuxInt = opToAuxInt(boolval.Op)
 17081  		v.AddArg3(x, y, flagArg(boolval))
 17082  		return true
 17083  	}
 17084  	// match: (CondSelect x y boolval)
 17085  	// cond: flagArg(boolval) == nil
 17086  	// result: (CSEL [OpARM64NotEqual] x y (TSTWconst [1] boolval))
 17087  	for {
 17088  		x := v_0
 17089  		y := v_1
 17090  		boolval := v_2
 17091  		if !(flagArg(boolval) == nil) {
 17092  			break
 17093  		}
 17094  		v.reset(OpARM64CSEL)
 17095  		v.AuxInt = opToAuxInt(OpARM64NotEqual)
 17096  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
 17097  		v0.AuxInt = int32ToAuxInt(1)
 17098  		v0.AddArg(boolval)
 17099  		v.AddArg3(x, y, v0)
 17100  		return true
 17101  	}
 17102  	return false
 17103  }
 17104  func rewriteValueARM64_OpConst16(v *Value) bool {
 17105  	// match: (Const16 [val])
 17106  	// result: (MOVDconst [int64(val)])
 17107  	for {
 17108  		val := auxIntToInt16(v.AuxInt)
 17109  		v.reset(OpARM64MOVDconst)
 17110  		v.AuxInt = int64ToAuxInt(int64(val))
 17111  		return true
 17112  	}
 17113  }
 17114  func rewriteValueARM64_OpConst32(v *Value) bool {
 17115  	// match: (Const32 [val])
 17116  	// result: (MOVDconst [int64(val)])
 17117  	for {
 17118  		val := auxIntToInt32(v.AuxInt)
 17119  		v.reset(OpARM64MOVDconst)
 17120  		v.AuxInt = int64ToAuxInt(int64(val))
 17121  		return true
 17122  	}
 17123  }
 17124  func rewriteValueARM64_OpConst32F(v *Value) bool {
 17125  	// match: (Const32F [val])
 17126  	// result: (FMOVSconst [float64(val)])
 17127  	for {
 17128  		val := auxIntToFloat32(v.AuxInt)
 17129  		v.reset(OpARM64FMOVSconst)
 17130  		v.AuxInt = float64ToAuxInt(float64(val))
 17131  		return true
 17132  	}
 17133  }
 17134  func rewriteValueARM64_OpConst64(v *Value) bool {
 17135  	// match: (Const64 [val])
 17136  	// result: (MOVDconst [int64(val)])
 17137  	for {
 17138  		val := auxIntToInt64(v.AuxInt)
 17139  		v.reset(OpARM64MOVDconst)
 17140  		v.AuxInt = int64ToAuxInt(int64(val))
 17141  		return true
 17142  	}
 17143  }
 17144  func rewriteValueARM64_OpConst64F(v *Value) bool {
 17145  	// match: (Const64F [val])
 17146  	// result: (FMOVDconst [float64(val)])
 17147  	for {
 17148  		val := auxIntToFloat64(v.AuxInt)
 17149  		v.reset(OpARM64FMOVDconst)
 17150  		v.AuxInt = float64ToAuxInt(float64(val))
 17151  		return true
 17152  	}
 17153  }
 17154  func rewriteValueARM64_OpConst8(v *Value) bool {
 17155  	// match: (Const8 [val])
 17156  	// result: (MOVDconst [int64(val)])
 17157  	for {
 17158  		val := auxIntToInt8(v.AuxInt)
 17159  		v.reset(OpARM64MOVDconst)
 17160  		v.AuxInt = int64ToAuxInt(int64(val))
 17161  		return true
 17162  	}
 17163  }
 17164  func rewriteValueARM64_OpConstBool(v *Value) bool {
 17165  	// match: (ConstBool [t])
 17166  	// result: (MOVDconst [b2i(t)])
 17167  	for {
 17168  		t := auxIntToBool(v.AuxInt)
 17169  		v.reset(OpARM64MOVDconst)
 17170  		v.AuxInt = int64ToAuxInt(b2i(t))
 17171  		return true
 17172  	}
 17173  }
 17174  func rewriteValueARM64_OpConstNil(v *Value) bool {
 17175  	// match: (ConstNil)
 17176  	// result: (MOVDconst [0])
 17177  	for {
 17178  		v.reset(OpARM64MOVDconst)
 17179  		v.AuxInt = int64ToAuxInt(0)
 17180  		return true
 17181  	}
 17182  }
 17183  func rewriteValueARM64_OpCtz16(v *Value) bool {
 17184  	v_0 := v.Args[0]
 17185  	b := v.Block
 17186  	typ := &b.Func.Config.Types
 17187  	// match: (Ctz16 <t> x)
 17188  	// result: (CLZW <t> (RBITW <typ.UInt32> (ORconst <typ.UInt32> [0x10000] x)))
 17189  	for {
 17190  		t := v.Type
 17191  		x := v_0
 17192  		v.reset(OpARM64CLZW)
 17193  		v.Type = t
 17194  		v0 := b.NewValue0(v.Pos, OpARM64RBITW, typ.UInt32)
 17195  		v1 := b.NewValue0(v.Pos, OpARM64ORconst, typ.UInt32)
 17196  		v1.AuxInt = int64ToAuxInt(0x10000)
 17197  		v1.AddArg(x)
 17198  		v0.AddArg(v1)
 17199  		v.AddArg(v0)
 17200  		return true
 17201  	}
 17202  }
 17203  func rewriteValueARM64_OpCtz32(v *Value) bool {
 17204  	v_0 := v.Args[0]
 17205  	b := v.Block
 17206  	// match: (Ctz32 <t> x)
 17207  	// result: (CLZW (RBITW <t> x))
 17208  	for {
 17209  		t := v.Type
 17210  		x := v_0
 17211  		v.reset(OpARM64CLZW)
 17212  		v0 := b.NewValue0(v.Pos, OpARM64RBITW, t)
 17213  		v0.AddArg(x)
 17214  		v.AddArg(v0)
 17215  		return true
 17216  	}
 17217  }
 17218  func rewriteValueARM64_OpCtz64(v *Value) bool {
 17219  	v_0 := v.Args[0]
 17220  	b := v.Block
 17221  	// match: (Ctz64 <t> x)
 17222  	// result: (CLZ (RBIT <t> x))
 17223  	for {
 17224  		t := v.Type
 17225  		x := v_0
 17226  		v.reset(OpARM64CLZ)
 17227  		v0 := b.NewValue0(v.Pos, OpARM64RBIT, t)
 17228  		v0.AddArg(x)
 17229  		v.AddArg(v0)
 17230  		return true
 17231  	}
 17232  }
 17233  func rewriteValueARM64_OpCtz8(v *Value) bool {
 17234  	v_0 := v.Args[0]
 17235  	b := v.Block
 17236  	typ := &b.Func.Config.Types
 17237  	// match: (Ctz8 <t> x)
 17238  	// result: (CLZW <t> (RBITW <typ.UInt32> (ORconst <typ.UInt32> [0x100] x)))
 17239  	for {
 17240  		t := v.Type
 17241  		x := v_0
 17242  		v.reset(OpARM64CLZW)
 17243  		v.Type = t
 17244  		v0 := b.NewValue0(v.Pos, OpARM64RBITW, typ.UInt32)
 17245  		v1 := b.NewValue0(v.Pos, OpARM64ORconst, typ.UInt32)
 17246  		v1.AuxInt = int64ToAuxInt(0x100)
 17247  		v1.AddArg(x)
 17248  		v0.AddArg(v1)
 17249  		v.AddArg(v0)
 17250  		return true
 17251  	}
 17252  }
 17253  func rewriteValueARM64_OpDiv16(v *Value) bool {
 17254  	v_1 := v.Args[1]
 17255  	v_0 := v.Args[0]
 17256  	b := v.Block
 17257  	typ := &b.Func.Config.Types
 17258  	// match: (Div16 [false] x y)
 17259  	// result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
 17260  	for {
 17261  		if auxIntToBool(v.AuxInt) != false {
 17262  			break
 17263  		}
 17264  		x := v_0
 17265  		y := v_1
 17266  		v.reset(OpARM64DIVW)
 17267  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17268  		v0.AddArg(x)
 17269  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17270  		v1.AddArg(y)
 17271  		v.AddArg2(v0, v1)
 17272  		return true
 17273  	}
 17274  	return false
 17275  }
 17276  func rewriteValueARM64_OpDiv16u(v *Value) bool {
 17277  	v_1 := v.Args[1]
 17278  	v_0 := v.Args[0]
 17279  	b := v.Block
 17280  	typ := &b.Func.Config.Types
 17281  	// match: (Div16u x y)
 17282  	// result: (UDIVW (ZeroExt16to32 x) (ZeroExt16to32 y))
 17283  	for {
 17284  		x := v_0
 17285  		y := v_1
 17286  		v.reset(OpARM64UDIVW)
 17287  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17288  		v0.AddArg(x)
 17289  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17290  		v1.AddArg(y)
 17291  		v.AddArg2(v0, v1)
 17292  		return true
 17293  	}
 17294  }
 17295  func rewriteValueARM64_OpDiv32(v *Value) bool {
 17296  	v_1 := v.Args[1]
 17297  	v_0 := v.Args[0]
 17298  	// match: (Div32 [false] x y)
 17299  	// result: (DIVW x y)
 17300  	for {
 17301  		if auxIntToBool(v.AuxInt) != false {
 17302  			break
 17303  		}
 17304  		x := v_0
 17305  		y := v_1
 17306  		v.reset(OpARM64DIVW)
 17307  		v.AddArg2(x, y)
 17308  		return true
 17309  	}
 17310  	return false
 17311  }
 17312  func rewriteValueARM64_OpDiv64(v *Value) bool {
 17313  	v_1 := v.Args[1]
 17314  	v_0 := v.Args[0]
 17315  	// match: (Div64 [false] x y)
 17316  	// result: (DIV x y)
 17317  	for {
 17318  		if auxIntToBool(v.AuxInt) != false {
 17319  			break
 17320  		}
 17321  		x := v_0
 17322  		y := v_1
 17323  		v.reset(OpARM64DIV)
 17324  		v.AddArg2(x, y)
 17325  		return true
 17326  	}
 17327  	return false
 17328  }
 17329  func rewriteValueARM64_OpDiv8(v *Value) bool {
 17330  	v_1 := v.Args[1]
 17331  	v_0 := v.Args[0]
 17332  	b := v.Block
 17333  	typ := &b.Func.Config.Types
 17334  	// match: (Div8 x y)
 17335  	// result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
 17336  	for {
 17337  		x := v_0
 17338  		y := v_1
 17339  		v.reset(OpARM64DIVW)
 17340  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 17341  		v0.AddArg(x)
 17342  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 17343  		v1.AddArg(y)
 17344  		v.AddArg2(v0, v1)
 17345  		return true
 17346  	}
 17347  }
 17348  func rewriteValueARM64_OpDiv8u(v *Value) bool {
 17349  	v_1 := v.Args[1]
 17350  	v_0 := v.Args[0]
 17351  	b := v.Block
 17352  	typ := &b.Func.Config.Types
 17353  	// match: (Div8u x y)
 17354  	// result: (UDIVW (ZeroExt8to32 x) (ZeroExt8to32 y))
 17355  	for {
 17356  		x := v_0
 17357  		y := v_1
 17358  		v.reset(OpARM64UDIVW)
 17359  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17360  		v0.AddArg(x)
 17361  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17362  		v1.AddArg(y)
 17363  		v.AddArg2(v0, v1)
 17364  		return true
 17365  	}
 17366  }
 17367  func rewriteValueARM64_OpEq16(v *Value) bool {
 17368  	v_1 := v.Args[1]
 17369  	v_0 := v.Args[0]
 17370  	b := v.Block
 17371  	typ := &b.Func.Config.Types
 17372  	// match: (Eq16 x y)
 17373  	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 17374  	for {
 17375  		x := v_0
 17376  		y := v_1
 17377  		v.reset(OpARM64Equal)
 17378  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17379  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17380  		v1.AddArg(x)
 17381  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17382  		v2.AddArg(y)
 17383  		v0.AddArg2(v1, v2)
 17384  		v.AddArg(v0)
 17385  		return true
 17386  	}
 17387  }
 17388  func rewriteValueARM64_OpEq32(v *Value) bool {
 17389  	v_1 := v.Args[1]
 17390  	v_0 := v.Args[0]
 17391  	b := v.Block
 17392  	// match: (Eq32 x y)
 17393  	// result: (Equal (CMPW x y))
 17394  	for {
 17395  		x := v_0
 17396  		y := v_1
 17397  		v.reset(OpARM64Equal)
 17398  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17399  		v0.AddArg2(x, y)
 17400  		v.AddArg(v0)
 17401  		return true
 17402  	}
 17403  }
 17404  func rewriteValueARM64_OpEq32F(v *Value) bool {
 17405  	v_1 := v.Args[1]
 17406  	v_0 := v.Args[0]
 17407  	b := v.Block
 17408  	// match: (Eq32F x y)
 17409  	// result: (Equal (FCMPS x y))
 17410  	for {
 17411  		x := v_0
 17412  		y := v_1
 17413  		v.reset(OpARM64Equal)
 17414  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 17415  		v0.AddArg2(x, y)
 17416  		v.AddArg(v0)
 17417  		return true
 17418  	}
 17419  }
 17420  func rewriteValueARM64_OpEq64(v *Value) bool {
 17421  	v_1 := v.Args[1]
 17422  	v_0 := v.Args[0]
 17423  	b := v.Block
 17424  	// match: (Eq64 x y)
 17425  	// result: (Equal (CMP x y))
 17426  	for {
 17427  		x := v_0
 17428  		y := v_1
 17429  		v.reset(OpARM64Equal)
 17430  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17431  		v0.AddArg2(x, y)
 17432  		v.AddArg(v0)
 17433  		return true
 17434  	}
 17435  }
 17436  func rewriteValueARM64_OpEq64F(v *Value) bool {
 17437  	v_1 := v.Args[1]
 17438  	v_0 := v.Args[0]
 17439  	b := v.Block
 17440  	// match: (Eq64F x y)
 17441  	// result: (Equal (FCMPD x y))
 17442  	for {
 17443  		x := v_0
 17444  		y := v_1
 17445  		v.reset(OpARM64Equal)
 17446  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 17447  		v0.AddArg2(x, y)
 17448  		v.AddArg(v0)
 17449  		return true
 17450  	}
 17451  }
 17452  func rewriteValueARM64_OpEq8(v *Value) bool {
 17453  	v_1 := v.Args[1]
 17454  	v_0 := v.Args[0]
 17455  	b := v.Block
 17456  	typ := &b.Func.Config.Types
 17457  	// match: (Eq8 x y)
 17458  	// result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 17459  	for {
 17460  		x := v_0
 17461  		y := v_1
 17462  		v.reset(OpARM64Equal)
 17463  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17464  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17465  		v1.AddArg(x)
 17466  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17467  		v2.AddArg(y)
 17468  		v0.AddArg2(v1, v2)
 17469  		v.AddArg(v0)
 17470  		return true
 17471  	}
 17472  }
 17473  func rewriteValueARM64_OpEqB(v *Value) bool {
 17474  	v_1 := v.Args[1]
 17475  	v_0 := v.Args[0]
 17476  	b := v.Block
 17477  	typ := &b.Func.Config.Types
 17478  	// match: (EqB x y)
 17479  	// result: (XOR (MOVDconst [1]) (XOR <typ.Bool> x y))
 17480  	for {
 17481  		x := v_0
 17482  		y := v_1
 17483  		v.reset(OpARM64XOR)
 17484  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17485  		v0.AuxInt = int64ToAuxInt(1)
 17486  		v1 := b.NewValue0(v.Pos, OpARM64XOR, typ.Bool)
 17487  		v1.AddArg2(x, y)
 17488  		v.AddArg2(v0, v1)
 17489  		return true
 17490  	}
 17491  }
 17492  func rewriteValueARM64_OpEqPtr(v *Value) bool {
 17493  	v_1 := v.Args[1]
 17494  	v_0 := v.Args[0]
 17495  	b := v.Block
 17496  	// match: (EqPtr x y)
 17497  	// result: (Equal (CMP x y))
 17498  	for {
 17499  		x := v_0
 17500  		y := v_1
 17501  		v.reset(OpARM64Equal)
 17502  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17503  		v0.AddArg2(x, y)
 17504  		v.AddArg(v0)
 17505  		return true
 17506  	}
 17507  }
 17508  func rewriteValueARM64_OpFMA(v *Value) bool {
 17509  	v_2 := v.Args[2]
 17510  	v_1 := v.Args[1]
 17511  	v_0 := v.Args[0]
 17512  	// match: (FMA x y z)
 17513  	// result: (FMADDD z x y)
 17514  	for {
 17515  		x := v_0
 17516  		y := v_1
 17517  		z := v_2
 17518  		v.reset(OpARM64FMADDD)
 17519  		v.AddArg3(z, x, y)
 17520  		return true
 17521  	}
 17522  }
 17523  func rewriteValueARM64_OpHmul32(v *Value) bool {
 17524  	v_1 := v.Args[1]
 17525  	v_0 := v.Args[0]
 17526  	b := v.Block
 17527  	typ := &b.Func.Config.Types
 17528  	// match: (Hmul32 x y)
 17529  	// result: (SRAconst (MULL <typ.Int64> x y) [32])
 17530  	for {
 17531  		x := v_0
 17532  		y := v_1
 17533  		v.reset(OpARM64SRAconst)
 17534  		v.AuxInt = int64ToAuxInt(32)
 17535  		v0 := b.NewValue0(v.Pos, OpARM64MULL, typ.Int64)
 17536  		v0.AddArg2(x, y)
 17537  		v.AddArg(v0)
 17538  		return true
 17539  	}
 17540  }
 17541  func rewriteValueARM64_OpHmul32u(v *Value) bool {
 17542  	v_1 := v.Args[1]
 17543  	v_0 := v.Args[0]
 17544  	b := v.Block
 17545  	typ := &b.Func.Config.Types
 17546  	// match: (Hmul32u x y)
 17547  	// result: (SRAconst (UMULL <typ.UInt64> x y) [32])
 17548  	for {
 17549  		x := v_0
 17550  		y := v_1
 17551  		v.reset(OpARM64SRAconst)
 17552  		v.AuxInt = int64ToAuxInt(32)
 17553  		v0 := b.NewValue0(v.Pos, OpARM64UMULL, typ.UInt64)
 17554  		v0.AddArg2(x, y)
 17555  		v.AddArg(v0)
 17556  		return true
 17557  	}
 17558  }
 17559  func rewriteValueARM64_OpIsInBounds(v *Value) bool {
 17560  	v_1 := v.Args[1]
 17561  	v_0 := v.Args[0]
 17562  	b := v.Block
 17563  	// match: (IsInBounds idx len)
 17564  	// result: (LessThanU (CMP idx len))
 17565  	for {
 17566  		idx := v_0
 17567  		len := v_1
 17568  		v.reset(OpARM64LessThanU)
 17569  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17570  		v0.AddArg2(idx, len)
 17571  		v.AddArg(v0)
 17572  		return true
 17573  	}
 17574  }
 17575  func rewriteValueARM64_OpIsNonNil(v *Value) bool {
 17576  	v_0 := v.Args[0]
 17577  	b := v.Block
 17578  	// match: (IsNonNil ptr)
 17579  	// result: (NotEqual (CMPconst [0] ptr))
 17580  	for {
 17581  		ptr := v_0
 17582  		v.reset(OpARM64NotEqual)
 17583  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 17584  		v0.AuxInt = int64ToAuxInt(0)
 17585  		v0.AddArg(ptr)
 17586  		v.AddArg(v0)
 17587  		return true
 17588  	}
 17589  }
 17590  func rewriteValueARM64_OpIsSliceInBounds(v *Value) bool {
 17591  	v_1 := v.Args[1]
 17592  	v_0 := v.Args[0]
 17593  	b := v.Block
 17594  	// match: (IsSliceInBounds idx len)
 17595  	// result: (LessEqualU (CMP idx len))
 17596  	for {
 17597  		idx := v_0
 17598  		len := v_1
 17599  		v.reset(OpARM64LessEqualU)
 17600  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17601  		v0.AddArg2(idx, len)
 17602  		v.AddArg(v0)
 17603  		return true
 17604  	}
 17605  }
 17606  func rewriteValueARM64_OpLeq16(v *Value) bool {
 17607  	v_1 := v.Args[1]
 17608  	v_0 := v.Args[0]
 17609  	b := v.Block
 17610  	typ := &b.Func.Config.Types
 17611  	// match: (Leq16 x y)
 17612  	// result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
 17613  	for {
 17614  		x := v_0
 17615  		y := v_1
 17616  		v.reset(OpARM64LessEqual)
 17617  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17618  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17619  		v1.AddArg(x)
 17620  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17621  		v2.AddArg(y)
 17622  		v0.AddArg2(v1, v2)
 17623  		v.AddArg(v0)
 17624  		return true
 17625  	}
 17626  }
 17627  func rewriteValueARM64_OpLeq16U(v *Value) bool {
 17628  	v_1 := v.Args[1]
 17629  	v_0 := v.Args[0]
 17630  	b := v.Block
 17631  	typ := &b.Func.Config.Types
 17632  	// match: (Leq16U x zero:(MOVDconst [0]))
 17633  	// result: (Eq16 x zero)
 17634  	for {
 17635  		x := v_0
 17636  		zero := v_1
 17637  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17638  			break
 17639  		}
 17640  		v.reset(OpEq16)
 17641  		v.AddArg2(x, zero)
 17642  		return true
 17643  	}
 17644  	// match: (Leq16U (MOVDconst [1]) x)
 17645  	// result: (Neq16 (MOVDconst [0]) x)
 17646  	for {
 17647  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 17648  			break
 17649  		}
 17650  		x := v_1
 17651  		v.reset(OpNeq16)
 17652  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17653  		v0.AuxInt = int64ToAuxInt(0)
 17654  		v.AddArg2(v0, x)
 17655  		return true
 17656  	}
 17657  	// match: (Leq16U x y)
 17658  	// result: (LessEqualU (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 17659  	for {
 17660  		x := v_0
 17661  		y := v_1
 17662  		v.reset(OpARM64LessEqualU)
 17663  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17664  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17665  		v1.AddArg(x)
 17666  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17667  		v2.AddArg(y)
 17668  		v0.AddArg2(v1, v2)
 17669  		v.AddArg(v0)
 17670  		return true
 17671  	}
 17672  }
 17673  func rewriteValueARM64_OpLeq32(v *Value) bool {
 17674  	v_1 := v.Args[1]
 17675  	v_0 := v.Args[0]
 17676  	b := v.Block
 17677  	// match: (Leq32 x y)
 17678  	// result: (LessEqual (CMPW x y))
 17679  	for {
 17680  		x := v_0
 17681  		y := v_1
 17682  		v.reset(OpARM64LessEqual)
 17683  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17684  		v0.AddArg2(x, y)
 17685  		v.AddArg(v0)
 17686  		return true
 17687  	}
 17688  }
 17689  func rewriteValueARM64_OpLeq32F(v *Value) bool {
 17690  	v_1 := v.Args[1]
 17691  	v_0 := v.Args[0]
 17692  	b := v.Block
 17693  	// match: (Leq32F x y)
 17694  	// result: (LessEqualF (FCMPS x y))
 17695  	for {
 17696  		x := v_0
 17697  		y := v_1
 17698  		v.reset(OpARM64LessEqualF)
 17699  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 17700  		v0.AddArg2(x, y)
 17701  		v.AddArg(v0)
 17702  		return true
 17703  	}
 17704  }
 17705  func rewriteValueARM64_OpLeq32U(v *Value) bool {
 17706  	v_1 := v.Args[1]
 17707  	v_0 := v.Args[0]
 17708  	b := v.Block
 17709  	typ := &b.Func.Config.Types
 17710  	// match: (Leq32U x zero:(MOVDconst [0]))
 17711  	// result: (Eq32 x zero)
 17712  	for {
 17713  		x := v_0
 17714  		zero := v_1
 17715  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17716  			break
 17717  		}
 17718  		v.reset(OpEq32)
 17719  		v.AddArg2(x, zero)
 17720  		return true
 17721  	}
 17722  	// match: (Leq32U (MOVDconst [1]) x)
 17723  	// result: (Neq32 (MOVDconst [0]) x)
 17724  	for {
 17725  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 17726  			break
 17727  		}
 17728  		x := v_1
 17729  		v.reset(OpNeq32)
 17730  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17731  		v0.AuxInt = int64ToAuxInt(0)
 17732  		v.AddArg2(v0, x)
 17733  		return true
 17734  	}
 17735  	// match: (Leq32U x y)
 17736  	// result: (LessEqualU (CMPW x y))
 17737  	for {
 17738  		x := v_0
 17739  		y := v_1
 17740  		v.reset(OpARM64LessEqualU)
 17741  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17742  		v0.AddArg2(x, y)
 17743  		v.AddArg(v0)
 17744  		return true
 17745  	}
 17746  }
 17747  func rewriteValueARM64_OpLeq64(v *Value) bool {
 17748  	v_1 := v.Args[1]
 17749  	v_0 := v.Args[0]
 17750  	b := v.Block
 17751  	// match: (Leq64 x y)
 17752  	// result: (LessEqual (CMP x y))
 17753  	for {
 17754  		x := v_0
 17755  		y := v_1
 17756  		v.reset(OpARM64LessEqual)
 17757  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17758  		v0.AddArg2(x, y)
 17759  		v.AddArg(v0)
 17760  		return true
 17761  	}
 17762  }
 17763  func rewriteValueARM64_OpLeq64F(v *Value) bool {
 17764  	v_1 := v.Args[1]
 17765  	v_0 := v.Args[0]
 17766  	b := v.Block
 17767  	// match: (Leq64F x y)
 17768  	// result: (LessEqualF (FCMPD x y))
 17769  	for {
 17770  		x := v_0
 17771  		y := v_1
 17772  		v.reset(OpARM64LessEqualF)
 17773  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 17774  		v0.AddArg2(x, y)
 17775  		v.AddArg(v0)
 17776  		return true
 17777  	}
 17778  }
 17779  func rewriteValueARM64_OpLeq64U(v *Value) bool {
 17780  	v_1 := v.Args[1]
 17781  	v_0 := v.Args[0]
 17782  	b := v.Block
 17783  	typ := &b.Func.Config.Types
 17784  	// match: (Leq64U x zero:(MOVDconst [0]))
 17785  	// result: (Eq64 x zero)
 17786  	for {
 17787  		x := v_0
 17788  		zero := v_1
 17789  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17790  			break
 17791  		}
 17792  		v.reset(OpEq64)
 17793  		v.AddArg2(x, zero)
 17794  		return true
 17795  	}
 17796  	// match: (Leq64U (MOVDconst [1]) x)
 17797  	// result: (Neq64 (MOVDconst [0]) x)
 17798  	for {
 17799  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 17800  			break
 17801  		}
 17802  		x := v_1
 17803  		v.reset(OpNeq64)
 17804  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17805  		v0.AuxInt = int64ToAuxInt(0)
 17806  		v.AddArg2(v0, x)
 17807  		return true
 17808  	}
 17809  	// match: (Leq64U x y)
 17810  	// result: (LessEqualU (CMP x y))
 17811  	for {
 17812  		x := v_0
 17813  		y := v_1
 17814  		v.reset(OpARM64LessEqualU)
 17815  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 17816  		v0.AddArg2(x, y)
 17817  		v.AddArg(v0)
 17818  		return true
 17819  	}
 17820  }
 17821  func rewriteValueARM64_OpLeq8(v *Value) bool {
 17822  	v_1 := v.Args[1]
 17823  	v_0 := v.Args[0]
 17824  	b := v.Block
 17825  	typ := &b.Func.Config.Types
 17826  	// match: (Leq8 x y)
 17827  	// result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
 17828  	for {
 17829  		x := v_0
 17830  		y := v_1
 17831  		v.reset(OpARM64LessEqual)
 17832  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17833  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 17834  		v1.AddArg(x)
 17835  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 17836  		v2.AddArg(y)
 17837  		v0.AddArg2(v1, v2)
 17838  		v.AddArg(v0)
 17839  		return true
 17840  	}
 17841  }
 17842  func rewriteValueARM64_OpLeq8U(v *Value) bool {
 17843  	v_1 := v.Args[1]
 17844  	v_0 := v.Args[0]
 17845  	b := v.Block
 17846  	typ := &b.Func.Config.Types
 17847  	// match: (Leq8U x zero:(MOVDconst [0]))
 17848  	// result: (Eq8 x zero)
 17849  	for {
 17850  		x := v_0
 17851  		zero := v_1
 17852  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17853  			break
 17854  		}
 17855  		v.reset(OpEq8)
 17856  		v.AddArg2(x, zero)
 17857  		return true
 17858  	}
 17859  	// match: (Leq8U (MOVDconst [1]) x)
 17860  	// result: (Neq8 (MOVDconst [0]) x)
 17861  	for {
 17862  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 17863  			break
 17864  		}
 17865  		x := v_1
 17866  		v.reset(OpNeq8)
 17867  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17868  		v0.AuxInt = int64ToAuxInt(0)
 17869  		v.AddArg2(v0, x)
 17870  		return true
 17871  	}
 17872  	// match: (Leq8U x y)
 17873  	// result: (LessEqualU (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 17874  	for {
 17875  		x := v_0
 17876  		y := v_1
 17877  		v.reset(OpARM64LessEqualU)
 17878  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17879  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17880  		v1.AddArg(x)
 17881  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 17882  		v2.AddArg(y)
 17883  		v0.AddArg2(v1, v2)
 17884  		v.AddArg(v0)
 17885  		return true
 17886  	}
 17887  }
 17888  func rewriteValueARM64_OpLess16(v *Value) bool {
 17889  	v_1 := v.Args[1]
 17890  	v_0 := v.Args[0]
 17891  	b := v.Block
 17892  	typ := &b.Func.Config.Types
 17893  	// match: (Less16 x y)
 17894  	// result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
 17895  	for {
 17896  		x := v_0
 17897  		y := v_1
 17898  		v.reset(OpARM64LessThan)
 17899  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17900  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17901  		v1.AddArg(x)
 17902  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 17903  		v2.AddArg(y)
 17904  		v0.AddArg2(v1, v2)
 17905  		v.AddArg(v0)
 17906  		return true
 17907  	}
 17908  }
 17909  func rewriteValueARM64_OpLess16U(v *Value) bool {
 17910  	v_1 := v.Args[1]
 17911  	v_0 := v.Args[0]
 17912  	b := v.Block
 17913  	typ := &b.Func.Config.Types
 17914  	// match: (Less16U zero:(MOVDconst [0]) x)
 17915  	// result: (Neq16 zero x)
 17916  	for {
 17917  		zero := v_0
 17918  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17919  			break
 17920  		}
 17921  		x := v_1
 17922  		v.reset(OpNeq16)
 17923  		v.AddArg2(zero, x)
 17924  		return true
 17925  	}
 17926  	// match: (Less16U x (MOVDconst [1]))
 17927  	// result: (Eq16 x (MOVDconst [0]))
 17928  	for {
 17929  		x := v_0
 17930  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 17931  			break
 17932  		}
 17933  		v.reset(OpEq16)
 17934  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17935  		v0.AuxInt = int64ToAuxInt(0)
 17936  		v.AddArg2(x, v0)
 17937  		return true
 17938  	}
 17939  	// match: (Less16U x y)
 17940  	// result: (LessThanU (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 17941  	for {
 17942  		x := v_0
 17943  		y := v_1
 17944  		v.reset(OpARM64LessThanU)
 17945  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17946  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17947  		v1.AddArg(x)
 17948  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 17949  		v2.AddArg(y)
 17950  		v0.AddArg2(v1, v2)
 17951  		v.AddArg(v0)
 17952  		return true
 17953  	}
 17954  }
 17955  func rewriteValueARM64_OpLess32(v *Value) bool {
 17956  	v_1 := v.Args[1]
 17957  	v_0 := v.Args[0]
 17958  	b := v.Block
 17959  	// match: (Less32 x y)
 17960  	// result: (LessThan (CMPW x y))
 17961  	for {
 17962  		x := v_0
 17963  		y := v_1
 17964  		v.reset(OpARM64LessThan)
 17965  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 17966  		v0.AddArg2(x, y)
 17967  		v.AddArg(v0)
 17968  		return true
 17969  	}
 17970  }
 17971  func rewriteValueARM64_OpLess32F(v *Value) bool {
 17972  	v_1 := v.Args[1]
 17973  	v_0 := v.Args[0]
 17974  	b := v.Block
 17975  	// match: (Less32F x y)
 17976  	// result: (LessThanF (FCMPS x y))
 17977  	for {
 17978  		x := v_0
 17979  		y := v_1
 17980  		v.reset(OpARM64LessThanF)
 17981  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 17982  		v0.AddArg2(x, y)
 17983  		v.AddArg(v0)
 17984  		return true
 17985  	}
 17986  }
 17987  func rewriteValueARM64_OpLess32U(v *Value) bool {
 17988  	v_1 := v.Args[1]
 17989  	v_0 := v.Args[0]
 17990  	b := v.Block
 17991  	typ := &b.Func.Config.Types
 17992  	// match: (Less32U zero:(MOVDconst [0]) x)
 17993  	// result: (Neq32 zero x)
 17994  	for {
 17995  		zero := v_0
 17996  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 17997  			break
 17998  		}
 17999  		x := v_1
 18000  		v.reset(OpNeq32)
 18001  		v.AddArg2(zero, x)
 18002  		return true
 18003  	}
 18004  	// match: (Less32U x (MOVDconst [1]))
 18005  	// result: (Eq32 x (MOVDconst [0]))
 18006  	for {
 18007  		x := v_0
 18008  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 18009  			break
 18010  		}
 18011  		v.reset(OpEq32)
 18012  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 18013  		v0.AuxInt = int64ToAuxInt(0)
 18014  		v.AddArg2(x, v0)
 18015  		return true
 18016  	}
 18017  	// match: (Less32U x y)
 18018  	// result: (LessThanU (CMPW x y))
 18019  	for {
 18020  		x := v_0
 18021  		y := v_1
 18022  		v.reset(OpARM64LessThanU)
 18023  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18024  		v0.AddArg2(x, y)
 18025  		v.AddArg(v0)
 18026  		return true
 18027  	}
 18028  }
 18029  func rewriteValueARM64_OpLess64(v *Value) bool {
 18030  	v_1 := v.Args[1]
 18031  	v_0 := v.Args[0]
 18032  	b := v.Block
 18033  	// match: (Less64 x y)
 18034  	// result: (LessThan (CMP x y))
 18035  	for {
 18036  		x := v_0
 18037  		y := v_1
 18038  		v.reset(OpARM64LessThan)
 18039  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 18040  		v0.AddArg2(x, y)
 18041  		v.AddArg(v0)
 18042  		return true
 18043  	}
 18044  }
 18045  func rewriteValueARM64_OpLess64F(v *Value) bool {
 18046  	v_1 := v.Args[1]
 18047  	v_0 := v.Args[0]
 18048  	b := v.Block
 18049  	// match: (Less64F x y)
 18050  	// result: (LessThanF (FCMPD x y))
 18051  	for {
 18052  		x := v_0
 18053  		y := v_1
 18054  		v.reset(OpARM64LessThanF)
 18055  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 18056  		v0.AddArg2(x, y)
 18057  		v.AddArg(v0)
 18058  		return true
 18059  	}
 18060  }
 18061  func rewriteValueARM64_OpLess64U(v *Value) bool {
 18062  	v_1 := v.Args[1]
 18063  	v_0 := v.Args[0]
 18064  	b := v.Block
 18065  	typ := &b.Func.Config.Types
 18066  	// match: (Less64U zero:(MOVDconst [0]) x)
 18067  	// result: (Neq64 zero x)
 18068  	for {
 18069  		zero := v_0
 18070  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 18071  			break
 18072  		}
 18073  		x := v_1
 18074  		v.reset(OpNeq64)
 18075  		v.AddArg2(zero, x)
 18076  		return true
 18077  	}
 18078  	// match: (Less64U x (MOVDconst [1]))
 18079  	// result: (Eq64 x (MOVDconst [0]))
 18080  	for {
 18081  		x := v_0
 18082  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 18083  			break
 18084  		}
 18085  		v.reset(OpEq64)
 18086  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 18087  		v0.AuxInt = int64ToAuxInt(0)
 18088  		v.AddArg2(x, v0)
 18089  		return true
 18090  	}
 18091  	// match: (Less64U x y)
 18092  	// result: (LessThanU (CMP x y))
 18093  	for {
 18094  		x := v_0
 18095  		y := v_1
 18096  		v.reset(OpARM64LessThanU)
 18097  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 18098  		v0.AddArg2(x, y)
 18099  		v.AddArg(v0)
 18100  		return true
 18101  	}
 18102  }
 18103  func rewriteValueARM64_OpLess8(v *Value) bool {
 18104  	v_1 := v.Args[1]
 18105  	v_0 := v.Args[0]
 18106  	b := v.Block
 18107  	typ := &b.Func.Config.Types
 18108  	// match: (Less8 x y)
 18109  	// result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
 18110  	for {
 18111  		x := v_0
 18112  		y := v_1
 18113  		v.reset(OpARM64LessThan)
 18114  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18115  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 18116  		v1.AddArg(x)
 18117  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 18118  		v2.AddArg(y)
 18119  		v0.AddArg2(v1, v2)
 18120  		v.AddArg(v0)
 18121  		return true
 18122  	}
 18123  }
 18124  func rewriteValueARM64_OpLess8U(v *Value) bool {
 18125  	v_1 := v.Args[1]
 18126  	v_0 := v.Args[0]
 18127  	b := v.Block
 18128  	typ := &b.Func.Config.Types
 18129  	// match: (Less8U zero:(MOVDconst [0]) x)
 18130  	// result: (Neq8 zero x)
 18131  	for {
 18132  		zero := v_0
 18133  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 18134  			break
 18135  		}
 18136  		x := v_1
 18137  		v.reset(OpNeq8)
 18138  		v.AddArg2(zero, x)
 18139  		return true
 18140  	}
 18141  	// match: (Less8U x (MOVDconst [1]))
 18142  	// result: (Eq8 x (MOVDconst [0]))
 18143  	for {
 18144  		x := v_0
 18145  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 18146  			break
 18147  		}
 18148  		v.reset(OpEq8)
 18149  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 18150  		v0.AuxInt = int64ToAuxInt(0)
 18151  		v.AddArg2(x, v0)
 18152  		return true
 18153  	}
 18154  	// match: (Less8U x y)
 18155  	// result: (LessThanU (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 18156  	for {
 18157  		x := v_0
 18158  		y := v_1
 18159  		v.reset(OpARM64LessThanU)
 18160  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18161  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 18162  		v1.AddArg(x)
 18163  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 18164  		v2.AddArg(y)
 18165  		v0.AddArg2(v1, v2)
 18166  		v.AddArg(v0)
 18167  		return true
 18168  	}
 18169  }
 18170  func rewriteValueARM64_OpLoad(v *Value) bool {
 18171  	v_1 := v.Args[1]
 18172  	v_0 := v.Args[0]
 18173  	// match: (Load <t> ptr mem)
 18174  	// cond: t.IsBoolean()
 18175  	// result: (MOVBUload ptr mem)
 18176  	for {
 18177  		t := v.Type
 18178  		ptr := v_0
 18179  		mem := v_1
 18180  		if !(t.IsBoolean()) {
 18181  			break
 18182  		}
 18183  		v.reset(OpARM64MOVBUload)
 18184  		v.AddArg2(ptr, mem)
 18185  		return true
 18186  	}
 18187  	// match: (Load <t> ptr mem)
 18188  	// cond: (is8BitInt(t) && t.IsSigned())
 18189  	// result: (MOVBload ptr mem)
 18190  	for {
 18191  		t := v.Type
 18192  		ptr := v_0
 18193  		mem := v_1
 18194  		if !(is8BitInt(t) && t.IsSigned()) {
 18195  			break
 18196  		}
 18197  		v.reset(OpARM64MOVBload)
 18198  		v.AddArg2(ptr, mem)
 18199  		return true
 18200  	}
 18201  	// match: (Load <t> ptr mem)
 18202  	// cond: (is8BitInt(t) && !t.IsSigned())
 18203  	// result: (MOVBUload ptr mem)
 18204  	for {
 18205  		t := v.Type
 18206  		ptr := v_0
 18207  		mem := v_1
 18208  		if !(is8BitInt(t) && !t.IsSigned()) {
 18209  			break
 18210  		}
 18211  		v.reset(OpARM64MOVBUload)
 18212  		v.AddArg2(ptr, mem)
 18213  		return true
 18214  	}
 18215  	// match: (Load <t> ptr mem)
 18216  	// cond: (is16BitInt(t) && t.IsSigned())
 18217  	// result: (MOVHload ptr mem)
 18218  	for {
 18219  		t := v.Type
 18220  		ptr := v_0
 18221  		mem := v_1
 18222  		if !(is16BitInt(t) && t.IsSigned()) {
 18223  			break
 18224  		}
 18225  		v.reset(OpARM64MOVHload)
 18226  		v.AddArg2(ptr, mem)
 18227  		return true
 18228  	}
 18229  	// match: (Load <t> ptr mem)
 18230  	// cond: (is16BitInt(t) && !t.IsSigned())
 18231  	// result: (MOVHUload ptr mem)
 18232  	for {
 18233  		t := v.Type
 18234  		ptr := v_0
 18235  		mem := v_1
 18236  		if !(is16BitInt(t) && !t.IsSigned()) {
 18237  			break
 18238  		}
 18239  		v.reset(OpARM64MOVHUload)
 18240  		v.AddArg2(ptr, mem)
 18241  		return true
 18242  	}
 18243  	// match: (Load <t> ptr mem)
 18244  	// cond: (is32BitInt(t) && t.IsSigned())
 18245  	// result: (MOVWload ptr mem)
 18246  	for {
 18247  		t := v.Type
 18248  		ptr := v_0
 18249  		mem := v_1
 18250  		if !(is32BitInt(t) && t.IsSigned()) {
 18251  			break
 18252  		}
 18253  		v.reset(OpARM64MOVWload)
 18254  		v.AddArg2(ptr, mem)
 18255  		return true
 18256  	}
 18257  	// match: (Load <t> ptr mem)
 18258  	// cond: (is32BitInt(t) && !t.IsSigned())
 18259  	// result: (MOVWUload ptr mem)
 18260  	for {
 18261  		t := v.Type
 18262  		ptr := v_0
 18263  		mem := v_1
 18264  		if !(is32BitInt(t) && !t.IsSigned()) {
 18265  			break
 18266  		}
 18267  		v.reset(OpARM64MOVWUload)
 18268  		v.AddArg2(ptr, mem)
 18269  		return true
 18270  	}
 18271  	// match: (Load <t> ptr mem)
 18272  	// cond: (is64BitInt(t) || isPtr(t))
 18273  	// result: (MOVDload ptr mem)
 18274  	for {
 18275  		t := v.Type
 18276  		ptr := v_0
 18277  		mem := v_1
 18278  		if !(is64BitInt(t) || isPtr(t)) {
 18279  			break
 18280  		}
 18281  		v.reset(OpARM64MOVDload)
 18282  		v.AddArg2(ptr, mem)
 18283  		return true
 18284  	}
 18285  	// match: (Load <t> ptr mem)
 18286  	// cond: is32BitFloat(t)
 18287  	// result: (FMOVSload ptr mem)
 18288  	for {
 18289  		t := v.Type
 18290  		ptr := v_0
 18291  		mem := v_1
 18292  		if !(is32BitFloat(t)) {
 18293  			break
 18294  		}
 18295  		v.reset(OpARM64FMOVSload)
 18296  		v.AddArg2(ptr, mem)
 18297  		return true
 18298  	}
 18299  	// match: (Load <t> ptr mem)
 18300  	// cond: is64BitFloat(t)
 18301  	// result: (FMOVDload ptr mem)
 18302  	for {
 18303  		t := v.Type
 18304  		ptr := v_0
 18305  		mem := v_1
 18306  		if !(is64BitFloat(t)) {
 18307  			break
 18308  		}
 18309  		v.reset(OpARM64FMOVDload)
 18310  		v.AddArg2(ptr, mem)
 18311  		return true
 18312  	}
 18313  	return false
 18314  }
 18315  func rewriteValueARM64_OpLocalAddr(v *Value) bool {
 18316  	v_1 := v.Args[1]
 18317  	v_0 := v.Args[0]
 18318  	b := v.Block
 18319  	typ := &b.Func.Config.Types
 18320  	// match: (LocalAddr <t> {sym} base mem)
 18321  	// cond: t.Elem().HasPointers()
 18322  	// result: (MOVDaddr {sym} (SPanchored base mem))
 18323  	for {
 18324  		t := v.Type
 18325  		sym := auxToSym(v.Aux)
 18326  		base := v_0
 18327  		mem := v_1
 18328  		if !(t.Elem().HasPointers()) {
 18329  			break
 18330  		}
 18331  		v.reset(OpARM64MOVDaddr)
 18332  		v.Aux = symToAux(sym)
 18333  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
 18334  		v0.AddArg2(base, mem)
 18335  		v.AddArg(v0)
 18336  		return true
 18337  	}
 18338  	// match: (LocalAddr <t> {sym} base _)
 18339  	// cond: !t.Elem().HasPointers()
 18340  	// result: (MOVDaddr {sym} base)
 18341  	for {
 18342  		t := v.Type
 18343  		sym := auxToSym(v.Aux)
 18344  		base := v_0
 18345  		if !(!t.Elem().HasPointers()) {
 18346  			break
 18347  		}
 18348  		v.reset(OpARM64MOVDaddr)
 18349  		v.Aux = symToAux(sym)
 18350  		v.AddArg(base)
 18351  		return true
 18352  	}
 18353  	return false
 18354  }
 18355  func rewriteValueARM64_OpLsh16x16(v *Value) bool {
 18356  	v_1 := v.Args[1]
 18357  	v_0 := v.Args[0]
 18358  	b := v.Block
 18359  	typ := &b.Func.Config.Types
 18360  	// match: (Lsh16x16 <t> x y)
 18361  	// cond: shiftIsBounded(v)
 18362  	// result: (SLL <t> x y)
 18363  	for {
 18364  		t := v.Type
 18365  		x := v_0
 18366  		y := v_1
 18367  		if !(shiftIsBounded(v)) {
 18368  			break
 18369  		}
 18370  		v.reset(OpARM64SLL)
 18371  		v.Type = t
 18372  		v.AddArg2(x, y)
 18373  		return true
 18374  	}
 18375  	// match: (Lsh16x16 <t> x y)
 18376  	// cond: !shiftIsBounded(v)
 18377  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 18378  	for {
 18379  		t := v.Type
 18380  		x := v_0
 18381  		y := v_1
 18382  		if !(!shiftIsBounded(v)) {
 18383  			break
 18384  		}
 18385  		v.reset(OpARM64CSEL)
 18386  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18387  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18388  		v0.AddArg2(x, y)
 18389  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18390  		v1.AuxInt = int64ToAuxInt(0)
 18391  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18392  		v2.AuxInt = int64ToAuxInt(64)
 18393  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 18394  		v3.AddArg(y)
 18395  		v2.AddArg(v3)
 18396  		v.AddArg3(v0, v1, v2)
 18397  		return true
 18398  	}
 18399  	return false
 18400  }
 18401  func rewriteValueARM64_OpLsh16x32(v *Value) bool {
 18402  	v_1 := v.Args[1]
 18403  	v_0 := v.Args[0]
 18404  	b := v.Block
 18405  	typ := &b.Func.Config.Types
 18406  	// match: (Lsh16x32 <t> x y)
 18407  	// cond: shiftIsBounded(v)
 18408  	// result: (SLL <t> x y)
 18409  	for {
 18410  		t := v.Type
 18411  		x := v_0
 18412  		y := v_1
 18413  		if !(shiftIsBounded(v)) {
 18414  			break
 18415  		}
 18416  		v.reset(OpARM64SLL)
 18417  		v.Type = t
 18418  		v.AddArg2(x, y)
 18419  		return true
 18420  	}
 18421  	// match: (Lsh16x32 <t> x y)
 18422  	// cond: !shiftIsBounded(v)
 18423  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 18424  	for {
 18425  		t := v.Type
 18426  		x := v_0
 18427  		y := v_1
 18428  		if !(!shiftIsBounded(v)) {
 18429  			break
 18430  		}
 18431  		v.reset(OpARM64CSEL)
 18432  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18433  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18434  		v0.AddArg2(x, y)
 18435  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18436  		v1.AuxInt = int64ToAuxInt(0)
 18437  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18438  		v2.AuxInt = int64ToAuxInt(64)
 18439  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 18440  		v3.AddArg(y)
 18441  		v2.AddArg(v3)
 18442  		v.AddArg3(v0, v1, v2)
 18443  		return true
 18444  	}
 18445  	return false
 18446  }
 18447  func rewriteValueARM64_OpLsh16x64(v *Value) bool {
 18448  	v_1 := v.Args[1]
 18449  	v_0 := v.Args[0]
 18450  	b := v.Block
 18451  	// match: (Lsh16x64 <t> x y)
 18452  	// cond: shiftIsBounded(v)
 18453  	// result: (SLL <t> x y)
 18454  	for {
 18455  		t := v.Type
 18456  		x := v_0
 18457  		y := v_1
 18458  		if !(shiftIsBounded(v)) {
 18459  			break
 18460  		}
 18461  		v.reset(OpARM64SLL)
 18462  		v.Type = t
 18463  		v.AddArg2(x, y)
 18464  		return true
 18465  	}
 18466  	// match: (Lsh16x64 <t> x y)
 18467  	// cond: !shiftIsBounded(v)
 18468  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 18469  	for {
 18470  		t := v.Type
 18471  		x := v_0
 18472  		y := v_1
 18473  		if !(!shiftIsBounded(v)) {
 18474  			break
 18475  		}
 18476  		v.reset(OpARM64CSEL)
 18477  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18478  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18479  		v0.AddArg2(x, y)
 18480  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18481  		v1.AuxInt = int64ToAuxInt(0)
 18482  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18483  		v2.AuxInt = int64ToAuxInt(64)
 18484  		v2.AddArg(y)
 18485  		v.AddArg3(v0, v1, v2)
 18486  		return true
 18487  	}
 18488  	return false
 18489  }
 18490  func rewriteValueARM64_OpLsh16x8(v *Value) bool {
 18491  	v_1 := v.Args[1]
 18492  	v_0 := v.Args[0]
 18493  	b := v.Block
 18494  	typ := &b.Func.Config.Types
 18495  	// match: (Lsh16x8 <t> x y)
 18496  	// cond: shiftIsBounded(v)
 18497  	// result: (SLL <t> x y)
 18498  	for {
 18499  		t := v.Type
 18500  		x := v_0
 18501  		y := v_1
 18502  		if !(shiftIsBounded(v)) {
 18503  			break
 18504  		}
 18505  		v.reset(OpARM64SLL)
 18506  		v.Type = t
 18507  		v.AddArg2(x, y)
 18508  		return true
 18509  	}
 18510  	// match: (Lsh16x8 <t> x y)
 18511  	// cond: !shiftIsBounded(v)
 18512  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 18513  	for {
 18514  		t := v.Type
 18515  		x := v_0
 18516  		y := v_1
 18517  		if !(!shiftIsBounded(v)) {
 18518  			break
 18519  		}
 18520  		v.reset(OpARM64CSEL)
 18521  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18522  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18523  		v0.AddArg2(x, y)
 18524  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18525  		v1.AuxInt = int64ToAuxInt(0)
 18526  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18527  		v2.AuxInt = int64ToAuxInt(64)
 18528  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 18529  		v3.AddArg(y)
 18530  		v2.AddArg(v3)
 18531  		v.AddArg3(v0, v1, v2)
 18532  		return true
 18533  	}
 18534  	return false
 18535  }
 18536  func rewriteValueARM64_OpLsh32x16(v *Value) bool {
 18537  	v_1 := v.Args[1]
 18538  	v_0 := v.Args[0]
 18539  	b := v.Block
 18540  	typ := &b.Func.Config.Types
 18541  	// match: (Lsh32x16 <t> x y)
 18542  	// cond: shiftIsBounded(v)
 18543  	// result: (SLL <t> x y)
 18544  	for {
 18545  		t := v.Type
 18546  		x := v_0
 18547  		y := v_1
 18548  		if !(shiftIsBounded(v)) {
 18549  			break
 18550  		}
 18551  		v.reset(OpARM64SLL)
 18552  		v.Type = t
 18553  		v.AddArg2(x, y)
 18554  		return true
 18555  	}
 18556  	// match: (Lsh32x16 <t> x y)
 18557  	// cond: !shiftIsBounded(v)
 18558  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 18559  	for {
 18560  		t := v.Type
 18561  		x := v_0
 18562  		y := v_1
 18563  		if !(!shiftIsBounded(v)) {
 18564  			break
 18565  		}
 18566  		v.reset(OpARM64CSEL)
 18567  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18568  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18569  		v0.AddArg2(x, y)
 18570  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18571  		v1.AuxInt = int64ToAuxInt(0)
 18572  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18573  		v2.AuxInt = int64ToAuxInt(64)
 18574  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 18575  		v3.AddArg(y)
 18576  		v2.AddArg(v3)
 18577  		v.AddArg3(v0, v1, v2)
 18578  		return true
 18579  	}
 18580  	return false
 18581  }
 18582  func rewriteValueARM64_OpLsh32x32(v *Value) bool {
 18583  	v_1 := v.Args[1]
 18584  	v_0 := v.Args[0]
 18585  	b := v.Block
 18586  	typ := &b.Func.Config.Types
 18587  	// match: (Lsh32x32 <t> x y)
 18588  	// cond: shiftIsBounded(v)
 18589  	// result: (SLL <t> x y)
 18590  	for {
 18591  		t := v.Type
 18592  		x := v_0
 18593  		y := v_1
 18594  		if !(shiftIsBounded(v)) {
 18595  			break
 18596  		}
 18597  		v.reset(OpARM64SLL)
 18598  		v.Type = t
 18599  		v.AddArg2(x, y)
 18600  		return true
 18601  	}
 18602  	// match: (Lsh32x32 <t> x y)
 18603  	// cond: !shiftIsBounded(v)
 18604  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 18605  	for {
 18606  		t := v.Type
 18607  		x := v_0
 18608  		y := v_1
 18609  		if !(!shiftIsBounded(v)) {
 18610  			break
 18611  		}
 18612  		v.reset(OpARM64CSEL)
 18613  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18614  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18615  		v0.AddArg2(x, y)
 18616  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18617  		v1.AuxInt = int64ToAuxInt(0)
 18618  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18619  		v2.AuxInt = int64ToAuxInt(64)
 18620  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 18621  		v3.AddArg(y)
 18622  		v2.AddArg(v3)
 18623  		v.AddArg3(v0, v1, v2)
 18624  		return true
 18625  	}
 18626  	return false
 18627  }
 18628  func rewriteValueARM64_OpLsh32x64(v *Value) bool {
 18629  	v_1 := v.Args[1]
 18630  	v_0 := v.Args[0]
 18631  	b := v.Block
 18632  	// match: (Lsh32x64 <t> x y)
 18633  	// cond: shiftIsBounded(v)
 18634  	// result: (SLL <t> x y)
 18635  	for {
 18636  		t := v.Type
 18637  		x := v_0
 18638  		y := v_1
 18639  		if !(shiftIsBounded(v)) {
 18640  			break
 18641  		}
 18642  		v.reset(OpARM64SLL)
 18643  		v.Type = t
 18644  		v.AddArg2(x, y)
 18645  		return true
 18646  	}
 18647  	// match: (Lsh32x64 <t> x y)
 18648  	// cond: !shiftIsBounded(v)
 18649  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 18650  	for {
 18651  		t := v.Type
 18652  		x := v_0
 18653  		y := v_1
 18654  		if !(!shiftIsBounded(v)) {
 18655  			break
 18656  		}
 18657  		v.reset(OpARM64CSEL)
 18658  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18659  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18660  		v0.AddArg2(x, y)
 18661  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18662  		v1.AuxInt = int64ToAuxInt(0)
 18663  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18664  		v2.AuxInt = int64ToAuxInt(64)
 18665  		v2.AddArg(y)
 18666  		v.AddArg3(v0, v1, v2)
 18667  		return true
 18668  	}
 18669  	return false
 18670  }
 18671  func rewriteValueARM64_OpLsh32x8(v *Value) bool {
 18672  	v_1 := v.Args[1]
 18673  	v_0 := v.Args[0]
 18674  	b := v.Block
 18675  	typ := &b.Func.Config.Types
 18676  	// match: (Lsh32x8 <t> x y)
 18677  	// cond: shiftIsBounded(v)
 18678  	// result: (SLL <t> x y)
 18679  	for {
 18680  		t := v.Type
 18681  		x := v_0
 18682  		y := v_1
 18683  		if !(shiftIsBounded(v)) {
 18684  			break
 18685  		}
 18686  		v.reset(OpARM64SLL)
 18687  		v.Type = t
 18688  		v.AddArg2(x, y)
 18689  		return true
 18690  	}
 18691  	// match: (Lsh32x8 <t> x y)
 18692  	// cond: !shiftIsBounded(v)
 18693  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 18694  	for {
 18695  		t := v.Type
 18696  		x := v_0
 18697  		y := v_1
 18698  		if !(!shiftIsBounded(v)) {
 18699  			break
 18700  		}
 18701  		v.reset(OpARM64CSEL)
 18702  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18703  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18704  		v0.AddArg2(x, y)
 18705  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18706  		v1.AuxInt = int64ToAuxInt(0)
 18707  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18708  		v2.AuxInt = int64ToAuxInt(64)
 18709  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 18710  		v3.AddArg(y)
 18711  		v2.AddArg(v3)
 18712  		v.AddArg3(v0, v1, v2)
 18713  		return true
 18714  	}
 18715  	return false
 18716  }
 18717  func rewriteValueARM64_OpLsh64x16(v *Value) bool {
 18718  	v_1 := v.Args[1]
 18719  	v_0 := v.Args[0]
 18720  	b := v.Block
 18721  	typ := &b.Func.Config.Types
 18722  	// match: (Lsh64x16 <t> x y)
 18723  	// cond: shiftIsBounded(v)
 18724  	// result: (SLL <t> x y)
 18725  	for {
 18726  		t := v.Type
 18727  		x := v_0
 18728  		y := v_1
 18729  		if !(shiftIsBounded(v)) {
 18730  			break
 18731  		}
 18732  		v.reset(OpARM64SLL)
 18733  		v.Type = t
 18734  		v.AddArg2(x, y)
 18735  		return true
 18736  	}
 18737  	// match: (Lsh64x16 <t> x y)
 18738  	// cond: !shiftIsBounded(v)
 18739  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 18740  	for {
 18741  		t := v.Type
 18742  		x := v_0
 18743  		y := v_1
 18744  		if !(!shiftIsBounded(v)) {
 18745  			break
 18746  		}
 18747  		v.reset(OpARM64CSEL)
 18748  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18749  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18750  		v0.AddArg2(x, y)
 18751  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18752  		v1.AuxInt = int64ToAuxInt(0)
 18753  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18754  		v2.AuxInt = int64ToAuxInt(64)
 18755  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 18756  		v3.AddArg(y)
 18757  		v2.AddArg(v3)
 18758  		v.AddArg3(v0, v1, v2)
 18759  		return true
 18760  	}
 18761  	return false
 18762  }
 18763  func rewriteValueARM64_OpLsh64x32(v *Value) bool {
 18764  	v_1 := v.Args[1]
 18765  	v_0 := v.Args[0]
 18766  	b := v.Block
 18767  	typ := &b.Func.Config.Types
 18768  	// match: (Lsh64x32 <t> x y)
 18769  	// cond: shiftIsBounded(v)
 18770  	// result: (SLL <t> x y)
 18771  	for {
 18772  		t := v.Type
 18773  		x := v_0
 18774  		y := v_1
 18775  		if !(shiftIsBounded(v)) {
 18776  			break
 18777  		}
 18778  		v.reset(OpARM64SLL)
 18779  		v.Type = t
 18780  		v.AddArg2(x, y)
 18781  		return true
 18782  	}
 18783  	// match: (Lsh64x32 <t> x y)
 18784  	// cond: !shiftIsBounded(v)
 18785  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 18786  	for {
 18787  		t := v.Type
 18788  		x := v_0
 18789  		y := v_1
 18790  		if !(!shiftIsBounded(v)) {
 18791  			break
 18792  		}
 18793  		v.reset(OpARM64CSEL)
 18794  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18795  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18796  		v0.AddArg2(x, y)
 18797  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18798  		v1.AuxInt = int64ToAuxInt(0)
 18799  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18800  		v2.AuxInt = int64ToAuxInt(64)
 18801  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 18802  		v3.AddArg(y)
 18803  		v2.AddArg(v3)
 18804  		v.AddArg3(v0, v1, v2)
 18805  		return true
 18806  	}
 18807  	return false
 18808  }
 18809  func rewriteValueARM64_OpLsh64x64(v *Value) bool {
 18810  	v_1 := v.Args[1]
 18811  	v_0 := v.Args[0]
 18812  	b := v.Block
 18813  	// match: (Lsh64x64 <t> x y)
 18814  	// cond: shiftIsBounded(v)
 18815  	// result: (SLL <t> x y)
 18816  	for {
 18817  		t := v.Type
 18818  		x := v_0
 18819  		y := v_1
 18820  		if !(shiftIsBounded(v)) {
 18821  			break
 18822  		}
 18823  		v.reset(OpARM64SLL)
 18824  		v.Type = t
 18825  		v.AddArg2(x, y)
 18826  		return true
 18827  	}
 18828  	// match: (Lsh64x64 <t> x y)
 18829  	// cond: !shiftIsBounded(v)
 18830  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 18831  	for {
 18832  		t := v.Type
 18833  		x := v_0
 18834  		y := v_1
 18835  		if !(!shiftIsBounded(v)) {
 18836  			break
 18837  		}
 18838  		v.reset(OpARM64CSEL)
 18839  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18840  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18841  		v0.AddArg2(x, y)
 18842  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18843  		v1.AuxInt = int64ToAuxInt(0)
 18844  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18845  		v2.AuxInt = int64ToAuxInt(64)
 18846  		v2.AddArg(y)
 18847  		v.AddArg3(v0, v1, v2)
 18848  		return true
 18849  	}
 18850  	return false
 18851  }
 18852  func rewriteValueARM64_OpLsh64x8(v *Value) bool {
 18853  	v_1 := v.Args[1]
 18854  	v_0 := v.Args[0]
 18855  	b := v.Block
 18856  	typ := &b.Func.Config.Types
 18857  	// match: (Lsh64x8 <t> x y)
 18858  	// cond: shiftIsBounded(v)
 18859  	// result: (SLL <t> x y)
 18860  	for {
 18861  		t := v.Type
 18862  		x := v_0
 18863  		y := v_1
 18864  		if !(shiftIsBounded(v)) {
 18865  			break
 18866  		}
 18867  		v.reset(OpARM64SLL)
 18868  		v.Type = t
 18869  		v.AddArg2(x, y)
 18870  		return true
 18871  	}
 18872  	// match: (Lsh64x8 <t> x y)
 18873  	// cond: !shiftIsBounded(v)
 18874  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 18875  	for {
 18876  		t := v.Type
 18877  		x := v_0
 18878  		y := v_1
 18879  		if !(!shiftIsBounded(v)) {
 18880  			break
 18881  		}
 18882  		v.reset(OpARM64CSEL)
 18883  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18884  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18885  		v0.AddArg2(x, y)
 18886  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18887  		v1.AuxInt = int64ToAuxInt(0)
 18888  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18889  		v2.AuxInt = int64ToAuxInt(64)
 18890  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 18891  		v3.AddArg(y)
 18892  		v2.AddArg(v3)
 18893  		v.AddArg3(v0, v1, v2)
 18894  		return true
 18895  	}
 18896  	return false
 18897  }
 18898  func rewriteValueARM64_OpLsh8x16(v *Value) bool {
 18899  	v_1 := v.Args[1]
 18900  	v_0 := v.Args[0]
 18901  	b := v.Block
 18902  	typ := &b.Func.Config.Types
 18903  	// match: (Lsh8x16 <t> x y)
 18904  	// cond: shiftIsBounded(v)
 18905  	// result: (SLL <t> x y)
 18906  	for {
 18907  		t := v.Type
 18908  		x := v_0
 18909  		y := v_1
 18910  		if !(shiftIsBounded(v)) {
 18911  			break
 18912  		}
 18913  		v.reset(OpARM64SLL)
 18914  		v.Type = t
 18915  		v.AddArg2(x, y)
 18916  		return true
 18917  	}
 18918  	// match: (Lsh8x16 <t> x y)
 18919  	// cond: !shiftIsBounded(v)
 18920  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 18921  	for {
 18922  		t := v.Type
 18923  		x := v_0
 18924  		y := v_1
 18925  		if !(!shiftIsBounded(v)) {
 18926  			break
 18927  		}
 18928  		v.reset(OpARM64CSEL)
 18929  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18930  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18931  		v0.AddArg2(x, y)
 18932  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18933  		v1.AuxInt = int64ToAuxInt(0)
 18934  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18935  		v2.AuxInt = int64ToAuxInt(64)
 18936  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 18937  		v3.AddArg(y)
 18938  		v2.AddArg(v3)
 18939  		v.AddArg3(v0, v1, v2)
 18940  		return true
 18941  	}
 18942  	return false
 18943  }
 18944  func rewriteValueARM64_OpLsh8x32(v *Value) bool {
 18945  	v_1 := v.Args[1]
 18946  	v_0 := v.Args[0]
 18947  	b := v.Block
 18948  	typ := &b.Func.Config.Types
 18949  	// match: (Lsh8x32 <t> x y)
 18950  	// cond: shiftIsBounded(v)
 18951  	// result: (SLL <t> x y)
 18952  	for {
 18953  		t := v.Type
 18954  		x := v_0
 18955  		y := v_1
 18956  		if !(shiftIsBounded(v)) {
 18957  			break
 18958  		}
 18959  		v.reset(OpARM64SLL)
 18960  		v.Type = t
 18961  		v.AddArg2(x, y)
 18962  		return true
 18963  	}
 18964  	// match: (Lsh8x32 <t> x y)
 18965  	// cond: !shiftIsBounded(v)
 18966  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 18967  	for {
 18968  		t := v.Type
 18969  		x := v_0
 18970  		y := v_1
 18971  		if !(!shiftIsBounded(v)) {
 18972  			break
 18973  		}
 18974  		v.reset(OpARM64CSEL)
 18975  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 18976  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 18977  		v0.AddArg2(x, y)
 18978  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 18979  		v1.AuxInt = int64ToAuxInt(0)
 18980  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18981  		v2.AuxInt = int64ToAuxInt(64)
 18982  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 18983  		v3.AddArg(y)
 18984  		v2.AddArg(v3)
 18985  		v.AddArg3(v0, v1, v2)
 18986  		return true
 18987  	}
 18988  	return false
 18989  }
 18990  func rewriteValueARM64_OpLsh8x64(v *Value) bool {
 18991  	v_1 := v.Args[1]
 18992  	v_0 := v.Args[0]
 18993  	b := v.Block
 18994  	// match: (Lsh8x64 <t> x y)
 18995  	// cond: shiftIsBounded(v)
 18996  	// result: (SLL <t> x y)
 18997  	for {
 18998  		t := v.Type
 18999  		x := v_0
 19000  		y := v_1
 19001  		if !(shiftIsBounded(v)) {
 19002  			break
 19003  		}
 19004  		v.reset(OpARM64SLL)
 19005  		v.Type = t
 19006  		v.AddArg2(x, y)
 19007  		return true
 19008  	}
 19009  	// match: (Lsh8x64 <t> x y)
 19010  	// cond: !shiftIsBounded(v)
 19011  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 19012  	for {
 19013  		t := v.Type
 19014  		x := v_0
 19015  		y := v_1
 19016  		if !(!shiftIsBounded(v)) {
 19017  			break
 19018  		}
 19019  		v.reset(OpARM64CSEL)
 19020  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19021  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19022  		v0.AddArg2(x, y)
 19023  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19024  		v1.AuxInt = int64ToAuxInt(0)
 19025  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19026  		v2.AuxInt = int64ToAuxInt(64)
 19027  		v2.AddArg(y)
 19028  		v.AddArg3(v0, v1, v2)
 19029  		return true
 19030  	}
 19031  	return false
 19032  }
 19033  func rewriteValueARM64_OpLsh8x8(v *Value) bool {
 19034  	v_1 := v.Args[1]
 19035  	v_0 := v.Args[0]
 19036  	b := v.Block
 19037  	typ := &b.Func.Config.Types
 19038  	// match: (Lsh8x8 <t> x y)
 19039  	// cond: shiftIsBounded(v)
 19040  	// result: (SLL <t> x y)
 19041  	for {
 19042  		t := v.Type
 19043  		x := v_0
 19044  		y := v_1
 19045  		if !(shiftIsBounded(v)) {
 19046  			break
 19047  		}
 19048  		v.reset(OpARM64SLL)
 19049  		v.Type = t
 19050  		v.AddArg2(x, y)
 19051  		return true
 19052  	}
 19053  	// match: (Lsh8x8 <t> x y)
 19054  	// cond: !shiftIsBounded(v)
 19055  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 19056  	for {
 19057  		t := v.Type
 19058  		x := v_0
 19059  		y := v_1
 19060  		if !(!shiftIsBounded(v)) {
 19061  			break
 19062  		}
 19063  		v.reset(OpARM64CSEL)
 19064  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19065  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19066  		v0.AddArg2(x, y)
 19067  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19068  		v1.AuxInt = int64ToAuxInt(0)
 19069  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19070  		v2.AuxInt = int64ToAuxInt(64)
 19071  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 19072  		v3.AddArg(y)
 19073  		v2.AddArg(v3)
 19074  		v.AddArg3(v0, v1, v2)
 19075  		return true
 19076  	}
 19077  	return false
 19078  }
 19079  func rewriteValueARM64_OpMod16(v *Value) bool {
 19080  	v_1 := v.Args[1]
 19081  	v_0 := v.Args[0]
 19082  	b := v.Block
 19083  	typ := &b.Func.Config.Types
 19084  	// match: (Mod16 x y)
 19085  	// result: (MODW (SignExt16to32 x) (SignExt16to32 y))
 19086  	for {
 19087  		x := v_0
 19088  		y := v_1
 19089  		v.reset(OpARM64MODW)
 19090  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 19091  		v0.AddArg(x)
 19092  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 19093  		v1.AddArg(y)
 19094  		v.AddArg2(v0, v1)
 19095  		return true
 19096  	}
 19097  }
 19098  func rewriteValueARM64_OpMod16u(v *Value) bool {
 19099  	v_1 := v.Args[1]
 19100  	v_0 := v.Args[0]
 19101  	b := v.Block
 19102  	typ := &b.Func.Config.Types
 19103  	// match: (Mod16u x y)
 19104  	// result: (UMODW (ZeroExt16to32 x) (ZeroExt16to32 y))
 19105  	for {
 19106  		x := v_0
 19107  		y := v_1
 19108  		v.reset(OpARM64UMODW)
 19109  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 19110  		v0.AddArg(x)
 19111  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 19112  		v1.AddArg(y)
 19113  		v.AddArg2(v0, v1)
 19114  		return true
 19115  	}
 19116  }
 19117  func rewriteValueARM64_OpMod32(v *Value) bool {
 19118  	v_1 := v.Args[1]
 19119  	v_0 := v.Args[0]
 19120  	// match: (Mod32 x y)
 19121  	// result: (MODW x y)
 19122  	for {
 19123  		x := v_0
 19124  		y := v_1
 19125  		v.reset(OpARM64MODW)
 19126  		v.AddArg2(x, y)
 19127  		return true
 19128  	}
 19129  }
 19130  func rewriteValueARM64_OpMod64(v *Value) bool {
 19131  	v_1 := v.Args[1]
 19132  	v_0 := v.Args[0]
 19133  	// match: (Mod64 x y)
 19134  	// result: (MOD x y)
 19135  	for {
 19136  		x := v_0
 19137  		y := v_1
 19138  		v.reset(OpARM64MOD)
 19139  		v.AddArg2(x, y)
 19140  		return true
 19141  	}
 19142  }
 19143  func rewriteValueARM64_OpMod8(v *Value) bool {
 19144  	v_1 := v.Args[1]
 19145  	v_0 := v.Args[0]
 19146  	b := v.Block
 19147  	typ := &b.Func.Config.Types
 19148  	// match: (Mod8 x y)
 19149  	// result: (MODW (SignExt8to32 x) (SignExt8to32 y))
 19150  	for {
 19151  		x := v_0
 19152  		y := v_1
 19153  		v.reset(OpARM64MODW)
 19154  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 19155  		v0.AddArg(x)
 19156  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 19157  		v1.AddArg(y)
 19158  		v.AddArg2(v0, v1)
 19159  		return true
 19160  	}
 19161  }
 19162  func rewriteValueARM64_OpMod8u(v *Value) bool {
 19163  	v_1 := v.Args[1]
 19164  	v_0 := v.Args[0]
 19165  	b := v.Block
 19166  	typ := &b.Func.Config.Types
 19167  	// match: (Mod8u x y)
 19168  	// result: (UMODW (ZeroExt8to32 x) (ZeroExt8to32 y))
 19169  	for {
 19170  		x := v_0
 19171  		y := v_1
 19172  		v.reset(OpARM64UMODW)
 19173  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 19174  		v0.AddArg(x)
 19175  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 19176  		v1.AddArg(y)
 19177  		v.AddArg2(v0, v1)
 19178  		return true
 19179  	}
 19180  }
 19181  func rewriteValueARM64_OpMove(v *Value) bool {
 19182  	v_2 := v.Args[2]
 19183  	v_1 := v.Args[1]
 19184  	v_0 := v.Args[0]
 19185  	b := v.Block
 19186  	typ := &b.Func.Config.Types
 19187  	// match: (Move [0] _ _ mem)
 19188  	// result: mem
 19189  	for {
 19190  		if auxIntToInt64(v.AuxInt) != 0 {
 19191  			break
 19192  		}
 19193  		mem := v_2
 19194  		v.copyOf(mem)
 19195  		return true
 19196  	}
 19197  	// match: (Move [1] dst src mem)
 19198  	// result: (MOVBstore dst (MOVBUload src mem) mem)
 19199  	for {
 19200  		if auxIntToInt64(v.AuxInt) != 1 {
 19201  			break
 19202  		}
 19203  		dst := v_0
 19204  		src := v_1
 19205  		mem := v_2
 19206  		v.reset(OpARM64MOVBstore)
 19207  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 19208  		v0.AddArg2(src, mem)
 19209  		v.AddArg3(dst, v0, mem)
 19210  		return true
 19211  	}
 19212  	// match: (Move [2] dst src mem)
 19213  	// result: (MOVHstore dst (MOVHUload src mem) mem)
 19214  	for {
 19215  		if auxIntToInt64(v.AuxInt) != 2 {
 19216  			break
 19217  		}
 19218  		dst := v_0
 19219  		src := v_1
 19220  		mem := v_2
 19221  		v.reset(OpARM64MOVHstore)
 19222  		v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 19223  		v0.AddArg2(src, mem)
 19224  		v.AddArg3(dst, v0, mem)
 19225  		return true
 19226  	}
 19227  	// match: (Move [3] dst src mem)
 19228  	// result: (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVHstore dst (MOVHUload src mem) mem))
 19229  	for {
 19230  		if auxIntToInt64(v.AuxInt) != 3 {
 19231  			break
 19232  		}
 19233  		dst := v_0
 19234  		src := v_1
 19235  		mem := v_2
 19236  		v.reset(OpARM64MOVBstore)
 19237  		v.AuxInt = int32ToAuxInt(2)
 19238  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 19239  		v0.AuxInt = int32ToAuxInt(2)
 19240  		v0.AddArg2(src, mem)
 19241  		v1 := b.NewValue0(v.Pos, OpARM64MOVHstore, types.TypeMem)
 19242  		v2 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 19243  		v2.AddArg2(src, mem)
 19244  		v1.AddArg3(dst, v2, mem)
 19245  		v.AddArg3(dst, v0, v1)
 19246  		return true
 19247  	}
 19248  	// match: (Move [4] dst src mem)
 19249  	// result: (MOVWstore dst (MOVWUload src mem) mem)
 19250  	for {
 19251  		if auxIntToInt64(v.AuxInt) != 4 {
 19252  			break
 19253  		}
 19254  		dst := v_0
 19255  		src := v_1
 19256  		mem := v_2
 19257  		v.reset(OpARM64MOVWstore)
 19258  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19259  		v0.AddArg2(src, mem)
 19260  		v.AddArg3(dst, v0, mem)
 19261  		return true
 19262  	}
 19263  	// match: (Move [5] dst src mem)
 19264  	// result: (MOVBstore [4] dst (MOVBUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
 19265  	for {
 19266  		if auxIntToInt64(v.AuxInt) != 5 {
 19267  			break
 19268  		}
 19269  		dst := v_0
 19270  		src := v_1
 19271  		mem := v_2
 19272  		v.reset(OpARM64MOVBstore)
 19273  		v.AuxInt = int32ToAuxInt(4)
 19274  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 19275  		v0.AuxInt = int32ToAuxInt(4)
 19276  		v0.AddArg2(src, mem)
 19277  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 19278  		v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19279  		v2.AddArg2(src, mem)
 19280  		v1.AddArg3(dst, v2, mem)
 19281  		v.AddArg3(dst, v0, v1)
 19282  		return true
 19283  	}
 19284  	// match: (Move [6] dst src mem)
 19285  	// result: (MOVHstore [4] dst (MOVHUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
 19286  	for {
 19287  		if auxIntToInt64(v.AuxInt) != 6 {
 19288  			break
 19289  		}
 19290  		dst := v_0
 19291  		src := v_1
 19292  		mem := v_2
 19293  		v.reset(OpARM64MOVHstore)
 19294  		v.AuxInt = int32ToAuxInt(4)
 19295  		v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 19296  		v0.AuxInt = int32ToAuxInt(4)
 19297  		v0.AddArg2(src, mem)
 19298  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 19299  		v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19300  		v2.AddArg2(src, mem)
 19301  		v1.AddArg3(dst, v2, mem)
 19302  		v.AddArg3(dst, v0, v1)
 19303  		return true
 19304  	}
 19305  	// match: (Move [7] dst src mem)
 19306  	// result: (MOVWstore [3] dst (MOVWUload [3] src mem) (MOVWstore dst (MOVWUload src mem) mem))
 19307  	for {
 19308  		if auxIntToInt64(v.AuxInt) != 7 {
 19309  			break
 19310  		}
 19311  		dst := v_0
 19312  		src := v_1
 19313  		mem := v_2
 19314  		v.reset(OpARM64MOVWstore)
 19315  		v.AuxInt = int32ToAuxInt(3)
 19316  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19317  		v0.AuxInt = int32ToAuxInt(3)
 19318  		v0.AddArg2(src, mem)
 19319  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 19320  		v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19321  		v2.AddArg2(src, mem)
 19322  		v1.AddArg3(dst, v2, mem)
 19323  		v.AddArg3(dst, v0, v1)
 19324  		return true
 19325  	}
 19326  	// match: (Move [8] dst src mem)
 19327  	// result: (MOVDstore dst (MOVDload src mem) mem)
 19328  	for {
 19329  		if auxIntToInt64(v.AuxInt) != 8 {
 19330  			break
 19331  		}
 19332  		dst := v_0
 19333  		src := v_1
 19334  		mem := v_2
 19335  		v.reset(OpARM64MOVDstore)
 19336  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19337  		v0.AddArg2(src, mem)
 19338  		v.AddArg3(dst, v0, mem)
 19339  		return true
 19340  	}
 19341  	// match: (Move [9] dst src mem)
 19342  	// result: (MOVBstore [8] dst (MOVBUload [8] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19343  	for {
 19344  		if auxIntToInt64(v.AuxInt) != 9 {
 19345  			break
 19346  		}
 19347  		dst := v_0
 19348  		src := v_1
 19349  		mem := v_2
 19350  		v.reset(OpARM64MOVBstore)
 19351  		v.AuxInt = int32ToAuxInt(8)
 19352  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 19353  		v0.AuxInt = int32ToAuxInt(8)
 19354  		v0.AddArg2(src, mem)
 19355  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19356  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19357  		v2.AddArg2(src, mem)
 19358  		v1.AddArg3(dst, v2, mem)
 19359  		v.AddArg3(dst, v0, v1)
 19360  		return true
 19361  	}
 19362  	// match: (Move [10] dst src mem)
 19363  	// result: (MOVHstore [8] dst (MOVHUload [8] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19364  	for {
 19365  		if auxIntToInt64(v.AuxInt) != 10 {
 19366  			break
 19367  		}
 19368  		dst := v_0
 19369  		src := v_1
 19370  		mem := v_2
 19371  		v.reset(OpARM64MOVHstore)
 19372  		v.AuxInt = int32ToAuxInt(8)
 19373  		v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 19374  		v0.AuxInt = int32ToAuxInt(8)
 19375  		v0.AddArg2(src, mem)
 19376  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19377  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19378  		v2.AddArg2(src, mem)
 19379  		v1.AddArg3(dst, v2, mem)
 19380  		v.AddArg3(dst, v0, v1)
 19381  		return true
 19382  	}
 19383  	// match: (Move [11] dst src mem)
 19384  	// result: (MOVDstore [3] dst (MOVDload [3] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19385  	for {
 19386  		if auxIntToInt64(v.AuxInt) != 11 {
 19387  			break
 19388  		}
 19389  		dst := v_0
 19390  		src := v_1
 19391  		mem := v_2
 19392  		v.reset(OpARM64MOVDstore)
 19393  		v.AuxInt = int32ToAuxInt(3)
 19394  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19395  		v0.AuxInt = int32ToAuxInt(3)
 19396  		v0.AddArg2(src, mem)
 19397  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19398  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19399  		v2.AddArg2(src, mem)
 19400  		v1.AddArg3(dst, v2, mem)
 19401  		v.AddArg3(dst, v0, v1)
 19402  		return true
 19403  	}
 19404  	// match: (Move [12] dst src mem)
 19405  	// result: (MOVWstore [8] dst (MOVWUload [8] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19406  	for {
 19407  		if auxIntToInt64(v.AuxInt) != 12 {
 19408  			break
 19409  		}
 19410  		dst := v_0
 19411  		src := v_1
 19412  		mem := v_2
 19413  		v.reset(OpARM64MOVWstore)
 19414  		v.AuxInt = int32ToAuxInt(8)
 19415  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 19416  		v0.AuxInt = int32ToAuxInt(8)
 19417  		v0.AddArg2(src, mem)
 19418  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19419  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19420  		v2.AddArg2(src, mem)
 19421  		v1.AddArg3(dst, v2, mem)
 19422  		v.AddArg3(dst, v0, v1)
 19423  		return true
 19424  	}
 19425  	// match: (Move [13] dst src mem)
 19426  	// result: (MOVDstore [5] dst (MOVDload [5] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19427  	for {
 19428  		if auxIntToInt64(v.AuxInt) != 13 {
 19429  			break
 19430  		}
 19431  		dst := v_0
 19432  		src := v_1
 19433  		mem := v_2
 19434  		v.reset(OpARM64MOVDstore)
 19435  		v.AuxInt = int32ToAuxInt(5)
 19436  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19437  		v0.AuxInt = int32ToAuxInt(5)
 19438  		v0.AddArg2(src, mem)
 19439  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19440  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19441  		v2.AddArg2(src, mem)
 19442  		v1.AddArg3(dst, v2, mem)
 19443  		v.AddArg3(dst, v0, v1)
 19444  		return true
 19445  	}
 19446  	// match: (Move [14] dst src mem)
 19447  	// result: (MOVDstore [6] dst (MOVDload [6] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19448  	for {
 19449  		if auxIntToInt64(v.AuxInt) != 14 {
 19450  			break
 19451  		}
 19452  		dst := v_0
 19453  		src := v_1
 19454  		mem := v_2
 19455  		v.reset(OpARM64MOVDstore)
 19456  		v.AuxInt = int32ToAuxInt(6)
 19457  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19458  		v0.AuxInt = int32ToAuxInt(6)
 19459  		v0.AddArg2(src, mem)
 19460  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19461  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19462  		v2.AddArg2(src, mem)
 19463  		v1.AddArg3(dst, v2, mem)
 19464  		v.AddArg3(dst, v0, v1)
 19465  		return true
 19466  	}
 19467  	// match: (Move [15] dst src mem)
 19468  	// result: (MOVDstore [7] dst (MOVDload [7] src mem) (MOVDstore dst (MOVDload src mem) mem))
 19469  	for {
 19470  		if auxIntToInt64(v.AuxInt) != 15 {
 19471  			break
 19472  		}
 19473  		dst := v_0
 19474  		src := v_1
 19475  		mem := v_2
 19476  		v.reset(OpARM64MOVDstore)
 19477  		v.AuxInt = int32ToAuxInt(7)
 19478  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19479  		v0.AuxInt = int32ToAuxInt(7)
 19480  		v0.AddArg2(src, mem)
 19481  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 19482  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19483  		v2.AddArg2(src, mem)
 19484  		v1.AddArg3(dst, v2, mem)
 19485  		v.AddArg3(dst, v0, v1)
 19486  		return true
 19487  	}
 19488  	// match: (Move [16] dst src mem)
 19489  	// result: (STP dst (Select0 <typ.UInt64> (LDP src mem)) (Select1 <typ.UInt64> (LDP src mem)) mem)
 19490  	for {
 19491  		if auxIntToInt64(v.AuxInt) != 16 {
 19492  			break
 19493  		}
 19494  		dst := v_0
 19495  		src := v_1
 19496  		mem := v_2
 19497  		v.reset(OpARM64STP)
 19498  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19499  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19500  		v1.AddArg2(src, mem)
 19501  		v0.AddArg(v1)
 19502  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19503  		v2.AddArg(v1)
 19504  		v.AddArg4(dst, v0, v2, mem)
 19505  		return true
 19506  	}
 19507  	// match: (Move [s] dst src mem)
 19508  	// cond: s > 16 && s <= 24
 19509  	// 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))
 19510  	for {
 19511  		s := auxIntToInt64(v.AuxInt)
 19512  		dst := v_0
 19513  		src := v_1
 19514  		mem := v_2
 19515  		if !(s > 16 && s <= 24) {
 19516  			break
 19517  		}
 19518  		v.reset(OpARM64MOVDstore)
 19519  		v.AuxInt = int32ToAuxInt(int32(s - 8))
 19520  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19521  		v0.AuxInt = int32ToAuxInt(int32(s - 8))
 19522  		v0.AddArg2(src, mem)
 19523  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19524  		v2 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19525  		v3 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19526  		v3.AddArg2(src, mem)
 19527  		v2.AddArg(v3)
 19528  		v4 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19529  		v4.AddArg(v3)
 19530  		v1.AddArg4(dst, v2, v4, mem)
 19531  		v.AddArg3(dst, v0, v1)
 19532  		return true
 19533  	}
 19534  	// match: (Move [s] dst src mem)
 19535  	// cond: s > 24 && s <= 32
 19536  	// 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))
 19537  	for {
 19538  		s := auxIntToInt64(v.AuxInt)
 19539  		dst := v_0
 19540  		src := v_1
 19541  		mem := v_2
 19542  		if !(s > 24 && s <= 32) {
 19543  			break
 19544  		}
 19545  		v.reset(OpARM64STP)
 19546  		v.AuxInt = int32ToAuxInt(int32(s - 16))
 19547  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19548  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19549  		v1.AuxInt = int32ToAuxInt(int32(s - 16))
 19550  		v1.AddArg2(src, mem)
 19551  		v0.AddArg(v1)
 19552  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19553  		v2.AddArg(v1)
 19554  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19555  		v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19556  		v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19557  		v5.AddArg2(src, mem)
 19558  		v4.AddArg(v5)
 19559  		v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19560  		v6.AddArg(v5)
 19561  		v3.AddArg4(dst, v4, v6, mem)
 19562  		v.AddArg4(dst, v0, v2, v3)
 19563  		return true
 19564  	}
 19565  	// match: (Move [s] dst src mem)
 19566  	// cond: s > 32 && s <= 40
 19567  	// 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)))
 19568  	for {
 19569  		s := auxIntToInt64(v.AuxInt)
 19570  		dst := v_0
 19571  		src := v_1
 19572  		mem := v_2
 19573  		if !(s > 32 && s <= 40) {
 19574  			break
 19575  		}
 19576  		v.reset(OpARM64MOVDstore)
 19577  		v.AuxInt = int32ToAuxInt(int32(s - 8))
 19578  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19579  		v0.AuxInt = int32ToAuxInt(int32(s - 8))
 19580  		v0.AddArg2(src, mem)
 19581  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19582  		v1.AuxInt = int32ToAuxInt(16)
 19583  		v2 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19584  		v3 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19585  		v3.AuxInt = int32ToAuxInt(16)
 19586  		v3.AddArg2(src, mem)
 19587  		v2.AddArg(v3)
 19588  		v4 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19589  		v4.AddArg(v3)
 19590  		v5 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19591  		v6 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19592  		v7 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19593  		v7.AddArg2(src, mem)
 19594  		v6.AddArg(v7)
 19595  		v8 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19596  		v8.AddArg(v7)
 19597  		v5.AddArg4(dst, v6, v8, mem)
 19598  		v1.AddArg4(dst, v2, v4, v5)
 19599  		v.AddArg3(dst, v0, v1)
 19600  		return true
 19601  	}
 19602  	// match: (Move [s] dst src mem)
 19603  	// cond: s > 40 && s <= 48
 19604  	// 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)))
 19605  	for {
 19606  		s := auxIntToInt64(v.AuxInt)
 19607  		dst := v_0
 19608  		src := v_1
 19609  		mem := v_2
 19610  		if !(s > 40 && s <= 48) {
 19611  			break
 19612  		}
 19613  		v.reset(OpARM64STP)
 19614  		v.AuxInt = int32ToAuxInt(int32(s - 16))
 19615  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19616  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19617  		v1.AuxInt = int32ToAuxInt(int32(s - 16))
 19618  		v1.AddArg2(src, mem)
 19619  		v0.AddArg(v1)
 19620  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19621  		v2.AddArg(v1)
 19622  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19623  		v3.AuxInt = int32ToAuxInt(16)
 19624  		v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19625  		v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19626  		v5.AuxInt = int32ToAuxInt(16)
 19627  		v5.AddArg2(src, mem)
 19628  		v4.AddArg(v5)
 19629  		v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19630  		v6.AddArg(v5)
 19631  		v7 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19632  		v8 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19633  		v9 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19634  		v9.AddArg2(src, mem)
 19635  		v8.AddArg(v9)
 19636  		v10 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19637  		v10.AddArg(v9)
 19638  		v7.AddArg4(dst, v8, v10, mem)
 19639  		v3.AddArg4(dst, v4, v6, v7)
 19640  		v.AddArg4(dst, v0, v2, v3)
 19641  		return true
 19642  	}
 19643  	// match: (Move [s] dst src mem)
 19644  	// cond: s > 48 && s <= 56
 19645  	// 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))))
 19646  	for {
 19647  		s := auxIntToInt64(v.AuxInt)
 19648  		dst := v_0
 19649  		src := v_1
 19650  		mem := v_2
 19651  		if !(s > 48 && s <= 56) {
 19652  			break
 19653  		}
 19654  		v.reset(OpARM64MOVDstore)
 19655  		v.AuxInt = int32ToAuxInt(int32(s - 8))
 19656  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 19657  		v0.AuxInt = int32ToAuxInt(int32(s - 8))
 19658  		v0.AddArg2(src, mem)
 19659  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19660  		v1.AuxInt = int32ToAuxInt(32)
 19661  		v2 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19662  		v3 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19663  		v3.AuxInt = int32ToAuxInt(32)
 19664  		v3.AddArg2(src, mem)
 19665  		v2.AddArg(v3)
 19666  		v4 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19667  		v4.AddArg(v3)
 19668  		v5 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19669  		v5.AuxInt = int32ToAuxInt(16)
 19670  		v6 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19671  		v7 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19672  		v7.AuxInt = int32ToAuxInt(16)
 19673  		v7.AddArg2(src, mem)
 19674  		v6.AddArg(v7)
 19675  		v8 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19676  		v8.AddArg(v7)
 19677  		v9 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19678  		v10 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19679  		v11 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19680  		v11.AddArg2(src, mem)
 19681  		v10.AddArg(v11)
 19682  		v12 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19683  		v12.AddArg(v11)
 19684  		v9.AddArg4(dst, v10, v12, mem)
 19685  		v5.AddArg4(dst, v6, v8, v9)
 19686  		v1.AddArg4(dst, v2, v4, v5)
 19687  		v.AddArg3(dst, v0, v1)
 19688  		return true
 19689  	}
 19690  	// match: (Move [s] dst src mem)
 19691  	// cond: s > 56 && s <= 64
 19692  	// 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))))
 19693  	for {
 19694  		s := auxIntToInt64(v.AuxInt)
 19695  		dst := v_0
 19696  		src := v_1
 19697  		mem := v_2
 19698  		if !(s > 56 && s <= 64) {
 19699  			break
 19700  		}
 19701  		v.reset(OpARM64STP)
 19702  		v.AuxInt = int32ToAuxInt(int32(s - 16))
 19703  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19704  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19705  		v1.AuxInt = int32ToAuxInt(int32(s - 16))
 19706  		v1.AddArg2(src, mem)
 19707  		v0.AddArg(v1)
 19708  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19709  		v2.AddArg(v1)
 19710  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19711  		v3.AuxInt = int32ToAuxInt(32)
 19712  		v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19713  		v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19714  		v5.AuxInt = int32ToAuxInt(32)
 19715  		v5.AddArg2(src, mem)
 19716  		v4.AddArg(v5)
 19717  		v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19718  		v6.AddArg(v5)
 19719  		v7 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19720  		v7.AuxInt = int32ToAuxInt(16)
 19721  		v8 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19722  		v9 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19723  		v9.AuxInt = int32ToAuxInt(16)
 19724  		v9.AddArg2(src, mem)
 19725  		v8.AddArg(v9)
 19726  		v10 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19727  		v10.AddArg(v9)
 19728  		v11 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 19729  		v12 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 19730  		v13 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 19731  		v13.AddArg2(src, mem)
 19732  		v12.AddArg(v13)
 19733  		v14 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 19734  		v14.AddArg(v13)
 19735  		v11.AddArg4(dst, v12, v14, mem)
 19736  		v7.AddArg4(dst, v8, v10, v11)
 19737  		v3.AddArg4(dst, v4, v6, v7)
 19738  		v.AddArg4(dst, v0, v2, v3)
 19739  		return true
 19740  	}
 19741  	// match: (Move [s] dst src mem)
 19742  	// cond: s > 64 && s < 192 && logLargeCopy(v, s)
 19743  	// result: (LoweredMove [s] dst src mem)
 19744  	for {
 19745  		s := auxIntToInt64(v.AuxInt)
 19746  		dst := v_0
 19747  		src := v_1
 19748  		mem := v_2
 19749  		if !(s > 64 && s < 192 && logLargeCopy(v, s)) {
 19750  			break
 19751  		}
 19752  		v.reset(OpARM64LoweredMove)
 19753  		v.AuxInt = int64ToAuxInt(s)
 19754  		v.AddArg3(dst, src, mem)
 19755  		return true
 19756  	}
 19757  	// match: (Move [s] dst src mem)
 19758  	// cond: s >= 192 && logLargeCopy(v, s)
 19759  	// result: (LoweredMoveLoop [s] dst src mem)
 19760  	for {
 19761  		s := auxIntToInt64(v.AuxInt)
 19762  		dst := v_0
 19763  		src := v_1
 19764  		mem := v_2
 19765  		if !(s >= 192 && logLargeCopy(v, s)) {
 19766  			break
 19767  		}
 19768  		v.reset(OpARM64LoweredMoveLoop)
 19769  		v.AuxInt = int64ToAuxInt(s)
 19770  		v.AddArg3(dst, src, mem)
 19771  		return true
 19772  	}
 19773  	return false
 19774  }
 19775  func rewriteValueARM64_OpNeq16(v *Value) bool {
 19776  	v_1 := v.Args[1]
 19777  	v_0 := v.Args[0]
 19778  	b := v.Block
 19779  	typ := &b.Func.Config.Types
 19780  	// match: (Neq16 x y)
 19781  	// result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 19782  	for {
 19783  		x := v_0
 19784  		y := v_1
 19785  		v.reset(OpARM64NotEqual)
 19786  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 19787  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 19788  		v1.AddArg(x)
 19789  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 19790  		v2.AddArg(y)
 19791  		v0.AddArg2(v1, v2)
 19792  		v.AddArg(v0)
 19793  		return true
 19794  	}
 19795  }
 19796  func rewriteValueARM64_OpNeq32(v *Value) bool {
 19797  	v_1 := v.Args[1]
 19798  	v_0 := v.Args[0]
 19799  	b := v.Block
 19800  	// match: (Neq32 x y)
 19801  	// result: (NotEqual (CMPW x y))
 19802  	for {
 19803  		x := v_0
 19804  		y := v_1
 19805  		v.reset(OpARM64NotEqual)
 19806  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 19807  		v0.AddArg2(x, y)
 19808  		v.AddArg(v0)
 19809  		return true
 19810  	}
 19811  }
 19812  func rewriteValueARM64_OpNeq32F(v *Value) bool {
 19813  	v_1 := v.Args[1]
 19814  	v_0 := v.Args[0]
 19815  	b := v.Block
 19816  	// match: (Neq32F x y)
 19817  	// result: (NotEqual (FCMPS x y))
 19818  	for {
 19819  		x := v_0
 19820  		y := v_1
 19821  		v.reset(OpARM64NotEqual)
 19822  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 19823  		v0.AddArg2(x, y)
 19824  		v.AddArg(v0)
 19825  		return true
 19826  	}
 19827  }
 19828  func rewriteValueARM64_OpNeq64(v *Value) bool {
 19829  	v_1 := v.Args[1]
 19830  	v_0 := v.Args[0]
 19831  	b := v.Block
 19832  	// match: (Neq64 x y)
 19833  	// result: (NotEqual (CMP x y))
 19834  	for {
 19835  		x := v_0
 19836  		y := v_1
 19837  		v.reset(OpARM64NotEqual)
 19838  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 19839  		v0.AddArg2(x, y)
 19840  		v.AddArg(v0)
 19841  		return true
 19842  	}
 19843  }
 19844  func rewriteValueARM64_OpNeq64F(v *Value) bool {
 19845  	v_1 := v.Args[1]
 19846  	v_0 := v.Args[0]
 19847  	b := v.Block
 19848  	// match: (Neq64F x y)
 19849  	// result: (NotEqual (FCMPD x y))
 19850  	for {
 19851  		x := v_0
 19852  		y := v_1
 19853  		v.reset(OpARM64NotEqual)
 19854  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 19855  		v0.AddArg2(x, y)
 19856  		v.AddArg(v0)
 19857  		return true
 19858  	}
 19859  }
 19860  func rewriteValueARM64_OpNeq8(v *Value) bool {
 19861  	v_1 := v.Args[1]
 19862  	v_0 := v.Args[0]
 19863  	b := v.Block
 19864  	typ := &b.Func.Config.Types
 19865  	// match: (Neq8 x y)
 19866  	// result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 19867  	for {
 19868  		x := v_0
 19869  		y := v_1
 19870  		v.reset(OpARM64NotEqual)
 19871  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 19872  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 19873  		v1.AddArg(x)
 19874  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 19875  		v2.AddArg(y)
 19876  		v0.AddArg2(v1, v2)
 19877  		v.AddArg(v0)
 19878  		return true
 19879  	}
 19880  }
 19881  func rewriteValueARM64_OpNeqPtr(v *Value) bool {
 19882  	v_1 := v.Args[1]
 19883  	v_0 := v.Args[0]
 19884  	b := v.Block
 19885  	// match: (NeqPtr x y)
 19886  	// result: (NotEqual (CMP x y))
 19887  	for {
 19888  		x := v_0
 19889  		y := v_1
 19890  		v.reset(OpARM64NotEqual)
 19891  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 19892  		v0.AddArg2(x, y)
 19893  		v.AddArg(v0)
 19894  		return true
 19895  	}
 19896  }
 19897  func rewriteValueARM64_OpNot(v *Value) bool {
 19898  	v_0 := v.Args[0]
 19899  	b := v.Block
 19900  	typ := &b.Func.Config.Types
 19901  	// match: (Not x)
 19902  	// result: (XOR (MOVDconst [1]) x)
 19903  	for {
 19904  		x := v_0
 19905  		v.reset(OpARM64XOR)
 19906  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 19907  		v0.AuxInt = int64ToAuxInt(1)
 19908  		v.AddArg2(v0, x)
 19909  		return true
 19910  	}
 19911  }
 19912  func rewriteValueARM64_OpOffPtr(v *Value) bool {
 19913  	v_0 := v.Args[0]
 19914  	// match: (OffPtr [off] ptr:(SP))
 19915  	// cond: is32Bit(off)
 19916  	// result: (MOVDaddr [int32(off)] ptr)
 19917  	for {
 19918  		off := auxIntToInt64(v.AuxInt)
 19919  		ptr := v_0
 19920  		if ptr.Op != OpSP || !(is32Bit(off)) {
 19921  			break
 19922  		}
 19923  		v.reset(OpARM64MOVDaddr)
 19924  		v.AuxInt = int32ToAuxInt(int32(off))
 19925  		v.AddArg(ptr)
 19926  		return true
 19927  	}
 19928  	// match: (OffPtr [off] ptr)
 19929  	// result: (ADDconst [off] ptr)
 19930  	for {
 19931  		off := auxIntToInt64(v.AuxInt)
 19932  		ptr := v_0
 19933  		v.reset(OpARM64ADDconst)
 19934  		v.AuxInt = int64ToAuxInt(off)
 19935  		v.AddArg(ptr)
 19936  		return true
 19937  	}
 19938  }
 19939  func rewriteValueARM64_OpPopCount16(v *Value) bool {
 19940  	v_0 := v.Args[0]
 19941  	b := v.Block
 19942  	typ := &b.Func.Config.Types
 19943  	// match: (PopCount16 <t> x)
 19944  	// result: (FMOVDfpgp <t> (VUADDLV <typ.Float64> (VCNT <typ.Float64> (FMOVDgpfp <typ.Float64> (ZeroExt16to64 x)))))
 19945  	for {
 19946  		t := v.Type
 19947  		x := v_0
 19948  		v.reset(OpARM64FMOVDfpgp)
 19949  		v.Type = t
 19950  		v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
 19951  		v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
 19952  		v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
 19953  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 19954  		v3.AddArg(x)
 19955  		v2.AddArg(v3)
 19956  		v1.AddArg(v2)
 19957  		v0.AddArg(v1)
 19958  		v.AddArg(v0)
 19959  		return true
 19960  	}
 19961  }
 19962  func rewriteValueARM64_OpPopCount32(v *Value) bool {
 19963  	v_0 := v.Args[0]
 19964  	b := v.Block
 19965  	typ := &b.Func.Config.Types
 19966  	// match: (PopCount32 <t> x)
 19967  	// result: (FMOVDfpgp <t> (VUADDLV <typ.Float64> (VCNT <typ.Float64> (FMOVDgpfp <typ.Float64> (ZeroExt32to64 x)))))
 19968  	for {
 19969  		t := v.Type
 19970  		x := v_0
 19971  		v.reset(OpARM64FMOVDfpgp)
 19972  		v.Type = t
 19973  		v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
 19974  		v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
 19975  		v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
 19976  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 19977  		v3.AddArg(x)
 19978  		v2.AddArg(v3)
 19979  		v1.AddArg(v2)
 19980  		v0.AddArg(v1)
 19981  		v.AddArg(v0)
 19982  		return true
 19983  	}
 19984  }
 19985  func rewriteValueARM64_OpPopCount64(v *Value) bool {
 19986  	v_0 := v.Args[0]
 19987  	b := v.Block
 19988  	typ := &b.Func.Config.Types
 19989  	// match: (PopCount64 <t> x)
 19990  	// result: (FMOVDfpgp <t> (VUADDLV <typ.Float64> (VCNT <typ.Float64> (FMOVDgpfp <typ.Float64> x))))
 19991  	for {
 19992  		t := v.Type
 19993  		x := v_0
 19994  		v.reset(OpARM64FMOVDfpgp)
 19995  		v.Type = t
 19996  		v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
 19997  		v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
 19998  		v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
 19999  		v2.AddArg(x)
 20000  		v1.AddArg(v2)
 20001  		v0.AddArg(v1)
 20002  		v.AddArg(v0)
 20003  		return true
 20004  	}
 20005  }
 20006  func rewriteValueARM64_OpPrefetchCache(v *Value) bool {
 20007  	v_1 := v.Args[1]
 20008  	v_0 := v.Args[0]
 20009  	// match: (PrefetchCache addr mem)
 20010  	// result: (PRFM [0] addr mem)
 20011  	for {
 20012  		addr := v_0
 20013  		mem := v_1
 20014  		v.reset(OpARM64PRFM)
 20015  		v.AuxInt = int64ToAuxInt(0)
 20016  		v.AddArg2(addr, mem)
 20017  		return true
 20018  	}
 20019  }
 20020  func rewriteValueARM64_OpPrefetchCacheStreamed(v *Value) bool {
 20021  	v_1 := v.Args[1]
 20022  	v_0 := v.Args[0]
 20023  	// match: (PrefetchCacheStreamed addr mem)
 20024  	// result: (PRFM [1] addr mem)
 20025  	for {
 20026  		addr := v_0
 20027  		mem := v_1
 20028  		v.reset(OpARM64PRFM)
 20029  		v.AuxInt = int64ToAuxInt(1)
 20030  		v.AddArg2(addr, mem)
 20031  		return true
 20032  	}
 20033  }
 20034  func rewriteValueARM64_OpPubBarrier(v *Value) bool {
 20035  	v_0 := v.Args[0]
 20036  	// match: (PubBarrier mem)
 20037  	// result: (DMB [0xe] mem)
 20038  	for {
 20039  		mem := v_0
 20040  		v.reset(OpARM64DMB)
 20041  		v.AuxInt = int64ToAuxInt(0xe)
 20042  		v.AddArg(mem)
 20043  		return true
 20044  	}
 20045  }
 20046  func rewriteValueARM64_OpRotateLeft16(v *Value) bool {
 20047  	v_1 := v.Args[1]
 20048  	v_0 := v.Args[0]
 20049  	b := v.Block
 20050  	typ := &b.Func.Config.Types
 20051  	// match: (RotateLeft16 <t> x (MOVDconst [c]))
 20052  	// result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
 20053  	for {
 20054  		t := v.Type
 20055  		x := v_0
 20056  		if v_1.Op != OpARM64MOVDconst {
 20057  			break
 20058  		}
 20059  		c := auxIntToInt64(v_1.AuxInt)
 20060  		v.reset(OpOr16)
 20061  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 20062  		v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 20063  		v1.AuxInt = int64ToAuxInt(c & 15)
 20064  		v0.AddArg2(x, v1)
 20065  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 20066  		v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 20067  		v3.AuxInt = int64ToAuxInt(-c & 15)
 20068  		v2.AddArg2(x, v3)
 20069  		v.AddArg2(v0, v2)
 20070  		return true
 20071  	}
 20072  	// match: (RotateLeft16 <t> x y)
 20073  	// result: (RORW <t> (ORshiftLL <typ.UInt32> (ZeroExt16to32 x) (ZeroExt16to32 x) [16]) (NEG <typ.Int64> y))
 20074  	for {
 20075  		t := v.Type
 20076  		x := v_0
 20077  		y := v_1
 20078  		v.reset(OpARM64RORW)
 20079  		v.Type = t
 20080  		v0 := b.NewValue0(v.Pos, OpARM64ORshiftLL, typ.UInt32)
 20081  		v0.AuxInt = int64ToAuxInt(16)
 20082  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 20083  		v1.AddArg(x)
 20084  		v0.AddArg2(v1, v1)
 20085  		v2 := b.NewValue0(v.Pos, OpARM64NEG, typ.Int64)
 20086  		v2.AddArg(y)
 20087  		v.AddArg2(v0, v2)
 20088  		return true
 20089  	}
 20090  }
 20091  func rewriteValueARM64_OpRotateLeft32(v *Value) bool {
 20092  	v_1 := v.Args[1]
 20093  	v_0 := v.Args[0]
 20094  	b := v.Block
 20095  	// match: (RotateLeft32 x y)
 20096  	// result: (RORW x (NEG <y.Type> y))
 20097  	for {
 20098  		x := v_0
 20099  		y := v_1
 20100  		v.reset(OpARM64RORW)
 20101  		v0 := b.NewValue0(v.Pos, OpARM64NEG, y.Type)
 20102  		v0.AddArg(y)
 20103  		v.AddArg2(x, v0)
 20104  		return true
 20105  	}
 20106  }
 20107  func rewriteValueARM64_OpRotateLeft64(v *Value) bool {
 20108  	v_1 := v.Args[1]
 20109  	v_0 := v.Args[0]
 20110  	b := v.Block
 20111  	// match: (RotateLeft64 x y)
 20112  	// result: (ROR x (NEG <y.Type> y))
 20113  	for {
 20114  		x := v_0
 20115  		y := v_1
 20116  		v.reset(OpARM64ROR)
 20117  		v0 := b.NewValue0(v.Pos, OpARM64NEG, y.Type)
 20118  		v0.AddArg(y)
 20119  		v.AddArg2(x, v0)
 20120  		return true
 20121  	}
 20122  }
 20123  func rewriteValueARM64_OpRotateLeft8(v *Value) bool {
 20124  	v_1 := v.Args[1]
 20125  	v_0 := v.Args[0]
 20126  	b := v.Block
 20127  	typ := &b.Func.Config.Types
 20128  	// match: (RotateLeft8 <t> x (MOVDconst [c]))
 20129  	// result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
 20130  	for {
 20131  		t := v.Type
 20132  		x := v_0
 20133  		if v_1.Op != OpARM64MOVDconst {
 20134  			break
 20135  		}
 20136  		c := auxIntToInt64(v_1.AuxInt)
 20137  		v.reset(OpOr8)
 20138  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 20139  		v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 20140  		v1.AuxInt = int64ToAuxInt(c & 7)
 20141  		v0.AddArg2(x, v1)
 20142  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 20143  		v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 20144  		v3.AuxInt = int64ToAuxInt(-c & 7)
 20145  		v2.AddArg2(x, v3)
 20146  		v.AddArg2(v0, v2)
 20147  		return true
 20148  	}
 20149  	// match: (RotateLeft8 <t> x y)
 20150  	// result: (OR <t> (SLL <t> x (ANDconst <typ.Int64> [7] y)) (SRL <t> (ZeroExt8to64 x) (ANDconst <typ.Int64> [7] (NEG <typ.Int64> y))))
 20151  	for {
 20152  		t := v.Type
 20153  		x := v_0
 20154  		y := v_1
 20155  		v.reset(OpARM64OR)
 20156  		v.Type = t
 20157  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 20158  		v1 := b.NewValue0(v.Pos, OpARM64ANDconst, typ.Int64)
 20159  		v1.AuxInt = int64ToAuxInt(7)
 20160  		v1.AddArg(y)
 20161  		v0.AddArg2(x, v1)
 20162  		v2 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20163  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20164  		v3.AddArg(x)
 20165  		v4 := b.NewValue0(v.Pos, OpARM64ANDconst, typ.Int64)
 20166  		v4.AuxInt = int64ToAuxInt(7)
 20167  		v5 := b.NewValue0(v.Pos, OpARM64NEG, typ.Int64)
 20168  		v5.AddArg(y)
 20169  		v4.AddArg(v5)
 20170  		v2.AddArg2(v3, v4)
 20171  		v.AddArg2(v0, v2)
 20172  		return true
 20173  	}
 20174  }
 20175  func rewriteValueARM64_OpRsh16Ux16(v *Value) bool {
 20176  	v_1 := v.Args[1]
 20177  	v_0 := v.Args[0]
 20178  	b := v.Block
 20179  	typ := &b.Func.Config.Types
 20180  	// match: (Rsh16Ux16 <t> x y)
 20181  	// cond: shiftIsBounded(v)
 20182  	// result: (SRL <t> (ZeroExt16to64 x) y)
 20183  	for {
 20184  		t := v.Type
 20185  		x := v_0
 20186  		y := v_1
 20187  		if !(shiftIsBounded(v)) {
 20188  			break
 20189  		}
 20190  		v.reset(OpARM64SRL)
 20191  		v.Type = t
 20192  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20193  		v0.AddArg(x)
 20194  		v.AddArg2(v0, y)
 20195  		return true
 20196  	}
 20197  	// match: (Rsh16Ux16 <t> x y)
 20198  	// cond: !shiftIsBounded(v)
 20199  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 20200  	for {
 20201  		t := v.Type
 20202  		x := v_0
 20203  		y := v_1
 20204  		if !(!shiftIsBounded(v)) {
 20205  			break
 20206  		}
 20207  		v.reset(OpARM64CSEL)
 20208  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20209  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20210  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20211  		v1.AddArg(x)
 20212  		v0.AddArg2(v1, y)
 20213  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20214  		v2.AuxInt = int64ToAuxInt(0)
 20215  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20216  		v3.AuxInt = int64ToAuxInt(64)
 20217  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20218  		v4.AddArg(y)
 20219  		v3.AddArg(v4)
 20220  		v.AddArg3(v0, v2, v3)
 20221  		return true
 20222  	}
 20223  	return false
 20224  }
 20225  func rewriteValueARM64_OpRsh16Ux32(v *Value) bool {
 20226  	v_1 := v.Args[1]
 20227  	v_0 := v.Args[0]
 20228  	b := v.Block
 20229  	typ := &b.Func.Config.Types
 20230  	// match: (Rsh16Ux32 <t> x y)
 20231  	// cond: shiftIsBounded(v)
 20232  	// result: (SRL <t> (ZeroExt16to64 x) y)
 20233  	for {
 20234  		t := v.Type
 20235  		x := v_0
 20236  		y := v_1
 20237  		if !(shiftIsBounded(v)) {
 20238  			break
 20239  		}
 20240  		v.reset(OpARM64SRL)
 20241  		v.Type = t
 20242  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20243  		v0.AddArg(x)
 20244  		v.AddArg2(v0, y)
 20245  		return true
 20246  	}
 20247  	// match: (Rsh16Ux32 <t> x y)
 20248  	// cond: !shiftIsBounded(v)
 20249  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 20250  	for {
 20251  		t := v.Type
 20252  		x := v_0
 20253  		y := v_1
 20254  		if !(!shiftIsBounded(v)) {
 20255  			break
 20256  		}
 20257  		v.reset(OpARM64CSEL)
 20258  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20259  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20260  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20261  		v1.AddArg(x)
 20262  		v0.AddArg2(v1, y)
 20263  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20264  		v2.AuxInt = int64ToAuxInt(0)
 20265  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20266  		v3.AuxInt = int64ToAuxInt(64)
 20267  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20268  		v4.AddArg(y)
 20269  		v3.AddArg(v4)
 20270  		v.AddArg3(v0, v2, v3)
 20271  		return true
 20272  	}
 20273  	return false
 20274  }
 20275  func rewriteValueARM64_OpRsh16Ux64(v *Value) bool {
 20276  	v_1 := v.Args[1]
 20277  	v_0 := v.Args[0]
 20278  	b := v.Block
 20279  	typ := &b.Func.Config.Types
 20280  	// match: (Rsh16Ux64 <t> x y)
 20281  	// cond: shiftIsBounded(v)
 20282  	// result: (SRL <t> (ZeroExt16to64 x) y)
 20283  	for {
 20284  		t := v.Type
 20285  		x := v_0
 20286  		y := v_1
 20287  		if !(shiftIsBounded(v)) {
 20288  			break
 20289  		}
 20290  		v.reset(OpARM64SRL)
 20291  		v.Type = t
 20292  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20293  		v0.AddArg(x)
 20294  		v.AddArg2(v0, y)
 20295  		return true
 20296  	}
 20297  	// match: (Rsh16Ux64 <t> x y)
 20298  	// cond: !shiftIsBounded(v)
 20299  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
 20300  	for {
 20301  		t := v.Type
 20302  		x := v_0
 20303  		y := v_1
 20304  		if !(!shiftIsBounded(v)) {
 20305  			break
 20306  		}
 20307  		v.reset(OpARM64CSEL)
 20308  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20309  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20310  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20311  		v1.AddArg(x)
 20312  		v0.AddArg2(v1, y)
 20313  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20314  		v2.AuxInt = int64ToAuxInt(0)
 20315  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20316  		v3.AuxInt = int64ToAuxInt(64)
 20317  		v3.AddArg(y)
 20318  		v.AddArg3(v0, v2, v3)
 20319  		return true
 20320  	}
 20321  	return false
 20322  }
 20323  func rewriteValueARM64_OpRsh16Ux8(v *Value) bool {
 20324  	v_1 := v.Args[1]
 20325  	v_0 := v.Args[0]
 20326  	b := v.Block
 20327  	typ := &b.Func.Config.Types
 20328  	// match: (Rsh16Ux8 <t> x y)
 20329  	// cond: shiftIsBounded(v)
 20330  	// result: (SRL <t> (ZeroExt16to64 x) y)
 20331  	for {
 20332  		t := v.Type
 20333  		x := v_0
 20334  		y := v_1
 20335  		if !(shiftIsBounded(v)) {
 20336  			break
 20337  		}
 20338  		v.reset(OpARM64SRL)
 20339  		v.Type = t
 20340  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20341  		v0.AddArg(x)
 20342  		v.AddArg2(v0, y)
 20343  		return true
 20344  	}
 20345  	// match: (Rsh16Ux8 <t> x y)
 20346  	// cond: !shiftIsBounded(v)
 20347  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 20348  	for {
 20349  		t := v.Type
 20350  		x := v_0
 20351  		y := v_1
 20352  		if !(!shiftIsBounded(v)) {
 20353  			break
 20354  		}
 20355  		v.reset(OpARM64CSEL)
 20356  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20357  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20358  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20359  		v1.AddArg(x)
 20360  		v0.AddArg2(v1, y)
 20361  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20362  		v2.AuxInt = int64ToAuxInt(0)
 20363  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20364  		v3.AuxInt = int64ToAuxInt(64)
 20365  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20366  		v4.AddArg(y)
 20367  		v3.AddArg(v4)
 20368  		v.AddArg3(v0, v2, v3)
 20369  		return true
 20370  	}
 20371  	return false
 20372  }
 20373  func rewriteValueARM64_OpRsh16x16(v *Value) bool {
 20374  	v_1 := v.Args[1]
 20375  	v_0 := v.Args[0]
 20376  	b := v.Block
 20377  	typ := &b.Func.Config.Types
 20378  	// match: (Rsh16x16 <t> x y)
 20379  	// cond: shiftIsBounded(v)
 20380  	// result: (SRA <t> (SignExt16to64 x) y)
 20381  	for {
 20382  		t := v.Type
 20383  		x := v_0
 20384  		y := v_1
 20385  		if !(shiftIsBounded(v)) {
 20386  			break
 20387  		}
 20388  		v.reset(OpARM64SRA)
 20389  		v.Type = t
 20390  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20391  		v0.AddArg(x)
 20392  		v.AddArg2(v0, y)
 20393  		return true
 20394  	}
 20395  	// match: (Rsh16x16 x y)
 20396  	// cond: !shiftIsBounded(v)
 20397  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 20398  	for {
 20399  		x := v_0
 20400  		y := v_1
 20401  		if !(!shiftIsBounded(v)) {
 20402  			break
 20403  		}
 20404  		v.reset(OpARM64SRA)
 20405  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20406  		v0.AddArg(x)
 20407  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20408  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20409  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20410  		v2.AuxInt = int64ToAuxInt(63)
 20411  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20412  		v3.AuxInt = int64ToAuxInt(64)
 20413  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20414  		v4.AddArg(y)
 20415  		v3.AddArg(v4)
 20416  		v1.AddArg3(y, v2, v3)
 20417  		v.AddArg2(v0, v1)
 20418  		return true
 20419  	}
 20420  	return false
 20421  }
 20422  func rewriteValueARM64_OpRsh16x32(v *Value) bool {
 20423  	v_1 := v.Args[1]
 20424  	v_0 := v.Args[0]
 20425  	b := v.Block
 20426  	typ := &b.Func.Config.Types
 20427  	// match: (Rsh16x32 <t> x y)
 20428  	// cond: shiftIsBounded(v)
 20429  	// result: (SRA <t> (SignExt16to64 x) y)
 20430  	for {
 20431  		t := v.Type
 20432  		x := v_0
 20433  		y := v_1
 20434  		if !(shiftIsBounded(v)) {
 20435  			break
 20436  		}
 20437  		v.reset(OpARM64SRA)
 20438  		v.Type = t
 20439  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20440  		v0.AddArg(x)
 20441  		v.AddArg2(v0, y)
 20442  		return true
 20443  	}
 20444  	// match: (Rsh16x32 x y)
 20445  	// cond: !shiftIsBounded(v)
 20446  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 20447  	for {
 20448  		x := v_0
 20449  		y := v_1
 20450  		if !(!shiftIsBounded(v)) {
 20451  			break
 20452  		}
 20453  		v.reset(OpARM64SRA)
 20454  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20455  		v0.AddArg(x)
 20456  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20457  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20458  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20459  		v2.AuxInt = int64ToAuxInt(63)
 20460  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20461  		v3.AuxInt = int64ToAuxInt(64)
 20462  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20463  		v4.AddArg(y)
 20464  		v3.AddArg(v4)
 20465  		v1.AddArg3(y, v2, v3)
 20466  		v.AddArg2(v0, v1)
 20467  		return true
 20468  	}
 20469  	return false
 20470  }
 20471  func rewriteValueARM64_OpRsh16x64(v *Value) bool {
 20472  	v_1 := v.Args[1]
 20473  	v_0 := v.Args[0]
 20474  	b := v.Block
 20475  	typ := &b.Func.Config.Types
 20476  	// match: (Rsh16x64 <t> x y)
 20477  	// cond: shiftIsBounded(v)
 20478  	// result: (SRA <t> (SignExt16to64 x) y)
 20479  	for {
 20480  		t := v.Type
 20481  		x := v_0
 20482  		y := v_1
 20483  		if !(shiftIsBounded(v)) {
 20484  			break
 20485  		}
 20486  		v.reset(OpARM64SRA)
 20487  		v.Type = t
 20488  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20489  		v0.AddArg(x)
 20490  		v.AddArg2(v0, y)
 20491  		return true
 20492  	}
 20493  	// match: (Rsh16x64 x y)
 20494  	// cond: !shiftIsBounded(v)
 20495  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 20496  	for {
 20497  		x := v_0
 20498  		y := v_1
 20499  		if !(!shiftIsBounded(v)) {
 20500  			break
 20501  		}
 20502  		v.reset(OpARM64SRA)
 20503  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20504  		v0.AddArg(x)
 20505  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20506  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20507  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20508  		v2.AuxInt = int64ToAuxInt(63)
 20509  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20510  		v3.AuxInt = int64ToAuxInt(64)
 20511  		v3.AddArg(y)
 20512  		v1.AddArg3(y, v2, v3)
 20513  		v.AddArg2(v0, v1)
 20514  		return true
 20515  	}
 20516  	return false
 20517  }
 20518  func rewriteValueARM64_OpRsh16x8(v *Value) bool {
 20519  	v_1 := v.Args[1]
 20520  	v_0 := v.Args[0]
 20521  	b := v.Block
 20522  	typ := &b.Func.Config.Types
 20523  	// match: (Rsh16x8 <t> x y)
 20524  	// cond: shiftIsBounded(v)
 20525  	// result: (SRA <t> (SignExt16to64 x) y)
 20526  	for {
 20527  		t := v.Type
 20528  		x := v_0
 20529  		y := v_1
 20530  		if !(shiftIsBounded(v)) {
 20531  			break
 20532  		}
 20533  		v.reset(OpARM64SRA)
 20534  		v.Type = t
 20535  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20536  		v0.AddArg(x)
 20537  		v.AddArg2(v0, y)
 20538  		return true
 20539  	}
 20540  	// match: (Rsh16x8 x y)
 20541  	// cond: !shiftIsBounded(v)
 20542  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 20543  	for {
 20544  		x := v_0
 20545  		y := v_1
 20546  		if !(!shiftIsBounded(v)) {
 20547  			break
 20548  		}
 20549  		v.reset(OpARM64SRA)
 20550  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 20551  		v0.AddArg(x)
 20552  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20553  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20554  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20555  		v2.AuxInt = int64ToAuxInt(63)
 20556  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20557  		v3.AuxInt = int64ToAuxInt(64)
 20558  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20559  		v4.AddArg(y)
 20560  		v3.AddArg(v4)
 20561  		v1.AddArg3(y, v2, v3)
 20562  		v.AddArg2(v0, v1)
 20563  		return true
 20564  	}
 20565  	return false
 20566  }
 20567  func rewriteValueARM64_OpRsh32Ux16(v *Value) bool {
 20568  	v_1 := v.Args[1]
 20569  	v_0 := v.Args[0]
 20570  	b := v.Block
 20571  	typ := &b.Func.Config.Types
 20572  	// match: (Rsh32Ux16 <t> x y)
 20573  	// cond: shiftIsBounded(v)
 20574  	// result: (SRL <t> (ZeroExt32to64 x) y)
 20575  	for {
 20576  		t := v.Type
 20577  		x := v_0
 20578  		y := v_1
 20579  		if !(shiftIsBounded(v)) {
 20580  			break
 20581  		}
 20582  		v.reset(OpARM64SRL)
 20583  		v.Type = t
 20584  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20585  		v0.AddArg(x)
 20586  		v.AddArg2(v0, y)
 20587  		return true
 20588  	}
 20589  	// match: (Rsh32Ux16 <t> x y)
 20590  	// cond: !shiftIsBounded(v)
 20591  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 20592  	for {
 20593  		t := v.Type
 20594  		x := v_0
 20595  		y := v_1
 20596  		if !(!shiftIsBounded(v)) {
 20597  			break
 20598  		}
 20599  		v.reset(OpARM64CSEL)
 20600  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20601  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20602  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20603  		v1.AddArg(x)
 20604  		v0.AddArg2(v1, y)
 20605  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20606  		v2.AuxInt = int64ToAuxInt(0)
 20607  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20608  		v3.AuxInt = int64ToAuxInt(64)
 20609  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20610  		v4.AddArg(y)
 20611  		v3.AddArg(v4)
 20612  		v.AddArg3(v0, v2, v3)
 20613  		return true
 20614  	}
 20615  	return false
 20616  }
 20617  func rewriteValueARM64_OpRsh32Ux32(v *Value) bool {
 20618  	v_1 := v.Args[1]
 20619  	v_0 := v.Args[0]
 20620  	b := v.Block
 20621  	typ := &b.Func.Config.Types
 20622  	// match: (Rsh32Ux32 <t> x y)
 20623  	// cond: shiftIsBounded(v)
 20624  	// result: (SRL <t> (ZeroExt32to64 x) y)
 20625  	for {
 20626  		t := v.Type
 20627  		x := v_0
 20628  		y := v_1
 20629  		if !(shiftIsBounded(v)) {
 20630  			break
 20631  		}
 20632  		v.reset(OpARM64SRL)
 20633  		v.Type = t
 20634  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20635  		v0.AddArg(x)
 20636  		v.AddArg2(v0, y)
 20637  		return true
 20638  	}
 20639  	// match: (Rsh32Ux32 <t> x y)
 20640  	// cond: !shiftIsBounded(v)
 20641  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 20642  	for {
 20643  		t := v.Type
 20644  		x := v_0
 20645  		y := v_1
 20646  		if !(!shiftIsBounded(v)) {
 20647  			break
 20648  		}
 20649  		v.reset(OpARM64CSEL)
 20650  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20651  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20652  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20653  		v1.AddArg(x)
 20654  		v0.AddArg2(v1, y)
 20655  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20656  		v2.AuxInt = int64ToAuxInt(0)
 20657  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20658  		v3.AuxInt = int64ToAuxInt(64)
 20659  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20660  		v4.AddArg(y)
 20661  		v3.AddArg(v4)
 20662  		v.AddArg3(v0, v2, v3)
 20663  		return true
 20664  	}
 20665  	return false
 20666  }
 20667  func rewriteValueARM64_OpRsh32Ux64(v *Value) bool {
 20668  	v_1 := v.Args[1]
 20669  	v_0 := v.Args[0]
 20670  	b := v.Block
 20671  	typ := &b.Func.Config.Types
 20672  	// match: (Rsh32Ux64 <t> x y)
 20673  	// cond: shiftIsBounded(v)
 20674  	// result: (SRL <t> (ZeroExt32to64 x) y)
 20675  	for {
 20676  		t := v.Type
 20677  		x := v_0
 20678  		y := v_1
 20679  		if !(shiftIsBounded(v)) {
 20680  			break
 20681  		}
 20682  		v.reset(OpARM64SRL)
 20683  		v.Type = t
 20684  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20685  		v0.AddArg(x)
 20686  		v.AddArg2(v0, y)
 20687  		return true
 20688  	}
 20689  	// match: (Rsh32Ux64 <t> x y)
 20690  	// cond: !shiftIsBounded(v)
 20691  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
 20692  	for {
 20693  		t := v.Type
 20694  		x := v_0
 20695  		y := v_1
 20696  		if !(!shiftIsBounded(v)) {
 20697  			break
 20698  		}
 20699  		v.reset(OpARM64CSEL)
 20700  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20701  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20702  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20703  		v1.AddArg(x)
 20704  		v0.AddArg2(v1, y)
 20705  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20706  		v2.AuxInt = int64ToAuxInt(0)
 20707  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20708  		v3.AuxInt = int64ToAuxInt(64)
 20709  		v3.AddArg(y)
 20710  		v.AddArg3(v0, v2, v3)
 20711  		return true
 20712  	}
 20713  	return false
 20714  }
 20715  func rewriteValueARM64_OpRsh32Ux8(v *Value) bool {
 20716  	v_1 := v.Args[1]
 20717  	v_0 := v.Args[0]
 20718  	b := v.Block
 20719  	typ := &b.Func.Config.Types
 20720  	// match: (Rsh32Ux8 <t> x y)
 20721  	// cond: shiftIsBounded(v)
 20722  	// result: (SRL <t> (ZeroExt32to64 x) y)
 20723  	for {
 20724  		t := v.Type
 20725  		x := v_0
 20726  		y := v_1
 20727  		if !(shiftIsBounded(v)) {
 20728  			break
 20729  		}
 20730  		v.reset(OpARM64SRL)
 20731  		v.Type = t
 20732  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20733  		v0.AddArg(x)
 20734  		v.AddArg2(v0, y)
 20735  		return true
 20736  	}
 20737  	// match: (Rsh32Ux8 <t> x y)
 20738  	// cond: !shiftIsBounded(v)
 20739  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 20740  	for {
 20741  		t := v.Type
 20742  		x := v_0
 20743  		y := v_1
 20744  		if !(!shiftIsBounded(v)) {
 20745  			break
 20746  		}
 20747  		v.reset(OpARM64CSEL)
 20748  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20749  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20750  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20751  		v1.AddArg(x)
 20752  		v0.AddArg2(v1, y)
 20753  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 20754  		v2.AuxInt = int64ToAuxInt(0)
 20755  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20756  		v3.AuxInt = int64ToAuxInt(64)
 20757  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20758  		v4.AddArg(y)
 20759  		v3.AddArg(v4)
 20760  		v.AddArg3(v0, v2, v3)
 20761  		return true
 20762  	}
 20763  	return false
 20764  }
 20765  func rewriteValueARM64_OpRsh32x16(v *Value) bool {
 20766  	v_1 := v.Args[1]
 20767  	v_0 := v.Args[0]
 20768  	b := v.Block
 20769  	typ := &b.Func.Config.Types
 20770  	// match: (Rsh32x16 <t> x y)
 20771  	// cond: shiftIsBounded(v)
 20772  	// result: (SRA <t> (SignExt32to64 x) y)
 20773  	for {
 20774  		t := v.Type
 20775  		x := v_0
 20776  		y := v_1
 20777  		if !(shiftIsBounded(v)) {
 20778  			break
 20779  		}
 20780  		v.reset(OpARM64SRA)
 20781  		v.Type = t
 20782  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20783  		v0.AddArg(x)
 20784  		v.AddArg2(v0, y)
 20785  		return true
 20786  	}
 20787  	// match: (Rsh32x16 x y)
 20788  	// cond: !shiftIsBounded(v)
 20789  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 20790  	for {
 20791  		x := v_0
 20792  		y := v_1
 20793  		if !(!shiftIsBounded(v)) {
 20794  			break
 20795  		}
 20796  		v.reset(OpARM64SRA)
 20797  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20798  		v0.AddArg(x)
 20799  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20800  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20801  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20802  		v2.AuxInt = int64ToAuxInt(63)
 20803  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20804  		v3.AuxInt = int64ToAuxInt(64)
 20805  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20806  		v4.AddArg(y)
 20807  		v3.AddArg(v4)
 20808  		v1.AddArg3(y, v2, v3)
 20809  		v.AddArg2(v0, v1)
 20810  		return true
 20811  	}
 20812  	return false
 20813  }
 20814  func rewriteValueARM64_OpRsh32x32(v *Value) bool {
 20815  	v_1 := v.Args[1]
 20816  	v_0 := v.Args[0]
 20817  	b := v.Block
 20818  	typ := &b.Func.Config.Types
 20819  	// match: (Rsh32x32 <t> x y)
 20820  	// cond: shiftIsBounded(v)
 20821  	// result: (SRA <t> (SignExt32to64 x) y)
 20822  	for {
 20823  		t := v.Type
 20824  		x := v_0
 20825  		y := v_1
 20826  		if !(shiftIsBounded(v)) {
 20827  			break
 20828  		}
 20829  		v.reset(OpARM64SRA)
 20830  		v.Type = t
 20831  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20832  		v0.AddArg(x)
 20833  		v.AddArg2(v0, y)
 20834  		return true
 20835  	}
 20836  	// match: (Rsh32x32 x y)
 20837  	// cond: !shiftIsBounded(v)
 20838  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 20839  	for {
 20840  		x := v_0
 20841  		y := v_1
 20842  		if !(!shiftIsBounded(v)) {
 20843  			break
 20844  		}
 20845  		v.reset(OpARM64SRA)
 20846  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20847  		v0.AddArg(x)
 20848  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20849  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20850  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20851  		v2.AuxInt = int64ToAuxInt(63)
 20852  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20853  		v3.AuxInt = int64ToAuxInt(64)
 20854  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20855  		v4.AddArg(y)
 20856  		v3.AddArg(v4)
 20857  		v1.AddArg3(y, v2, v3)
 20858  		v.AddArg2(v0, v1)
 20859  		return true
 20860  	}
 20861  	return false
 20862  }
 20863  func rewriteValueARM64_OpRsh32x64(v *Value) bool {
 20864  	v_1 := v.Args[1]
 20865  	v_0 := v.Args[0]
 20866  	b := v.Block
 20867  	typ := &b.Func.Config.Types
 20868  	// match: (Rsh32x64 <t> x y)
 20869  	// cond: shiftIsBounded(v)
 20870  	// result: (SRA <t> (SignExt32to64 x) y)
 20871  	for {
 20872  		t := v.Type
 20873  		x := v_0
 20874  		y := v_1
 20875  		if !(shiftIsBounded(v)) {
 20876  			break
 20877  		}
 20878  		v.reset(OpARM64SRA)
 20879  		v.Type = t
 20880  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20881  		v0.AddArg(x)
 20882  		v.AddArg2(v0, y)
 20883  		return true
 20884  	}
 20885  	// match: (Rsh32x64 x y)
 20886  	// cond: !shiftIsBounded(v)
 20887  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 20888  	for {
 20889  		x := v_0
 20890  		y := v_1
 20891  		if !(!shiftIsBounded(v)) {
 20892  			break
 20893  		}
 20894  		v.reset(OpARM64SRA)
 20895  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20896  		v0.AddArg(x)
 20897  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20898  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20899  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20900  		v2.AuxInt = int64ToAuxInt(63)
 20901  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20902  		v3.AuxInt = int64ToAuxInt(64)
 20903  		v3.AddArg(y)
 20904  		v1.AddArg3(y, v2, v3)
 20905  		v.AddArg2(v0, v1)
 20906  		return true
 20907  	}
 20908  	return false
 20909  }
 20910  func rewriteValueARM64_OpRsh32x8(v *Value) bool {
 20911  	v_1 := v.Args[1]
 20912  	v_0 := v.Args[0]
 20913  	b := v.Block
 20914  	typ := &b.Func.Config.Types
 20915  	// match: (Rsh32x8 <t> x y)
 20916  	// cond: shiftIsBounded(v)
 20917  	// result: (SRA <t> (SignExt32to64 x) y)
 20918  	for {
 20919  		t := v.Type
 20920  		x := v_0
 20921  		y := v_1
 20922  		if !(shiftIsBounded(v)) {
 20923  			break
 20924  		}
 20925  		v.reset(OpARM64SRA)
 20926  		v.Type = t
 20927  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20928  		v0.AddArg(x)
 20929  		v.AddArg2(v0, y)
 20930  		return true
 20931  	}
 20932  	// match: (Rsh32x8 x y)
 20933  	// cond: !shiftIsBounded(v)
 20934  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 20935  	for {
 20936  		x := v_0
 20937  		y := v_1
 20938  		if !(!shiftIsBounded(v)) {
 20939  			break
 20940  		}
 20941  		v.reset(OpARM64SRA)
 20942  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 20943  		v0.AddArg(x)
 20944  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 20945  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 20946  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 20947  		v2.AuxInt = int64ToAuxInt(63)
 20948  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20949  		v3.AuxInt = int64ToAuxInt(64)
 20950  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20951  		v4.AddArg(y)
 20952  		v3.AddArg(v4)
 20953  		v1.AddArg3(y, v2, v3)
 20954  		v.AddArg2(v0, v1)
 20955  		return true
 20956  	}
 20957  	return false
 20958  }
 20959  func rewriteValueARM64_OpRsh64Ux16(v *Value) bool {
 20960  	v_1 := v.Args[1]
 20961  	v_0 := v.Args[0]
 20962  	b := v.Block
 20963  	typ := &b.Func.Config.Types
 20964  	// match: (Rsh64Ux16 <t> x y)
 20965  	// cond: shiftIsBounded(v)
 20966  	// result: (SRL <t> x y)
 20967  	for {
 20968  		t := v.Type
 20969  		x := v_0
 20970  		y := v_1
 20971  		if !(shiftIsBounded(v)) {
 20972  			break
 20973  		}
 20974  		v.reset(OpARM64SRL)
 20975  		v.Type = t
 20976  		v.AddArg2(x, y)
 20977  		return true
 20978  	}
 20979  	// match: (Rsh64Ux16 <t> x y)
 20980  	// cond: !shiftIsBounded(v)
 20981  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 20982  	for {
 20983  		t := v.Type
 20984  		x := v_0
 20985  		y := v_1
 20986  		if !(!shiftIsBounded(v)) {
 20987  			break
 20988  		}
 20989  		v.reset(OpARM64CSEL)
 20990  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20991  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 20992  		v0.AddArg2(x, y)
 20993  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 20994  		v1.AuxInt = int64ToAuxInt(0)
 20995  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20996  		v2.AuxInt = int64ToAuxInt(64)
 20997  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20998  		v3.AddArg(y)
 20999  		v2.AddArg(v3)
 21000  		v.AddArg3(v0, v1, v2)
 21001  		return true
 21002  	}
 21003  	return false
 21004  }
 21005  func rewriteValueARM64_OpRsh64Ux32(v *Value) bool {
 21006  	v_1 := v.Args[1]
 21007  	v_0 := v.Args[0]
 21008  	b := v.Block
 21009  	typ := &b.Func.Config.Types
 21010  	// match: (Rsh64Ux32 <t> x y)
 21011  	// cond: shiftIsBounded(v)
 21012  	// result: (SRL <t> x y)
 21013  	for {
 21014  		t := v.Type
 21015  		x := v_0
 21016  		y := v_1
 21017  		if !(shiftIsBounded(v)) {
 21018  			break
 21019  		}
 21020  		v.reset(OpARM64SRL)
 21021  		v.Type = t
 21022  		v.AddArg2(x, y)
 21023  		return true
 21024  	}
 21025  	// match: (Rsh64Ux32 <t> x y)
 21026  	// cond: !shiftIsBounded(v)
 21027  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 21028  	for {
 21029  		t := v.Type
 21030  		x := v_0
 21031  		y := v_1
 21032  		if !(!shiftIsBounded(v)) {
 21033  			break
 21034  		}
 21035  		v.reset(OpARM64CSEL)
 21036  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21037  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21038  		v0.AddArg2(x, y)
 21039  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 21040  		v1.AuxInt = int64ToAuxInt(0)
 21041  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21042  		v2.AuxInt = int64ToAuxInt(64)
 21043  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21044  		v3.AddArg(y)
 21045  		v2.AddArg(v3)
 21046  		v.AddArg3(v0, v1, v2)
 21047  		return true
 21048  	}
 21049  	return false
 21050  }
 21051  func rewriteValueARM64_OpRsh64Ux64(v *Value) bool {
 21052  	v_1 := v.Args[1]
 21053  	v_0 := v.Args[0]
 21054  	b := v.Block
 21055  	// match: (Rsh64Ux64 <t> x y)
 21056  	// cond: shiftIsBounded(v)
 21057  	// result: (SRL <t> x y)
 21058  	for {
 21059  		t := v.Type
 21060  		x := v_0
 21061  		y := v_1
 21062  		if !(shiftIsBounded(v)) {
 21063  			break
 21064  		}
 21065  		v.reset(OpARM64SRL)
 21066  		v.Type = t
 21067  		v.AddArg2(x, y)
 21068  		return true
 21069  	}
 21070  	// match: (Rsh64Ux64 <t> x y)
 21071  	// cond: !shiftIsBounded(v)
 21072  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 21073  	for {
 21074  		t := v.Type
 21075  		x := v_0
 21076  		y := v_1
 21077  		if !(!shiftIsBounded(v)) {
 21078  			break
 21079  		}
 21080  		v.reset(OpARM64CSEL)
 21081  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21082  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21083  		v0.AddArg2(x, y)
 21084  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 21085  		v1.AuxInt = int64ToAuxInt(0)
 21086  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21087  		v2.AuxInt = int64ToAuxInt(64)
 21088  		v2.AddArg(y)
 21089  		v.AddArg3(v0, v1, v2)
 21090  		return true
 21091  	}
 21092  	return false
 21093  }
 21094  func rewriteValueARM64_OpRsh64Ux8(v *Value) bool {
 21095  	v_1 := v.Args[1]
 21096  	v_0 := v.Args[0]
 21097  	b := v.Block
 21098  	typ := &b.Func.Config.Types
 21099  	// match: (Rsh64Ux8 <t> x y)
 21100  	// cond: shiftIsBounded(v)
 21101  	// result: (SRL <t> x y)
 21102  	for {
 21103  		t := v.Type
 21104  		x := v_0
 21105  		y := v_1
 21106  		if !(shiftIsBounded(v)) {
 21107  			break
 21108  		}
 21109  		v.reset(OpARM64SRL)
 21110  		v.Type = t
 21111  		v.AddArg2(x, y)
 21112  		return true
 21113  	}
 21114  	// match: (Rsh64Ux8 <t> x y)
 21115  	// cond: !shiftIsBounded(v)
 21116  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 21117  	for {
 21118  		t := v.Type
 21119  		x := v_0
 21120  		y := v_1
 21121  		if !(!shiftIsBounded(v)) {
 21122  			break
 21123  		}
 21124  		v.reset(OpARM64CSEL)
 21125  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21126  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21127  		v0.AddArg2(x, y)
 21128  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 21129  		v1.AuxInt = int64ToAuxInt(0)
 21130  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21131  		v2.AuxInt = int64ToAuxInt(64)
 21132  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21133  		v3.AddArg(y)
 21134  		v2.AddArg(v3)
 21135  		v.AddArg3(v0, v1, v2)
 21136  		return true
 21137  	}
 21138  	return false
 21139  }
 21140  func rewriteValueARM64_OpRsh64x16(v *Value) bool {
 21141  	v_1 := v.Args[1]
 21142  	v_0 := v.Args[0]
 21143  	b := v.Block
 21144  	typ := &b.Func.Config.Types
 21145  	// match: (Rsh64x16 <t> x y)
 21146  	// cond: shiftIsBounded(v)
 21147  	// result: (SRA <t> x y)
 21148  	for {
 21149  		t := v.Type
 21150  		x := v_0
 21151  		y := v_1
 21152  		if !(shiftIsBounded(v)) {
 21153  			break
 21154  		}
 21155  		v.reset(OpARM64SRA)
 21156  		v.Type = t
 21157  		v.AddArg2(x, y)
 21158  		return true
 21159  	}
 21160  	// match: (Rsh64x16 x y)
 21161  	// cond: !shiftIsBounded(v)
 21162  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 21163  	for {
 21164  		x := v_0
 21165  		y := v_1
 21166  		if !(!shiftIsBounded(v)) {
 21167  			break
 21168  		}
 21169  		v.reset(OpARM64SRA)
 21170  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21171  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 21172  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21173  		v1.AuxInt = int64ToAuxInt(63)
 21174  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21175  		v2.AuxInt = int64ToAuxInt(64)
 21176  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21177  		v3.AddArg(y)
 21178  		v2.AddArg(v3)
 21179  		v0.AddArg3(y, v1, v2)
 21180  		v.AddArg2(x, v0)
 21181  		return true
 21182  	}
 21183  	return false
 21184  }
 21185  func rewriteValueARM64_OpRsh64x32(v *Value) bool {
 21186  	v_1 := v.Args[1]
 21187  	v_0 := v.Args[0]
 21188  	b := v.Block
 21189  	typ := &b.Func.Config.Types
 21190  	// match: (Rsh64x32 <t> x y)
 21191  	// cond: shiftIsBounded(v)
 21192  	// result: (SRA <t> x y)
 21193  	for {
 21194  		t := v.Type
 21195  		x := v_0
 21196  		y := v_1
 21197  		if !(shiftIsBounded(v)) {
 21198  			break
 21199  		}
 21200  		v.reset(OpARM64SRA)
 21201  		v.Type = t
 21202  		v.AddArg2(x, y)
 21203  		return true
 21204  	}
 21205  	// match: (Rsh64x32 x y)
 21206  	// cond: !shiftIsBounded(v)
 21207  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 21208  	for {
 21209  		x := v_0
 21210  		y := v_1
 21211  		if !(!shiftIsBounded(v)) {
 21212  			break
 21213  		}
 21214  		v.reset(OpARM64SRA)
 21215  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21216  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 21217  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21218  		v1.AuxInt = int64ToAuxInt(63)
 21219  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21220  		v2.AuxInt = int64ToAuxInt(64)
 21221  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21222  		v3.AddArg(y)
 21223  		v2.AddArg(v3)
 21224  		v0.AddArg3(y, v1, v2)
 21225  		v.AddArg2(x, v0)
 21226  		return true
 21227  	}
 21228  	return false
 21229  }
 21230  func rewriteValueARM64_OpRsh64x64(v *Value) bool {
 21231  	v_1 := v.Args[1]
 21232  	v_0 := v.Args[0]
 21233  	b := v.Block
 21234  	// match: (Rsh64x64 <t> x y)
 21235  	// cond: shiftIsBounded(v)
 21236  	// result: (SRA <t> x y)
 21237  	for {
 21238  		t := v.Type
 21239  		x := v_0
 21240  		y := v_1
 21241  		if !(shiftIsBounded(v)) {
 21242  			break
 21243  		}
 21244  		v.reset(OpARM64SRA)
 21245  		v.Type = t
 21246  		v.AddArg2(x, y)
 21247  		return true
 21248  	}
 21249  	// match: (Rsh64x64 x y)
 21250  	// cond: !shiftIsBounded(v)
 21251  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 21252  	for {
 21253  		x := v_0
 21254  		y := v_1
 21255  		if !(!shiftIsBounded(v)) {
 21256  			break
 21257  		}
 21258  		v.reset(OpARM64SRA)
 21259  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21260  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 21261  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21262  		v1.AuxInt = int64ToAuxInt(63)
 21263  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21264  		v2.AuxInt = int64ToAuxInt(64)
 21265  		v2.AddArg(y)
 21266  		v0.AddArg3(y, v1, v2)
 21267  		v.AddArg2(x, v0)
 21268  		return true
 21269  	}
 21270  	return false
 21271  }
 21272  func rewriteValueARM64_OpRsh64x8(v *Value) bool {
 21273  	v_1 := v.Args[1]
 21274  	v_0 := v.Args[0]
 21275  	b := v.Block
 21276  	typ := &b.Func.Config.Types
 21277  	// match: (Rsh64x8 <t> x y)
 21278  	// cond: shiftIsBounded(v)
 21279  	// result: (SRA <t> x y)
 21280  	for {
 21281  		t := v.Type
 21282  		x := v_0
 21283  		y := v_1
 21284  		if !(shiftIsBounded(v)) {
 21285  			break
 21286  		}
 21287  		v.reset(OpARM64SRA)
 21288  		v.Type = t
 21289  		v.AddArg2(x, y)
 21290  		return true
 21291  	}
 21292  	// match: (Rsh64x8 x y)
 21293  	// cond: !shiftIsBounded(v)
 21294  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 21295  	for {
 21296  		x := v_0
 21297  		y := v_1
 21298  		if !(!shiftIsBounded(v)) {
 21299  			break
 21300  		}
 21301  		v.reset(OpARM64SRA)
 21302  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21303  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 21304  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21305  		v1.AuxInt = int64ToAuxInt(63)
 21306  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21307  		v2.AuxInt = int64ToAuxInt(64)
 21308  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21309  		v3.AddArg(y)
 21310  		v2.AddArg(v3)
 21311  		v0.AddArg3(y, v1, v2)
 21312  		v.AddArg2(x, v0)
 21313  		return true
 21314  	}
 21315  	return false
 21316  }
 21317  func rewriteValueARM64_OpRsh8Ux16(v *Value) bool {
 21318  	v_1 := v.Args[1]
 21319  	v_0 := v.Args[0]
 21320  	b := v.Block
 21321  	typ := &b.Func.Config.Types
 21322  	// match: (Rsh8Ux16 <t> x y)
 21323  	// cond: shiftIsBounded(v)
 21324  	// result: (SRL <t> (ZeroExt8to64 x) y)
 21325  	for {
 21326  		t := v.Type
 21327  		x := v_0
 21328  		y := v_1
 21329  		if !(shiftIsBounded(v)) {
 21330  			break
 21331  		}
 21332  		v.reset(OpARM64SRL)
 21333  		v.Type = t
 21334  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21335  		v0.AddArg(x)
 21336  		v.AddArg2(v0, y)
 21337  		return true
 21338  	}
 21339  	// match: (Rsh8Ux16 <t> x y)
 21340  	// cond: !shiftIsBounded(v)
 21341  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 21342  	for {
 21343  		t := v.Type
 21344  		x := v_0
 21345  		y := v_1
 21346  		if !(!shiftIsBounded(v)) {
 21347  			break
 21348  		}
 21349  		v.reset(OpARM64CSEL)
 21350  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21351  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21352  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21353  		v1.AddArg(x)
 21354  		v0.AddArg2(v1, y)
 21355  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21356  		v2.AuxInt = int64ToAuxInt(0)
 21357  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21358  		v3.AuxInt = int64ToAuxInt(64)
 21359  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21360  		v4.AddArg(y)
 21361  		v3.AddArg(v4)
 21362  		v.AddArg3(v0, v2, v3)
 21363  		return true
 21364  	}
 21365  	return false
 21366  }
 21367  func rewriteValueARM64_OpRsh8Ux32(v *Value) bool {
 21368  	v_1 := v.Args[1]
 21369  	v_0 := v.Args[0]
 21370  	b := v.Block
 21371  	typ := &b.Func.Config.Types
 21372  	// match: (Rsh8Ux32 <t> x y)
 21373  	// cond: shiftIsBounded(v)
 21374  	// result: (SRL <t> (ZeroExt8to64 x) y)
 21375  	for {
 21376  		t := v.Type
 21377  		x := v_0
 21378  		y := v_1
 21379  		if !(shiftIsBounded(v)) {
 21380  			break
 21381  		}
 21382  		v.reset(OpARM64SRL)
 21383  		v.Type = t
 21384  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21385  		v0.AddArg(x)
 21386  		v.AddArg2(v0, y)
 21387  		return true
 21388  	}
 21389  	// match: (Rsh8Ux32 <t> x y)
 21390  	// cond: !shiftIsBounded(v)
 21391  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 21392  	for {
 21393  		t := v.Type
 21394  		x := v_0
 21395  		y := v_1
 21396  		if !(!shiftIsBounded(v)) {
 21397  			break
 21398  		}
 21399  		v.reset(OpARM64CSEL)
 21400  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21401  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21402  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21403  		v1.AddArg(x)
 21404  		v0.AddArg2(v1, y)
 21405  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21406  		v2.AuxInt = int64ToAuxInt(0)
 21407  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21408  		v3.AuxInt = int64ToAuxInt(64)
 21409  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21410  		v4.AddArg(y)
 21411  		v3.AddArg(v4)
 21412  		v.AddArg3(v0, v2, v3)
 21413  		return true
 21414  	}
 21415  	return false
 21416  }
 21417  func rewriteValueARM64_OpRsh8Ux64(v *Value) bool {
 21418  	v_1 := v.Args[1]
 21419  	v_0 := v.Args[0]
 21420  	b := v.Block
 21421  	typ := &b.Func.Config.Types
 21422  	// match: (Rsh8Ux64 <t> x y)
 21423  	// cond: shiftIsBounded(v)
 21424  	// result: (SRL <t> (ZeroExt8to64 x) y)
 21425  	for {
 21426  		t := v.Type
 21427  		x := v_0
 21428  		y := v_1
 21429  		if !(shiftIsBounded(v)) {
 21430  			break
 21431  		}
 21432  		v.reset(OpARM64SRL)
 21433  		v.Type = t
 21434  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21435  		v0.AddArg(x)
 21436  		v.AddArg2(v0, y)
 21437  		return true
 21438  	}
 21439  	// match: (Rsh8Ux64 <t> x y)
 21440  	// cond: !shiftIsBounded(v)
 21441  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
 21442  	for {
 21443  		t := v.Type
 21444  		x := v_0
 21445  		y := v_1
 21446  		if !(!shiftIsBounded(v)) {
 21447  			break
 21448  		}
 21449  		v.reset(OpARM64CSEL)
 21450  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21451  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21452  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21453  		v1.AddArg(x)
 21454  		v0.AddArg2(v1, y)
 21455  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21456  		v2.AuxInt = int64ToAuxInt(0)
 21457  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21458  		v3.AuxInt = int64ToAuxInt(64)
 21459  		v3.AddArg(y)
 21460  		v.AddArg3(v0, v2, v3)
 21461  		return true
 21462  	}
 21463  	return false
 21464  }
 21465  func rewriteValueARM64_OpRsh8Ux8(v *Value) bool {
 21466  	v_1 := v.Args[1]
 21467  	v_0 := v.Args[0]
 21468  	b := v.Block
 21469  	typ := &b.Func.Config.Types
 21470  	// match: (Rsh8Ux8 <t> x y)
 21471  	// cond: shiftIsBounded(v)
 21472  	// result: (SRL <t> (ZeroExt8to64 x) y)
 21473  	for {
 21474  		t := v.Type
 21475  		x := v_0
 21476  		y := v_1
 21477  		if !(shiftIsBounded(v)) {
 21478  			break
 21479  		}
 21480  		v.reset(OpARM64SRL)
 21481  		v.Type = t
 21482  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21483  		v0.AddArg(x)
 21484  		v.AddArg2(v0, y)
 21485  		return true
 21486  	}
 21487  	// match: (Rsh8Ux8 <t> x y)
 21488  	// cond: !shiftIsBounded(v)
 21489  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 21490  	for {
 21491  		t := v.Type
 21492  		x := v_0
 21493  		y := v_1
 21494  		if !(!shiftIsBounded(v)) {
 21495  			break
 21496  		}
 21497  		v.reset(OpARM64CSEL)
 21498  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21499  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21500  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21501  		v1.AddArg(x)
 21502  		v0.AddArg2(v1, y)
 21503  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21504  		v2.AuxInt = int64ToAuxInt(0)
 21505  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21506  		v3.AuxInt = int64ToAuxInt(64)
 21507  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21508  		v4.AddArg(y)
 21509  		v3.AddArg(v4)
 21510  		v.AddArg3(v0, v2, v3)
 21511  		return true
 21512  	}
 21513  	return false
 21514  }
 21515  func rewriteValueARM64_OpRsh8x16(v *Value) bool {
 21516  	v_1 := v.Args[1]
 21517  	v_0 := v.Args[0]
 21518  	b := v.Block
 21519  	typ := &b.Func.Config.Types
 21520  	// match: (Rsh8x16 <t> x y)
 21521  	// cond: shiftIsBounded(v)
 21522  	// result: (SRA <t> (SignExt8to64 x) y)
 21523  	for {
 21524  		t := v.Type
 21525  		x := v_0
 21526  		y := v_1
 21527  		if !(shiftIsBounded(v)) {
 21528  			break
 21529  		}
 21530  		v.reset(OpARM64SRA)
 21531  		v.Type = t
 21532  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21533  		v0.AddArg(x)
 21534  		v.AddArg2(v0, y)
 21535  		return true
 21536  	}
 21537  	// match: (Rsh8x16 x y)
 21538  	// cond: !shiftIsBounded(v)
 21539  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 21540  	for {
 21541  		x := v_0
 21542  		y := v_1
 21543  		if !(!shiftIsBounded(v)) {
 21544  			break
 21545  		}
 21546  		v.reset(OpARM64SRA)
 21547  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21548  		v0.AddArg(x)
 21549  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21550  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21551  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21552  		v2.AuxInt = int64ToAuxInt(63)
 21553  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21554  		v3.AuxInt = int64ToAuxInt(64)
 21555  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21556  		v4.AddArg(y)
 21557  		v3.AddArg(v4)
 21558  		v1.AddArg3(y, v2, v3)
 21559  		v.AddArg2(v0, v1)
 21560  		return true
 21561  	}
 21562  	return false
 21563  }
 21564  func rewriteValueARM64_OpRsh8x32(v *Value) bool {
 21565  	v_1 := v.Args[1]
 21566  	v_0 := v.Args[0]
 21567  	b := v.Block
 21568  	typ := &b.Func.Config.Types
 21569  	// match: (Rsh8x32 <t> x y)
 21570  	// cond: shiftIsBounded(v)
 21571  	// result: (SRA <t> (SignExt8to64 x) y)
 21572  	for {
 21573  		t := v.Type
 21574  		x := v_0
 21575  		y := v_1
 21576  		if !(shiftIsBounded(v)) {
 21577  			break
 21578  		}
 21579  		v.reset(OpARM64SRA)
 21580  		v.Type = t
 21581  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21582  		v0.AddArg(x)
 21583  		v.AddArg2(v0, y)
 21584  		return true
 21585  	}
 21586  	// match: (Rsh8x32 x y)
 21587  	// cond: !shiftIsBounded(v)
 21588  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 21589  	for {
 21590  		x := v_0
 21591  		y := v_1
 21592  		if !(!shiftIsBounded(v)) {
 21593  			break
 21594  		}
 21595  		v.reset(OpARM64SRA)
 21596  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21597  		v0.AddArg(x)
 21598  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21599  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21600  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21601  		v2.AuxInt = int64ToAuxInt(63)
 21602  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21603  		v3.AuxInt = int64ToAuxInt(64)
 21604  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21605  		v4.AddArg(y)
 21606  		v3.AddArg(v4)
 21607  		v1.AddArg3(y, v2, v3)
 21608  		v.AddArg2(v0, v1)
 21609  		return true
 21610  	}
 21611  	return false
 21612  }
 21613  func rewriteValueARM64_OpRsh8x64(v *Value) bool {
 21614  	v_1 := v.Args[1]
 21615  	v_0 := v.Args[0]
 21616  	b := v.Block
 21617  	typ := &b.Func.Config.Types
 21618  	// match: (Rsh8x64 <t> x y)
 21619  	// cond: shiftIsBounded(v)
 21620  	// result: (SRA <t> (SignExt8to64 x) y)
 21621  	for {
 21622  		t := v.Type
 21623  		x := v_0
 21624  		y := v_1
 21625  		if !(shiftIsBounded(v)) {
 21626  			break
 21627  		}
 21628  		v.reset(OpARM64SRA)
 21629  		v.Type = t
 21630  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21631  		v0.AddArg(x)
 21632  		v.AddArg2(v0, y)
 21633  		return true
 21634  	}
 21635  	// match: (Rsh8x64 x y)
 21636  	// cond: !shiftIsBounded(v)
 21637  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 21638  	for {
 21639  		x := v_0
 21640  		y := v_1
 21641  		if !(!shiftIsBounded(v)) {
 21642  			break
 21643  		}
 21644  		v.reset(OpARM64SRA)
 21645  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21646  		v0.AddArg(x)
 21647  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21648  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21649  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21650  		v2.AuxInt = int64ToAuxInt(63)
 21651  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21652  		v3.AuxInt = int64ToAuxInt(64)
 21653  		v3.AddArg(y)
 21654  		v1.AddArg3(y, v2, v3)
 21655  		v.AddArg2(v0, v1)
 21656  		return true
 21657  	}
 21658  	return false
 21659  }
 21660  func rewriteValueARM64_OpRsh8x8(v *Value) bool {
 21661  	v_1 := v.Args[1]
 21662  	v_0 := v.Args[0]
 21663  	b := v.Block
 21664  	typ := &b.Func.Config.Types
 21665  	// match: (Rsh8x8 <t> x y)
 21666  	// cond: shiftIsBounded(v)
 21667  	// result: (SRA <t> (SignExt8to64 x) y)
 21668  	for {
 21669  		t := v.Type
 21670  		x := v_0
 21671  		y := v_1
 21672  		if !(shiftIsBounded(v)) {
 21673  			break
 21674  		}
 21675  		v.reset(OpARM64SRA)
 21676  		v.Type = t
 21677  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21678  		v0.AddArg(x)
 21679  		v.AddArg2(v0, y)
 21680  		return true
 21681  	}
 21682  	// match: (Rsh8x8 x y)
 21683  	// cond: !shiftIsBounded(v)
 21684  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 21685  	for {
 21686  		x := v_0
 21687  		y := v_1
 21688  		if !(!shiftIsBounded(v)) {
 21689  			break
 21690  		}
 21691  		v.reset(OpARM64SRA)
 21692  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 21693  		v0.AddArg(x)
 21694  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21695  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21696  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21697  		v2.AuxInt = int64ToAuxInt(63)
 21698  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21699  		v3.AuxInt = int64ToAuxInt(64)
 21700  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21701  		v4.AddArg(y)
 21702  		v3.AddArg(v4)
 21703  		v1.AddArg3(y, v2, v3)
 21704  		v.AddArg2(v0, v1)
 21705  		return true
 21706  	}
 21707  	return false
 21708  }
 21709  func rewriteValueARM64_OpSelect0(v *Value) bool {
 21710  	v_0 := v.Args[0]
 21711  	b := v.Block
 21712  	typ := &b.Func.Config.Types
 21713  	// match: (Select0 (Mul64uhilo x y))
 21714  	// result: (UMULH x y)
 21715  	for {
 21716  		if v_0.Op != OpMul64uhilo {
 21717  			break
 21718  		}
 21719  		y := v_0.Args[1]
 21720  		x := v_0.Args[0]
 21721  		v.reset(OpARM64UMULH)
 21722  		v.AddArg2(x, y)
 21723  		return true
 21724  	}
 21725  	// match: (Select0 (Add64carry x y c))
 21726  	// result: (Select0 <typ.UInt64> (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] c))))
 21727  	for {
 21728  		if v_0.Op != OpAdd64carry {
 21729  			break
 21730  		}
 21731  		c := v_0.Args[2]
 21732  		x := v_0.Args[0]
 21733  		y := v_0.Args[1]
 21734  		v.reset(OpSelect0)
 21735  		v.Type = typ.UInt64
 21736  		v0 := b.NewValue0(v.Pos, OpARM64ADCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21737  		v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21738  		v2 := b.NewValue0(v.Pos, OpARM64ADDSconstflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21739  		v2.AuxInt = int64ToAuxInt(-1)
 21740  		v2.AddArg(c)
 21741  		v1.AddArg(v2)
 21742  		v0.AddArg3(x, y, v1)
 21743  		v.AddArg(v0)
 21744  		return true
 21745  	}
 21746  	// match: (Select0 (Sub64borrow x y bo))
 21747  	// result: (Select0 <typ.UInt64> (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags bo))))
 21748  	for {
 21749  		if v_0.Op != OpSub64borrow {
 21750  			break
 21751  		}
 21752  		bo := v_0.Args[2]
 21753  		x := v_0.Args[0]
 21754  		y := v_0.Args[1]
 21755  		v.reset(OpSelect0)
 21756  		v.Type = typ.UInt64
 21757  		v0 := b.NewValue0(v.Pos, OpARM64SBCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21758  		v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21759  		v2 := b.NewValue0(v.Pos, OpARM64NEGSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21760  		v2.AddArg(bo)
 21761  		v1.AddArg(v2)
 21762  		v0.AddArg3(x, y, v1)
 21763  		v.AddArg(v0)
 21764  		return true
 21765  	}
 21766  	// match: (Select0 (Mul64uover x y))
 21767  	// result: (MUL x y)
 21768  	for {
 21769  		if v_0.Op != OpMul64uover {
 21770  			break
 21771  		}
 21772  		y := v_0.Args[1]
 21773  		x := v_0.Args[0]
 21774  		v.reset(OpARM64MUL)
 21775  		v.AddArg2(x, y)
 21776  		return true
 21777  	}
 21778  	return false
 21779  }
 21780  func rewriteValueARM64_OpSelect1(v *Value) bool {
 21781  	v_0 := v.Args[0]
 21782  	b := v.Block
 21783  	typ := &b.Func.Config.Types
 21784  	// match: (Select1 (Mul64uhilo x y))
 21785  	// result: (MUL x y)
 21786  	for {
 21787  		if v_0.Op != OpMul64uhilo {
 21788  			break
 21789  		}
 21790  		y := v_0.Args[1]
 21791  		x := v_0.Args[0]
 21792  		v.reset(OpARM64MUL)
 21793  		v.AddArg2(x, y)
 21794  		return true
 21795  	}
 21796  	// match: (Select1 (Add64carry x y c))
 21797  	// result: (ADCzerocarry <typ.UInt64> (Select1 <types.TypeFlags> (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] c)))))
 21798  	for {
 21799  		if v_0.Op != OpAdd64carry {
 21800  			break
 21801  		}
 21802  		c := v_0.Args[2]
 21803  		x := v_0.Args[0]
 21804  		y := v_0.Args[1]
 21805  		v.reset(OpARM64ADCzerocarry)
 21806  		v.Type = typ.UInt64
 21807  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21808  		v1 := b.NewValue0(v.Pos, OpARM64ADCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21809  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21810  		v3 := b.NewValue0(v.Pos, OpARM64ADDSconstflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21811  		v3.AuxInt = int64ToAuxInt(-1)
 21812  		v3.AddArg(c)
 21813  		v2.AddArg(v3)
 21814  		v1.AddArg3(x, y, v2)
 21815  		v0.AddArg(v1)
 21816  		v.AddArg(v0)
 21817  		return true
 21818  	}
 21819  	// match: (Select1 (Sub64borrow x y bo))
 21820  	// result: (NEG <typ.UInt64> (NGCzerocarry <typ.UInt64> (Select1 <types.TypeFlags> (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags bo))))))
 21821  	for {
 21822  		if v_0.Op != OpSub64borrow {
 21823  			break
 21824  		}
 21825  		bo := v_0.Args[2]
 21826  		x := v_0.Args[0]
 21827  		y := v_0.Args[1]
 21828  		v.reset(OpARM64NEG)
 21829  		v.Type = typ.UInt64
 21830  		v0 := b.NewValue0(v.Pos, OpARM64NGCzerocarry, typ.UInt64)
 21831  		v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21832  		v2 := b.NewValue0(v.Pos, OpARM64SBCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21833  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 21834  		v4 := b.NewValue0(v.Pos, OpARM64NEGSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 21835  		v4.AddArg(bo)
 21836  		v3.AddArg(v4)
 21837  		v2.AddArg3(x, y, v3)
 21838  		v1.AddArg(v2)
 21839  		v0.AddArg(v1)
 21840  		v.AddArg(v0)
 21841  		return true
 21842  	}
 21843  	// match: (Select1 (Mul64uover x y))
 21844  	// result: (NotEqual (CMPconst (UMULH <typ.UInt64> x y) [0]))
 21845  	for {
 21846  		if v_0.Op != OpMul64uover {
 21847  			break
 21848  		}
 21849  		y := v_0.Args[1]
 21850  		x := v_0.Args[0]
 21851  		v.reset(OpARM64NotEqual)
 21852  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21853  		v0.AuxInt = int64ToAuxInt(0)
 21854  		v1 := b.NewValue0(v.Pos, OpARM64UMULH, typ.UInt64)
 21855  		v1.AddArg2(x, y)
 21856  		v0.AddArg(v1)
 21857  		v.AddArg(v0)
 21858  		return true
 21859  	}
 21860  	return false
 21861  }
 21862  func rewriteValueARM64_OpSelectN(v *Value) bool {
 21863  	v_0 := v.Args[0]
 21864  	b := v.Block
 21865  	config := b.Func.Config
 21866  	// match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
 21867  	// 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)
 21868  	// result: (Move [sz] dst src mem)
 21869  	for {
 21870  		if auxIntToInt64(v.AuxInt) != 0 {
 21871  			break
 21872  		}
 21873  		call := v_0
 21874  		if call.Op != OpARM64CALLstatic || len(call.Args) != 1 {
 21875  			break
 21876  		}
 21877  		sym := auxToCall(call.Aux)
 21878  		s1 := call.Args[0]
 21879  		if s1.Op != OpARM64MOVDstore {
 21880  			break
 21881  		}
 21882  		_ = s1.Args[2]
 21883  		s1_1 := s1.Args[1]
 21884  		if s1_1.Op != OpARM64MOVDconst {
 21885  			break
 21886  		}
 21887  		sz := auxIntToInt64(s1_1.AuxInt)
 21888  		s2 := s1.Args[2]
 21889  		if s2.Op != OpARM64MOVDstore {
 21890  			break
 21891  		}
 21892  		_ = s2.Args[2]
 21893  		src := s2.Args[1]
 21894  		s3 := s2.Args[2]
 21895  		if s3.Op != OpARM64MOVDstore {
 21896  			break
 21897  		}
 21898  		mem := s3.Args[2]
 21899  		dst := s3.Args[1]
 21900  		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)) {
 21901  			break
 21902  		}
 21903  		v.reset(OpMove)
 21904  		v.AuxInt = int64ToAuxInt(sz)
 21905  		v.AddArg3(dst, src, mem)
 21906  		return true
 21907  	}
 21908  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
 21909  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 21910  	// result: (Move [sz] dst src mem)
 21911  	for {
 21912  		if auxIntToInt64(v.AuxInt) != 0 {
 21913  			break
 21914  		}
 21915  		call := v_0
 21916  		if call.Op != OpARM64CALLstatic || len(call.Args) != 4 {
 21917  			break
 21918  		}
 21919  		sym := auxToCall(call.Aux)
 21920  		mem := call.Args[3]
 21921  		dst := call.Args[0]
 21922  		src := call.Args[1]
 21923  		call_2 := call.Args[2]
 21924  		if call_2.Op != OpARM64MOVDconst {
 21925  			break
 21926  		}
 21927  		sz := auxIntToInt64(call_2.AuxInt)
 21928  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 21929  			break
 21930  		}
 21931  		v.reset(OpMove)
 21932  		v.AuxInt = int64ToAuxInt(sz)
 21933  		v.AddArg3(dst, src, mem)
 21934  		return true
 21935  	}
 21936  	return false
 21937  }
 21938  func rewriteValueARM64_OpSlicemask(v *Value) bool {
 21939  	v_0 := v.Args[0]
 21940  	b := v.Block
 21941  	// match: (Slicemask <t> x)
 21942  	// result: (SRAconst (NEG <t> x) [63])
 21943  	for {
 21944  		t := v.Type
 21945  		x := v_0
 21946  		v.reset(OpARM64SRAconst)
 21947  		v.AuxInt = int64ToAuxInt(63)
 21948  		v0 := b.NewValue0(v.Pos, OpARM64NEG, t)
 21949  		v0.AddArg(x)
 21950  		v.AddArg(v0)
 21951  		return true
 21952  	}
 21953  }
 21954  func rewriteValueARM64_OpStore(v *Value) bool {
 21955  	v_2 := v.Args[2]
 21956  	v_1 := v.Args[1]
 21957  	v_0 := v.Args[0]
 21958  	// match: (Store {t} ptr val mem)
 21959  	// cond: t.Size() == 1
 21960  	// result: (MOVBstore ptr val mem)
 21961  	for {
 21962  		t := auxToType(v.Aux)
 21963  		ptr := v_0
 21964  		val := v_1
 21965  		mem := v_2
 21966  		if !(t.Size() == 1) {
 21967  			break
 21968  		}
 21969  		v.reset(OpARM64MOVBstore)
 21970  		v.AddArg3(ptr, val, mem)
 21971  		return true
 21972  	}
 21973  	// match: (Store {t} ptr val mem)
 21974  	// cond: t.Size() == 2
 21975  	// result: (MOVHstore ptr val mem)
 21976  	for {
 21977  		t := auxToType(v.Aux)
 21978  		ptr := v_0
 21979  		val := v_1
 21980  		mem := v_2
 21981  		if !(t.Size() == 2) {
 21982  			break
 21983  		}
 21984  		v.reset(OpARM64MOVHstore)
 21985  		v.AddArg3(ptr, val, mem)
 21986  		return true
 21987  	}
 21988  	// match: (Store {t} ptr val mem)
 21989  	// cond: t.Size() == 4 && !t.IsFloat()
 21990  	// result: (MOVWstore ptr val mem)
 21991  	for {
 21992  		t := auxToType(v.Aux)
 21993  		ptr := v_0
 21994  		val := v_1
 21995  		mem := v_2
 21996  		if !(t.Size() == 4 && !t.IsFloat()) {
 21997  			break
 21998  		}
 21999  		v.reset(OpARM64MOVWstore)
 22000  		v.AddArg3(ptr, val, mem)
 22001  		return true
 22002  	}
 22003  	// match: (Store {t} ptr val mem)
 22004  	// cond: t.Size() == 8 && !t.IsFloat()
 22005  	// result: (MOVDstore ptr val mem)
 22006  	for {
 22007  		t := auxToType(v.Aux)
 22008  		ptr := v_0
 22009  		val := v_1
 22010  		mem := v_2
 22011  		if !(t.Size() == 8 && !t.IsFloat()) {
 22012  			break
 22013  		}
 22014  		v.reset(OpARM64MOVDstore)
 22015  		v.AddArg3(ptr, val, mem)
 22016  		return true
 22017  	}
 22018  	// match: (Store {t} ptr val mem)
 22019  	// cond: t.Size() == 4 && t.IsFloat()
 22020  	// result: (FMOVSstore ptr val mem)
 22021  	for {
 22022  		t := auxToType(v.Aux)
 22023  		ptr := v_0
 22024  		val := v_1
 22025  		mem := v_2
 22026  		if !(t.Size() == 4 && t.IsFloat()) {
 22027  			break
 22028  		}
 22029  		v.reset(OpARM64FMOVSstore)
 22030  		v.AddArg3(ptr, val, mem)
 22031  		return true
 22032  	}
 22033  	// match: (Store {t} ptr val mem)
 22034  	// cond: t.Size() == 8 && t.IsFloat()
 22035  	// result: (FMOVDstore ptr val mem)
 22036  	for {
 22037  		t := auxToType(v.Aux)
 22038  		ptr := v_0
 22039  		val := v_1
 22040  		mem := v_2
 22041  		if !(t.Size() == 8 && t.IsFloat()) {
 22042  			break
 22043  		}
 22044  		v.reset(OpARM64FMOVDstore)
 22045  		v.AddArg3(ptr, val, mem)
 22046  		return true
 22047  	}
 22048  	return false
 22049  }
 22050  func rewriteValueARM64_OpZero(v *Value) bool {
 22051  	v_1 := v.Args[1]
 22052  	v_0 := v.Args[0]
 22053  	b := v.Block
 22054  	typ := &b.Func.Config.Types
 22055  	// match: (Zero [0] _ mem)
 22056  	// result: mem
 22057  	for {
 22058  		if auxIntToInt64(v.AuxInt) != 0 {
 22059  			break
 22060  		}
 22061  		mem := v_1
 22062  		v.copyOf(mem)
 22063  		return true
 22064  	}
 22065  	// match: (Zero [1] ptr mem)
 22066  	// result: (MOVBstore ptr (MOVDconst [0]) mem)
 22067  	for {
 22068  		if auxIntToInt64(v.AuxInt) != 1 {
 22069  			break
 22070  		}
 22071  		ptr := v_0
 22072  		mem := v_1
 22073  		v.reset(OpARM64MOVBstore)
 22074  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22075  		v0.AuxInt = int64ToAuxInt(0)
 22076  		v.AddArg3(ptr, v0, mem)
 22077  		return true
 22078  	}
 22079  	// match: (Zero [2] ptr mem)
 22080  	// result: (MOVHstore ptr (MOVDconst [0]) mem)
 22081  	for {
 22082  		if auxIntToInt64(v.AuxInt) != 2 {
 22083  			break
 22084  		}
 22085  		ptr := v_0
 22086  		mem := v_1
 22087  		v.reset(OpARM64MOVHstore)
 22088  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22089  		v0.AuxInt = int64ToAuxInt(0)
 22090  		v.AddArg3(ptr, v0, mem)
 22091  		return true
 22092  	}
 22093  	// match: (Zero [4] ptr mem)
 22094  	// result: (MOVWstore ptr (MOVDconst [0]) mem)
 22095  	for {
 22096  		if auxIntToInt64(v.AuxInt) != 4 {
 22097  			break
 22098  		}
 22099  		ptr := v_0
 22100  		mem := v_1
 22101  		v.reset(OpARM64MOVWstore)
 22102  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22103  		v0.AuxInt = int64ToAuxInt(0)
 22104  		v.AddArg3(ptr, v0, mem)
 22105  		return true
 22106  	}
 22107  	// match: (Zero [3] ptr mem)
 22108  	// result: (MOVBstore [2] ptr (MOVDconst [0]) (MOVHstore ptr (MOVDconst [0]) mem))
 22109  	for {
 22110  		if auxIntToInt64(v.AuxInt) != 3 {
 22111  			break
 22112  		}
 22113  		ptr := v_0
 22114  		mem := v_1
 22115  		v.reset(OpARM64MOVBstore)
 22116  		v.AuxInt = int32ToAuxInt(2)
 22117  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22118  		v0.AuxInt = int64ToAuxInt(0)
 22119  		v1 := b.NewValue0(v.Pos, OpARM64MOVHstore, types.TypeMem)
 22120  		v1.AddArg3(ptr, v0, mem)
 22121  		v.AddArg3(ptr, v0, v1)
 22122  		return true
 22123  	}
 22124  	// match: (Zero [5] ptr mem)
 22125  	// result: (MOVBstore [4] ptr (MOVDconst [0]) (MOVWstore ptr (MOVDconst [0]) mem))
 22126  	for {
 22127  		if auxIntToInt64(v.AuxInt) != 5 {
 22128  			break
 22129  		}
 22130  		ptr := v_0
 22131  		mem := v_1
 22132  		v.reset(OpARM64MOVBstore)
 22133  		v.AuxInt = int32ToAuxInt(4)
 22134  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22135  		v0.AuxInt = int64ToAuxInt(0)
 22136  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 22137  		v1.AddArg3(ptr, v0, mem)
 22138  		v.AddArg3(ptr, v0, v1)
 22139  		return true
 22140  	}
 22141  	// match: (Zero [6] ptr mem)
 22142  	// result: (MOVHstore [4] ptr (MOVDconst [0]) (MOVWstore ptr (MOVDconst [0]) mem))
 22143  	for {
 22144  		if auxIntToInt64(v.AuxInt) != 6 {
 22145  			break
 22146  		}
 22147  		ptr := v_0
 22148  		mem := v_1
 22149  		v.reset(OpARM64MOVHstore)
 22150  		v.AuxInt = int32ToAuxInt(4)
 22151  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22152  		v0.AuxInt = int64ToAuxInt(0)
 22153  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 22154  		v1.AddArg3(ptr, v0, mem)
 22155  		v.AddArg3(ptr, v0, v1)
 22156  		return true
 22157  	}
 22158  	// match: (Zero [7] ptr mem)
 22159  	// result: (MOVWstore [3] ptr (MOVDconst [0]) (MOVWstore ptr (MOVDconst [0]) mem))
 22160  	for {
 22161  		if auxIntToInt64(v.AuxInt) != 7 {
 22162  			break
 22163  		}
 22164  		ptr := v_0
 22165  		mem := v_1
 22166  		v.reset(OpARM64MOVWstore)
 22167  		v.AuxInt = int32ToAuxInt(3)
 22168  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22169  		v0.AuxInt = int64ToAuxInt(0)
 22170  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 22171  		v1.AddArg3(ptr, v0, mem)
 22172  		v.AddArg3(ptr, v0, v1)
 22173  		return true
 22174  	}
 22175  	// match: (Zero [8] ptr mem)
 22176  	// result: (MOVDstore ptr (MOVDconst [0]) mem)
 22177  	for {
 22178  		if auxIntToInt64(v.AuxInt) != 8 {
 22179  			break
 22180  		}
 22181  		ptr := v_0
 22182  		mem := v_1
 22183  		v.reset(OpARM64MOVDstore)
 22184  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22185  		v0.AuxInt = int64ToAuxInt(0)
 22186  		v.AddArg3(ptr, v0, mem)
 22187  		return true
 22188  	}
 22189  	// match: (Zero [9] ptr mem)
 22190  	// result: (MOVBstore [8] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22191  	for {
 22192  		if auxIntToInt64(v.AuxInt) != 9 {
 22193  			break
 22194  		}
 22195  		ptr := v_0
 22196  		mem := v_1
 22197  		v.reset(OpARM64MOVBstore)
 22198  		v.AuxInt = int32ToAuxInt(8)
 22199  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22200  		v0.AuxInt = int64ToAuxInt(0)
 22201  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22202  		v1.AddArg3(ptr, v0, mem)
 22203  		v.AddArg3(ptr, v0, v1)
 22204  		return true
 22205  	}
 22206  	// match: (Zero [10] ptr mem)
 22207  	// result: (MOVHstore [8] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22208  	for {
 22209  		if auxIntToInt64(v.AuxInt) != 10 {
 22210  			break
 22211  		}
 22212  		ptr := v_0
 22213  		mem := v_1
 22214  		v.reset(OpARM64MOVHstore)
 22215  		v.AuxInt = int32ToAuxInt(8)
 22216  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22217  		v0.AuxInt = int64ToAuxInt(0)
 22218  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22219  		v1.AddArg3(ptr, v0, mem)
 22220  		v.AddArg3(ptr, v0, v1)
 22221  		return true
 22222  	}
 22223  	// match: (Zero [11] ptr mem)
 22224  	// result: (MOVDstore [3] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22225  	for {
 22226  		if auxIntToInt64(v.AuxInt) != 11 {
 22227  			break
 22228  		}
 22229  		ptr := v_0
 22230  		mem := v_1
 22231  		v.reset(OpARM64MOVDstore)
 22232  		v.AuxInt = int32ToAuxInt(3)
 22233  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22234  		v0.AuxInt = int64ToAuxInt(0)
 22235  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22236  		v1.AddArg3(ptr, v0, mem)
 22237  		v.AddArg3(ptr, v0, v1)
 22238  		return true
 22239  	}
 22240  	// match: (Zero [12] ptr mem)
 22241  	// result: (MOVWstore [8] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22242  	for {
 22243  		if auxIntToInt64(v.AuxInt) != 12 {
 22244  			break
 22245  		}
 22246  		ptr := v_0
 22247  		mem := v_1
 22248  		v.reset(OpARM64MOVWstore)
 22249  		v.AuxInt = int32ToAuxInt(8)
 22250  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22251  		v0.AuxInt = int64ToAuxInt(0)
 22252  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22253  		v1.AddArg3(ptr, v0, mem)
 22254  		v.AddArg3(ptr, v0, v1)
 22255  		return true
 22256  	}
 22257  	// match: (Zero [13] ptr mem)
 22258  	// result: (MOVDstore [5] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22259  	for {
 22260  		if auxIntToInt64(v.AuxInt) != 13 {
 22261  			break
 22262  		}
 22263  		ptr := v_0
 22264  		mem := v_1
 22265  		v.reset(OpARM64MOVDstore)
 22266  		v.AuxInt = int32ToAuxInt(5)
 22267  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22268  		v0.AuxInt = int64ToAuxInt(0)
 22269  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22270  		v1.AddArg3(ptr, v0, mem)
 22271  		v.AddArg3(ptr, v0, v1)
 22272  		return true
 22273  	}
 22274  	// match: (Zero [14] ptr mem)
 22275  	// result: (MOVDstore [6] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22276  	for {
 22277  		if auxIntToInt64(v.AuxInt) != 14 {
 22278  			break
 22279  		}
 22280  		ptr := v_0
 22281  		mem := v_1
 22282  		v.reset(OpARM64MOVDstore)
 22283  		v.AuxInt = int32ToAuxInt(6)
 22284  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22285  		v0.AuxInt = int64ToAuxInt(0)
 22286  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22287  		v1.AddArg3(ptr, v0, mem)
 22288  		v.AddArg3(ptr, v0, v1)
 22289  		return true
 22290  	}
 22291  	// match: (Zero [15] ptr mem)
 22292  	// result: (MOVDstore [7] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 22293  	for {
 22294  		if auxIntToInt64(v.AuxInt) != 15 {
 22295  			break
 22296  		}
 22297  		ptr := v_0
 22298  		mem := v_1
 22299  		v.reset(OpARM64MOVDstore)
 22300  		v.AuxInt = int32ToAuxInt(7)
 22301  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22302  		v0.AuxInt = int64ToAuxInt(0)
 22303  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 22304  		v1.AddArg3(ptr, v0, mem)
 22305  		v.AddArg3(ptr, v0, v1)
 22306  		return true
 22307  	}
 22308  	// match: (Zero [16] ptr mem)
 22309  	// result: (STP [0] ptr (MOVDconst [0]) (MOVDconst [0]) mem)
 22310  	for {
 22311  		if auxIntToInt64(v.AuxInt) != 16 {
 22312  			break
 22313  		}
 22314  		ptr := v_0
 22315  		mem := v_1
 22316  		v.reset(OpARM64STP)
 22317  		v.AuxInt = int32ToAuxInt(0)
 22318  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 22319  		v0.AuxInt = int64ToAuxInt(0)
 22320  		v.AddArg4(ptr, v0, v0, mem)
 22321  		return true
 22322  	}
 22323  	// match: (Zero [s] ptr mem)
 22324  	// cond: s > 16 && s < 192
 22325  	// result: (LoweredZero [s] ptr mem)
 22326  	for {
 22327  		s := auxIntToInt64(v.AuxInt)
 22328  		ptr := v_0
 22329  		mem := v_1
 22330  		if !(s > 16 && s < 192) {
 22331  			break
 22332  		}
 22333  		v.reset(OpARM64LoweredZero)
 22334  		v.AuxInt = int64ToAuxInt(s)
 22335  		v.AddArg2(ptr, mem)
 22336  		return true
 22337  	}
 22338  	// match: (Zero [s] ptr mem)
 22339  	// cond: s >= 192
 22340  	// result: (LoweredZeroLoop [s] ptr mem)
 22341  	for {
 22342  		s := auxIntToInt64(v.AuxInt)
 22343  		ptr := v_0
 22344  		mem := v_1
 22345  		if !(s >= 192) {
 22346  			break
 22347  		}
 22348  		v.reset(OpARM64LoweredZeroLoop)
 22349  		v.AuxInt = int64ToAuxInt(s)
 22350  		v.AddArg2(ptr, mem)
 22351  		return true
 22352  	}
 22353  	return false
 22354  }
 22355  func rewriteBlockARM64(b *Block) bool {
 22356  	typ := &b.Func.Config.Types
 22357  	switch b.Kind {
 22358  	case BlockARM64EQ:
 22359  		// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
 22360  		// cond: z.Uses == 1
 22361  		// result: (EQ (TST x y) yes no)
 22362  		for b.Controls[0].Op == OpARM64CMPconst {
 22363  			v_0 := b.Controls[0]
 22364  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22365  				break
 22366  			}
 22367  			z := v_0.Args[0]
 22368  			if z.Op != OpARM64AND {
 22369  				break
 22370  			}
 22371  			_ = z.Args[1]
 22372  			z_0 := z.Args[0]
 22373  			z_1 := z.Args[1]
 22374  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22375  				x := z_0
 22376  				y := z_1
 22377  				if !(z.Uses == 1) {
 22378  					continue
 22379  				}
 22380  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 22381  				v0.AddArg2(x, y)
 22382  				b.resetWithControl(BlockARM64EQ, v0)
 22383  				return true
 22384  			}
 22385  			break
 22386  		}
 22387  		// match: (EQ (CMPconst [0] x:(ANDconst [c] y)) yes no)
 22388  		// cond: x.Uses == 1
 22389  		// result: (EQ (TSTconst [c] y) yes no)
 22390  		for b.Controls[0].Op == OpARM64CMPconst {
 22391  			v_0 := b.Controls[0]
 22392  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22393  				break
 22394  			}
 22395  			x := v_0.Args[0]
 22396  			if x.Op != OpARM64ANDconst {
 22397  				break
 22398  			}
 22399  			c := auxIntToInt64(x.AuxInt)
 22400  			y := x.Args[0]
 22401  			if !(x.Uses == 1) {
 22402  				break
 22403  			}
 22404  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 22405  			v0.AuxInt = int64ToAuxInt(c)
 22406  			v0.AddArg(y)
 22407  			b.resetWithControl(BlockARM64EQ, v0)
 22408  			return true
 22409  		}
 22410  		// match: (EQ (CMPWconst [0] z:(AND x y)) yes no)
 22411  		// cond: z.Uses == 1
 22412  		// result: (EQ (TSTW x y) yes no)
 22413  		for b.Controls[0].Op == OpARM64CMPWconst {
 22414  			v_0 := b.Controls[0]
 22415  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22416  				break
 22417  			}
 22418  			z := v_0.Args[0]
 22419  			if z.Op != OpARM64AND {
 22420  				break
 22421  			}
 22422  			_ = z.Args[1]
 22423  			z_0 := z.Args[0]
 22424  			z_1 := z.Args[1]
 22425  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22426  				x := z_0
 22427  				y := z_1
 22428  				if !(z.Uses == 1) {
 22429  					continue
 22430  				}
 22431  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 22432  				v0.AddArg2(x, y)
 22433  				b.resetWithControl(BlockARM64EQ, v0)
 22434  				return true
 22435  			}
 22436  			break
 22437  		}
 22438  		// match: (EQ (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 22439  		// cond: x.Uses == 1
 22440  		// result: (EQ (TSTWconst [int32(c)] y) yes no)
 22441  		for b.Controls[0].Op == OpARM64CMPWconst {
 22442  			v_0 := b.Controls[0]
 22443  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22444  				break
 22445  			}
 22446  			x := v_0.Args[0]
 22447  			if x.Op != OpARM64ANDconst {
 22448  				break
 22449  			}
 22450  			c := auxIntToInt64(x.AuxInt)
 22451  			y := x.Args[0]
 22452  			if !(x.Uses == 1) {
 22453  				break
 22454  			}
 22455  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 22456  			v0.AuxInt = int32ToAuxInt(int32(c))
 22457  			v0.AddArg(y)
 22458  			b.resetWithControl(BlockARM64EQ, v0)
 22459  			return true
 22460  		}
 22461  		// match: (EQ (CMPconst [0] x:(ADDconst [c] y)) yes no)
 22462  		// cond: x.Uses == 1
 22463  		// result: (EQ (CMNconst [c] y) yes no)
 22464  		for b.Controls[0].Op == OpARM64CMPconst {
 22465  			v_0 := b.Controls[0]
 22466  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22467  				break
 22468  			}
 22469  			x := v_0.Args[0]
 22470  			if x.Op != OpARM64ADDconst {
 22471  				break
 22472  			}
 22473  			c := auxIntToInt64(x.AuxInt)
 22474  			y := x.Args[0]
 22475  			if !(x.Uses == 1) {
 22476  				break
 22477  			}
 22478  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 22479  			v0.AuxInt = int64ToAuxInt(c)
 22480  			v0.AddArg(y)
 22481  			b.resetWithControl(BlockARM64EQ, v0)
 22482  			return true
 22483  		}
 22484  		// match: (EQ (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 22485  		// cond: x.Uses == 1
 22486  		// result: (EQ (CMNWconst [int32(c)] y) yes no)
 22487  		for b.Controls[0].Op == OpARM64CMPWconst {
 22488  			v_0 := b.Controls[0]
 22489  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22490  				break
 22491  			}
 22492  			x := v_0.Args[0]
 22493  			if x.Op != OpARM64ADDconst {
 22494  				break
 22495  			}
 22496  			c := auxIntToInt64(x.AuxInt)
 22497  			y := x.Args[0]
 22498  			if !(x.Uses == 1) {
 22499  				break
 22500  			}
 22501  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 22502  			v0.AuxInt = int32ToAuxInt(int32(c))
 22503  			v0.AddArg(y)
 22504  			b.resetWithControl(BlockARM64EQ, v0)
 22505  			return true
 22506  		}
 22507  		// match: (EQ (CMPconst [0] z:(ADD x y)) yes no)
 22508  		// cond: z.Uses == 1
 22509  		// result: (EQ (CMN x y) yes no)
 22510  		for b.Controls[0].Op == OpARM64CMPconst {
 22511  			v_0 := b.Controls[0]
 22512  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22513  				break
 22514  			}
 22515  			z := v_0.Args[0]
 22516  			if z.Op != OpARM64ADD {
 22517  				break
 22518  			}
 22519  			_ = z.Args[1]
 22520  			z_0 := z.Args[0]
 22521  			z_1 := z.Args[1]
 22522  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22523  				x := z_0
 22524  				y := z_1
 22525  				if !(z.Uses == 1) {
 22526  					continue
 22527  				}
 22528  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 22529  				v0.AddArg2(x, y)
 22530  				b.resetWithControl(BlockARM64EQ, v0)
 22531  				return true
 22532  			}
 22533  			break
 22534  		}
 22535  		// match: (EQ (CMPWconst [0] z:(ADD x y)) yes no)
 22536  		// cond: z.Uses == 1
 22537  		// result: (EQ (CMNW x y) yes no)
 22538  		for b.Controls[0].Op == OpARM64CMPWconst {
 22539  			v_0 := b.Controls[0]
 22540  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22541  				break
 22542  			}
 22543  			z := v_0.Args[0]
 22544  			if z.Op != OpARM64ADD {
 22545  				break
 22546  			}
 22547  			_ = z.Args[1]
 22548  			z_0 := z.Args[0]
 22549  			z_1 := z.Args[1]
 22550  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22551  				x := z_0
 22552  				y := z_1
 22553  				if !(z.Uses == 1) {
 22554  					continue
 22555  				}
 22556  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 22557  				v0.AddArg2(x, y)
 22558  				b.resetWithControl(BlockARM64EQ, v0)
 22559  				return true
 22560  			}
 22561  			break
 22562  		}
 22563  		// match: (EQ (CMP x z:(NEG y)) yes no)
 22564  		// cond: z.Uses == 1
 22565  		// result: (EQ (CMN x y) yes no)
 22566  		for b.Controls[0].Op == OpARM64CMP {
 22567  			v_0 := b.Controls[0]
 22568  			_ = v_0.Args[1]
 22569  			x := v_0.Args[0]
 22570  			z := v_0.Args[1]
 22571  			if z.Op != OpARM64NEG {
 22572  				break
 22573  			}
 22574  			y := z.Args[0]
 22575  			if !(z.Uses == 1) {
 22576  				break
 22577  			}
 22578  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 22579  			v0.AddArg2(x, y)
 22580  			b.resetWithControl(BlockARM64EQ, v0)
 22581  			return true
 22582  		}
 22583  		// match: (EQ (CMPW x z:(NEG y)) yes no)
 22584  		// cond: z.Uses == 1
 22585  		// result: (EQ (CMNW x y) yes no)
 22586  		for b.Controls[0].Op == OpARM64CMPW {
 22587  			v_0 := b.Controls[0]
 22588  			_ = v_0.Args[1]
 22589  			x := v_0.Args[0]
 22590  			z := v_0.Args[1]
 22591  			if z.Op != OpARM64NEG {
 22592  				break
 22593  			}
 22594  			y := z.Args[0]
 22595  			if !(z.Uses == 1) {
 22596  				break
 22597  			}
 22598  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 22599  			v0.AddArg2(x, y)
 22600  			b.resetWithControl(BlockARM64EQ, v0)
 22601  			return true
 22602  		}
 22603  		// match: (EQ (CMPconst [0] x) yes no)
 22604  		// result: (Z x yes no)
 22605  		for b.Controls[0].Op == OpARM64CMPconst {
 22606  			v_0 := b.Controls[0]
 22607  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22608  				break
 22609  			}
 22610  			x := v_0.Args[0]
 22611  			b.resetWithControl(BlockARM64Z, x)
 22612  			return true
 22613  		}
 22614  		// match: (EQ (CMPWconst [0] x) yes no)
 22615  		// result: (ZW x yes no)
 22616  		for b.Controls[0].Op == OpARM64CMPWconst {
 22617  			v_0 := b.Controls[0]
 22618  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22619  				break
 22620  			}
 22621  			x := v_0.Args[0]
 22622  			b.resetWithControl(BlockARM64ZW, x)
 22623  			return true
 22624  		}
 22625  		// match: (EQ (CMPconst [0] z:(MADD a x y)) yes no)
 22626  		// cond: z.Uses==1
 22627  		// result: (EQ (CMN a (MUL <x.Type> x y)) yes no)
 22628  		for b.Controls[0].Op == OpARM64CMPconst {
 22629  			v_0 := b.Controls[0]
 22630  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22631  				break
 22632  			}
 22633  			z := v_0.Args[0]
 22634  			if z.Op != OpARM64MADD {
 22635  				break
 22636  			}
 22637  			y := z.Args[2]
 22638  			a := z.Args[0]
 22639  			x := z.Args[1]
 22640  			if !(z.Uses == 1) {
 22641  				break
 22642  			}
 22643  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 22644  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 22645  			v1.AddArg2(x, y)
 22646  			v0.AddArg2(a, v1)
 22647  			b.resetWithControl(BlockARM64EQ, v0)
 22648  			return true
 22649  		}
 22650  		// match: (EQ (CMPconst [0] z:(MSUB a x y)) yes no)
 22651  		// cond: z.Uses==1
 22652  		// result: (EQ (CMP a (MUL <x.Type> x y)) yes no)
 22653  		for b.Controls[0].Op == OpARM64CMPconst {
 22654  			v_0 := b.Controls[0]
 22655  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22656  				break
 22657  			}
 22658  			z := v_0.Args[0]
 22659  			if z.Op != OpARM64MSUB {
 22660  				break
 22661  			}
 22662  			y := z.Args[2]
 22663  			a := z.Args[0]
 22664  			x := z.Args[1]
 22665  			if !(z.Uses == 1) {
 22666  				break
 22667  			}
 22668  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 22669  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 22670  			v1.AddArg2(x, y)
 22671  			v0.AddArg2(a, v1)
 22672  			b.resetWithControl(BlockARM64EQ, v0)
 22673  			return true
 22674  		}
 22675  		// match: (EQ (CMPWconst [0] z:(MADDW a x y)) yes no)
 22676  		// cond: z.Uses==1
 22677  		// result: (EQ (CMNW a (MULW <x.Type> x y)) yes no)
 22678  		for b.Controls[0].Op == OpARM64CMPWconst {
 22679  			v_0 := b.Controls[0]
 22680  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22681  				break
 22682  			}
 22683  			z := v_0.Args[0]
 22684  			if z.Op != OpARM64MADDW {
 22685  				break
 22686  			}
 22687  			y := z.Args[2]
 22688  			a := z.Args[0]
 22689  			x := z.Args[1]
 22690  			if !(z.Uses == 1) {
 22691  				break
 22692  			}
 22693  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 22694  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 22695  			v1.AddArg2(x, y)
 22696  			v0.AddArg2(a, v1)
 22697  			b.resetWithControl(BlockARM64EQ, v0)
 22698  			return true
 22699  		}
 22700  		// match: (EQ (CMPWconst [0] z:(MSUBW a x y)) yes no)
 22701  		// cond: z.Uses==1
 22702  		// result: (EQ (CMPW a (MULW <x.Type> x y)) yes no)
 22703  		for b.Controls[0].Op == OpARM64CMPWconst {
 22704  			v_0 := b.Controls[0]
 22705  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22706  				break
 22707  			}
 22708  			z := v_0.Args[0]
 22709  			if z.Op != OpARM64MSUBW {
 22710  				break
 22711  			}
 22712  			y := z.Args[2]
 22713  			a := z.Args[0]
 22714  			x := z.Args[1]
 22715  			if !(z.Uses == 1) {
 22716  				break
 22717  			}
 22718  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 22719  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 22720  			v1.AddArg2(x, y)
 22721  			v0.AddArg2(a, v1)
 22722  			b.resetWithControl(BlockARM64EQ, v0)
 22723  			return true
 22724  		}
 22725  		// match: (EQ (TSTconst [c] x) yes no)
 22726  		// cond: oneBit(c)
 22727  		// result: (TBZ [int64(ntz64(c))] x yes no)
 22728  		for b.Controls[0].Op == OpARM64TSTconst {
 22729  			v_0 := b.Controls[0]
 22730  			c := auxIntToInt64(v_0.AuxInt)
 22731  			x := v_0.Args[0]
 22732  			if !(oneBit(c)) {
 22733  				break
 22734  			}
 22735  			b.resetWithControl(BlockARM64TBZ, x)
 22736  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 22737  			return true
 22738  		}
 22739  		// match: (EQ (TSTWconst [c] x) yes no)
 22740  		// cond: oneBit(int64(uint32(c)))
 22741  		// result: (TBZ [int64(ntz64(int64(uint32(c))))] x yes no)
 22742  		for b.Controls[0].Op == OpARM64TSTWconst {
 22743  			v_0 := b.Controls[0]
 22744  			c := auxIntToInt32(v_0.AuxInt)
 22745  			x := v_0.Args[0]
 22746  			if !(oneBit(int64(uint32(c)))) {
 22747  				break
 22748  			}
 22749  			b.resetWithControl(BlockARM64TBZ, x)
 22750  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 22751  			return true
 22752  		}
 22753  		// match: (EQ (FlagConstant [fc]) yes no)
 22754  		// cond: fc.eq()
 22755  		// result: (First yes no)
 22756  		for b.Controls[0].Op == OpARM64FlagConstant {
 22757  			v_0 := b.Controls[0]
 22758  			fc := auxIntToFlagConstant(v_0.AuxInt)
 22759  			if !(fc.eq()) {
 22760  				break
 22761  			}
 22762  			b.Reset(BlockFirst)
 22763  			return true
 22764  		}
 22765  		// match: (EQ (FlagConstant [fc]) yes no)
 22766  		// cond: !fc.eq()
 22767  		// result: (First no yes)
 22768  		for b.Controls[0].Op == OpARM64FlagConstant {
 22769  			v_0 := b.Controls[0]
 22770  			fc := auxIntToFlagConstant(v_0.AuxInt)
 22771  			if !(!fc.eq()) {
 22772  				break
 22773  			}
 22774  			b.Reset(BlockFirst)
 22775  			b.swapSuccessors()
 22776  			return true
 22777  		}
 22778  		// match: (EQ (InvertFlags cmp) yes no)
 22779  		// result: (EQ cmp yes no)
 22780  		for b.Controls[0].Op == OpARM64InvertFlags {
 22781  			v_0 := b.Controls[0]
 22782  			cmp := v_0.Args[0]
 22783  			b.resetWithControl(BlockARM64EQ, cmp)
 22784  			return true
 22785  		}
 22786  	case BlockARM64FGE:
 22787  		// match: (FGE (InvertFlags cmp) yes no)
 22788  		// result: (FLE cmp yes no)
 22789  		for b.Controls[0].Op == OpARM64InvertFlags {
 22790  			v_0 := b.Controls[0]
 22791  			cmp := v_0.Args[0]
 22792  			b.resetWithControl(BlockARM64FLE, cmp)
 22793  			return true
 22794  		}
 22795  	case BlockARM64FGT:
 22796  		// match: (FGT (InvertFlags cmp) yes no)
 22797  		// result: (FLT cmp yes no)
 22798  		for b.Controls[0].Op == OpARM64InvertFlags {
 22799  			v_0 := b.Controls[0]
 22800  			cmp := v_0.Args[0]
 22801  			b.resetWithControl(BlockARM64FLT, cmp)
 22802  			return true
 22803  		}
 22804  	case BlockARM64FLE:
 22805  		// match: (FLE (InvertFlags cmp) yes no)
 22806  		// result: (FGE cmp yes no)
 22807  		for b.Controls[0].Op == OpARM64InvertFlags {
 22808  			v_0 := b.Controls[0]
 22809  			cmp := v_0.Args[0]
 22810  			b.resetWithControl(BlockARM64FGE, cmp)
 22811  			return true
 22812  		}
 22813  	case BlockARM64FLT:
 22814  		// match: (FLT (InvertFlags cmp) yes no)
 22815  		// result: (FGT cmp yes no)
 22816  		for b.Controls[0].Op == OpARM64InvertFlags {
 22817  			v_0 := b.Controls[0]
 22818  			cmp := v_0.Args[0]
 22819  			b.resetWithControl(BlockARM64FGT, cmp)
 22820  			return true
 22821  		}
 22822  	case BlockARM64GE:
 22823  		// match: (GE (CMPconst [0] z:(AND x y)) yes no)
 22824  		// cond: z.Uses == 1
 22825  		// result: (GE (TST x y) yes no)
 22826  		for b.Controls[0].Op == OpARM64CMPconst {
 22827  			v_0 := b.Controls[0]
 22828  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22829  				break
 22830  			}
 22831  			z := v_0.Args[0]
 22832  			if z.Op != OpARM64AND {
 22833  				break
 22834  			}
 22835  			_ = z.Args[1]
 22836  			z_0 := z.Args[0]
 22837  			z_1 := z.Args[1]
 22838  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22839  				x := z_0
 22840  				y := z_1
 22841  				if !(z.Uses == 1) {
 22842  					continue
 22843  				}
 22844  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 22845  				v0.AddArg2(x, y)
 22846  				b.resetWithControl(BlockARM64GE, v0)
 22847  				return true
 22848  			}
 22849  			break
 22850  		}
 22851  		// match: (GE (CMPconst [0] x:(ANDconst [c] y)) yes no)
 22852  		// cond: x.Uses == 1
 22853  		// result: (GE (TSTconst [c] y) yes no)
 22854  		for b.Controls[0].Op == OpARM64CMPconst {
 22855  			v_0 := b.Controls[0]
 22856  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22857  				break
 22858  			}
 22859  			x := v_0.Args[0]
 22860  			if x.Op != OpARM64ANDconst {
 22861  				break
 22862  			}
 22863  			c := auxIntToInt64(x.AuxInt)
 22864  			y := x.Args[0]
 22865  			if !(x.Uses == 1) {
 22866  				break
 22867  			}
 22868  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 22869  			v0.AuxInt = int64ToAuxInt(c)
 22870  			v0.AddArg(y)
 22871  			b.resetWithControl(BlockARM64GE, v0)
 22872  			return true
 22873  		}
 22874  		// match: (GE (CMPWconst [0] z:(AND x y)) yes no)
 22875  		// cond: z.Uses == 1
 22876  		// result: (GE (TSTW x y) yes no)
 22877  		for b.Controls[0].Op == OpARM64CMPWconst {
 22878  			v_0 := b.Controls[0]
 22879  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22880  				break
 22881  			}
 22882  			z := v_0.Args[0]
 22883  			if z.Op != OpARM64AND {
 22884  				break
 22885  			}
 22886  			_ = z.Args[1]
 22887  			z_0 := z.Args[0]
 22888  			z_1 := z.Args[1]
 22889  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22890  				x := z_0
 22891  				y := z_1
 22892  				if !(z.Uses == 1) {
 22893  					continue
 22894  				}
 22895  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 22896  				v0.AddArg2(x, y)
 22897  				b.resetWithControl(BlockARM64GE, v0)
 22898  				return true
 22899  			}
 22900  			break
 22901  		}
 22902  		// match: (GE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 22903  		// cond: x.Uses == 1
 22904  		// result: (GE (TSTWconst [int32(c)] y) yes no)
 22905  		for b.Controls[0].Op == OpARM64CMPWconst {
 22906  			v_0 := b.Controls[0]
 22907  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22908  				break
 22909  			}
 22910  			x := v_0.Args[0]
 22911  			if x.Op != OpARM64ANDconst {
 22912  				break
 22913  			}
 22914  			c := auxIntToInt64(x.AuxInt)
 22915  			y := x.Args[0]
 22916  			if !(x.Uses == 1) {
 22917  				break
 22918  			}
 22919  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 22920  			v0.AuxInt = int32ToAuxInt(int32(c))
 22921  			v0.AddArg(y)
 22922  			b.resetWithControl(BlockARM64GE, v0)
 22923  			return true
 22924  		}
 22925  		// match: (GE (CMPconst [0] x:(ADDconst [c] y)) yes no)
 22926  		// cond: x.Uses == 1
 22927  		// result: (GEnoov (CMNconst [c] y) yes no)
 22928  		for b.Controls[0].Op == OpARM64CMPconst {
 22929  			v_0 := b.Controls[0]
 22930  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22931  				break
 22932  			}
 22933  			x := v_0.Args[0]
 22934  			if x.Op != OpARM64ADDconst {
 22935  				break
 22936  			}
 22937  			c := auxIntToInt64(x.AuxInt)
 22938  			y := x.Args[0]
 22939  			if !(x.Uses == 1) {
 22940  				break
 22941  			}
 22942  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 22943  			v0.AuxInt = int64ToAuxInt(c)
 22944  			v0.AddArg(y)
 22945  			b.resetWithControl(BlockARM64GEnoov, v0)
 22946  			return true
 22947  		}
 22948  		// match: (GE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 22949  		// cond: x.Uses == 1
 22950  		// result: (GEnoov (CMNWconst [int32(c)] y) yes no)
 22951  		for b.Controls[0].Op == OpARM64CMPWconst {
 22952  			v_0 := b.Controls[0]
 22953  			if auxIntToInt32(v_0.AuxInt) != 0 {
 22954  				break
 22955  			}
 22956  			x := v_0.Args[0]
 22957  			if x.Op != OpARM64ADDconst {
 22958  				break
 22959  			}
 22960  			c := auxIntToInt64(x.AuxInt)
 22961  			y := x.Args[0]
 22962  			if !(x.Uses == 1) {
 22963  				break
 22964  			}
 22965  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 22966  			v0.AuxInt = int32ToAuxInt(int32(c))
 22967  			v0.AddArg(y)
 22968  			b.resetWithControl(BlockARM64GEnoov, v0)
 22969  			return true
 22970  		}
 22971  		// match: (GE (CMPconst [0] z:(ADD x y)) yes no)
 22972  		// cond: z.Uses == 1
 22973  		// result: (GEnoov (CMN x y) yes no)
 22974  		for b.Controls[0].Op == OpARM64CMPconst {
 22975  			v_0 := b.Controls[0]
 22976  			if auxIntToInt64(v_0.AuxInt) != 0 {
 22977  				break
 22978  			}
 22979  			z := v_0.Args[0]
 22980  			if z.Op != OpARM64ADD {
 22981  				break
 22982  			}
 22983  			_ = z.Args[1]
 22984  			z_0 := z.Args[0]
 22985  			z_1 := z.Args[1]
 22986  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 22987  				x := z_0
 22988  				y := z_1
 22989  				if !(z.Uses == 1) {
 22990  					continue
 22991  				}
 22992  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 22993  				v0.AddArg2(x, y)
 22994  				b.resetWithControl(BlockARM64GEnoov, v0)
 22995  				return true
 22996  			}
 22997  			break
 22998  		}
 22999  		// match: (GE (CMPWconst [0] z:(ADD x y)) yes no)
 23000  		// cond: z.Uses == 1
 23001  		// result: (GEnoov (CMNW x y) yes no)
 23002  		for b.Controls[0].Op == OpARM64CMPWconst {
 23003  			v_0 := b.Controls[0]
 23004  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23005  				break
 23006  			}
 23007  			z := v_0.Args[0]
 23008  			if z.Op != OpARM64ADD {
 23009  				break
 23010  			}
 23011  			_ = z.Args[1]
 23012  			z_0 := z.Args[0]
 23013  			z_1 := z.Args[1]
 23014  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23015  				x := z_0
 23016  				y := z_1
 23017  				if !(z.Uses == 1) {
 23018  					continue
 23019  				}
 23020  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23021  				v0.AddArg2(x, y)
 23022  				b.resetWithControl(BlockARM64GEnoov, v0)
 23023  				return true
 23024  			}
 23025  			break
 23026  		}
 23027  		// match: (GE (CMPconst [0] z:(MADD a x y)) yes no)
 23028  		// cond: z.Uses==1
 23029  		// result: (GEnoov (CMN a (MUL <x.Type> x y)) yes no)
 23030  		for b.Controls[0].Op == OpARM64CMPconst {
 23031  			v_0 := b.Controls[0]
 23032  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23033  				break
 23034  			}
 23035  			z := v_0.Args[0]
 23036  			if z.Op != OpARM64MADD {
 23037  				break
 23038  			}
 23039  			y := z.Args[2]
 23040  			a := z.Args[0]
 23041  			x := z.Args[1]
 23042  			if !(z.Uses == 1) {
 23043  				break
 23044  			}
 23045  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23046  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23047  			v1.AddArg2(x, y)
 23048  			v0.AddArg2(a, v1)
 23049  			b.resetWithControl(BlockARM64GEnoov, v0)
 23050  			return true
 23051  		}
 23052  		// match: (GE (CMPconst [0] z:(MSUB a x y)) yes no)
 23053  		// cond: z.Uses==1
 23054  		// result: (GEnoov (CMP a (MUL <x.Type> x y)) yes no)
 23055  		for b.Controls[0].Op == OpARM64CMPconst {
 23056  			v_0 := b.Controls[0]
 23057  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23058  				break
 23059  			}
 23060  			z := v_0.Args[0]
 23061  			if z.Op != OpARM64MSUB {
 23062  				break
 23063  			}
 23064  			y := z.Args[2]
 23065  			a := z.Args[0]
 23066  			x := z.Args[1]
 23067  			if !(z.Uses == 1) {
 23068  				break
 23069  			}
 23070  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 23071  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23072  			v1.AddArg2(x, y)
 23073  			v0.AddArg2(a, v1)
 23074  			b.resetWithControl(BlockARM64GEnoov, v0)
 23075  			return true
 23076  		}
 23077  		// match: (GE (CMPWconst [0] z:(MADDW a x y)) yes no)
 23078  		// cond: z.Uses==1
 23079  		// result: (GEnoov (CMNW a (MULW <x.Type> x y)) yes no)
 23080  		for b.Controls[0].Op == OpARM64CMPWconst {
 23081  			v_0 := b.Controls[0]
 23082  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23083  				break
 23084  			}
 23085  			z := v_0.Args[0]
 23086  			if z.Op != OpARM64MADDW {
 23087  				break
 23088  			}
 23089  			y := z.Args[2]
 23090  			a := z.Args[0]
 23091  			x := z.Args[1]
 23092  			if !(z.Uses == 1) {
 23093  				break
 23094  			}
 23095  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23096  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23097  			v1.AddArg2(x, y)
 23098  			v0.AddArg2(a, v1)
 23099  			b.resetWithControl(BlockARM64GEnoov, v0)
 23100  			return true
 23101  		}
 23102  		// match: (GE (CMPWconst [0] z:(MSUBW a x y)) yes no)
 23103  		// cond: z.Uses==1
 23104  		// result: (GEnoov (CMPW a (MULW <x.Type> x y)) yes no)
 23105  		for b.Controls[0].Op == OpARM64CMPWconst {
 23106  			v_0 := b.Controls[0]
 23107  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23108  				break
 23109  			}
 23110  			z := v_0.Args[0]
 23111  			if z.Op != OpARM64MSUBW {
 23112  				break
 23113  			}
 23114  			y := z.Args[2]
 23115  			a := z.Args[0]
 23116  			x := z.Args[1]
 23117  			if !(z.Uses == 1) {
 23118  				break
 23119  			}
 23120  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 23121  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23122  			v1.AddArg2(x, y)
 23123  			v0.AddArg2(a, v1)
 23124  			b.resetWithControl(BlockARM64GEnoov, v0)
 23125  			return true
 23126  		}
 23127  		// match: (GE (CMPWconst [0] x) yes no)
 23128  		// result: (TBZ [31] x yes no)
 23129  		for b.Controls[0].Op == OpARM64CMPWconst {
 23130  			v_0 := b.Controls[0]
 23131  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23132  				break
 23133  			}
 23134  			x := v_0.Args[0]
 23135  			b.resetWithControl(BlockARM64TBZ, x)
 23136  			b.AuxInt = int64ToAuxInt(31)
 23137  			return true
 23138  		}
 23139  		// match: (GE (CMPconst [0] x) yes no)
 23140  		// result: (TBZ [63] x yes no)
 23141  		for b.Controls[0].Op == OpARM64CMPconst {
 23142  			v_0 := b.Controls[0]
 23143  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23144  				break
 23145  			}
 23146  			x := v_0.Args[0]
 23147  			b.resetWithControl(BlockARM64TBZ, x)
 23148  			b.AuxInt = int64ToAuxInt(63)
 23149  			return true
 23150  		}
 23151  		// match: (GE (FlagConstant [fc]) yes no)
 23152  		// cond: fc.ge()
 23153  		// result: (First yes no)
 23154  		for b.Controls[0].Op == OpARM64FlagConstant {
 23155  			v_0 := b.Controls[0]
 23156  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23157  			if !(fc.ge()) {
 23158  				break
 23159  			}
 23160  			b.Reset(BlockFirst)
 23161  			return true
 23162  		}
 23163  		// match: (GE (FlagConstant [fc]) yes no)
 23164  		// cond: !fc.ge()
 23165  		// result: (First no yes)
 23166  		for b.Controls[0].Op == OpARM64FlagConstant {
 23167  			v_0 := b.Controls[0]
 23168  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23169  			if !(!fc.ge()) {
 23170  				break
 23171  			}
 23172  			b.Reset(BlockFirst)
 23173  			b.swapSuccessors()
 23174  			return true
 23175  		}
 23176  		// match: (GE (InvertFlags cmp) yes no)
 23177  		// result: (LE cmp yes no)
 23178  		for b.Controls[0].Op == OpARM64InvertFlags {
 23179  			v_0 := b.Controls[0]
 23180  			cmp := v_0.Args[0]
 23181  			b.resetWithControl(BlockARM64LE, cmp)
 23182  			return true
 23183  		}
 23184  	case BlockARM64GEnoov:
 23185  		// match: (GEnoov (FlagConstant [fc]) yes no)
 23186  		// cond: fc.geNoov()
 23187  		// result: (First yes no)
 23188  		for b.Controls[0].Op == OpARM64FlagConstant {
 23189  			v_0 := b.Controls[0]
 23190  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23191  			if !(fc.geNoov()) {
 23192  				break
 23193  			}
 23194  			b.Reset(BlockFirst)
 23195  			return true
 23196  		}
 23197  		// match: (GEnoov (FlagConstant [fc]) yes no)
 23198  		// cond: !fc.geNoov()
 23199  		// result: (First no yes)
 23200  		for b.Controls[0].Op == OpARM64FlagConstant {
 23201  			v_0 := b.Controls[0]
 23202  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23203  			if !(!fc.geNoov()) {
 23204  				break
 23205  			}
 23206  			b.Reset(BlockFirst)
 23207  			b.swapSuccessors()
 23208  			return true
 23209  		}
 23210  		// match: (GEnoov (InvertFlags cmp) yes no)
 23211  		// result: (LEnoov cmp yes no)
 23212  		for b.Controls[0].Op == OpARM64InvertFlags {
 23213  			v_0 := b.Controls[0]
 23214  			cmp := v_0.Args[0]
 23215  			b.resetWithControl(BlockARM64LEnoov, cmp)
 23216  			return true
 23217  		}
 23218  	case BlockARM64GT:
 23219  		// match: (GT (CMPconst [0] z:(AND x y)) yes no)
 23220  		// cond: z.Uses == 1
 23221  		// result: (GT (TST x y) yes no)
 23222  		for b.Controls[0].Op == OpARM64CMPconst {
 23223  			v_0 := b.Controls[0]
 23224  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23225  				break
 23226  			}
 23227  			z := v_0.Args[0]
 23228  			if z.Op != OpARM64AND {
 23229  				break
 23230  			}
 23231  			_ = z.Args[1]
 23232  			z_0 := z.Args[0]
 23233  			z_1 := z.Args[1]
 23234  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23235  				x := z_0
 23236  				y := z_1
 23237  				if !(z.Uses == 1) {
 23238  					continue
 23239  				}
 23240  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 23241  				v0.AddArg2(x, y)
 23242  				b.resetWithControl(BlockARM64GT, v0)
 23243  				return true
 23244  			}
 23245  			break
 23246  		}
 23247  		// match: (GT (CMPconst [0] x:(ANDconst [c] y)) yes no)
 23248  		// cond: x.Uses == 1
 23249  		// result: (GT (TSTconst [c] y) yes no)
 23250  		for b.Controls[0].Op == OpARM64CMPconst {
 23251  			v_0 := b.Controls[0]
 23252  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23253  				break
 23254  			}
 23255  			x := v_0.Args[0]
 23256  			if x.Op != OpARM64ANDconst {
 23257  				break
 23258  			}
 23259  			c := auxIntToInt64(x.AuxInt)
 23260  			y := x.Args[0]
 23261  			if !(x.Uses == 1) {
 23262  				break
 23263  			}
 23264  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 23265  			v0.AuxInt = int64ToAuxInt(c)
 23266  			v0.AddArg(y)
 23267  			b.resetWithControl(BlockARM64GT, v0)
 23268  			return true
 23269  		}
 23270  		// match: (GT (CMPWconst [0] z:(AND x y)) yes no)
 23271  		// cond: z.Uses == 1
 23272  		// result: (GT (TSTW x y) yes no)
 23273  		for b.Controls[0].Op == OpARM64CMPWconst {
 23274  			v_0 := b.Controls[0]
 23275  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23276  				break
 23277  			}
 23278  			z := v_0.Args[0]
 23279  			if z.Op != OpARM64AND {
 23280  				break
 23281  			}
 23282  			_ = z.Args[1]
 23283  			z_0 := z.Args[0]
 23284  			z_1 := z.Args[1]
 23285  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23286  				x := z_0
 23287  				y := z_1
 23288  				if !(z.Uses == 1) {
 23289  					continue
 23290  				}
 23291  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 23292  				v0.AddArg2(x, y)
 23293  				b.resetWithControl(BlockARM64GT, v0)
 23294  				return true
 23295  			}
 23296  			break
 23297  		}
 23298  		// match: (GT (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 23299  		// cond: x.Uses == 1
 23300  		// result: (GT (TSTWconst [int32(c)] y) yes no)
 23301  		for b.Controls[0].Op == OpARM64CMPWconst {
 23302  			v_0 := b.Controls[0]
 23303  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23304  				break
 23305  			}
 23306  			x := v_0.Args[0]
 23307  			if x.Op != OpARM64ANDconst {
 23308  				break
 23309  			}
 23310  			c := auxIntToInt64(x.AuxInt)
 23311  			y := x.Args[0]
 23312  			if !(x.Uses == 1) {
 23313  				break
 23314  			}
 23315  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 23316  			v0.AuxInt = int32ToAuxInt(int32(c))
 23317  			v0.AddArg(y)
 23318  			b.resetWithControl(BlockARM64GT, v0)
 23319  			return true
 23320  		}
 23321  		// match: (GT (CMPconst [0] x:(ADDconst [c] y)) yes no)
 23322  		// cond: x.Uses == 1
 23323  		// result: (GTnoov (CMNconst [c] y) yes no)
 23324  		for b.Controls[0].Op == OpARM64CMPconst {
 23325  			v_0 := b.Controls[0]
 23326  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23327  				break
 23328  			}
 23329  			x := v_0.Args[0]
 23330  			if x.Op != OpARM64ADDconst {
 23331  				break
 23332  			}
 23333  			c := auxIntToInt64(x.AuxInt)
 23334  			y := x.Args[0]
 23335  			if !(x.Uses == 1) {
 23336  				break
 23337  			}
 23338  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 23339  			v0.AuxInt = int64ToAuxInt(c)
 23340  			v0.AddArg(y)
 23341  			b.resetWithControl(BlockARM64GTnoov, v0)
 23342  			return true
 23343  		}
 23344  		// match: (GT (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 23345  		// cond: x.Uses == 1
 23346  		// result: (GTnoov (CMNWconst [int32(c)] y) yes no)
 23347  		for b.Controls[0].Op == OpARM64CMPWconst {
 23348  			v_0 := b.Controls[0]
 23349  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23350  				break
 23351  			}
 23352  			x := v_0.Args[0]
 23353  			if x.Op != OpARM64ADDconst {
 23354  				break
 23355  			}
 23356  			c := auxIntToInt64(x.AuxInt)
 23357  			y := x.Args[0]
 23358  			if !(x.Uses == 1) {
 23359  				break
 23360  			}
 23361  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 23362  			v0.AuxInt = int32ToAuxInt(int32(c))
 23363  			v0.AddArg(y)
 23364  			b.resetWithControl(BlockARM64GTnoov, v0)
 23365  			return true
 23366  		}
 23367  		// match: (GT (CMPconst [0] z:(ADD x y)) yes no)
 23368  		// cond: z.Uses == 1
 23369  		// result: (GTnoov (CMN x y) yes no)
 23370  		for b.Controls[0].Op == OpARM64CMPconst {
 23371  			v_0 := b.Controls[0]
 23372  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23373  				break
 23374  			}
 23375  			z := v_0.Args[0]
 23376  			if z.Op != OpARM64ADD {
 23377  				break
 23378  			}
 23379  			_ = z.Args[1]
 23380  			z_0 := z.Args[0]
 23381  			z_1 := z.Args[1]
 23382  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23383  				x := z_0
 23384  				y := z_1
 23385  				if !(z.Uses == 1) {
 23386  					continue
 23387  				}
 23388  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23389  				v0.AddArg2(x, y)
 23390  				b.resetWithControl(BlockARM64GTnoov, v0)
 23391  				return true
 23392  			}
 23393  			break
 23394  		}
 23395  		// match: (GT (CMPWconst [0] z:(ADD x y)) yes no)
 23396  		// cond: z.Uses == 1
 23397  		// result: (GTnoov (CMNW x y) yes no)
 23398  		for b.Controls[0].Op == OpARM64CMPWconst {
 23399  			v_0 := b.Controls[0]
 23400  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23401  				break
 23402  			}
 23403  			z := v_0.Args[0]
 23404  			if z.Op != OpARM64ADD {
 23405  				break
 23406  			}
 23407  			_ = z.Args[1]
 23408  			z_0 := z.Args[0]
 23409  			z_1 := z.Args[1]
 23410  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23411  				x := z_0
 23412  				y := z_1
 23413  				if !(z.Uses == 1) {
 23414  					continue
 23415  				}
 23416  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23417  				v0.AddArg2(x, y)
 23418  				b.resetWithControl(BlockARM64GTnoov, v0)
 23419  				return true
 23420  			}
 23421  			break
 23422  		}
 23423  		// match: (GT (CMPconst [0] z:(MADD a x y)) yes no)
 23424  		// cond: z.Uses==1
 23425  		// result: (GTnoov (CMN a (MUL <x.Type> x y)) yes no)
 23426  		for b.Controls[0].Op == OpARM64CMPconst {
 23427  			v_0 := b.Controls[0]
 23428  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23429  				break
 23430  			}
 23431  			z := v_0.Args[0]
 23432  			if z.Op != OpARM64MADD {
 23433  				break
 23434  			}
 23435  			y := z.Args[2]
 23436  			a := z.Args[0]
 23437  			x := z.Args[1]
 23438  			if !(z.Uses == 1) {
 23439  				break
 23440  			}
 23441  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23442  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23443  			v1.AddArg2(x, y)
 23444  			v0.AddArg2(a, v1)
 23445  			b.resetWithControl(BlockARM64GTnoov, v0)
 23446  			return true
 23447  		}
 23448  		// match: (GT (CMPconst [0] z:(MSUB a x y)) yes no)
 23449  		// cond: z.Uses==1
 23450  		// result: (GTnoov (CMP a (MUL <x.Type> x y)) yes no)
 23451  		for b.Controls[0].Op == OpARM64CMPconst {
 23452  			v_0 := b.Controls[0]
 23453  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23454  				break
 23455  			}
 23456  			z := v_0.Args[0]
 23457  			if z.Op != OpARM64MSUB {
 23458  				break
 23459  			}
 23460  			y := z.Args[2]
 23461  			a := z.Args[0]
 23462  			x := z.Args[1]
 23463  			if !(z.Uses == 1) {
 23464  				break
 23465  			}
 23466  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 23467  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23468  			v1.AddArg2(x, y)
 23469  			v0.AddArg2(a, v1)
 23470  			b.resetWithControl(BlockARM64GTnoov, v0)
 23471  			return true
 23472  		}
 23473  		// match: (GT (CMPWconst [0] z:(MADDW a x y)) yes no)
 23474  		// cond: z.Uses==1
 23475  		// result: (GTnoov (CMNW a (MULW <x.Type> x y)) yes no)
 23476  		for b.Controls[0].Op == OpARM64CMPWconst {
 23477  			v_0 := b.Controls[0]
 23478  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23479  				break
 23480  			}
 23481  			z := v_0.Args[0]
 23482  			if z.Op != OpARM64MADDW {
 23483  				break
 23484  			}
 23485  			y := z.Args[2]
 23486  			a := z.Args[0]
 23487  			x := z.Args[1]
 23488  			if !(z.Uses == 1) {
 23489  				break
 23490  			}
 23491  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23492  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23493  			v1.AddArg2(x, y)
 23494  			v0.AddArg2(a, v1)
 23495  			b.resetWithControl(BlockARM64GTnoov, v0)
 23496  			return true
 23497  		}
 23498  		// match: (GT (CMPWconst [0] z:(MSUBW a x y)) yes no)
 23499  		// cond: z.Uses==1
 23500  		// result: (GTnoov (CMPW a (MULW <x.Type> x y)) yes no)
 23501  		for b.Controls[0].Op == OpARM64CMPWconst {
 23502  			v_0 := b.Controls[0]
 23503  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23504  				break
 23505  			}
 23506  			z := v_0.Args[0]
 23507  			if z.Op != OpARM64MSUBW {
 23508  				break
 23509  			}
 23510  			y := z.Args[2]
 23511  			a := z.Args[0]
 23512  			x := z.Args[1]
 23513  			if !(z.Uses == 1) {
 23514  				break
 23515  			}
 23516  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 23517  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23518  			v1.AddArg2(x, y)
 23519  			v0.AddArg2(a, v1)
 23520  			b.resetWithControl(BlockARM64GTnoov, v0)
 23521  			return true
 23522  		}
 23523  		// match: (GT (FlagConstant [fc]) yes no)
 23524  		// cond: fc.gt()
 23525  		// result: (First yes no)
 23526  		for b.Controls[0].Op == OpARM64FlagConstant {
 23527  			v_0 := b.Controls[0]
 23528  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23529  			if !(fc.gt()) {
 23530  				break
 23531  			}
 23532  			b.Reset(BlockFirst)
 23533  			return true
 23534  		}
 23535  		// match: (GT (FlagConstant [fc]) yes no)
 23536  		// cond: !fc.gt()
 23537  		// result: (First no yes)
 23538  		for b.Controls[0].Op == OpARM64FlagConstant {
 23539  			v_0 := b.Controls[0]
 23540  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23541  			if !(!fc.gt()) {
 23542  				break
 23543  			}
 23544  			b.Reset(BlockFirst)
 23545  			b.swapSuccessors()
 23546  			return true
 23547  		}
 23548  		// match: (GT (InvertFlags cmp) yes no)
 23549  		// result: (LT cmp yes no)
 23550  		for b.Controls[0].Op == OpARM64InvertFlags {
 23551  			v_0 := b.Controls[0]
 23552  			cmp := v_0.Args[0]
 23553  			b.resetWithControl(BlockARM64LT, cmp)
 23554  			return true
 23555  		}
 23556  	case BlockARM64GTnoov:
 23557  		// match: (GTnoov (FlagConstant [fc]) yes no)
 23558  		// cond: fc.gtNoov()
 23559  		// result: (First yes no)
 23560  		for b.Controls[0].Op == OpARM64FlagConstant {
 23561  			v_0 := b.Controls[0]
 23562  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23563  			if !(fc.gtNoov()) {
 23564  				break
 23565  			}
 23566  			b.Reset(BlockFirst)
 23567  			return true
 23568  		}
 23569  		// match: (GTnoov (FlagConstant [fc]) yes no)
 23570  		// cond: !fc.gtNoov()
 23571  		// result: (First no yes)
 23572  		for b.Controls[0].Op == OpARM64FlagConstant {
 23573  			v_0 := b.Controls[0]
 23574  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23575  			if !(!fc.gtNoov()) {
 23576  				break
 23577  			}
 23578  			b.Reset(BlockFirst)
 23579  			b.swapSuccessors()
 23580  			return true
 23581  		}
 23582  		// match: (GTnoov (InvertFlags cmp) yes no)
 23583  		// result: (LTnoov cmp yes no)
 23584  		for b.Controls[0].Op == OpARM64InvertFlags {
 23585  			v_0 := b.Controls[0]
 23586  			cmp := v_0.Args[0]
 23587  			b.resetWithControl(BlockARM64LTnoov, cmp)
 23588  			return true
 23589  		}
 23590  	case BlockIf:
 23591  		// match: (If (Equal cc) yes no)
 23592  		// result: (EQ cc yes no)
 23593  		for b.Controls[0].Op == OpARM64Equal {
 23594  			v_0 := b.Controls[0]
 23595  			cc := v_0.Args[0]
 23596  			b.resetWithControl(BlockARM64EQ, cc)
 23597  			return true
 23598  		}
 23599  		// match: (If (NotEqual cc) yes no)
 23600  		// result: (NE cc yes no)
 23601  		for b.Controls[0].Op == OpARM64NotEqual {
 23602  			v_0 := b.Controls[0]
 23603  			cc := v_0.Args[0]
 23604  			b.resetWithControl(BlockARM64NE, cc)
 23605  			return true
 23606  		}
 23607  		// match: (If (LessThan cc) yes no)
 23608  		// result: (LT cc yes no)
 23609  		for b.Controls[0].Op == OpARM64LessThan {
 23610  			v_0 := b.Controls[0]
 23611  			cc := v_0.Args[0]
 23612  			b.resetWithControl(BlockARM64LT, cc)
 23613  			return true
 23614  		}
 23615  		// match: (If (LessThanU cc) yes no)
 23616  		// result: (ULT cc yes no)
 23617  		for b.Controls[0].Op == OpARM64LessThanU {
 23618  			v_0 := b.Controls[0]
 23619  			cc := v_0.Args[0]
 23620  			b.resetWithControl(BlockARM64ULT, cc)
 23621  			return true
 23622  		}
 23623  		// match: (If (LessEqual cc) yes no)
 23624  		// result: (LE cc yes no)
 23625  		for b.Controls[0].Op == OpARM64LessEqual {
 23626  			v_0 := b.Controls[0]
 23627  			cc := v_0.Args[0]
 23628  			b.resetWithControl(BlockARM64LE, cc)
 23629  			return true
 23630  		}
 23631  		// match: (If (LessEqualU cc) yes no)
 23632  		// result: (ULE cc yes no)
 23633  		for b.Controls[0].Op == OpARM64LessEqualU {
 23634  			v_0 := b.Controls[0]
 23635  			cc := v_0.Args[0]
 23636  			b.resetWithControl(BlockARM64ULE, cc)
 23637  			return true
 23638  		}
 23639  		// match: (If (GreaterThan cc) yes no)
 23640  		// result: (GT cc yes no)
 23641  		for b.Controls[0].Op == OpARM64GreaterThan {
 23642  			v_0 := b.Controls[0]
 23643  			cc := v_0.Args[0]
 23644  			b.resetWithControl(BlockARM64GT, cc)
 23645  			return true
 23646  		}
 23647  		// match: (If (GreaterThanU cc) yes no)
 23648  		// result: (UGT cc yes no)
 23649  		for b.Controls[0].Op == OpARM64GreaterThanU {
 23650  			v_0 := b.Controls[0]
 23651  			cc := v_0.Args[0]
 23652  			b.resetWithControl(BlockARM64UGT, cc)
 23653  			return true
 23654  		}
 23655  		// match: (If (GreaterEqual cc) yes no)
 23656  		// result: (GE cc yes no)
 23657  		for b.Controls[0].Op == OpARM64GreaterEqual {
 23658  			v_0 := b.Controls[0]
 23659  			cc := v_0.Args[0]
 23660  			b.resetWithControl(BlockARM64GE, cc)
 23661  			return true
 23662  		}
 23663  		// match: (If (GreaterEqualU cc) yes no)
 23664  		// result: (UGE cc yes no)
 23665  		for b.Controls[0].Op == OpARM64GreaterEqualU {
 23666  			v_0 := b.Controls[0]
 23667  			cc := v_0.Args[0]
 23668  			b.resetWithControl(BlockARM64UGE, cc)
 23669  			return true
 23670  		}
 23671  		// match: (If (LessThanF cc) yes no)
 23672  		// result: (FLT cc yes no)
 23673  		for b.Controls[0].Op == OpARM64LessThanF {
 23674  			v_0 := b.Controls[0]
 23675  			cc := v_0.Args[0]
 23676  			b.resetWithControl(BlockARM64FLT, cc)
 23677  			return true
 23678  		}
 23679  		// match: (If (LessEqualF cc) yes no)
 23680  		// result: (FLE cc yes no)
 23681  		for b.Controls[0].Op == OpARM64LessEqualF {
 23682  			v_0 := b.Controls[0]
 23683  			cc := v_0.Args[0]
 23684  			b.resetWithControl(BlockARM64FLE, cc)
 23685  			return true
 23686  		}
 23687  		// match: (If (GreaterThanF cc) yes no)
 23688  		// result: (FGT cc yes no)
 23689  		for b.Controls[0].Op == OpARM64GreaterThanF {
 23690  			v_0 := b.Controls[0]
 23691  			cc := v_0.Args[0]
 23692  			b.resetWithControl(BlockARM64FGT, cc)
 23693  			return true
 23694  		}
 23695  		// match: (If (GreaterEqualF cc) yes no)
 23696  		// result: (FGE cc yes no)
 23697  		for b.Controls[0].Op == OpARM64GreaterEqualF {
 23698  			v_0 := b.Controls[0]
 23699  			cc := v_0.Args[0]
 23700  			b.resetWithControl(BlockARM64FGE, cc)
 23701  			return true
 23702  		}
 23703  		// match: (If cond yes no)
 23704  		// result: (TBNZ [0] cond yes no)
 23705  		for {
 23706  			cond := b.Controls[0]
 23707  			b.resetWithControl(BlockARM64TBNZ, cond)
 23708  			b.AuxInt = int64ToAuxInt(0)
 23709  			return true
 23710  		}
 23711  	case BlockJumpTable:
 23712  		// match: (JumpTable idx)
 23713  		// result: (JUMPTABLE {makeJumpTableSym(b)} idx (MOVDaddr <typ.Uintptr> {makeJumpTableSym(b)} (SB)))
 23714  		for {
 23715  			idx := b.Controls[0]
 23716  			v0 := b.NewValue0(b.Pos, OpARM64MOVDaddr, typ.Uintptr)
 23717  			v0.Aux = symToAux(makeJumpTableSym(b))
 23718  			v1 := b.NewValue0(b.Pos, OpSB, typ.Uintptr)
 23719  			v0.AddArg(v1)
 23720  			b.resetWithControl2(BlockARM64JUMPTABLE, idx, v0)
 23721  			b.Aux = symToAux(makeJumpTableSym(b))
 23722  			return true
 23723  		}
 23724  	case BlockARM64LE:
 23725  		// match: (LE (CMPconst [0] z:(AND x y)) yes no)
 23726  		// cond: z.Uses == 1
 23727  		// result: (LE (TST x y) yes no)
 23728  		for b.Controls[0].Op == OpARM64CMPconst {
 23729  			v_0 := b.Controls[0]
 23730  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23731  				break
 23732  			}
 23733  			z := v_0.Args[0]
 23734  			if z.Op != OpARM64AND {
 23735  				break
 23736  			}
 23737  			_ = z.Args[1]
 23738  			z_0 := z.Args[0]
 23739  			z_1 := z.Args[1]
 23740  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23741  				x := z_0
 23742  				y := z_1
 23743  				if !(z.Uses == 1) {
 23744  					continue
 23745  				}
 23746  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 23747  				v0.AddArg2(x, y)
 23748  				b.resetWithControl(BlockARM64LE, v0)
 23749  				return true
 23750  			}
 23751  			break
 23752  		}
 23753  		// match: (LE (CMPconst [0] x:(ANDconst [c] y)) yes no)
 23754  		// cond: x.Uses == 1
 23755  		// result: (LE (TSTconst [c] y) yes no)
 23756  		for b.Controls[0].Op == OpARM64CMPconst {
 23757  			v_0 := b.Controls[0]
 23758  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23759  				break
 23760  			}
 23761  			x := v_0.Args[0]
 23762  			if x.Op != OpARM64ANDconst {
 23763  				break
 23764  			}
 23765  			c := auxIntToInt64(x.AuxInt)
 23766  			y := x.Args[0]
 23767  			if !(x.Uses == 1) {
 23768  				break
 23769  			}
 23770  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 23771  			v0.AuxInt = int64ToAuxInt(c)
 23772  			v0.AddArg(y)
 23773  			b.resetWithControl(BlockARM64LE, v0)
 23774  			return true
 23775  		}
 23776  		// match: (LE (CMPWconst [0] z:(AND x y)) yes no)
 23777  		// cond: z.Uses == 1
 23778  		// result: (LE (TSTW x y) yes no)
 23779  		for b.Controls[0].Op == OpARM64CMPWconst {
 23780  			v_0 := b.Controls[0]
 23781  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23782  				break
 23783  			}
 23784  			z := v_0.Args[0]
 23785  			if z.Op != OpARM64AND {
 23786  				break
 23787  			}
 23788  			_ = z.Args[1]
 23789  			z_0 := z.Args[0]
 23790  			z_1 := z.Args[1]
 23791  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23792  				x := z_0
 23793  				y := z_1
 23794  				if !(z.Uses == 1) {
 23795  					continue
 23796  				}
 23797  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 23798  				v0.AddArg2(x, y)
 23799  				b.resetWithControl(BlockARM64LE, v0)
 23800  				return true
 23801  			}
 23802  			break
 23803  		}
 23804  		// match: (LE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 23805  		// cond: x.Uses == 1
 23806  		// result: (LE (TSTWconst [int32(c)] y) yes no)
 23807  		for b.Controls[0].Op == OpARM64CMPWconst {
 23808  			v_0 := b.Controls[0]
 23809  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23810  				break
 23811  			}
 23812  			x := v_0.Args[0]
 23813  			if x.Op != OpARM64ANDconst {
 23814  				break
 23815  			}
 23816  			c := auxIntToInt64(x.AuxInt)
 23817  			y := x.Args[0]
 23818  			if !(x.Uses == 1) {
 23819  				break
 23820  			}
 23821  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 23822  			v0.AuxInt = int32ToAuxInt(int32(c))
 23823  			v0.AddArg(y)
 23824  			b.resetWithControl(BlockARM64LE, v0)
 23825  			return true
 23826  		}
 23827  		// match: (LE (CMPconst [0] x:(ADDconst [c] y)) yes no)
 23828  		// cond: x.Uses == 1
 23829  		// result: (LEnoov (CMNconst [c] y) yes no)
 23830  		for b.Controls[0].Op == OpARM64CMPconst {
 23831  			v_0 := b.Controls[0]
 23832  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23833  				break
 23834  			}
 23835  			x := v_0.Args[0]
 23836  			if x.Op != OpARM64ADDconst {
 23837  				break
 23838  			}
 23839  			c := auxIntToInt64(x.AuxInt)
 23840  			y := x.Args[0]
 23841  			if !(x.Uses == 1) {
 23842  				break
 23843  			}
 23844  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 23845  			v0.AuxInt = int64ToAuxInt(c)
 23846  			v0.AddArg(y)
 23847  			b.resetWithControl(BlockARM64LEnoov, v0)
 23848  			return true
 23849  		}
 23850  		// match: (LE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 23851  		// cond: x.Uses == 1
 23852  		// result: (LEnoov (CMNWconst [int32(c)] y) yes no)
 23853  		for b.Controls[0].Op == OpARM64CMPWconst {
 23854  			v_0 := b.Controls[0]
 23855  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23856  				break
 23857  			}
 23858  			x := v_0.Args[0]
 23859  			if x.Op != OpARM64ADDconst {
 23860  				break
 23861  			}
 23862  			c := auxIntToInt64(x.AuxInt)
 23863  			y := x.Args[0]
 23864  			if !(x.Uses == 1) {
 23865  				break
 23866  			}
 23867  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 23868  			v0.AuxInt = int32ToAuxInt(int32(c))
 23869  			v0.AddArg(y)
 23870  			b.resetWithControl(BlockARM64LEnoov, v0)
 23871  			return true
 23872  		}
 23873  		// match: (LE (CMPconst [0] z:(ADD x y)) yes no)
 23874  		// cond: z.Uses == 1
 23875  		// result: (LEnoov (CMN x y) yes no)
 23876  		for b.Controls[0].Op == OpARM64CMPconst {
 23877  			v_0 := b.Controls[0]
 23878  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23879  				break
 23880  			}
 23881  			z := v_0.Args[0]
 23882  			if z.Op != OpARM64ADD {
 23883  				break
 23884  			}
 23885  			_ = z.Args[1]
 23886  			z_0 := z.Args[0]
 23887  			z_1 := z.Args[1]
 23888  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23889  				x := z_0
 23890  				y := z_1
 23891  				if !(z.Uses == 1) {
 23892  					continue
 23893  				}
 23894  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23895  				v0.AddArg2(x, y)
 23896  				b.resetWithControl(BlockARM64LEnoov, v0)
 23897  				return true
 23898  			}
 23899  			break
 23900  		}
 23901  		// match: (LE (CMPWconst [0] z:(ADD x y)) yes no)
 23902  		// cond: z.Uses == 1
 23903  		// result: (LEnoov (CMNW x y) yes no)
 23904  		for b.Controls[0].Op == OpARM64CMPWconst {
 23905  			v_0 := b.Controls[0]
 23906  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23907  				break
 23908  			}
 23909  			z := v_0.Args[0]
 23910  			if z.Op != OpARM64ADD {
 23911  				break
 23912  			}
 23913  			_ = z.Args[1]
 23914  			z_0 := z.Args[0]
 23915  			z_1 := z.Args[1]
 23916  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23917  				x := z_0
 23918  				y := z_1
 23919  				if !(z.Uses == 1) {
 23920  					continue
 23921  				}
 23922  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23923  				v0.AddArg2(x, y)
 23924  				b.resetWithControl(BlockARM64LEnoov, v0)
 23925  				return true
 23926  			}
 23927  			break
 23928  		}
 23929  		// match: (LE (CMPconst [0] z:(MADD a x y)) yes no)
 23930  		// cond: z.Uses==1
 23931  		// result: (LEnoov (CMN a (MUL <x.Type> x y)) yes no)
 23932  		for b.Controls[0].Op == OpARM64CMPconst {
 23933  			v_0 := b.Controls[0]
 23934  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23935  				break
 23936  			}
 23937  			z := v_0.Args[0]
 23938  			if z.Op != OpARM64MADD {
 23939  				break
 23940  			}
 23941  			y := z.Args[2]
 23942  			a := z.Args[0]
 23943  			x := z.Args[1]
 23944  			if !(z.Uses == 1) {
 23945  				break
 23946  			}
 23947  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23948  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23949  			v1.AddArg2(x, y)
 23950  			v0.AddArg2(a, v1)
 23951  			b.resetWithControl(BlockARM64LEnoov, v0)
 23952  			return true
 23953  		}
 23954  		// match: (LE (CMPconst [0] z:(MSUB a x y)) yes no)
 23955  		// cond: z.Uses==1
 23956  		// result: (LEnoov (CMP a (MUL <x.Type> x y)) yes no)
 23957  		for b.Controls[0].Op == OpARM64CMPconst {
 23958  			v_0 := b.Controls[0]
 23959  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23960  				break
 23961  			}
 23962  			z := v_0.Args[0]
 23963  			if z.Op != OpARM64MSUB {
 23964  				break
 23965  			}
 23966  			y := z.Args[2]
 23967  			a := z.Args[0]
 23968  			x := z.Args[1]
 23969  			if !(z.Uses == 1) {
 23970  				break
 23971  			}
 23972  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 23973  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23974  			v1.AddArg2(x, y)
 23975  			v0.AddArg2(a, v1)
 23976  			b.resetWithControl(BlockARM64LEnoov, v0)
 23977  			return true
 23978  		}
 23979  		// match: (LE (CMPWconst [0] z:(MADDW a x y)) yes no)
 23980  		// cond: z.Uses==1
 23981  		// result: (LEnoov (CMNW a (MULW <x.Type> x y)) yes no)
 23982  		for b.Controls[0].Op == OpARM64CMPWconst {
 23983  			v_0 := b.Controls[0]
 23984  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23985  				break
 23986  			}
 23987  			z := v_0.Args[0]
 23988  			if z.Op != OpARM64MADDW {
 23989  				break
 23990  			}
 23991  			y := z.Args[2]
 23992  			a := z.Args[0]
 23993  			x := z.Args[1]
 23994  			if !(z.Uses == 1) {
 23995  				break
 23996  			}
 23997  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23998  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23999  			v1.AddArg2(x, y)
 24000  			v0.AddArg2(a, v1)
 24001  			b.resetWithControl(BlockARM64LEnoov, v0)
 24002  			return true
 24003  		}
 24004  		// match: (LE (CMPWconst [0] z:(MSUBW a x y)) yes no)
 24005  		// cond: z.Uses==1
 24006  		// result: (LEnoov (CMPW a (MULW <x.Type> x y)) yes no)
 24007  		for b.Controls[0].Op == OpARM64CMPWconst {
 24008  			v_0 := b.Controls[0]
 24009  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24010  				break
 24011  			}
 24012  			z := v_0.Args[0]
 24013  			if z.Op != OpARM64MSUBW {
 24014  				break
 24015  			}
 24016  			y := z.Args[2]
 24017  			a := z.Args[0]
 24018  			x := z.Args[1]
 24019  			if !(z.Uses == 1) {
 24020  				break
 24021  			}
 24022  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 24023  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24024  			v1.AddArg2(x, y)
 24025  			v0.AddArg2(a, v1)
 24026  			b.resetWithControl(BlockARM64LEnoov, v0)
 24027  			return true
 24028  		}
 24029  		// match: (LE (FlagConstant [fc]) yes no)
 24030  		// cond: fc.le()
 24031  		// result: (First yes no)
 24032  		for b.Controls[0].Op == OpARM64FlagConstant {
 24033  			v_0 := b.Controls[0]
 24034  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24035  			if !(fc.le()) {
 24036  				break
 24037  			}
 24038  			b.Reset(BlockFirst)
 24039  			return true
 24040  		}
 24041  		// match: (LE (FlagConstant [fc]) yes no)
 24042  		// cond: !fc.le()
 24043  		// result: (First no yes)
 24044  		for b.Controls[0].Op == OpARM64FlagConstant {
 24045  			v_0 := b.Controls[0]
 24046  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24047  			if !(!fc.le()) {
 24048  				break
 24049  			}
 24050  			b.Reset(BlockFirst)
 24051  			b.swapSuccessors()
 24052  			return true
 24053  		}
 24054  		// match: (LE (InvertFlags cmp) yes no)
 24055  		// result: (GE cmp yes no)
 24056  		for b.Controls[0].Op == OpARM64InvertFlags {
 24057  			v_0 := b.Controls[0]
 24058  			cmp := v_0.Args[0]
 24059  			b.resetWithControl(BlockARM64GE, cmp)
 24060  			return true
 24061  		}
 24062  	case BlockARM64LEnoov:
 24063  		// match: (LEnoov (FlagConstant [fc]) yes no)
 24064  		// cond: fc.leNoov()
 24065  		// result: (First yes no)
 24066  		for b.Controls[0].Op == OpARM64FlagConstant {
 24067  			v_0 := b.Controls[0]
 24068  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24069  			if !(fc.leNoov()) {
 24070  				break
 24071  			}
 24072  			b.Reset(BlockFirst)
 24073  			return true
 24074  		}
 24075  		// match: (LEnoov (FlagConstant [fc]) yes no)
 24076  		// cond: !fc.leNoov()
 24077  		// result: (First no yes)
 24078  		for b.Controls[0].Op == OpARM64FlagConstant {
 24079  			v_0 := b.Controls[0]
 24080  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24081  			if !(!fc.leNoov()) {
 24082  				break
 24083  			}
 24084  			b.Reset(BlockFirst)
 24085  			b.swapSuccessors()
 24086  			return true
 24087  		}
 24088  		// match: (LEnoov (InvertFlags cmp) yes no)
 24089  		// result: (GEnoov cmp yes no)
 24090  		for b.Controls[0].Op == OpARM64InvertFlags {
 24091  			v_0 := b.Controls[0]
 24092  			cmp := v_0.Args[0]
 24093  			b.resetWithControl(BlockARM64GEnoov, cmp)
 24094  			return true
 24095  		}
 24096  	case BlockARM64LT:
 24097  		// match: (LT (CMPconst [0] z:(AND x y)) yes no)
 24098  		// cond: z.Uses == 1
 24099  		// result: (LT (TST x y) yes no)
 24100  		for b.Controls[0].Op == OpARM64CMPconst {
 24101  			v_0 := b.Controls[0]
 24102  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24103  				break
 24104  			}
 24105  			z := v_0.Args[0]
 24106  			if z.Op != OpARM64AND {
 24107  				break
 24108  			}
 24109  			_ = z.Args[1]
 24110  			z_0 := z.Args[0]
 24111  			z_1 := z.Args[1]
 24112  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24113  				x := z_0
 24114  				y := z_1
 24115  				if !(z.Uses == 1) {
 24116  					continue
 24117  				}
 24118  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 24119  				v0.AddArg2(x, y)
 24120  				b.resetWithControl(BlockARM64LT, v0)
 24121  				return true
 24122  			}
 24123  			break
 24124  		}
 24125  		// match: (LT (CMPconst [0] x:(ANDconst [c] y)) yes no)
 24126  		// cond: x.Uses == 1
 24127  		// result: (LT (TSTconst [c] y) yes no)
 24128  		for b.Controls[0].Op == OpARM64CMPconst {
 24129  			v_0 := b.Controls[0]
 24130  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24131  				break
 24132  			}
 24133  			x := v_0.Args[0]
 24134  			if x.Op != OpARM64ANDconst {
 24135  				break
 24136  			}
 24137  			c := auxIntToInt64(x.AuxInt)
 24138  			y := x.Args[0]
 24139  			if !(x.Uses == 1) {
 24140  				break
 24141  			}
 24142  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 24143  			v0.AuxInt = int64ToAuxInt(c)
 24144  			v0.AddArg(y)
 24145  			b.resetWithControl(BlockARM64LT, v0)
 24146  			return true
 24147  		}
 24148  		// match: (LT (CMPWconst [0] z:(AND x y)) yes no)
 24149  		// cond: z.Uses == 1
 24150  		// result: (LT (TSTW x y) yes no)
 24151  		for b.Controls[0].Op == OpARM64CMPWconst {
 24152  			v_0 := b.Controls[0]
 24153  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24154  				break
 24155  			}
 24156  			z := v_0.Args[0]
 24157  			if z.Op != OpARM64AND {
 24158  				break
 24159  			}
 24160  			_ = z.Args[1]
 24161  			z_0 := z.Args[0]
 24162  			z_1 := z.Args[1]
 24163  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24164  				x := z_0
 24165  				y := z_1
 24166  				if !(z.Uses == 1) {
 24167  					continue
 24168  				}
 24169  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 24170  				v0.AddArg2(x, y)
 24171  				b.resetWithControl(BlockARM64LT, v0)
 24172  				return true
 24173  			}
 24174  			break
 24175  		}
 24176  		// match: (LT (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 24177  		// cond: x.Uses == 1
 24178  		// result: (LT (TSTWconst [int32(c)] y) yes no)
 24179  		for b.Controls[0].Op == OpARM64CMPWconst {
 24180  			v_0 := b.Controls[0]
 24181  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24182  				break
 24183  			}
 24184  			x := v_0.Args[0]
 24185  			if x.Op != OpARM64ANDconst {
 24186  				break
 24187  			}
 24188  			c := auxIntToInt64(x.AuxInt)
 24189  			y := x.Args[0]
 24190  			if !(x.Uses == 1) {
 24191  				break
 24192  			}
 24193  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 24194  			v0.AuxInt = int32ToAuxInt(int32(c))
 24195  			v0.AddArg(y)
 24196  			b.resetWithControl(BlockARM64LT, v0)
 24197  			return true
 24198  		}
 24199  		// match: (LT (CMPconst [0] x:(ADDconst [c] y)) yes no)
 24200  		// cond: x.Uses == 1
 24201  		// result: (LTnoov (CMNconst [c] y) yes no)
 24202  		for b.Controls[0].Op == OpARM64CMPconst {
 24203  			v_0 := b.Controls[0]
 24204  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24205  				break
 24206  			}
 24207  			x := v_0.Args[0]
 24208  			if x.Op != OpARM64ADDconst {
 24209  				break
 24210  			}
 24211  			c := auxIntToInt64(x.AuxInt)
 24212  			y := x.Args[0]
 24213  			if !(x.Uses == 1) {
 24214  				break
 24215  			}
 24216  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 24217  			v0.AuxInt = int64ToAuxInt(c)
 24218  			v0.AddArg(y)
 24219  			b.resetWithControl(BlockARM64LTnoov, v0)
 24220  			return true
 24221  		}
 24222  		// match: (LT (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 24223  		// cond: x.Uses == 1
 24224  		// result: (LTnoov (CMNWconst [int32(c)] y) yes no)
 24225  		for b.Controls[0].Op == OpARM64CMPWconst {
 24226  			v_0 := b.Controls[0]
 24227  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24228  				break
 24229  			}
 24230  			x := v_0.Args[0]
 24231  			if x.Op != OpARM64ADDconst {
 24232  				break
 24233  			}
 24234  			c := auxIntToInt64(x.AuxInt)
 24235  			y := x.Args[0]
 24236  			if !(x.Uses == 1) {
 24237  				break
 24238  			}
 24239  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 24240  			v0.AuxInt = int32ToAuxInt(int32(c))
 24241  			v0.AddArg(y)
 24242  			b.resetWithControl(BlockARM64LTnoov, v0)
 24243  			return true
 24244  		}
 24245  		// match: (LT (CMPconst [0] z:(ADD x y)) yes no)
 24246  		// cond: z.Uses == 1
 24247  		// result: (LTnoov (CMN x y) yes no)
 24248  		for b.Controls[0].Op == OpARM64CMPconst {
 24249  			v_0 := b.Controls[0]
 24250  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24251  				break
 24252  			}
 24253  			z := v_0.Args[0]
 24254  			if z.Op != OpARM64ADD {
 24255  				break
 24256  			}
 24257  			_ = z.Args[1]
 24258  			z_0 := z.Args[0]
 24259  			z_1 := z.Args[1]
 24260  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24261  				x := z_0
 24262  				y := z_1
 24263  				if !(z.Uses == 1) {
 24264  					continue
 24265  				}
 24266  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24267  				v0.AddArg2(x, y)
 24268  				b.resetWithControl(BlockARM64LTnoov, v0)
 24269  				return true
 24270  			}
 24271  			break
 24272  		}
 24273  		// match: (LT (CMPWconst [0] z:(ADD x y)) yes no)
 24274  		// cond: z.Uses == 1
 24275  		// result: (LTnoov (CMNW x y) yes no)
 24276  		for b.Controls[0].Op == OpARM64CMPWconst {
 24277  			v_0 := b.Controls[0]
 24278  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24279  				break
 24280  			}
 24281  			z := v_0.Args[0]
 24282  			if z.Op != OpARM64ADD {
 24283  				break
 24284  			}
 24285  			_ = z.Args[1]
 24286  			z_0 := z.Args[0]
 24287  			z_1 := z.Args[1]
 24288  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24289  				x := z_0
 24290  				y := z_1
 24291  				if !(z.Uses == 1) {
 24292  					continue
 24293  				}
 24294  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24295  				v0.AddArg2(x, y)
 24296  				b.resetWithControl(BlockARM64LTnoov, v0)
 24297  				return true
 24298  			}
 24299  			break
 24300  		}
 24301  		// match: (LT (CMPconst [0] z:(MADD a x y)) yes no)
 24302  		// cond: z.Uses==1
 24303  		// result: (LTnoov (CMN a (MUL <x.Type> x y)) yes no)
 24304  		for b.Controls[0].Op == OpARM64CMPconst {
 24305  			v_0 := b.Controls[0]
 24306  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24307  				break
 24308  			}
 24309  			z := v_0.Args[0]
 24310  			if z.Op != OpARM64MADD {
 24311  				break
 24312  			}
 24313  			y := z.Args[2]
 24314  			a := z.Args[0]
 24315  			x := z.Args[1]
 24316  			if !(z.Uses == 1) {
 24317  				break
 24318  			}
 24319  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24320  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24321  			v1.AddArg2(x, y)
 24322  			v0.AddArg2(a, v1)
 24323  			b.resetWithControl(BlockARM64LTnoov, v0)
 24324  			return true
 24325  		}
 24326  		// match: (LT (CMPconst [0] z:(MSUB a x y)) yes no)
 24327  		// cond: z.Uses==1
 24328  		// result: (LTnoov (CMP a (MUL <x.Type> x y)) yes no)
 24329  		for b.Controls[0].Op == OpARM64CMPconst {
 24330  			v_0 := b.Controls[0]
 24331  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24332  				break
 24333  			}
 24334  			z := v_0.Args[0]
 24335  			if z.Op != OpARM64MSUB {
 24336  				break
 24337  			}
 24338  			y := z.Args[2]
 24339  			a := z.Args[0]
 24340  			x := z.Args[1]
 24341  			if !(z.Uses == 1) {
 24342  				break
 24343  			}
 24344  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 24345  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24346  			v1.AddArg2(x, y)
 24347  			v0.AddArg2(a, v1)
 24348  			b.resetWithControl(BlockARM64LTnoov, v0)
 24349  			return true
 24350  		}
 24351  		// match: (LT (CMPWconst [0] z:(MADDW a x y)) yes no)
 24352  		// cond: z.Uses==1
 24353  		// result: (LTnoov (CMNW a (MULW <x.Type> x y)) yes no)
 24354  		for b.Controls[0].Op == OpARM64CMPWconst {
 24355  			v_0 := b.Controls[0]
 24356  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24357  				break
 24358  			}
 24359  			z := v_0.Args[0]
 24360  			if z.Op != OpARM64MADDW {
 24361  				break
 24362  			}
 24363  			y := z.Args[2]
 24364  			a := z.Args[0]
 24365  			x := z.Args[1]
 24366  			if !(z.Uses == 1) {
 24367  				break
 24368  			}
 24369  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24370  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24371  			v1.AddArg2(x, y)
 24372  			v0.AddArg2(a, v1)
 24373  			b.resetWithControl(BlockARM64LTnoov, v0)
 24374  			return true
 24375  		}
 24376  		// match: (LT (CMPWconst [0] z:(MSUBW a x y)) yes no)
 24377  		// cond: z.Uses==1
 24378  		// result: (LTnoov (CMPW a (MULW <x.Type> x y)) yes no)
 24379  		for b.Controls[0].Op == OpARM64CMPWconst {
 24380  			v_0 := b.Controls[0]
 24381  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24382  				break
 24383  			}
 24384  			z := v_0.Args[0]
 24385  			if z.Op != OpARM64MSUBW {
 24386  				break
 24387  			}
 24388  			y := z.Args[2]
 24389  			a := z.Args[0]
 24390  			x := z.Args[1]
 24391  			if !(z.Uses == 1) {
 24392  				break
 24393  			}
 24394  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 24395  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24396  			v1.AddArg2(x, y)
 24397  			v0.AddArg2(a, v1)
 24398  			b.resetWithControl(BlockARM64LTnoov, v0)
 24399  			return true
 24400  		}
 24401  		// match: (LT (CMPWconst [0] x) yes no)
 24402  		// result: (TBNZ [31] x yes no)
 24403  		for b.Controls[0].Op == OpARM64CMPWconst {
 24404  			v_0 := b.Controls[0]
 24405  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24406  				break
 24407  			}
 24408  			x := v_0.Args[0]
 24409  			b.resetWithControl(BlockARM64TBNZ, x)
 24410  			b.AuxInt = int64ToAuxInt(31)
 24411  			return true
 24412  		}
 24413  		// match: (LT (CMPconst [0] x) yes no)
 24414  		// result: (TBNZ [63] x yes no)
 24415  		for b.Controls[0].Op == OpARM64CMPconst {
 24416  			v_0 := b.Controls[0]
 24417  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24418  				break
 24419  			}
 24420  			x := v_0.Args[0]
 24421  			b.resetWithControl(BlockARM64TBNZ, x)
 24422  			b.AuxInt = int64ToAuxInt(63)
 24423  			return true
 24424  		}
 24425  		// match: (LT (FlagConstant [fc]) yes no)
 24426  		// cond: fc.lt()
 24427  		// result: (First yes no)
 24428  		for b.Controls[0].Op == OpARM64FlagConstant {
 24429  			v_0 := b.Controls[0]
 24430  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24431  			if !(fc.lt()) {
 24432  				break
 24433  			}
 24434  			b.Reset(BlockFirst)
 24435  			return true
 24436  		}
 24437  		// match: (LT (FlagConstant [fc]) yes no)
 24438  		// cond: !fc.lt()
 24439  		// result: (First no yes)
 24440  		for b.Controls[0].Op == OpARM64FlagConstant {
 24441  			v_0 := b.Controls[0]
 24442  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24443  			if !(!fc.lt()) {
 24444  				break
 24445  			}
 24446  			b.Reset(BlockFirst)
 24447  			b.swapSuccessors()
 24448  			return true
 24449  		}
 24450  		// match: (LT (InvertFlags cmp) yes no)
 24451  		// result: (GT cmp yes no)
 24452  		for b.Controls[0].Op == OpARM64InvertFlags {
 24453  			v_0 := b.Controls[0]
 24454  			cmp := v_0.Args[0]
 24455  			b.resetWithControl(BlockARM64GT, cmp)
 24456  			return true
 24457  		}
 24458  	case BlockARM64LTnoov:
 24459  		// match: (LTnoov (FlagConstant [fc]) yes no)
 24460  		// cond: fc.ltNoov()
 24461  		// result: (First yes no)
 24462  		for b.Controls[0].Op == OpARM64FlagConstant {
 24463  			v_0 := b.Controls[0]
 24464  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24465  			if !(fc.ltNoov()) {
 24466  				break
 24467  			}
 24468  			b.Reset(BlockFirst)
 24469  			return true
 24470  		}
 24471  		// match: (LTnoov (FlagConstant [fc]) yes no)
 24472  		// cond: !fc.ltNoov()
 24473  		// result: (First no yes)
 24474  		for b.Controls[0].Op == OpARM64FlagConstant {
 24475  			v_0 := b.Controls[0]
 24476  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24477  			if !(!fc.ltNoov()) {
 24478  				break
 24479  			}
 24480  			b.Reset(BlockFirst)
 24481  			b.swapSuccessors()
 24482  			return true
 24483  		}
 24484  		// match: (LTnoov (InvertFlags cmp) yes no)
 24485  		// result: (GTnoov cmp yes no)
 24486  		for b.Controls[0].Op == OpARM64InvertFlags {
 24487  			v_0 := b.Controls[0]
 24488  			cmp := v_0.Args[0]
 24489  			b.resetWithControl(BlockARM64GTnoov, cmp)
 24490  			return true
 24491  		}
 24492  	case BlockARM64NE:
 24493  		// match: (NE (CMPconst [0] z:(AND x y)) yes no)
 24494  		// cond: z.Uses == 1
 24495  		// result: (NE (TST x y) yes no)
 24496  		for b.Controls[0].Op == OpARM64CMPconst {
 24497  			v_0 := b.Controls[0]
 24498  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24499  				break
 24500  			}
 24501  			z := v_0.Args[0]
 24502  			if z.Op != OpARM64AND {
 24503  				break
 24504  			}
 24505  			_ = z.Args[1]
 24506  			z_0 := z.Args[0]
 24507  			z_1 := z.Args[1]
 24508  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24509  				x := z_0
 24510  				y := z_1
 24511  				if !(z.Uses == 1) {
 24512  					continue
 24513  				}
 24514  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 24515  				v0.AddArg2(x, y)
 24516  				b.resetWithControl(BlockARM64NE, v0)
 24517  				return true
 24518  			}
 24519  			break
 24520  		}
 24521  		// match: (NE (CMPconst [0] x:(ANDconst [c] y)) yes no)
 24522  		// cond: x.Uses == 1
 24523  		// result: (NE (TSTconst [c] y) yes no)
 24524  		for b.Controls[0].Op == OpARM64CMPconst {
 24525  			v_0 := b.Controls[0]
 24526  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24527  				break
 24528  			}
 24529  			x := v_0.Args[0]
 24530  			if x.Op != OpARM64ANDconst {
 24531  				break
 24532  			}
 24533  			c := auxIntToInt64(x.AuxInt)
 24534  			y := x.Args[0]
 24535  			if !(x.Uses == 1) {
 24536  				break
 24537  			}
 24538  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 24539  			v0.AuxInt = int64ToAuxInt(c)
 24540  			v0.AddArg(y)
 24541  			b.resetWithControl(BlockARM64NE, v0)
 24542  			return true
 24543  		}
 24544  		// match: (NE (CMPWconst [0] z:(AND x y)) yes no)
 24545  		// cond: z.Uses == 1
 24546  		// result: (NE (TSTW x y) yes no)
 24547  		for b.Controls[0].Op == OpARM64CMPWconst {
 24548  			v_0 := b.Controls[0]
 24549  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24550  				break
 24551  			}
 24552  			z := v_0.Args[0]
 24553  			if z.Op != OpARM64AND {
 24554  				break
 24555  			}
 24556  			_ = z.Args[1]
 24557  			z_0 := z.Args[0]
 24558  			z_1 := z.Args[1]
 24559  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24560  				x := z_0
 24561  				y := z_1
 24562  				if !(z.Uses == 1) {
 24563  					continue
 24564  				}
 24565  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 24566  				v0.AddArg2(x, y)
 24567  				b.resetWithControl(BlockARM64NE, v0)
 24568  				return true
 24569  			}
 24570  			break
 24571  		}
 24572  		// match: (NE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 24573  		// cond: x.Uses == 1
 24574  		// result: (NE (TSTWconst [int32(c)] y) yes no)
 24575  		for b.Controls[0].Op == OpARM64CMPWconst {
 24576  			v_0 := b.Controls[0]
 24577  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24578  				break
 24579  			}
 24580  			x := v_0.Args[0]
 24581  			if x.Op != OpARM64ANDconst {
 24582  				break
 24583  			}
 24584  			c := auxIntToInt64(x.AuxInt)
 24585  			y := x.Args[0]
 24586  			if !(x.Uses == 1) {
 24587  				break
 24588  			}
 24589  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 24590  			v0.AuxInt = int32ToAuxInt(int32(c))
 24591  			v0.AddArg(y)
 24592  			b.resetWithControl(BlockARM64NE, v0)
 24593  			return true
 24594  		}
 24595  		// match: (NE (CMPconst [0] x:(ADDconst [c] y)) yes no)
 24596  		// cond: x.Uses == 1
 24597  		// result: (NE (CMNconst [c] y) yes no)
 24598  		for b.Controls[0].Op == OpARM64CMPconst {
 24599  			v_0 := b.Controls[0]
 24600  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24601  				break
 24602  			}
 24603  			x := v_0.Args[0]
 24604  			if x.Op != OpARM64ADDconst {
 24605  				break
 24606  			}
 24607  			c := auxIntToInt64(x.AuxInt)
 24608  			y := x.Args[0]
 24609  			if !(x.Uses == 1) {
 24610  				break
 24611  			}
 24612  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 24613  			v0.AuxInt = int64ToAuxInt(c)
 24614  			v0.AddArg(y)
 24615  			b.resetWithControl(BlockARM64NE, v0)
 24616  			return true
 24617  		}
 24618  		// match: (NE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 24619  		// cond: x.Uses == 1
 24620  		// result: (NE (CMNWconst [int32(c)] y) yes no)
 24621  		for b.Controls[0].Op == OpARM64CMPWconst {
 24622  			v_0 := b.Controls[0]
 24623  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24624  				break
 24625  			}
 24626  			x := v_0.Args[0]
 24627  			if x.Op != OpARM64ADDconst {
 24628  				break
 24629  			}
 24630  			c := auxIntToInt64(x.AuxInt)
 24631  			y := x.Args[0]
 24632  			if !(x.Uses == 1) {
 24633  				break
 24634  			}
 24635  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 24636  			v0.AuxInt = int32ToAuxInt(int32(c))
 24637  			v0.AddArg(y)
 24638  			b.resetWithControl(BlockARM64NE, v0)
 24639  			return true
 24640  		}
 24641  		// match: (NE (CMPconst [0] z:(ADD x y)) yes no)
 24642  		// cond: z.Uses == 1
 24643  		// result: (NE (CMN x y) yes no)
 24644  		for b.Controls[0].Op == OpARM64CMPconst {
 24645  			v_0 := b.Controls[0]
 24646  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24647  				break
 24648  			}
 24649  			z := v_0.Args[0]
 24650  			if z.Op != OpARM64ADD {
 24651  				break
 24652  			}
 24653  			_ = z.Args[1]
 24654  			z_0 := z.Args[0]
 24655  			z_1 := z.Args[1]
 24656  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24657  				x := z_0
 24658  				y := z_1
 24659  				if !(z.Uses == 1) {
 24660  					continue
 24661  				}
 24662  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24663  				v0.AddArg2(x, y)
 24664  				b.resetWithControl(BlockARM64NE, v0)
 24665  				return true
 24666  			}
 24667  			break
 24668  		}
 24669  		// match: (NE (CMPWconst [0] z:(ADD x y)) yes no)
 24670  		// cond: z.Uses == 1
 24671  		// result: (NE (CMNW x y) yes no)
 24672  		for b.Controls[0].Op == OpARM64CMPWconst {
 24673  			v_0 := b.Controls[0]
 24674  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24675  				break
 24676  			}
 24677  			z := v_0.Args[0]
 24678  			if z.Op != OpARM64ADD {
 24679  				break
 24680  			}
 24681  			_ = z.Args[1]
 24682  			z_0 := z.Args[0]
 24683  			z_1 := z.Args[1]
 24684  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24685  				x := z_0
 24686  				y := z_1
 24687  				if !(z.Uses == 1) {
 24688  					continue
 24689  				}
 24690  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24691  				v0.AddArg2(x, y)
 24692  				b.resetWithControl(BlockARM64NE, v0)
 24693  				return true
 24694  			}
 24695  			break
 24696  		}
 24697  		// match: (NE (CMP x z:(NEG y)) yes no)
 24698  		// cond: z.Uses == 1
 24699  		// result: (NE (CMN x y) yes no)
 24700  		for b.Controls[0].Op == OpARM64CMP {
 24701  			v_0 := b.Controls[0]
 24702  			_ = v_0.Args[1]
 24703  			x := v_0.Args[0]
 24704  			z := v_0.Args[1]
 24705  			if z.Op != OpARM64NEG {
 24706  				break
 24707  			}
 24708  			y := z.Args[0]
 24709  			if !(z.Uses == 1) {
 24710  				break
 24711  			}
 24712  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24713  			v0.AddArg2(x, y)
 24714  			b.resetWithControl(BlockARM64NE, v0)
 24715  			return true
 24716  		}
 24717  		// match: (NE (CMPW x z:(NEG y)) yes no)
 24718  		// cond: z.Uses == 1
 24719  		// result: (NE (CMNW x y) yes no)
 24720  		for b.Controls[0].Op == OpARM64CMPW {
 24721  			v_0 := b.Controls[0]
 24722  			_ = v_0.Args[1]
 24723  			x := v_0.Args[0]
 24724  			z := v_0.Args[1]
 24725  			if z.Op != OpARM64NEG {
 24726  				break
 24727  			}
 24728  			y := z.Args[0]
 24729  			if !(z.Uses == 1) {
 24730  				break
 24731  			}
 24732  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24733  			v0.AddArg2(x, y)
 24734  			b.resetWithControl(BlockARM64NE, v0)
 24735  			return true
 24736  		}
 24737  		// match: (NE (CMPconst [0] x) yes no)
 24738  		// result: (NZ x yes no)
 24739  		for b.Controls[0].Op == OpARM64CMPconst {
 24740  			v_0 := b.Controls[0]
 24741  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24742  				break
 24743  			}
 24744  			x := v_0.Args[0]
 24745  			b.resetWithControl(BlockARM64NZ, x)
 24746  			return true
 24747  		}
 24748  		// match: (NE (CMPWconst [0] x) yes no)
 24749  		// result: (NZW x yes no)
 24750  		for b.Controls[0].Op == OpARM64CMPWconst {
 24751  			v_0 := b.Controls[0]
 24752  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24753  				break
 24754  			}
 24755  			x := v_0.Args[0]
 24756  			b.resetWithControl(BlockARM64NZW, x)
 24757  			return true
 24758  		}
 24759  		// match: (NE (CMPconst [0] z:(MADD a x y)) yes no)
 24760  		// cond: z.Uses==1
 24761  		// result: (NE (CMN a (MUL <x.Type> x y)) yes no)
 24762  		for b.Controls[0].Op == OpARM64CMPconst {
 24763  			v_0 := b.Controls[0]
 24764  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24765  				break
 24766  			}
 24767  			z := v_0.Args[0]
 24768  			if z.Op != OpARM64MADD {
 24769  				break
 24770  			}
 24771  			y := z.Args[2]
 24772  			a := z.Args[0]
 24773  			x := z.Args[1]
 24774  			if !(z.Uses == 1) {
 24775  				break
 24776  			}
 24777  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24778  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24779  			v1.AddArg2(x, y)
 24780  			v0.AddArg2(a, v1)
 24781  			b.resetWithControl(BlockARM64NE, v0)
 24782  			return true
 24783  		}
 24784  		// match: (NE (CMPconst [0] z:(MSUB a x y)) yes no)
 24785  		// cond: z.Uses==1
 24786  		// result: (NE (CMP a (MUL <x.Type> x y)) yes no)
 24787  		for b.Controls[0].Op == OpARM64CMPconst {
 24788  			v_0 := b.Controls[0]
 24789  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24790  				break
 24791  			}
 24792  			z := v_0.Args[0]
 24793  			if z.Op != OpARM64MSUB {
 24794  				break
 24795  			}
 24796  			y := z.Args[2]
 24797  			a := z.Args[0]
 24798  			x := z.Args[1]
 24799  			if !(z.Uses == 1) {
 24800  				break
 24801  			}
 24802  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 24803  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24804  			v1.AddArg2(x, y)
 24805  			v0.AddArg2(a, v1)
 24806  			b.resetWithControl(BlockARM64NE, v0)
 24807  			return true
 24808  		}
 24809  		// match: (NE (CMPWconst [0] z:(MADDW a x y)) yes no)
 24810  		// cond: z.Uses==1
 24811  		// result: (NE (CMNW a (MULW <x.Type> x y)) yes no)
 24812  		for b.Controls[0].Op == OpARM64CMPWconst {
 24813  			v_0 := b.Controls[0]
 24814  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24815  				break
 24816  			}
 24817  			z := v_0.Args[0]
 24818  			if z.Op != OpARM64MADDW {
 24819  				break
 24820  			}
 24821  			y := z.Args[2]
 24822  			a := z.Args[0]
 24823  			x := z.Args[1]
 24824  			if !(z.Uses == 1) {
 24825  				break
 24826  			}
 24827  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24828  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24829  			v1.AddArg2(x, y)
 24830  			v0.AddArg2(a, v1)
 24831  			b.resetWithControl(BlockARM64NE, v0)
 24832  			return true
 24833  		}
 24834  		// match: (NE (CMPWconst [0] z:(MSUBW a x y)) yes no)
 24835  		// cond: z.Uses==1
 24836  		// result: (NE (CMPW a (MULW <x.Type> x y)) yes no)
 24837  		for b.Controls[0].Op == OpARM64CMPWconst {
 24838  			v_0 := b.Controls[0]
 24839  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24840  				break
 24841  			}
 24842  			z := v_0.Args[0]
 24843  			if z.Op != OpARM64MSUBW {
 24844  				break
 24845  			}
 24846  			y := z.Args[2]
 24847  			a := z.Args[0]
 24848  			x := z.Args[1]
 24849  			if !(z.Uses == 1) {
 24850  				break
 24851  			}
 24852  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 24853  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24854  			v1.AddArg2(x, y)
 24855  			v0.AddArg2(a, v1)
 24856  			b.resetWithControl(BlockARM64NE, v0)
 24857  			return true
 24858  		}
 24859  		// match: (NE (TSTconst [c] x) yes no)
 24860  		// cond: oneBit(c)
 24861  		// result: (TBNZ [int64(ntz64(c))] x yes no)
 24862  		for b.Controls[0].Op == OpARM64TSTconst {
 24863  			v_0 := b.Controls[0]
 24864  			c := auxIntToInt64(v_0.AuxInt)
 24865  			x := v_0.Args[0]
 24866  			if !(oneBit(c)) {
 24867  				break
 24868  			}
 24869  			b.resetWithControl(BlockARM64TBNZ, x)
 24870  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 24871  			return true
 24872  		}
 24873  		// match: (NE (TSTWconst [c] x) yes no)
 24874  		// cond: oneBit(int64(uint32(c)))
 24875  		// result: (TBNZ [int64(ntz64(int64(uint32(c))))] x yes no)
 24876  		for b.Controls[0].Op == OpARM64TSTWconst {
 24877  			v_0 := b.Controls[0]
 24878  			c := auxIntToInt32(v_0.AuxInt)
 24879  			x := v_0.Args[0]
 24880  			if !(oneBit(int64(uint32(c)))) {
 24881  				break
 24882  			}
 24883  			b.resetWithControl(BlockARM64TBNZ, x)
 24884  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 24885  			return true
 24886  		}
 24887  		// match: (NE (FlagConstant [fc]) yes no)
 24888  		// cond: fc.ne()
 24889  		// result: (First yes no)
 24890  		for b.Controls[0].Op == OpARM64FlagConstant {
 24891  			v_0 := b.Controls[0]
 24892  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24893  			if !(fc.ne()) {
 24894  				break
 24895  			}
 24896  			b.Reset(BlockFirst)
 24897  			return true
 24898  		}
 24899  		// match: (NE (FlagConstant [fc]) yes no)
 24900  		// cond: !fc.ne()
 24901  		// result: (First no yes)
 24902  		for b.Controls[0].Op == OpARM64FlagConstant {
 24903  			v_0 := b.Controls[0]
 24904  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24905  			if !(!fc.ne()) {
 24906  				break
 24907  			}
 24908  			b.Reset(BlockFirst)
 24909  			b.swapSuccessors()
 24910  			return true
 24911  		}
 24912  		// match: (NE (InvertFlags cmp) yes no)
 24913  		// result: (NE cmp yes no)
 24914  		for b.Controls[0].Op == OpARM64InvertFlags {
 24915  			v_0 := b.Controls[0]
 24916  			cmp := v_0.Args[0]
 24917  			b.resetWithControl(BlockARM64NE, cmp)
 24918  			return true
 24919  		}
 24920  	case BlockARM64NZ:
 24921  		// match: (NZ (Equal cc) yes no)
 24922  		// result: (EQ cc yes no)
 24923  		for b.Controls[0].Op == OpARM64Equal {
 24924  			v_0 := b.Controls[0]
 24925  			cc := v_0.Args[0]
 24926  			b.resetWithControl(BlockARM64EQ, cc)
 24927  			return true
 24928  		}
 24929  		// match: (NZ (NotEqual cc) yes no)
 24930  		// result: (NE cc yes no)
 24931  		for b.Controls[0].Op == OpARM64NotEqual {
 24932  			v_0 := b.Controls[0]
 24933  			cc := v_0.Args[0]
 24934  			b.resetWithControl(BlockARM64NE, cc)
 24935  			return true
 24936  		}
 24937  		// match: (NZ (LessThan cc) yes no)
 24938  		// result: (LT cc yes no)
 24939  		for b.Controls[0].Op == OpARM64LessThan {
 24940  			v_0 := b.Controls[0]
 24941  			cc := v_0.Args[0]
 24942  			b.resetWithControl(BlockARM64LT, cc)
 24943  			return true
 24944  		}
 24945  		// match: (NZ (LessThanU cc) yes no)
 24946  		// result: (ULT cc yes no)
 24947  		for b.Controls[0].Op == OpARM64LessThanU {
 24948  			v_0 := b.Controls[0]
 24949  			cc := v_0.Args[0]
 24950  			b.resetWithControl(BlockARM64ULT, cc)
 24951  			return true
 24952  		}
 24953  		// match: (NZ (LessEqual cc) yes no)
 24954  		// result: (LE cc yes no)
 24955  		for b.Controls[0].Op == OpARM64LessEqual {
 24956  			v_0 := b.Controls[0]
 24957  			cc := v_0.Args[0]
 24958  			b.resetWithControl(BlockARM64LE, cc)
 24959  			return true
 24960  		}
 24961  		// match: (NZ (LessEqualU cc) yes no)
 24962  		// result: (ULE cc yes no)
 24963  		for b.Controls[0].Op == OpARM64LessEqualU {
 24964  			v_0 := b.Controls[0]
 24965  			cc := v_0.Args[0]
 24966  			b.resetWithControl(BlockARM64ULE, cc)
 24967  			return true
 24968  		}
 24969  		// match: (NZ (GreaterThan cc) yes no)
 24970  		// result: (GT cc yes no)
 24971  		for b.Controls[0].Op == OpARM64GreaterThan {
 24972  			v_0 := b.Controls[0]
 24973  			cc := v_0.Args[0]
 24974  			b.resetWithControl(BlockARM64GT, cc)
 24975  			return true
 24976  		}
 24977  		// match: (NZ (GreaterThanU cc) yes no)
 24978  		// result: (UGT cc yes no)
 24979  		for b.Controls[0].Op == OpARM64GreaterThanU {
 24980  			v_0 := b.Controls[0]
 24981  			cc := v_0.Args[0]
 24982  			b.resetWithControl(BlockARM64UGT, cc)
 24983  			return true
 24984  		}
 24985  		// match: (NZ (GreaterEqual cc) yes no)
 24986  		// result: (GE cc yes no)
 24987  		for b.Controls[0].Op == OpARM64GreaterEqual {
 24988  			v_0 := b.Controls[0]
 24989  			cc := v_0.Args[0]
 24990  			b.resetWithControl(BlockARM64GE, cc)
 24991  			return true
 24992  		}
 24993  		// match: (NZ (GreaterEqualU cc) yes no)
 24994  		// result: (UGE cc yes no)
 24995  		for b.Controls[0].Op == OpARM64GreaterEqualU {
 24996  			v_0 := b.Controls[0]
 24997  			cc := v_0.Args[0]
 24998  			b.resetWithControl(BlockARM64UGE, cc)
 24999  			return true
 25000  		}
 25001  		// match: (NZ (LessThanF cc) yes no)
 25002  		// result: (FLT cc yes no)
 25003  		for b.Controls[0].Op == OpARM64LessThanF {
 25004  			v_0 := b.Controls[0]
 25005  			cc := v_0.Args[0]
 25006  			b.resetWithControl(BlockARM64FLT, cc)
 25007  			return true
 25008  		}
 25009  		// match: (NZ (LessEqualF cc) yes no)
 25010  		// result: (FLE cc yes no)
 25011  		for b.Controls[0].Op == OpARM64LessEqualF {
 25012  			v_0 := b.Controls[0]
 25013  			cc := v_0.Args[0]
 25014  			b.resetWithControl(BlockARM64FLE, cc)
 25015  			return true
 25016  		}
 25017  		// match: (NZ (GreaterThanF cc) yes no)
 25018  		// result: (FGT cc yes no)
 25019  		for b.Controls[0].Op == OpARM64GreaterThanF {
 25020  			v_0 := b.Controls[0]
 25021  			cc := v_0.Args[0]
 25022  			b.resetWithControl(BlockARM64FGT, cc)
 25023  			return true
 25024  		}
 25025  		// match: (NZ (GreaterEqualF cc) yes no)
 25026  		// result: (FGE cc yes no)
 25027  		for b.Controls[0].Op == OpARM64GreaterEqualF {
 25028  			v_0 := b.Controls[0]
 25029  			cc := v_0.Args[0]
 25030  			b.resetWithControl(BlockARM64FGE, cc)
 25031  			return true
 25032  		}
 25033  		// match: (NZ sub:(SUB x y))
 25034  		// cond: sub.Uses == 1
 25035  		// result: (NE (CMP x y))
 25036  		for b.Controls[0].Op == OpARM64SUB {
 25037  			sub := b.Controls[0]
 25038  			y := sub.Args[1]
 25039  			x := sub.Args[0]
 25040  			if !(sub.Uses == 1) {
 25041  				break
 25042  			}
 25043  			v0 := b.NewValue0(sub.Pos, OpARM64CMP, types.TypeFlags)
 25044  			v0.AddArg2(x, y)
 25045  			b.resetWithControl(BlockARM64NE, v0)
 25046  			return true
 25047  		}
 25048  		// match: (NZ sub:(SUBconst [c] y))
 25049  		// cond: sub.Uses == 1
 25050  		// result: (NE (CMPconst [c] y))
 25051  		for b.Controls[0].Op == OpARM64SUBconst {
 25052  			sub := b.Controls[0]
 25053  			c := auxIntToInt64(sub.AuxInt)
 25054  			y := sub.Args[0]
 25055  			if !(sub.Uses == 1) {
 25056  				break
 25057  			}
 25058  			v0 := b.NewValue0(sub.Pos, OpARM64CMPconst, types.TypeFlags)
 25059  			v0.AuxInt = int64ToAuxInt(c)
 25060  			v0.AddArg(y)
 25061  			b.resetWithControl(BlockARM64NE, v0)
 25062  			return true
 25063  		}
 25064  		// match: (NZ (ANDconst [c] x) yes no)
 25065  		// cond: oneBit(c)
 25066  		// result: (TBNZ [int64(ntz64(c))] x yes no)
 25067  		for b.Controls[0].Op == OpARM64ANDconst {
 25068  			v_0 := b.Controls[0]
 25069  			c := auxIntToInt64(v_0.AuxInt)
 25070  			x := v_0.Args[0]
 25071  			if !(oneBit(c)) {
 25072  				break
 25073  			}
 25074  			b.resetWithControl(BlockARM64TBNZ, x)
 25075  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 25076  			return true
 25077  		}
 25078  		// match: (NZ (MOVDconst [0]) yes no)
 25079  		// result: (First no yes)
 25080  		for b.Controls[0].Op == OpARM64MOVDconst {
 25081  			v_0 := b.Controls[0]
 25082  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25083  				break
 25084  			}
 25085  			b.Reset(BlockFirst)
 25086  			b.swapSuccessors()
 25087  			return true
 25088  		}
 25089  		// match: (NZ (MOVDconst [c]) yes no)
 25090  		// cond: c != 0
 25091  		// result: (First yes no)
 25092  		for b.Controls[0].Op == OpARM64MOVDconst {
 25093  			v_0 := b.Controls[0]
 25094  			c := auxIntToInt64(v_0.AuxInt)
 25095  			if !(c != 0) {
 25096  				break
 25097  			}
 25098  			b.Reset(BlockFirst)
 25099  			return true
 25100  		}
 25101  	case BlockARM64NZW:
 25102  		// match: (NZW sub:(SUB x y))
 25103  		// cond: sub.Uses == 1
 25104  		// result: (NE (CMPW x y))
 25105  		for b.Controls[0].Op == OpARM64SUB {
 25106  			sub := b.Controls[0]
 25107  			y := sub.Args[1]
 25108  			x := sub.Args[0]
 25109  			if !(sub.Uses == 1) {
 25110  				break
 25111  			}
 25112  			v0 := b.NewValue0(sub.Pos, OpARM64CMPW, types.TypeFlags)
 25113  			v0.AddArg2(x, y)
 25114  			b.resetWithControl(BlockARM64NE, v0)
 25115  			return true
 25116  		}
 25117  		// match: (NZW sub:(SUBconst [c] y))
 25118  		// cond: sub.Uses == 1
 25119  		// result: (NE (CMPWconst [int32(c)] y))
 25120  		for b.Controls[0].Op == OpARM64SUBconst {
 25121  			sub := b.Controls[0]
 25122  			c := auxIntToInt64(sub.AuxInt)
 25123  			y := sub.Args[0]
 25124  			if !(sub.Uses == 1) {
 25125  				break
 25126  			}
 25127  			v0 := b.NewValue0(sub.Pos, OpARM64CMPWconst, types.TypeFlags)
 25128  			v0.AuxInt = int32ToAuxInt(int32(c))
 25129  			v0.AddArg(y)
 25130  			b.resetWithControl(BlockARM64NE, v0)
 25131  			return true
 25132  		}
 25133  		// match: (NZW (ANDconst [c] x) yes no)
 25134  		// cond: oneBit(int64(uint32(c)))
 25135  		// result: (TBNZ [int64(ntz64(int64(uint32(c))))] x yes no)
 25136  		for b.Controls[0].Op == OpARM64ANDconst {
 25137  			v_0 := b.Controls[0]
 25138  			c := auxIntToInt64(v_0.AuxInt)
 25139  			x := v_0.Args[0]
 25140  			if !(oneBit(int64(uint32(c)))) {
 25141  				break
 25142  			}
 25143  			b.resetWithControl(BlockARM64TBNZ, x)
 25144  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 25145  			return true
 25146  		}
 25147  		// match: (NZW (MOVDconst [c]) yes no)
 25148  		// cond: int32(c) == 0
 25149  		// result: (First no yes)
 25150  		for b.Controls[0].Op == OpARM64MOVDconst {
 25151  			v_0 := b.Controls[0]
 25152  			c := auxIntToInt64(v_0.AuxInt)
 25153  			if !(int32(c) == 0) {
 25154  				break
 25155  			}
 25156  			b.Reset(BlockFirst)
 25157  			b.swapSuccessors()
 25158  			return true
 25159  		}
 25160  		// match: (NZW (MOVDconst [c]) yes no)
 25161  		// cond: int32(c) != 0
 25162  		// result: (First yes no)
 25163  		for b.Controls[0].Op == OpARM64MOVDconst {
 25164  			v_0 := b.Controls[0]
 25165  			c := auxIntToInt64(v_0.AuxInt)
 25166  			if !(int32(c) != 0) {
 25167  				break
 25168  			}
 25169  			b.Reset(BlockFirst)
 25170  			return true
 25171  		}
 25172  	case BlockARM64TBNZ:
 25173  		// match: (TBNZ [0] (Equal cc) yes no)
 25174  		// result: (EQ cc yes no)
 25175  		for b.Controls[0].Op == OpARM64Equal {
 25176  			v_0 := b.Controls[0]
 25177  			cc := v_0.Args[0]
 25178  			if auxIntToInt64(b.AuxInt) != 0 {
 25179  				break
 25180  			}
 25181  			b.resetWithControl(BlockARM64EQ, cc)
 25182  			return true
 25183  		}
 25184  		// match: (TBNZ [0] (NotEqual cc) yes no)
 25185  		// result: (NE cc yes no)
 25186  		for b.Controls[0].Op == OpARM64NotEqual {
 25187  			v_0 := b.Controls[0]
 25188  			cc := v_0.Args[0]
 25189  			if auxIntToInt64(b.AuxInt) != 0 {
 25190  				break
 25191  			}
 25192  			b.resetWithControl(BlockARM64NE, cc)
 25193  			return true
 25194  		}
 25195  		// match: (TBNZ [0] (LessThan cc) yes no)
 25196  		// result: (LT cc yes no)
 25197  		for b.Controls[0].Op == OpARM64LessThan {
 25198  			v_0 := b.Controls[0]
 25199  			cc := v_0.Args[0]
 25200  			if auxIntToInt64(b.AuxInt) != 0 {
 25201  				break
 25202  			}
 25203  			b.resetWithControl(BlockARM64LT, cc)
 25204  			return true
 25205  		}
 25206  		// match: (TBNZ [0] (LessThanU cc) yes no)
 25207  		// result: (ULT cc yes no)
 25208  		for b.Controls[0].Op == OpARM64LessThanU {
 25209  			v_0 := b.Controls[0]
 25210  			cc := v_0.Args[0]
 25211  			if auxIntToInt64(b.AuxInt) != 0 {
 25212  				break
 25213  			}
 25214  			b.resetWithControl(BlockARM64ULT, cc)
 25215  			return true
 25216  		}
 25217  		// match: (TBNZ [0] (LessEqual cc) yes no)
 25218  		// result: (LE cc yes no)
 25219  		for b.Controls[0].Op == OpARM64LessEqual {
 25220  			v_0 := b.Controls[0]
 25221  			cc := v_0.Args[0]
 25222  			if auxIntToInt64(b.AuxInt) != 0 {
 25223  				break
 25224  			}
 25225  			b.resetWithControl(BlockARM64LE, cc)
 25226  			return true
 25227  		}
 25228  		// match: (TBNZ [0] (LessEqualU cc) yes no)
 25229  		// result: (ULE cc yes no)
 25230  		for b.Controls[0].Op == OpARM64LessEqualU {
 25231  			v_0 := b.Controls[0]
 25232  			cc := v_0.Args[0]
 25233  			if auxIntToInt64(b.AuxInt) != 0 {
 25234  				break
 25235  			}
 25236  			b.resetWithControl(BlockARM64ULE, cc)
 25237  			return true
 25238  		}
 25239  		// match: (TBNZ [0] (GreaterThan cc) yes no)
 25240  		// result: (GT cc yes no)
 25241  		for b.Controls[0].Op == OpARM64GreaterThan {
 25242  			v_0 := b.Controls[0]
 25243  			cc := v_0.Args[0]
 25244  			if auxIntToInt64(b.AuxInt) != 0 {
 25245  				break
 25246  			}
 25247  			b.resetWithControl(BlockARM64GT, cc)
 25248  			return true
 25249  		}
 25250  		// match: (TBNZ [0] (GreaterThanU cc) yes no)
 25251  		// result: (UGT cc yes no)
 25252  		for b.Controls[0].Op == OpARM64GreaterThanU {
 25253  			v_0 := b.Controls[0]
 25254  			cc := v_0.Args[0]
 25255  			if auxIntToInt64(b.AuxInt) != 0 {
 25256  				break
 25257  			}
 25258  			b.resetWithControl(BlockARM64UGT, cc)
 25259  			return true
 25260  		}
 25261  		// match: (TBNZ [0] (GreaterEqual cc) yes no)
 25262  		// result: (GE cc yes no)
 25263  		for b.Controls[0].Op == OpARM64GreaterEqual {
 25264  			v_0 := b.Controls[0]
 25265  			cc := v_0.Args[0]
 25266  			if auxIntToInt64(b.AuxInt) != 0 {
 25267  				break
 25268  			}
 25269  			b.resetWithControl(BlockARM64GE, cc)
 25270  			return true
 25271  		}
 25272  		// match: (TBNZ [0] (GreaterEqualU cc) yes no)
 25273  		// result: (UGE cc yes no)
 25274  		for b.Controls[0].Op == OpARM64GreaterEqualU {
 25275  			v_0 := b.Controls[0]
 25276  			cc := v_0.Args[0]
 25277  			if auxIntToInt64(b.AuxInt) != 0 {
 25278  				break
 25279  			}
 25280  			b.resetWithControl(BlockARM64UGE, cc)
 25281  			return true
 25282  		}
 25283  		// match: (TBNZ [0] (LessThanF cc) yes no)
 25284  		// result: (FLT cc yes no)
 25285  		for b.Controls[0].Op == OpARM64LessThanF {
 25286  			v_0 := b.Controls[0]
 25287  			cc := v_0.Args[0]
 25288  			if auxIntToInt64(b.AuxInt) != 0 {
 25289  				break
 25290  			}
 25291  			b.resetWithControl(BlockARM64FLT, cc)
 25292  			return true
 25293  		}
 25294  		// match: (TBNZ [0] (LessEqualF cc) yes no)
 25295  		// result: (FLE cc yes no)
 25296  		for b.Controls[0].Op == OpARM64LessEqualF {
 25297  			v_0 := b.Controls[0]
 25298  			cc := v_0.Args[0]
 25299  			if auxIntToInt64(b.AuxInt) != 0 {
 25300  				break
 25301  			}
 25302  			b.resetWithControl(BlockARM64FLE, cc)
 25303  			return true
 25304  		}
 25305  		// match: (TBNZ [0] (GreaterThanF cc) yes no)
 25306  		// result: (FGT cc yes no)
 25307  		for b.Controls[0].Op == OpARM64GreaterThanF {
 25308  			v_0 := b.Controls[0]
 25309  			cc := v_0.Args[0]
 25310  			if auxIntToInt64(b.AuxInt) != 0 {
 25311  				break
 25312  			}
 25313  			b.resetWithControl(BlockARM64FGT, cc)
 25314  			return true
 25315  		}
 25316  		// match: (TBNZ [0] (GreaterEqualF cc) yes no)
 25317  		// result: (FGE cc yes no)
 25318  		for b.Controls[0].Op == OpARM64GreaterEqualF {
 25319  			v_0 := b.Controls[0]
 25320  			cc := v_0.Args[0]
 25321  			if auxIntToInt64(b.AuxInt) != 0 {
 25322  				break
 25323  			}
 25324  			b.resetWithControl(BlockARM64FGE, cc)
 25325  			return true
 25326  		}
 25327  		// match: (TBNZ [0] (XORconst [1] x) yes no)
 25328  		// result: (TBZ [0] x yes no)
 25329  		for b.Controls[0].Op == OpARM64XORconst {
 25330  			v_0 := b.Controls[0]
 25331  			if auxIntToInt64(v_0.AuxInt) != 1 {
 25332  				break
 25333  			}
 25334  			x := v_0.Args[0]
 25335  			if auxIntToInt64(b.AuxInt) != 0 {
 25336  				break
 25337  			}
 25338  			b.resetWithControl(BlockARM64TBZ, x)
 25339  			b.AuxInt = int64ToAuxInt(0)
 25340  			return true
 25341  		}
 25342  	case BlockARM64TBZ:
 25343  		// match: (TBZ [0] (XORconst [1] x) yes no)
 25344  		// result: (TBNZ [0] x yes no)
 25345  		for b.Controls[0].Op == OpARM64XORconst {
 25346  			v_0 := b.Controls[0]
 25347  			if auxIntToInt64(v_0.AuxInt) != 1 {
 25348  				break
 25349  			}
 25350  			x := v_0.Args[0]
 25351  			if auxIntToInt64(b.AuxInt) != 0 {
 25352  				break
 25353  			}
 25354  			b.resetWithControl(BlockARM64TBNZ, x)
 25355  			b.AuxInt = int64ToAuxInt(0)
 25356  			return true
 25357  		}
 25358  	case BlockARM64UGE:
 25359  		// match: (UGE (FlagConstant [fc]) yes no)
 25360  		// cond: fc.uge()
 25361  		// result: (First yes no)
 25362  		for b.Controls[0].Op == OpARM64FlagConstant {
 25363  			v_0 := b.Controls[0]
 25364  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25365  			if !(fc.uge()) {
 25366  				break
 25367  			}
 25368  			b.Reset(BlockFirst)
 25369  			return true
 25370  		}
 25371  		// match: (UGE (FlagConstant [fc]) yes no)
 25372  		// cond: !fc.uge()
 25373  		// result: (First no yes)
 25374  		for b.Controls[0].Op == OpARM64FlagConstant {
 25375  			v_0 := b.Controls[0]
 25376  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25377  			if !(!fc.uge()) {
 25378  				break
 25379  			}
 25380  			b.Reset(BlockFirst)
 25381  			b.swapSuccessors()
 25382  			return true
 25383  		}
 25384  		// match: (UGE (InvertFlags cmp) yes no)
 25385  		// result: (ULE cmp yes no)
 25386  		for b.Controls[0].Op == OpARM64InvertFlags {
 25387  			v_0 := b.Controls[0]
 25388  			cmp := v_0.Args[0]
 25389  			b.resetWithControl(BlockARM64ULE, cmp)
 25390  			return true
 25391  		}
 25392  	case BlockARM64UGT:
 25393  		// match: (UGT (CMPconst [0] x))
 25394  		// result: (NE (CMPconst [0] x))
 25395  		for b.Controls[0].Op == OpARM64CMPconst {
 25396  			v_0 := b.Controls[0]
 25397  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25398  				break
 25399  			}
 25400  			x := v_0.Args[0]
 25401  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPconst, types.TypeFlags)
 25402  			v0.AuxInt = int64ToAuxInt(0)
 25403  			v0.AddArg(x)
 25404  			b.resetWithControl(BlockARM64NE, v0)
 25405  			return true
 25406  		}
 25407  		// match: (UGT (CMPWconst [0] x))
 25408  		// result: (NE (CMPWconst [0] x))
 25409  		for b.Controls[0].Op == OpARM64CMPWconst {
 25410  			v_0 := b.Controls[0]
 25411  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25412  				break
 25413  			}
 25414  			x := v_0.Args[0]
 25415  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPWconst, types.TypeFlags)
 25416  			v0.AuxInt = int32ToAuxInt(0)
 25417  			v0.AddArg(x)
 25418  			b.resetWithControl(BlockARM64NE, v0)
 25419  			return true
 25420  		}
 25421  		// match: (UGT (FlagConstant [fc]) yes no)
 25422  		// cond: fc.ugt()
 25423  		// result: (First yes no)
 25424  		for b.Controls[0].Op == OpARM64FlagConstant {
 25425  			v_0 := b.Controls[0]
 25426  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25427  			if !(fc.ugt()) {
 25428  				break
 25429  			}
 25430  			b.Reset(BlockFirst)
 25431  			return true
 25432  		}
 25433  		// match: (UGT (FlagConstant [fc]) yes no)
 25434  		// cond: !fc.ugt()
 25435  		// result: (First no yes)
 25436  		for b.Controls[0].Op == OpARM64FlagConstant {
 25437  			v_0 := b.Controls[0]
 25438  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25439  			if !(!fc.ugt()) {
 25440  				break
 25441  			}
 25442  			b.Reset(BlockFirst)
 25443  			b.swapSuccessors()
 25444  			return true
 25445  		}
 25446  		// match: (UGT (InvertFlags cmp) yes no)
 25447  		// result: (ULT cmp yes no)
 25448  		for b.Controls[0].Op == OpARM64InvertFlags {
 25449  			v_0 := b.Controls[0]
 25450  			cmp := v_0.Args[0]
 25451  			b.resetWithControl(BlockARM64ULT, cmp)
 25452  			return true
 25453  		}
 25454  	case BlockARM64ULE:
 25455  		// match: (ULE (CMPconst [0] x))
 25456  		// result: (EQ (CMPconst [0] x))
 25457  		for b.Controls[0].Op == OpARM64CMPconst {
 25458  			v_0 := b.Controls[0]
 25459  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25460  				break
 25461  			}
 25462  			x := v_0.Args[0]
 25463  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPconst, types.TypeFlags)
 25464  			v0.AuxInt = int64ToAuxInt(0)
 25465  			v0.AddArg(x)
 25466  			b.resetWithControl(BlockARM64EQ, v0)
 25467  			return true
 25468  		}
 25469  		// match: (ULE (CMPWconst [0] x))
 25470  		// result: (EQ (CMPWconst [0] x))
 25471  		for b.Controls[0].Op == OpARM64CMPWconst {
 25472  			v_0 := b.Controls[0]
 25473  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25474  				break
 25475  			}
 25476  			x := v_0.Args[0]
 25477  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPWconst, types.TypeFlags)
 25478  			v0.AuxInt = int32ToAuxInt(0)
 25479  			v0.AddArg(x)
 25480  			b.resetWithControl(BlockARM64EQ, v0)
 25481  			return true
 25482  		}
 25483  		// match: (ULE (FlagConstant [fc]) yes no)
 25484  		// cond: fc.ule()
 25485  		// result: (First yes no)
 25486  		for b.Controls[0].Op == OpARM64FlagConstant {
 25487  			v_0 := b.Controls[0]
 25488  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25489  			if !(fc.ule()) {
 25490  				break
 25491  			}
 25492  			b.Reset(BlockFirst)
 25493  			return true
 25494  		}
 25495  		// match: (ULE (FlagConstant [fc]) yes no)
 25496  		// cond: !fc.ule()
 25497  		// result: (First no yes)
 25498  		for b.Controls[0].Op == OpARM64FlagConstant {
 25499  			v_0 := b.Controls[0]
 25500  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25501  			if !(!fc.ule()) {
 25502  				break
 25503  			}
 25504  			b.Reset(BlockFirst)
 25505  			b.swapSuccessors()
 25506  			return true
 25507  		}
 25508  		// match: (ULE (InvertFlags cmp) yes no)
 25509  		// result: (UGE cmp yes no)
 25510  		for b.Controls[0].Op == OpARM64InvertFlags {
 25511  			v_0 := b.Controls[0]
 25512  			cmp := v_0.Args[0]
 25513  			b.resetWithControl(BlockARM64UGE, cmp)
 25514  			return true
 25515  		}
 25516  	case BlockARM64ULT:
 25517  		// match: (ULT (FlagConstant [fc]) yes no)
 25518  		// cond: fc.ult()
 25519  		// result: (First yes no)
 25520  		for b.Controls[0].Op == OpARM64FlagConstant {
 25521  			v_0 := b.Controls[0]
 25522  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25523  			if !(fc.ult()) {
 25524  				break
 25525  			}
 25526  			b.Reset(BlockFirst)
 25527  			return true
 25528  		}
 25529  		// match: (ULT (FlagConstant [fc]) yes no)
 25530  		// cond: !fc.ult()
 25531  		// result: (First no yes)
 25532  		for b.Controls[0].Op == OpARM64FlagConstant {
 25533  			v_0 := b.Controls[0]
 25534  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25535  			if !(!fc.ult()) {
 25536  				break
 25537  			}
 25538  			b.Reset(BlockFirst)
 25539  			b.swapSuccessors()
 25540  			return true
 25541  		}
 25542  		// match: (ULT (InvertFlags cmp) yes no)
 25543  		// result: (UGT cmp yes no)
 25544  		for b.Controls[0].Op == OpARM64InvertFlags {
 25545  			v_0 := b.Controls[0]
 25546  			cmp := v_0.Args[0]
 25547  			b.resetWithControl(BlockARM64UGT, cmp)
 25548  			return true
 25549  		}
 25550  	case BlockARM64Z:
 25551  		// match: (Z sub:(SUB x y))
 25552  		// cond: sub.Uses == 1
 25553  		// result: (EQ (CMP x y))
 25554  		for b.Controls[0].Op == OpARM64SUB {
 25555  			sub := b.Controls[0]
 25556  			y := sub.Args[1]
 25557  			x := sub.Args[0]
 25558  			if !(sub.Uses == 1) {
 25559  				break
 25560  			}
 25561  			v0 := b.NewValue0(sub.Pos, OpARM64CMP, types.TypeFlags)
 25562  			v0.AddArg2(x, y)
 25563  			b.resetWithControl(BlockARM64EQ, v0)
 25564  			return true
 25565  		}
 25566  		// match: (Z sub:(SUBconst [c] y))
 25567  		// cond: sub.Uses == 1
 25568  		// result: (EQ (CMPconst [c] y))
 25569  		for b.Controls[0].Op == OpARM64SUBconst {
 25570  			sub := b.Controls[0]
 25571  			c := auxIntToInt64(sub.AuxInt)
 25572  			y := sub.Args[0]
 25573  			if !(sub.Uses == 1) {
 25574  				break
 25575  			}
 25576  			v0 := b.NewValue0(sub.Pos, OpARM64CMPconst, types.TypeFlags)
 25577  			v0.AuxInt = int64ToAuxInt(c)
 25578  			v0.AddArg(y)
 25579  			b.resetWithControl(BlockARM64EQ, v0)
 25580  			return true
 25581  		}
 25582  		// match: (Z (ANDconst [c] x) yes no)
 25583  		// cond: oneBit(c)
 25584  		// result: (TBZ [int64(ntz64(c))] x yes no)
 25585  		for b.Controls[0].Op == OpARM64ANDconst {
 25586  			v_0 := b.Controls[0]
 25587  			c := auxIntToInt64(v_0.AuxInt)
 25588  			x := v_0.Args[0]
 25589  			if !(oneBit(c)) {
 25590  				break
 25591  			}
 25592  			b.resetWithControl(BlockARM64TBZ, x)
 25593  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 25594  			return true
 25595  		}
 25596  		// match: (Z (MOVDconst [0]) yes no)
 25597  		// result: (First yes no)
 25598  		for b.Controls[0].Op == OpARM64MOVDconst {
 25599  			v_0 := b.Controls[0]
 25600  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25601  				break
 25602  			}
 25603  			b.Reset(BlockFirst)
 25604  			return true
 25605  		}
 25606  		// match: (Z (MOVDconst [c]) yes no)
 25607  		// cond: c != 0
 25608  		// result: (First no yes)
 25609  		for b.Controls[0].Op == OpARM64MOVDconst {
 25610  			v_0 := b.Controls[0]
 25611  			c := auxIntToInt64(v_0.AuxInt)
 25612  			if !(c != 0) {
 25613  				break
 25614  			}
 25615  			b.Reset(BlockFirst)
 25616  			b.swapSuccessors()
 25617  			return true
 25618  		}
 25619  	case BlockARM64ZW:
 25620  		// match: (ZW sub:(SUB x y))
 25621  		// cond: sub.Uses == 1
 25622  		// result: (EQ (CMPW x y))
 25623  		for b.Controls[0].Op == OpARM64SUB {
 25624  			sub := b.Controls[0]
 25625  			y := sub.Args[1]
 25626  			x := sub.Args[0]
 25627  			if !(sub.Uses == 1) {
 25628  				break
 25629  			}
 25630  			v0 := b.NewValue0(sub.Pos, OpARM64CMPW, types.TypeFlags)
 25631  			v0.AddArg2(x, y)
 25632  			b.resetWithControl(BlockARM64EQ, v0)
 25633  			return true
 25634  		}
 25635  		// match: (ZW sub:(SUBconst [c] y))
 25636  		// cond: sub.Uses == 1
 25637  		// result: (EQ (CMPWconst [int32(c)] y))
 25638  		for b.Controls[0].Op == OpARM64SUBconst {
 25639  			sub := b.Controls[0]
 25640  			c := auxIntToInt64(sub.AuxInt)
 25641  			y := sub.Args[0]
 25642  			if !(sub.Uses == 1) {
 25643  				break
 25644  			}
 25645  			v0 := b.NewValue0(sub.Pos, OpARM64CMPWconst, types.TypeFlags)
 25646  			v0.AuxInt = int32ToAuxInt(int32(c))
 25647  			v0.AddArg(y)
 25648  			b.resetWithControl(BlockARM64EQ, v0)
 25649  			return true
 25650  		}
 25651  		// match: (ZW (ANDconst [c] x) yes no)
 25652  		// cond: oneBit(int64(uint32(c)))
 25653  		// result: (TBZ [int64(ntz64(int64(uint32(c))))] x yes no)
 25654  		for b.Controls[0].Op == OpARM64ANDconst {
 25655  			v_0 := b.Controls[0]
 25656  			c := auxIntToInt64(v_0.AuxInt)
 25657  			x := v_0.Args[0]
 25658  			if !(oneBit(int64(uint32(c)))) {
 25659  				break
 25660  			}
 25661  			b.resetWithControl(BlockARM64TBZ, x)
 25662  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 25663  			return true
 25664  		}
 25665  		// match: (ZW (MOVDconst [c]) yes no)
 25666  		// cond: int32(c) == 0
 25667  		// result: (First yes no)
 25668  		for b.Controls[0].Op == OpARM64MOVDconst {
 25669  			v_0 := b.Controls[0]
 25670  			c := auxIntToInt64(v_0.AuxInt)
 25671  			if !(int32(c) == 0) {
 25672  				break
 25673  			}
 25674  			b.Reset(BlockFirst)
 25675  			return true
 25676  		}
 25677  		// match: (ZW (MOVDconst [c]) yes no)
 25678  		// cond: int32(c) != 0
 25679  		// result: (First no yes)
 25680  		for b.Controls[0].Op == OpARM64MOVDconst {
 25681  			v_0 := b.Controls[0]
 25682  			c := auxIntToInt64(v_0.AuxInt)
 25683  			if !(int32(c) != 0) {
 25684  				break
 25685  			}
 25686  			b.Reset(BlockFirst)
 25687  			b.swapSuccessors()
 25688  			return true
 25689  		}
 25690  	}
 25691  	return false
 25692  }
 25693  

View as plain text