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

     1  // Code generated from _gen/ARM64.rules using 'go generate'; DO NOT EDIT.
     2  
     3  package ssa
     4  
     5  import "cmd/compile/internal/types"
     6  
     7  func rewriteValueARM64(v *Value) bool {
     8  	switch v.Op {
     9  	case OpARM64ADCSflags:
    10  		return rewriteValueARM64_OpARM64ADCSflags(v)
    11  	case OpARM64ADD:
    12  		return rewriteValueARM64_OpARM64ADD(v)
    13  	case OpARM64ADDSflags:
    14  		return rewriteValueARM64_OpARM64ADDSflags(v)
    15  	case OpARM64ADDconst:
    16  		return rewriteValueARM64_OpARM64ADDconst(v)
    17  	case OpARM64ADDshiftLL:
    18  		return rewriteValueARM64_OpARM64ADDshiftLL(v)
    19  	case OpARM64ADDshiftRA:
    20  		return rewriteValueARM64_OpARM64ADDshiftRA(v)
    21  	case OpARM64ADDshiftRL:
    22  		return rewriteValueARM64_OpARM64ADDshiftRL(v)
    23  	case OpARM64AND:
    24  		return rewriteValueARM64_OpARM64AND(v)
    25  	case OpARM64ANDconst:
    26  		return rewriteValueARM64_OpARM64ANDconst(v)
    27  	case OpARM64ANDshiftLL:
    28  		return rewriteValueARM64_OpARM64ANDshiftLL(v)
    29  	case OpARM64ANDshiftRA:
    30  		return rewriteValueARM64_OpARM64ANDshiftRA(v)
    31  	case OpARM64ANDshiftRL:
    32  		return rewriteValueARM64_OpARM64ANDshiftRL(v)
    33  	case OpARM64ANDshiftRO:
    34  		return rewriteValueARM64_OpARM64ANDshiftRO(v)
    35  	case OpARM64BIC:
    36  		return rewriteValueARM64_OpARM64BIC(v)
    37  	case OpARM64BICshiftLL:
    38  		return rewriteValueARM64_OpARM64BICshiftLL(v)
    39  	case OpARM64BICshiftRA:
    40  		return rewriteValueARM64_OpARM64BICshiftRA(v)
    41  	case OpARM64BICshiftRL:
    42  		return rewriteValueARM64_OpARM64BICshiftRL(v)
    43  	case OpARM64BICshiftRO:
    44  		return rewriteValueARM64_OpARM64BICshiftRO(v)
    45  	case OpARM64CMN:
    46  		return rewriteValueARM64_OpARM64CMN(v)
    47  	case OpARM64CMNW:
    48  		return rewriteValueARM64_OpARM64CMNW(v)
    49  	case OpARM64CMNWconst:
    50  		return rewriteValueARM64_OpARM64CMNWconst(v)
    51  	case OpARM64CMNconst:
    52  		return rewriteValueARM64_OpARM64CMNconst(v)
    53  	case OpARM64CMNshiftLL:
    54  		return rewriteValueARM64_OpARM64CMNshiftLL(v)
    55  	case OpARM64CMNshiftRA:
    56  		return rewriteValueARM64_OpARM64CMNshiftRA(v)
    57  	case OpARM64CMNshiftRL:
    58  		return rewriteValueARM64_OpARM64CMNshiftRL(v)
    59  	case OpARM64CMP:
    60  		return rewriteValueARM64_OpARM64CMP(v)
    61  	case OpARM64CMPW:
    62  		return rewriteValueARM64_OpARM64CMPW(v)
    63  	case OpARM64CMPWconst:
    64  		return rewriteValueARM64_OpARM64CMPWconst(v)
    65  	case OpARM64CMPconst:
    66  		return rewriteValueARM64_OpARM64CMPconst(v)
    67  	case OpARM64CMPshiftLL:
    68  		return rewriteValueARM64_OpARM64CMPshiftLL(v)
    69  	case OpARM64CMPshiftRA:
    70  		return rewriteValueARM64_OpARM64CMPshiftRA(v)
    71  	case OpARM64CMPshiftRL:
    72  		return rewriteValueARM64_OpARM64CMPshiftRL(v)
    73  	case OpARM64CSEL:
    74  		return rewriteValueARM64_OpARM64CSEL(v)
    75  	case OpARM64CSEL0:
    76  		return rewriteValueARM64_OpARM64CSEL0(v)
    77  	case OpARM64CSETM:
    78  		return rewriteValueARM64_OpARM64CSETM(v)
    79  	case OpARM64CSINC:
    80  		return rewriteValueARM64_OpARM64CSINC(v)
    81  	case OpARM64CSINV:
    82  		return rewriteValueARM64_OpARM64CSINV(v)
    83  	case OpARM64CSNEG:
    84  		return rewriteValueARM64_OpARM64CSNEG(v)
    85  	case OpARM64DIV:
    86  		return rewriteValueARM64_OpARM64DIV(v)
    87  	case OpARM64DIVW:
    88  		return rewriteValueARM64_OpARM64DIVW(v)
    89  	case OpARM64EON:
    90  		return rewriteValueARM64_OpARM64EON(v)
    91  	case OpARM64EONshiftLL:
    92  		return rewriteValueARM64_OpARM64EONshiftLL(v)
    93  	case OpARM64EONshiftRA:
    94  		return rewriteValueARM64_OpARM64EONshiftRA(v)
    95  	case OpARM64EONshiftRL:
    96  		return rewriteValueARM64_OpARM64EONshiftRL(v)
    97  	case OpARM64EONshiftRO:
    98  		return rewriteValueARM64_OpARM64EONshiftRO(v)
    99  	case OpARM64Equal:
   100  		return rewriteValueARM64_OpARM64Equal(v)
   101  	case OpARM64FADDD:
   102  		return rewriteValueARM64_OpARM64FADDD(v)
   103  	case OpARM64FADDS:
   104  		return rewriteValueARM64_OpARM64FADDS(v)
   105  	case OpARM64FCMPD:
   106  		return rewriteValueARM64_OpARM64FCMPD(v)
   107  	case OpARM64FCMPS:
   108  		return rewriteValueARM64_OpARM64FCMPS(v)
   109  	case OpARM64FMOVDfpgp:
   110  		return rewriteValueARM64_OpARM64FMOVDfpgp(v)
   111  	case OpARM64FMOVDgpfp:
   112  		return rewriteValueARM64_OpARM64FMOVDgpfp(v)
   113  	case OpARM64FMOVDload:
   114  		return rewriteValueARM64_OpARM64FMOVDload(v)
   115  	case OpARM64FMOVDloadidx:
   116  		return rewriteValueARM64_OpARM64FMOVDloadidx(v)
   117  	case OpARM64FMOVDloadidx8:
   118  		return rewriteValueARM64_OpARM64FMOVDloadidx8(v)
   119  	case OpARM64FMOVDstore:
   120  		return rewriteValueARM64_OpARM64FMOVDstore(v)
   121  	case OpARM64FMOVDstoreidx:
   122  		return rewriteValueARM64_OpARM64FMOVDstoreidx(v)
   123  	case OpARM64FMOVDstoreidx8:
   124  		return rewriteValueARM64_OpARM64FMOVDstoreidx8(v)
   125  	case OpARM64FMOVSload:
   126  		return rewriteValueARM64_OpARM64FMOVSload(v)
   127  	case OpARM64FMOVSloadidx:
   128  		return rewriteValueARM64_OpARM64FMOVSloadidx(v)
   129  	case OpARM64FMOVSloadidx4:
   130  		return rewriteValueARM64_OpARM64FMOVSloadidx4(v)
   131  	case OpARM64FMOVSstore:
   132  		return rewriteValueARM64_OpARM64FMOVSstore(v)
   133  	case OpARM64FMOVSstoreidx:
   134  		return rewriteValueARM64_OpARM64FMOVSstoreidx(v)
   135  	case OpARM64FMOVSstoreidx4:
   136  		return rewriteValueARM64_OpARM64FMOVSstoreidx4(v)
   137  	case OpARM64FMULD:
   138  		return rewriteValueARM64_OpARM64FMULD(v)
   139  	case OpARM64FMULS:
   140  		return rewriteValueARM64_OpARM64FMULS(v)
   141  	case OpARM64FNEGD:
   142  		return rewriteValueARM64_OpARM64FNEGD(v)
   143  	case OpARM64FNEGS:
   144  		return rewriteValueARM64_OpARM64FNEGS(v)
   145  	case OpARM64FNMULD:
   146  		return rewriteValueARM64_OpARM64FNMULD(v)
   147  	case OpARM64FNMULS:
   148  		return rewriteValueARM64_OpARM64FNMULS(v)
   149  	case OpARM64FSUBD:
   150  		return rewriteValueARM64_OpARM64FSUBD(v)
   151  	case OpARM64FSUBS:
   152  		return rewriteValueARM64_OpARM64FSUBS(v)
   153  	case OpARM64GreaterEqual:
   154  		return rewriteValueARM64_OpARM64GreaterEqual(v)
   155  	case OpARM64GreaterEqualF:
   156  		return rewriteValueARM64_OpARM64GreaterEqualF(v)
   157  	case OpARM64GreaterEqualNoov:
   158  		return rewriteValueARM64_OpARM64GreaterEqualNoov(v)
   159  	case OpARM64GreaterEqualU:
   160  		return rewriteValueARM64_OpARM64GreaterEqualU(v)
   161  	case OpARM64GreaterThan:
   162  		return rewriteValueARM64_OpARM64GreaterThan(v)
   163  	case OpARM64GreaterThanF:
   164  		return rewriteValueARM64_OpARM64GreaterThanF(v)
   165  	case OpARM64GreaterThanU:
   166  		return rewriteValueARM64_OpARM64GreaterThanU(v)
   167  	case OpARM64LDP:
   168  		return rewriteValueARM64_OpARM64LDP(v)
   169  	case OpARM64LessEqual:
   170  		return rewriteValueARM64_OpARM64LessEqual(v)
   171  	case OpARM64LessEqualF:
   172  		return rewriteValueARM64_OpARM64LessEqualF(v)
   173  	case OpARM64LessEqualU:
   174  		return rewriteValueARM64_OpARM64LessEqualU(v)
   175  	case OpARM64LessThan:
   176  		return rewriteValueARM64_OpARM64LessThan(v)
   177  	case OpARM64LessThanF:
   178  		return rewriteValueARM64_OpARM64LessThanF(v)
   179  	case OpARM64LessThanNoov:
   180  		return rewriteValueARM64_OpARM64LessThanNoov(v)
   181  	case OpARM64LessThanU:
   182  		return rewriteValueARM64_OpARM64LessThanU(v)
   183  	case OpARM64MADD:
   184  		return rewriteValueARM64_OpARM64MADD(v)
   185  	case OpARM64MADDW:
   186  		return rewriteValueARM64_OpARM64MADDW(v)
   187  	case OpARM64MNEG:
   188  		return rewriteValueARM64_OpARM64MNEG(v)
   189  	case OpARM64MNEGW:
   190  		return rewriteValueARM64_OpARM64MNEGW(v)
   191  	case OpARM64MOD:
   192  		return rewriteValueARM64_OpARM64MOD(v)
   193  	case OpARM64MODW:
   194  		return rewriteValueARM64_OpARM64MODW(v)
   195  	case OpARM64MOVBUload:
   196  		return rewriteValueARM64_OpARM64MOVBUload(v)
   197  	case OpARM64MOVBUloadidx:
   198  		return rewriteValueARM64_OpARM64MOVBUloadidx(v)
   199  	case OpARM64MOVBUreg:
   200  		return rewriteValueARM64_OpARM64MOVBUreg(v)
   201  	case OpARM64MOVBload:
   202  		return rewriteValueARM64_OpARM64MOVBload(v)
   203  	case OpARM64MOVBloadidx:
   204  		return rewriteValueARM64_OpARM64MOVBloadidx(v)
   205  	case OpARM64MOVBreg:
   206  		return rewriteValueARM64_OpARM64MOVBreg(v)
   207  	case OpARM64MOVBstore:
   208  		return rewriteValueARM64_OpARM64MOVBstore(v)
   209  	case OpARM64MOVBstoreidx:
   210  		return rewriteValueARM64_OpARM64MOVBstoreidx(v)
   211  	case OpARM64MOVBstorezero:
   212  		return rewriteValueARM64_OpARM64MOVBstorezero(v)
   213  	case OpARM64MOVBstorezeroidx:
   214  		return rewriteValueARM64_OpARM64MOVBstorezeroidx(v)
   215  	case OpARM64MOVDload:
   216  		return rewriteValueARM64_OpARM64MOVDload(v)
   217  	case OpARM64MOVDloadidx:
   218  		return rewriteValueARM64_OpARM64MOVDloadidx(v)
   219  	case OpARM64MOVDloadidx8:
   220  		return rewriteValueARM64_OpARM64MOVDloadidx8(v)
   221  	case OpARM64MOVDnop:
   222  		return rewriteValueARM64_OpARM64MOVDnop(v)
   223  	case OpARM64MOVDreg:
   224  		return rewriteValueARM64_OpARM64MOVDreg(v)
   225  	case OpARM64MOVDstore:
   226  		return rewriteValueARM64_OpARM64MOVDstore(v)
   227  	case OpARM64MOVDstoreidx:
   228  		return rewriteValueARM64_OpARM64MOVDstoreidx(v)
   229  	case OpARM64MOVDstoreidx8:
   230  		return rewriteValueARM64_OpARM64MOVDstoreidx8(v)
   231  	case OpARM64MOVDstorezero:
   232  		return rewriteValueARM64_OpARM64MOVDstorezero(v)
   233  	case OpARM64MOVDstorezeroidx:
   234  		return rewriteValueARM64_OpARM64MOVDstorezeroidx(v)
   235  	case OpARM64MOVDstorezeroidx8:
   236  		return rewriteValueARM64_OpARM64MOVDstorezeroidx8(v)
   237  	case OpARM64MOVHUload:
   238  		return rewriteValueARM64_OpARM64MOVHUload(v)
   239  	case OpARM64MOVHUloadidx:
   240  		return rewriteValueARM64_OpARM64MOVHUloadidx(v)
   241  	case OpARM64MOVHUloadidx2:
   242  		return rewriteValueARM64_OpARM64MOVHUloadidx2(v)
   243  	case OpARM64MOVHUreg:
   244  		return rewriteValueARM64_OpARM64MOVHUreg(v)
   245  	case OpARM64MOVHload:
   246  		return rewriteValueARM64_OpARM64MOVHload(v)
   247  	case OpARM64MOVHloadidx:
   248  		return rewriteValueARM64_OpARM64MOVHloadidx(v)
   249  	case OpARM64MOVHloadidx2:
   250  		return rewriteValueARM64_OpARM64MOVHloadidx2(v)
   251  	case OpARM64MOVHreg:
   252  		return rewriteValueARM64_OpARM64MOVHreg(v)
   253  	case OpARM64MOVHstore:
   254  		return rewriteValueARM64_OpARM64MOVHstore(v)
   255  	case OpARM64MOVHstoreidx:
   256  		return rewriteValueARM64_OpARM64MOVHstoreidx(v)
   257  	case OpARM64MOVHstoreidx2:
   258  		return rewriteValueARM64_OpARM64MOVHstoreidx2(v)
   259  	case OpARM64MOVHstorezero:
   260  		return rewriteValueARM64_OpARM64MOVHstorezero(v)
   261  	case OpARM64MOVHstorezeroidx:
   262  		return rewriteValueARM64_OpARM64MOVHstorezeroidx(v)
   263  	case OpARM64MOVHstorezeroidx2:
   264  		return rewriteValueARM64_OpARM64MOVHstorezeroidx2(v)
   265  	case OpARM64MOVQstorezero:
   266  		return rewriteValueARM64_OpARM64MOVQstorezero(v)
   267  	case OpARM64MOVWUload:
   268  		return rewriteValueARM64_OpARM64MOVWUload(v)
   269  	case OpARM64MOVWUloadidx:
   270  		return rewriteValueARM64_OpARM64MOVWUloadidx(v)
   271  	case OpARM64MOVWUloadidx4:
   272  		return rewriteValueARM64_OpARM64MOVWUloadidx4(v)
   273  	case OpARM64MOVWUreg:
   274  		return rewriteValueARM64_OpARM64MOVWUreg(v)
   275  	case OpARM64MOVWload:
   276  		return rewriteValueARM64_OpARM64MOVWload(v)
   277  	case OpARM64MOVWloadidx:
   278  		return rewriteValueARM64_OpARM64MOVWloadidx(v)
   279  	case OpARM64MOVWloadidx4:
   280  		return rewriteValueARM64_OpARM64MOVWloadidx4(v)
   281  	case OpARM64MOVWreg:
   282  		return rewriteValueARM64_OpARM64MOVWreg(v)
   283  	case OpARM64MOVWstore:
   284  		return rewriteValueARM64_OpARM64MOVWstore(v)
   285  	case OpARM64MOVWstoreidx:
   286  		return rewriteValueARM64_OpARM64MOVWstoreidx(v)
   287  	case OpARM64MOVWstoreidx4:
   288  		return rewriteValueARM64_OpARM64MOVWstoreidx4(v)
   289  	case OpARM64MOVWstorezero:
   290  		return rewriteValueARM64_OpARM64MOVWstorezero(v)
   291  	case OpARM64MOVWstorezeroidx:
   292  		return rewriteValueARM64_OpARM64MOVWstorezeroidx(v)
   293  	case OpARM64MOVWstorezeroidx4:
   294  		return rewriteValueARM64_OpARM64MOVWstorezeroidx4(v)
   295  	case OpARM64MSUB:
   296  		return rewriteValueARM64_OpARM64MSUB(v)
   297  	case OpARM64MSUBW:
   298  		return rewriteValueARM64_OpARM64MSUBW(v)
   299  	case OpARM64MUL:
   300  		return rewriteValueARM64_OpARM64MUL(v)
   301  	case OpARM64MULW:
   302  		return rewriteValueARM64_OpARM64MULW(v)
   303  	case OpARM64MVN:
   304  		return rewriteValueARM64_OpARM64MVN(v)
   305  	case OpARM64MVNshiftLL:
   306  		return rewriteValueARM64_OpARM64MVNshiftLL(v)
   307  	case OpARM64MVNshiftRA:
   308  		return rewriteValueARM64_OpARM64MVNshiftRA(v)
   309  	case OpARM64MVNshiftRL:
   310  		return rewriteValueARM64_OpARM64MVNshiftRL(v)
   311  	case OpARM64MVNshiftRO:
   312  		return rewriteValueARM64_OpARM64MVNshiftRO(v)
   313  	case OpARM64NEG:
   314  		return rewriteValueARM64_OpARM64NEG(v)
   315  	case OpARM64NEGshiftLL:
   316  		return rewriteValueARM64_OpARM64NEGshiftLL(v)
   317  	case OpARM64NEGshiftRA:
   318  		return rewriteValueARM64_OpARM64NEGshiftRA(v)
   319  	case OpARM64NEGshiftRL:
   320  		return rewriteValueARM64_OpARM64NEGshiftRL(v)
   321  	case OpARM64NotEqual:
   322  		return rewriteValueARM64_OpARM64NotEqual(v)
   323  	case OpARM64OR:
   324  		return rewriteValueARM64_OpARM64OR(v)
   325  	case OpARM64ORN:
   326  		return rewriteValueARM64_OpARM64ORN(v)
   327  	case OpARM64ORNshiftLL:
   328  		return rewriteValueARM64_OpARM64ORNshiftLL(v)
   329  	case OpARM64ORNshiftRA:
   330  		return rewriteValueARM64_OpARM64ORNshiftRA(v)
   331  	case OpARM64ORNshiftRL:
   332  		return rewriteValueARM64_OpARM64ORNshiftRL(v)
   333  	case OpARM64ORNshiftRO:
   334  		return rewriteValueARM64_OpARM64ORNshiftRO(v)
   335  	case OpARM64ORconst:
   336  		return rewriteValueARM64_OpARM64ORconst(v)
   337  	case OpARM64ORshiftLL:
   338  		return rewriteValueARM64_OpARM64ORshiftLL(v)
   339  	case OpARM64ORshiftRA:
   340  		return rewriteValueARM64_OpARM64ORshiftRA(v)
   341  	case OpARM64ORshiftRL:
   342  		return rewriteValueARM64_OpARM64ORshiftRL(v)
   343  	case OpARM64ORshiftRO:
   344  		return rewriteValueARM64_OpARM64ORshiftRO(v)
   345  	case OpARM64REV:
   346  		return rewriteValueARM64_OpARM64REV(v)
   347  	case OpARM64REVW:
   348  		return rewriteValueARM64_OpARM64REVW(v)
   349  	case OpARM64ROR:
   350  		return rewriteValueARM64_OpARM64ROR(v)
   351  	case OpARM64RORW:
   352  		return rewriteValueARM64_OpARM64RORW(v)
   353  	case OpARM64SBCSflags:
   354  		return rewriteValueARM64_OpARM64SBCSflags(v)
   355  	case OpARM64SBFX:
   356  		return rewriteValueARM64_OpARM64SBFX(v)
   357  	case OpARM64SLL:
   358  		return rewriteValueARM64_OpARM64SLL(v)
   359  	case OpARM64SLLconst:
   360  		return rewriteValueARM64_OpARM64SLLconst(v)
   361  	case OpARM64SRA:
   362  		return rewriteValueARM64_OpARM64SRA(v)
   363  	case OpARM64SRAconst:
   364  		return rewriteValueARM64_OpARM64SRAconst(v)
   365  	case OpARM64SRL:
   366  		return rewriteValueARM64_OpARM64SRL(v)
   367  	case OpARM64SRLconst:
   368  		return rewriteValueARM64_OpARM64SRLconst(v)
   369  	case OpARM64STP:
   370  		return rewriteValueARM64_OpARM64STP(v)
   371  	case OpARM64SUB:
   372  		return rewriteValueARM64_OpARM64SUB(v)
   373  	case OpARM64SUBconst:
   374  		return rewriteValueARM64_OpARM64SUBconst(v)
   375  	case OpARM64SUBshiftLL:
   376  		return rewriteValueARM64_OpARM64SUBshiftLL(v)
   377  	case OpARM64SUBshiftRA:
   378  		return rewriteValueARM64_OpARM64SUBshiftRA(v)
   379  	case OpARM64SUBshiftRL:
   380  		return rewriteValueARM64_OpARM64SUBshiftRL(v)
   381  	case OpARM64TST:
   382  		return rewriteValueARM64_OpARM64TST(v)
   383  	case OpARM64TSTW:
   384  		return rewriteValueARM64_OpARM64TSTW(v)
   385  	case OpARM64TSTWconst:
   386  		return rewriteValueARM64_OpARM64TSTWconst(v)
   387  	case OpARM64TSTconst:
   388  		return rewriteValueARM64_OpARM64TSTconst(v)
   389  	case OpARM64TSTshiftLL:
   390  		return rewriteValueARM64_OpARM64TSTshiftLL(v)
   391  	case OpARM64TSTshiftRA:
   392  		return rewriteValueARM64_OpARM64TSTshiftRA(v)
   393  	case OpARM64TSTshiftRL:
   394  		return rewriteValueARM64_OpARM64TSTshiftRL(v)
   395  	case OpARM64TSTshiftRO:
   396  		return rewriteValueARM64_OpARM64TSTshiftRO(v)
   397  	case OpARM64UBFIZ:
   398  		return rewriteValueARM64_OpARM64UBFIZ(v)
   399  	case OpARM64UBFX:
   400  		return rewriteValueARM64_OpARM64UBFX(v)
   401  	case OpARM64UDIV:
   402  		return rewriteValueARM64_OpARM64UDIV(v)
   403  	case OpARM64UDIVW:
   404  		return rewriteValueARM64_OpARM64UDIVW(v)
   405  	case OpARM64UMOD:
   406  		return rewriteValueARM64_OpARM64UMOD(v)
   407  	case OpARM64UMODW:
   408  		return rewriteValueARM64_OpARM64UMODW(v)
   409  	case OpARM64XOR:
   410  		return rewriteValueARM64_OpARM64XOR(v)
   411  	case OpARM64XORconst:
   412  		return rewriteValueARM64_OpARM64XORconst(v)
   413  	case OpARM64XORshiftLL:
   414  		return rewriteValueARM64_OpARM64XORshiftLL(v)
   415  	case OpARM64XORshiftRA:
   416  		return rewriteValueARM64_OpARM64XORshiftRA(v)
   417  	case OpARM64XORshiftRL:
   418  		return rewriteValueARM64_OpARM64XORshiftRL(v)
   419  	case OpARM64XORshiftRO:
   420  		return rewriteValueARM64_OpARM64XORshiftRO(v)
   421  	case OpAbs:
   422  		v.Op = OpARM64FABSD
   423  		return true
   424  	case OpAdd16:
   425  		v.Op = OpARM64ADD
   426  		return true
   427  	case OpAdd32:
   428  		v.Op = OpARM64ADD
   429  		return true
   430  	case OpAdd32F:
   431  		v.Op = OpARM64FADDS
   432  		return true
   433  	case OpAdd64:
   434  		v.Op = OpARM64ADD
   435  		return true
   436  	case OpAdd64F:
   437  		v.Op = OpARM64FADDD
   438  		return true
   439  	case OpAdd8:
   440  		v.Op = OpARM64ADD
   441  		return true
   442  	case OpAddPtr:
   443  		v.Op = OpARM64ADD
   444  		return true
   445  	case OpAddr:
   446  		return rewriteValueARM64_OpAddr(v)
   447  	case OpAnd16:
   448  		v.Op = OpARM64AND
   449  		return true
   450  	case OpAnd32:
   451  		v.Op = OpARM64AND
   452  		return true
   453  	case OpAnd64:
   454  		v.Op = OpARM64AND
   455  		return true
   456  	case OpAnd8:
   457  		v.Op = OpARM64AND
   458  		return true
   459  	case OpAndB:
   460  		v.Op = OpARM64AND
   461  		return true
   462  	case OpAtomicAdd32:
   463  		v.Op = OpARM64LoweredAtomicAdd32
   464  		return true
   465  	case OpAtomicAdd32Variant:
   466  		v.Op = OpARM64LoweredAtomicAdd32Variant
   467  		return true
   468  	case OpAtomicAdd64:
   469  		v.Op = OpARM64LoweredAtomicAdd64
   470  		return true
   471  	case OpAtomicAdd64Variant:
   472  		v.Op = OpARM64LoweredAtomicAdd64Variant
   473  		return true
   474  	case OpAtomicAnd32value:
   475  		v.Op = OpARM64LoweredAtomicAnd32
   476  		return true
   477  	case OpAtomicAnd32valueVariant:
   478  		v.Op = OpARM64LoweredAtomicAnd32Variant
   479  		return true
   480  	case OpAtomicAnd64value:
   481  		v.Op = OpARM64LoweredAtomicAnd64
   482  		return true
   483  	case OpAtomicAnd64valueVariant:
   484  		v.Op = OpARM64LoweredAtomicAnd64Variant
   485  		return true
   486  	case OpAtomicAnd8value:
   487  		v.Op = OpARM64LoweredAtomicAnd8
   488  		return true
   489  	case OpAtomicAnd8valueVariant:
   490  		v.Op = OpARM64LoweredAtomicAnd8Variant
   491  		return true
   492  	case OpAtomicCompareAndSwap32:
   493  		v.Op = OpARM64LoweredAtomicCas32
   494  		return true
   495  	case OpAtomicCompareAndSwap32Variant:
   496  		v.Op = OpARM64LoweredAtomicCas32Variant
   497  		return true
   498  	case OpAtomicCompareAndSwap64:
   499  		v.Op = OpARM64LoweredAtomicCas64
   500  		return true
   501  	case OpAtomicCompareAndSwap64Variant:
   502  		v.Op = OpARM64LoweredAtomicCas64Variant
   503  		return true
   504  	case OpAtomicExchange32:
   505  		v.Op = OpARM64LoweredAtomicExchange32
   506  		return true
   507  	case OpAtomicExchange32Variant:
   508  		v.Op = OpARM64LoweredAtomicExchange32Variant
   509  		return true
   510  	case OpAtomicExchange64:
   511  		v.Op = OpARM64LoweredAtomicExchange64
   512  		return true
   513  	case OpAtomicExchange64Variant:
   514  		v.Op = OpARM64LoweredAtomicExchange64Variant
   515  		return true
   516  	case OpAtomicExchange8:
   517  		v.Op = OpARM64LoweredAtomicExchange8
   518  		return true
   519  	case OpAtomicExchange8Variant:
   520  		v.Op = OpARM64LoweredAtomicExchange8Variant
   521  		return true
   522  	case OpAtomicLoad32:
   523  		v.Op = OpARM64LDARW
   524  		return true
   525  	case OpAtomicLoad64:
   526  		v.Op = OpARM64LDAR
   527  		return true
   528  	case OpAtomicLoad8:
   529  		v.Op = OpARM64LDARB
   530  		return true
   531  	case OpAtomicLoadPtr:
   532  		v.Op = OpARM64LDAR
   533  		return true
   534  	case OpAtomicOr32value:
   535  		v.Op = OpARM64LoweredAtomicOr32
   536  		return true
   537  	case OpAtomicOr32valueVariant:
   538  		v.Op = OpARM64LoweredAtomicOr32Variant
   539  		return true
   540  	case OpAtomicOr64value:
   541  		v.Op = OpARM64LoweredAtomicOr64
   542  		return true
   543  	case OpAtomicOr64valueVariant:
   544  		v.Op = OpARM64LoweredAtomicOr64Variant
   545  		return true
   546  	case OpAtomicOr8value:
   547  		v.Op = OpARM64LoweredAtomicOr8
   548  		return true
   549  	case OpAtomicOr8valueVariant:
   550  		v.Op = OpARM64LoweredAtomicOr8Variant
   551  		return true
   552  	case OpAtomicStore32:
   553  		v.Op = OpARM64STLRW
   554  		return true
   555  	case OpAtomicStore64:
   556  		v.Op = OpARM64STLR
   557  		return true
   558  	case OpAtomicStore8:
   559  		v.Op = OpARM64STLRB
   560  		return true
   561  	case OpAtomicStorePtrNoWB:
   562  		v.Op = OpARM64STLR
   563  		return true
   564  	case OpAvg64u:
   565  		return rewriteValueARM64_OpAvg64u(v)
   566  	case OpBitLen32:
   567  		return rewriteValueARM64_OpBitLen32(v)
   568  	case OpBitLen64:
   569  		return rewriteValueARM64_OpBitLen64(v)
   570  	case OpBitRev16:
   571  		return rewriteValueARM64_OpBitRev16(v)
   572  	case OpBitRev32:
   573  		v.Op = OpARM64RBITW
   574  		return true
   575  	case OpBitRev64:
   576  		v.Op = OpARM64RBIT
   577  		return true
   578  	case OpBitRev8:
   579  		return rewriteValueARM64_OpBitRev8(v)
   580  	case OpBswap16:
   581  		v.Op = OpARM64REV16W
   582  		return true
   583  	case OpBswap32:
   584  		v.Op = OpARM64REVW
   585  		return true
   586  	case OpBswap64:
   587  		v.Op = OpARM64REV
   588  		return true
   589  	case OpCeil:
   590  		v.Op = OpARM64FRINTPD
   591  		return true
   592  	case OpClosureCall:
   593  		v.Op = OpARM64CALLclosure
   594  		return true
   595  	case OpCom16:
   596  		v.Op = OpARM64MVN
   597  		return true
   598  	case OpCom32:
   599  		v.Op = OpARM64MVN
   600  		return true
   601  	case OpCom64:
   602  		v.Op = OpARM64MVN
   603  		return true
   604  	case OpCom8:
   605  		v.Op = OpARM64MVN
   606  		return true
   607  	case OpCondSelect:
   608  		return rewriteValueARM64_OpCondSelect(v)
   609  	case OpConst16:
   610  		return rewriteValueARM64_OpConst16(v)
   611  	case OpConst32:
   612  		return rewriteValueARM64_OpConst32(v)
   613  	case OpConst32F:
   614  		return rewriteValueARM64_OpConst32F(v)
   615  	case OpConst64:
   616  		return rewriteValueARM64_OpConst64(v)
   617  	case OpConst64F:
   618  		return rewriteValueARM64_OpConst64F(v)
   619  	case OpConst8:
   620  		return rewriteValueARM64_OpConst8(v)
   621  	case OpConstBool:
   622  		return rewriteValueARM64_OpConstBool(v)
   623  	case OpConstNil:
   624  		return rewriteValueARM64_OpConstNil(v)
   625  	case OpCtz16:
   626  		return rewriteValueARM64_OpCtz16(v)
   627  	case OpCtz16NonZero:
   628  		v.Op = OpCtz32
   629  		return true
   630  	case OpCtz32:
   631  		return rewriteValueARM64_OpCtz32(v)
   632  	case OpCtz32NonZero:
   633  		v.Op = OpCtz32
   634  		return true
   635  	case OpCtz64:
   636  		return rewriteValueARM64_OpCtz64(v)
   637  	case OpCtz64NonZero:
   638  		v.Op = OpCtz64
   639  		return true
   640  	case OpCtz8:
   641  		return rewriteValueARM64_OpCtz8(v)
   642  	case OpCtz8NonZero:
   643  		v.Op = OpCtz32
   644  		return true
   645  	case OpCvt32Fto32:
   646  		v.Op = OpARM64FCVTZSSW
   647  		return true
   648  	case OpCvt32Fto32U:
   649  		v.Op = OpARM64FCVTZUSW
   650  		return true
   651  	case OpCvt32Fto64:
   652  		v.Op = OpARM64FCVTZSS
   653  		return true
   654  	case OpCvt32Fto64F:
   655  		v.Op = OpARM64FCVTSD
   656  		return true
   657  	case OpCvt32Fto64U:
   658  		v.Op = OpARM64FCVTZUS
   659  		return true
   660  	case OpCvt32Uto32F:
   661  		v.Op = OpARM64UCVTFWS
   662  		return true
   663  	case OpCvt32Uto64F:
   664  		v.Op = OpARM64UCVTFWD
   665  		return true
   666  	case OpCvt32to32F:
   667  		v.Op = OpARM64SCVTFWS
   668  		return true
   669  	case OpCvt32to64F:
   670  		v.Op = OpARM64SCVTFWD
   671  		return true
   672  	case OpCvt64Fto32:
   673  		v.Op = OpARM64FCVTZSDW
   674  		return true
   675  	case OpCvt64Fto32F:
   676  		v.Op = OpARM64FCVTDS
   677  		return true
   678  	case OpCvt64Fto32U:
   679  		v.Op = OpARM64FCVTZUDW
   680  		return true
   681  	case OpCvt64Fto64:
   682  		v.Op = OpARM64FCVTZSD
   683  		return true
   684  	case OpCvt64Fto64U:
   685  		v.Op = OpARM64FCVTZUD
   686  		return true
   687  	case OpCvt64Uto32F:
   688  		v.Op = OpARM64UCVTFS
   689  		return true
   690  	case OpCvt64Uto64F:
   691  		v.Op = OpARM64UCVTFD
   692  		return true
   693  	case OpCvt64to32F:
   694  		v.Op = OpARM64SCVTFS
   695  		return true
   696  	case OpCvt64to64F:
   697  		v.Op = OpARM64SCVTFD
   698  		return true
   699  	case OpCvtBoolToUint8:
   700  		v.Op = OpCopy
   701  		return true
   702  	case OpDiv16:
   703  		return rewriteValueARM64_OpDiv16(v)
   704  	case OpDiv16u:
   705  		return rewriteValueARM64_OpDiv16u(v)
   706  	case OpDiv32:
   707  		return rewriteValueARM64_OpDiv32(v)
   708  	case OpDiv32F:
   709  		v.Op = OpARM64FDIVS
   710  		return true
   711  	case OpDiv32u:
   712  		v.Op = OpARM64UDIVW
   713  		return true
   714  	case OpDiv64:
   715  		return rewriteValueARM64_OpDiv64(v)
   716  	case OpDiv64F:
   717  		v.Op = OpARM64FDIVD
   718  		return true
   719  	case OpDiv64u:
   720  		v.Op = OpARM64UDIV
   721  		return true
   722  	case OpDiv8:
   723  		return rewriteValueARM64_OpDiv8(v)
   724  	case OpDiv8u:
   725  		return rewriteValueARM64_OpDiv8u(v)
   726  	case OpEq16:
   727  		return rewriteValueARM64_OpEq16(v)
   728  	case OpEq32:
   729  		return rewriteValueARM64_OpEq32(v)
   730  	case OpEq32F:
   731  		return rewriteValueARM64_OpEq32F(v)
   732  	case OpEq64:
   733  		return rewriteValueARM64_OpEq64(v)
   734  	case OpEq64F:
   735  		return rewriteValueARM64_OpEq64F(v)
   736  	case OpEq8:
   737  		return rewriteValueARM64_OpEq8(v)
   738  	case OpEqB:
   739  		return rewriteValueARM64_OpEqB(v)
   740  	case OpEqPtr:
   741  		return rewriteValueARM64_OpEqPtr(v)
   742  	case OpFMA:
   743  		return rewriteValueARM64_OpFMA(v)
   744  	case OpFloor:
   745  		v.Op = OpARM64FRINTMD
   746  		return true
   747  	case OpGetCallerPC:
   748  		v.Op = OpARM64LoweredGetCallerPC
   749  		return true
   750  	case OpGetCallerSP:
   751  		v.Op = OpARM64LoweredGetCallerSP
   752  		return true
   753  	case OpGetClosurePtr:
   754  		v.Op = OpARM64LoweredGetClosurePtr
   755  		return true
   756  	case OpHmul32:
   757  		return rewriteValueARM64_OpHmul32(v)
   758  	case OpHmul32u:
   759  		return rewriteValueARM64_OpHmul32u(v)
   760  	case OpHmul64:
   761  		v.Op = OpARM64MULH
   762  		return true
   763  	case OpHmul64u:
   764  		v.Op = OpARM64UMULH
   765  		return true
   766  	case OpInterCall:
   767  		v.Op = OpARM64CALLinter
   768  		return true
   769  	case OpIsInBounds:
   770  		return rewriteValueARM64_OpIsInBounds(v)
   771  	case OpIsNonNil:
   772  		return rewriteValueARM64_OpIsNonNil(v)
   773  	case OpIsSliceInBounds:
   774  		return rewriteValueARM64_OpIsSliceInBounds(v)
   775  	case OpLeq16:
   776  		return rewriteValueARM64_OpLeq16(v)
   777  	case OpLeq16U:
   778  		return rewriteValueARM64_OpLeq16U(v)
   779  	case OpLeq32:
   780  		return rewriteValueARM64_OpLeq32(v)
   781  	case OpLeq32F:
   782  		return rewriteValueARM64_OpLeq32F(v)
   783  	case OpLeq32U:
   784  		return rewriteValueARM64_OpLeq32U(v)
   785  	case OpLeq64:
   786  		return rewriteValueARM64_OpLeq64(v)
   787  	case OpLeq64F:
   788  		return rewriteValueARM64_OpLeq64F(v)
   789  	case OpLeq64U:
   790  		return rewriteValueARM64_OpLeq64U(v)
   791  	case OpLeq8:
   792  		return rewriteValueARM64_OpLeq8(v)
   793  	case OpLeq8U:
   794  		return rewriteValueARM64_OpLeq8U(v)
   795  	case OpLess16:
   796  		return rewriteValueARM64_OpLess16(v)
   797  	case OpLess16U:
   798  		return rewriteValueARM64_OpLess16U(v)
   799  	case OpLess32:
   800  		return rewriteValueARM64_OpLess32(v)
   801  	case OpLess32F:
   802  		return rewriteValueARM64_OpLess32F(v)
   803  	case OpLess32U:
   804  		return rewriteValueARM64_OpLess32U(v)
   805  	case OpLess64:
   806  		return rewriteValueARM64_OpLess64(v)
   807  	case OpLess64F:
   808  		return rewriteValueARM64_OpLess64F(v)
   809  	case OpLess64U:
   810  		return rewriteValueARM64_OpLess64U(v)
   811  	case OpLess8:
   812  		return rewriteValueARM64_OpLess8(v)
   813  	case OpLess8U:
   814  		return rewriteValueARM64_OpLess8U(v)
   815  	case OpLoad:
   816  		return rewriteValueARM64_OpLoad(v)
   817  	case OpLocalAddr:
   818  		return rewriteValueARM64_OpLocalAddr(v)
   819  	case OpLsh16x16:
   820  		return rewriteValueARM64_OpLsh16x16(v)
   821  	case OpLsh16x32:
   822  		return rewriteValueARM64_OpLsh16x32(v)
   823  	case OpLsh16x64:
   824  		return rewriteValueARM64_OpLsh16x64(v)
   825  	case OpLsh16x8:
   826  		return rewriteValueARM64_OpLsh16x8(v)
   827  	case OpLsh32x16:
   828  		return rewriteValueARM64_OpLsh32x16(v)
   829  	case OpLsh32x32:
   830  		return rewriteValueARM64_OpLsh32x32(v)
   831  	case OpLsh32x64:
   832  		return rewriteValueARM64_OpLsh32x64(v)
   833  	case OpLsh32x8:
   834  		return rewriteValueARM64_OpLsh32x8(v)
   835  	case OpLsh64x16:
   836  		return rewriteValueARM64_OpLsh64x16(v)
   837  	case OpLsh64x32:
   838  		return rewriteValueARM64_OpLsh64x32(v)
   839  	case OpLsh64x64:
   840  		return rewriteValueARM64_OpLsh64x64(v)
   841  	case OpLsh64x8:
   842  		return rewriteValueARM64_OpLsh64x8(v)
   843  	case OpLsh8x16:
   844  		return rewriteValueARM64_OpLsh8x16(v)
   845  	case OpLsh8x32:
   846  		return rewriteValueARM64_OpLsh8x32(v)
   847  	case OpLsh8x64:
   848  		return rewriteValueARM64_OpLsh8x64(v)
   849  	case OpLsh8x8:
   850  		return rewriteValueARM64_OpLsh8x8(v)
   851  	case OpMax32F:
   852  		v.Op = OpARM64FMAXS
   853  		return true
   854  	case OpMax64F:
   855  		v.Op = OpARM64FMAXD
   856  		return true
   857  	case OpMin32F:
   858  		v.Op = OpARM64FMINS
   859  		return true
   860  	case OpMin64F:
   861  		v.Op = OpARM64FMIND
   862  		return true
   863  	case OpMod16:
   864  		return rewriteValueARM64_OpMod16(v)
   865  	case OpMod16u:
   866  		return rewriteValueARM64_OpMod16u(v)
   867  	case OpMod32:
   868  		return rewriteValueARM64_OpMod32(v)
   869  	case OpMod32u:
   870  		v.Op = OpARM64UMODW
   871  		return true
   872  	case OpMod64:
   873  		return rewriteValueARM64_OpMod64(v)
   874  	case OpMod64u:
   875  		v.Op = OpARM64UMOD
   876  		return true
   877  	case OpMod8:
   878  		return rewriteValueARM64_OpMod8(v)
   879  	case OpMod8u:
   880  		return rewriteValueARM64_OpMod8u(v)
   881  	case OpMove:
   882  		return rewriteValueARM64_OpMove(v)
   883  	case OpMul16:
   884  		v.Op = OpARM64MULW
   885  		return true
   886  	case OpMul32:
   887  		v.Op = OpARM64MULW
   888  		return true
   889  	case OpMul32F:
   890  		v.Op = OpARM64FMULS
   891  		return true
   892  	case OpMul64:
   893  		v.Op = OpARM64MUL
   894  		return true
   895  	case OpMul64F:
   896  		v.Op = OpARM64FMULD
   897  		return true
   898  	case OpMul8:
   899  		v.Op = OpARM64MULW
   900  		return true
   901  	case OpNeg16:
   902  		v.Op = OpARM64NEG
   903  		return true
   904  	case OpNeg32:
   905  		v.Op = OpARM64NEG
   906  		return true
   907  	case OpNeg32F:
   908  		v.Op = OpARM64FNEGS
   909  		return true
   910  	case OpNeg64:
   911  		v.Op = OpARM64NEG
   912  		return true
   913  	case OpNeg64F:
   914  		v.Op = OpARM64FNEGD
   915  		return true
   916  	case OpNeg8:
   917  		v.Op = OpARM64NEG
   918  		return true
   919  	case OpNeq16:
   920  		return rewriteValueARM64_OpNeq16(v)
   921  	case OpNeq32:
   922  		return rewriteValueARM64_OpNeq32(v)
   923  	case OpNeq32F:
   924  		return rewriteValueARM64_OpNeq32F(v)
   925  	case OpNeq64:
   926  		return rewriteValueARM64_OpNeq64(v)
   927  	case OpNeq64F:
   928  		return rewriteValueARM64_OpNeq64F(v)
   929  	case OpNeq8:
   930  		return rewriteValueARM64_OpNeq8(v)
   931  	case OpNeqB:
   932  		v.Op = OpARM64XOR
   933  		return true
   934  	case OpNeqPtr:
   935  		return rewriteValueARM64_OpNeqPtr(v)
   936  	case OpNilCheck:
   937  		v.Op = OpARM64LoweredNilCheck
   938  		return true
   939  	case OpNot:
   940  		return rewriteValueARM64_OpNot(v)
   941  	case OpOffPtr:
   942  		return rewriteValueARM64_OpOffPtr(v)
   943  	case OpOr16:
   944  		v.Op = OpARM64OR
   945  		return true
   946  	case OpOr32:
   947  		v.Op = OpARM64OR
   948  		return true
   949  	case OpOr64:
   950  		v.Op = OpARM64OR
   951  		return true
   952  	case OpOr8:
   953  		v.Op = OpARM64OR
   954  		return true
   955  	case OpOrB:
   956  		v.Op = OpARM64OR
   957  		return true
   958  	case OpPanicBounds:
   959  		return rewriteValueARM64_OpPanicBounds(v)
   960  	case OpPopCount16:
   961  		return rewriteValueARM64_OpPopCount16(v)
   962  	case OpPopCount32:
   963  		return rewriteValueARM64_OpPopCount32(v)
   964  	case OpPopCount64:
   965  		return rewriteValueARM64_OpPopCount64(v)
   966  	case OpPrefetchCache:
   967  		return rewriteValueARM64_OpPrefetchCache(v)
   968  	case OpPrefetchCacheStreamed:
   969  		return rewriteValueARM64_OpPrefetchCacheStreamed(v)
   970  	case OpPubBarrier:
   971  		return rewriteValueARM64_OpPubBarrier(v)
   972  	case OpRotateLeft16:
   973  		return rewriteValueARM64_OpRotateLeft16(v)
   974  	case OpRotateLeft32:
   975  		return rewriteValueARM64_OpRotateLeft32(v)
   976  	case OpRotateLeft64:
   977  		return rewriteValueARM64_OpRotateLeft64(v)
   978  	case OpRotateLeft8:
   979  		return rewriteValueARM64_OpRotateLeft8(v)
   980  	case OpRound:
   981  		v.Op = OpARM64FRINTAD
   982  		return true
   983  	case OpRound32F:
   984  		v.Op = OpARM64LoweredRound32F
   985  		return true
   986  	case OpRound64F:
   987  		v.Op = OpARM64LoweredRound64F
   988  		return true
   989  	case OpRoundToEven:
   990  		v.Op = OpARM64FRINTND
   991  		return true
   992  	case OpRsh16Ux16:
   993  		return rewriteValueARM64_OpRsh16Ux16(v)
   994  	case OpRsh16Ux32:
   995  		return rewriteValueARM64_OpRsh16Ux32(v)
   996  	case OpRsh16Ux64:
   997  		return rewriteValueARM64_OpRsh16Ux64(v)
   998  	case OpRsh16Ux8:
   999  		return rewriteValueARM64_OpRsh16Ux8(v)
  1000  	case OpRsh16x16:
  1001  		return rewriteValueARM64_OpRsh16x16(v)
  1002  	case OpRsh16x32:
  1003  		return rewriteValueARM64_OpRsh16x32(v)
  1004  	case OpRsh16x64:
  1005  		return rewriteValueARM64_OpRsh16x64(v)
  1006  	case OpRsh16x8:
  1007  		return rewriteValueARM64_OpRsh16x8(v)
  1008  	case OpRsh32Ux16:
  1009  		return rewriteValueARM64_OpRsh32Ux16(v)
  1010  	case OpRsh32Ux32:
  1011  		return rewriteValueARM64_OpRsh32Ux32(v)
  1012  	case OpRsh32Ux64:
  1013  		return rewriteValueARM64_OpRsh32Ux64(v)
  1014  	case OpRsh32Ux8:
  1015  		return rewriteValueARM64_OpRsh32Ux8(v)
  1016  	case OpRsh32x16:
  1017  		return rewriteValueARM64_OpRsh32x16(v)
  1018  	case OpRsh32x32:
  1019  		return rewriteValueARM64_OpRsh32x32(v)
  1020  	case OpRsh32x64:
  1021  		return rewriteValueARM64_OpRsh32x64(v)
  1022  	case OpRsh32x8:
  1023  		return rewriteValueARM64_OpRsh32x8(v)
  1024  	case OpRsh64Ux16:
  1025  		return rewriteValueARM64_OpRsh64Ux16(v)
  1026  	case OpRsh64Ux32:
  1027  		return rewriteValueARM64_OpRsh64Ux32(v)
  1028  	case OpRsh64Ux64:
  1029  		return rewriteValueARM64_OpRsh64Ux64(v)
  1030  	case OpRsh64Ux8:
  1031  		return rewriteValueARM64_OpRsh64Ux8(v)
  1032  	case OpRsh64x16:
  1033  		return rewriteValueARM64_OpRsh64x16(v)
  1034  	case OpRsh64x32:
  1035  		return rewriteValueARM64_OpRsh64x32(v)
  1036  	case OpRsh64x64:
  1037  		return rewriteValueARM64_OpRsh64x64(v)
  1038  	case OpRsh64x8:
  1039  		return rewriteValueARM64_OpRsh64x8(v)
  1040  	case OpRsh8Ux16:
  1041  		return rewriteValueARM64_OpRsh8Ux16(v)
  1042  	case OpRsh8Ux32:
  1043  		return rewriteValueARM64_OpRsh8Ux32(v)
  1044  	case OpRsh8Ux64:
  1045  		return rewriteValueARM64_OpRsh8Ux64(v)
  1046  	case OpRsh8Ux8:
  1047  		return rewriteValueARM64_OpRsh8Ux8(v)
  1048  	case OpRsh8x16:
  1049  		return rewriteValueARM64_OpRsh8x16(v)
  1050  	case OpRsh8x32:
  1051  		return rewriteValueARM64_OpRsh8x32(v)
  1052  	case OpRsh8x64:
  1053  		return rewriteValueARM64_OpRsh8x64(v)
  1054  	case OpRsh8x8:
  1055  		return rewriteValueARM64_OpRsh8x8(v)
  1056  	case OpSelect0:
  1057  		return rewriteValueARM64_OpSelect0(v)
  1058  	case OpSelect1:
  1059  		return rewriteValueARM64_OpSelect1(v)
  1060  	case OpSelectN:
  1061  		return rewriteValueARM64_OpSelectN(v)
  1062  	case OpSignExt16to32:
  1063  		v.Op = OpARM64MOVHreg
  1064  		return true
  1065  	case OpSignExt16to64:
  1066  		v.Op = OpARM64MOVHreg
  1067  		return true
  1068  	case OpSignExt32to64:
  1069  		v.Op = OpARM64MOVWreg
  1070  		return true
  1071  	case OpSignExt8to16:
  1072  		v.Op = OpARM64MOVBreg
  1073  		return true
  1074  	case OpSignExt8to32:
  1075  		v.Op = OpARM64MOVBreg
  1076  		return true
  1077  	case OpSignExt8to64:
  1078  		v.Op = OpARM64MOVBreg
  1079  		return true
  1080  	case OpSlicemask:
  1081  		return rewriteValueARM64_OpSlicemask(v)
  1082  	case OpSqrt:
  1083  		v.Op = OpARM64FSQRTD
  1084  		return true
  1085  	case OpSqrt32:
  1086  		v.Op = OpARM64FSQRTS
  1087  		return true
  1088  	case OpStaticCall:
  1089  		v.Op = OpARM64CALLstatic
  1090  		return true
  1091  	case OpStore:
  1092  		return rewriteValueARM64_OpStore(v)
  1093  	case OpSub16:
  1094  		v.Op = OpARM64SUB
  1095  		return true
  1096  	case OpSub32:
  1097  		v.Op = OpARM64SUB
  1098  		return true
  1099  	case OpSub32F:
  1100  		v.Op = OpARM64FSUBS
  1101  		return true
  1102  	case OpSub64:
  1103  		v.Op = OpARM64SUB
  1104  		return true
  1105  	case OpSub64F:
  1106  		v.Op = OpARM64FSUBD
  1107  		return true
  1108  	case OpSub8:
  1109  		v.Op = OpARM64SUB
  1110  		return true
  1111  	case OpSubPtr:
  1112  		v.Op = OpARM64SUB
  1113  		return true
  1114  	case OpTailCall:
  1115  		v.Op = OpARM64CALLtail
  1116  		return true
  1117  	case OpTrunc:
  1118  		v.Op = OpARM64FRINTZD
  1119  		return true
  1120  	case OpTrunc16to8:
  1121  		v.Op = OpCopy
  1122  		return true
  1123  	case OpTrunc32to16:
  1124  		v.Op = OpCopy
  1125  		return true
  1126  	case OpTrunc32to8:
  1127  		v.Op = OpCopy
  1128  		return true
  1129  	case OpTrunc64to16:
  1130  		v.Op = OpCopy
  1131  		return true
  1132  	case OpTrunc64to32:
  1133  		v.Op = OpCopy
  1134  		return true
  1135  	case OpTrunc64to8:
  1136  		v.Op = OpCopy
  1137  		return true
  1138  	case OpWB:
  1139  		v.Op = OpARM64LoweredWB
  1140  		return true
  1141  	case OpXor16:
  1142  		v.Op = OpARM64XOR
  1143  		return true
  1144  	case OpXor32:
  1145  		v.Op = OpARM64XOR
  1146  		return true
  1147  	case OpXor64:
  1148  		v.Op = OpARM64XOR
  1149  		return true
  1150  	case OpXor8:
  1151  		v.Op = OpARM64XOR
  1152  		return true
  1153  	case OpZero:
  1154  		return rewriteValueARM64_OpZero(v)
  1155  	case OpZeroExt16to32:
  1156  		v.Op = OpARM64MOVHUreg
  1157  		return true
  1158  	case OpZeroExt16to64:
  1159  		v.Op = OpARM64MOVHUreg
  1160  		return true
  1161  	case OpZeroExt32to64:
  1162  		v.Op = OpARM64MOVWUreg
  1163  		return true
  1164  	case OpZeroExt8to16:
  1165  		v.Op = OpARM64MOVBUreg
  1166  		return true
  1167  	case OpZeroExt8to32:
  1168  		v.Op = OpARM64MOVBUreg
  1169  		return true
  1170  	case OpZeroExt8to64:
  1171  		v.Op = OpARM64MOVBUreg
  1172  		return true
  1173  	}
  1174  	return false
  1175  }
  1176  func rewriteValueARM64_OpARM64ADCSflags(v *Value) bool {
  1177  	v_2 := v.Args[2]
  1178  	v_1 := v.Args[1]
  1179  	v_0 := v.Args[0]
  1180  	b := v.Block
  1181  	typ := &b.Func.Config.Types
  1182  	// match: (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] (ADCzerocarry <typ.UInt64> c))))
  1183  	// result: (ADCSflags x y c)
  1184  	for {
  1185  		x := v_0
  1186  		y := v_1
  1187  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
  1188  			break
  1189  		}
  1190  		v_2_0 := v_2.Args[0]
  1191  		if v_2_0.Op != OpARM64ADDSconstflags || auxIntToInt64(v_2_0.AuxInt) != -1 {
  1192  			break
  1193  		}
  1194  		v_2_0_0 := v_2_0.Args[0]
  1195  		if v_2_0_0.Op != OpARM64ADCzerocarry || v_2_0_0.Type != typ.UInt64 {
  1196  			break
  1197  		}
  1198  		c := v_2_0_0.Args[0]
  1199  		v.reset(OpARM64ADCSflags)
  1200  		v.AddArg3(x, y, c)
  1201  		return true
  1202  	}
  1203  	// match: (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] (MOVDconst [0]))))
  1204  	// result: (ADDSflags x y)
  1205  	for {
  1206  		x := v_0
  1207  		y := v_1
  1208  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
  1209  			break
  1210  		}
  1211  		v_2_0 := v_2.Args[0]
  1212  		if v_2_0.Op != OpARM64ADDSconstflags || auxIntToInt64(v_2_0.AuxInt) != -1 {
  1213  			break
  1214  		}
  1215  		v_2_0_0 := v_2_0.Args[0]
  1216  		if v_2_0_0.Op != OpARM64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
  1217  			break
  1218  		}
  1219  		v.reset(OpARM64ADDSflags)
  1220  		v.AddArg2(x, y)
  1221  		return true
  1222  	}
  1223  	return false
  1224  }
  1225  func rewriteValueARM64_OpARM64ADD(v *Value) bool {
  1226  	v_1 := v.Args[1]
  1227  	v_0 := v.Args[0]
  1228  	// match: (ADD x (MOVDconst <t> [c]))
  1229  	// cond: !t.IsPtr()
  1230  	// result: (ADDconst [c] x)
  1231  	for {
  1232  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1233  			x := v_0
  1234  			if v_1.Op != OpARM64MOVDconst {
  1235  				continue
  1236  			}
  1237  			t := v_1.Type
  1238  			c := auxIntToInt64(v_1.AuxInt)
  1239  			if !(!t.IsPtr()) {
  1240  				continue
  1241  			}
  1242  			v.reset(OpARM64ADDconst)
  1243  			v.AuxInt = int64ToAuxInt(c)
  1244  			v.AddArg(x)
  1245  			return true
  1246  		}
  1247  		break
  1248  	}
  1249  	// match: (ADD a l:(MUL x y))
  1250  	// cond: l.Uses==1 && clobber(l)
  1251  	// result: (MADD a x y)
  1252  	for {
  1253  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1254  			a := v_0
  1255  			l := v_1
  1256  			if l.Op != OpARM64MUL {
  1257  				continue
  1258  			}
  1259  			y := l.Args[1]
  1260  			x := l.Args[0]
  1261  			if !(l.Uses == 1 && clobber(l)) {
  1262  				continue
  1263  			}
  1264  			v.reset(OpARM64MADD)
  1265  			v.AddArg3(a, x, y)
  1266  			return true
  1267  		}
  1268  		break
  1269  	}
  1270  	// match: (ADD a l:(MNEG x y))
  1271  	// cond: l.Uses==1 && clobber(l)
  1272  	// result: (MSUB a x y)
  1273  	for {
  1274  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1275  			a := v_0
  1276  			l := v_1
  1277  			if l.Op != OpARM64MNEG {
  1278  				continue
  1279  			}
  1280  			y := l.Args[1]
  1281  			x := l.Args[0]
  1282  			if !(l.Uses == 1 && clobber(l)) {
  1283  				continue
  1284  			}
  1285  			v.reset(OpARM64MSUB)
  1286  			v.AddArg3(a, x, y)
  1287  			return true
  1288  		}
  1289  		break
  1290  	}
  1291  	// match: (ADD a l:(MULW x y))
  1292  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
  1293  	// result: (MADDW a x y)
  1294  	for {
  1295  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1296  			a := v_0
  1297  			l := v_1
  1298  			if l.Op != OpARM64MULW {
  1299  				continue
  1300  			}
  1301  			y := l.Args[1]
  1302  			x := l.Args[0]
  1303  			if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
  1304  				continue
  1305  			}
  1306  			v.reset(OpARM64MADDW)
  1307  			v.AddArg3(a, x, y)
  1308  			return true
  1309  		}
  1310  		break
  1311  	}
  1312  	// match: (ADD a l:(MNEGW x y))
  1313  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
  1314  	// result: (MSUBW a x y)
  1315  	for {
  1316  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1317  			a := v_0
  1318  			l := v_1
  1319  			if l.Op != OpARM64MNEGW {
  1320  				continue
  1321  			}
  1322  			y := l.Args[1]
  1323  			x := l.Args[0]
  1324  			if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
  1325  				continue
  1326  			}
  1327  			v.reset(OpARM64MSUBW)
  1328  			v.AddArg3(a, x, y)
  1329  			return true
  1330  		}
  1331  		break
  1332  	}
  1333  	// match: (ADD x (NEG y))
  1334  	// result: (SUB x y)
  1335  	for {
  1336  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1337  			x := v_0
  1338  			if v_1.Op != OpARM64NEG {
  1339  				continue
  1340  			}
  1341  			y := v_1.Args[0]
  1342  			v.reset(OpARM64SUB)
  1343  			v.AddArg2(x, y)
  1344  			return true
  1345  		}
  1346  		break
  1347  	}
  1348  	// match: (ADD x0 x1:(SLLconst [c] y))
  1349  	// cond: clobberIfDead(x1)
  1350  	// result: (ADDshiftLL x0 y [c])
  1351  	for {
  1352  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1353  			x0 := v_0
  1354  			x1 := v_1
  1355  			if x1.Op != OpARM64SLLconst {
  1356  				continue
  1357  			}
  1358  			c := auxIntToInt64(x1.AuxInt)
  1359  			y := x1.Args[0]
  1360  			if !(clobberIfDead(x1)) {
  1361  				continue
  1362  			}
  1363  			v.reset(OpARM64ADDshiftLL)
  1364  			v.AuxInt = int64ToAuxInt(c)
  1365  			v.AddArg2(x0, y)
  1366  			return true
  1367  		}
  1368  		break
  1369  	}
  1370  	// match: (ADD x0 x1:(SRLconst [c] y))
  1371  	// cond: clobberIfDead(x1)
  1372  	// result: (ADDshiftRL x0 y [c])
  1373  	for {
  1374  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1375  			x0 := v_0
  1376  			x1 := v_1
  1377  			if x1.Op != OpARM64SRLconst {
  1378  				continue
  1379  			}
  1380  			c := auxIntToInt64(x1.AuxInt)
  1381  			y := x1.Args[0]
  1382  			if !(clobberIfDead(x1)) {
  1383  				continue
  1384  			}
  1385  			v.reset(OpARM64ADDshiftRL)
  1386  			v.AuxInt = int64ToAuxInt(c)
  1387  			v.AddArg2(x0, y)
  1388  			return true
  1389  		}
  1390  		break
  1391  	}
  1392  	// match: (ADD x0 x1:(SRAconst [c] y))
  1393  	// cond: clobberIfDead(x1)
  1394  	// result: (ADDshiftRA x0 y [c])
  1395  	for {
  1396  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1397  			x0 := v_0
  1398  			x1 := v_1
  1399  			if x1.Op != OpARM64SRAconst {
  1400  				continue
  1401  			}
  1402  			c := auxIntToInt64(x1.AuxInt)
  1403  			y := x1.Args[0]
  1404  			if !(clobberIfDead(x1)) {
  1405  				continue
  1406  			}
  1407  			v.reset(OpARM64ADDshiftRA)
  1408  			v.AuxInt = int64ToAuxInt(c)
  1409  			v.AddArg2(x0, y)
  1410  			return true
  1411  		}
  1412  		break
  1413  	}
  1414  	return false
  1415  }
  1416  func rewriteValueARM64_OpARM64ADDSflags(v *Value) bool {
  1417  	v_1 := v.Args[1]
  1418  	v_0 := v.Args[0]
  1419  	// match: (ADDSflags x (MOVDconst [c]))
  1420  	// result: (ADDSconstflags [c] x)
  1421  	for {
  1422  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1423  			x := v_0
  1424  			if v_1.Op != OpARM64MOVDconst {
  1425  				continue
  1426  			}
  1427  			c := auxIntToInt64(v_1.AuxInt)
  1428  			v.reset(OpARM64ADDSconstflags)
  1429  			v.AuxInt = int64ToAuxInt(c)
  1430  			v.AddArg(x)
  1431  			return true
  1432  		}
  1433  		break
  1434  	}
  1435  	return false
  1436  }
  1437  func rewriteValueARM64_OpARM64ADDconst(v *Value) bool {
  1438  	v_0 := v.Args[0]
  1439  	// match: (ADDconst [off1] (MOVDaddr [off2] {sym} ptr))
  1440  	// cond: is32Bit(off1+int64(off2))
  1441  	// result: (MOVDaddr [int32(off1)+off2] {sym} ptr)
  1442  	for {
  1443  		off1 := auxIntToInt64(v.AuxInt)
  1444  		if v_0.Op != OpARM64MOVDaddr {
  1445  			break
  1446  		}
  1447  		off2 := auxIntToInt32(v_0.AuxInt)
  1448  		sym := auxToSym(v_0.Aux)
  1449  		ptr := v_0.Args[0]
  1450  		if !(is32Bit(off1 + int64(off2))) {
  1451  			break
  1452  		}
  1453  		v.reset(OpARM64MOVDaddr)
  1454  		v.AuxInt = int32ToAuxInt(int32(off1) + off2)
  1455  		v.Aux = symToAux(sym)
  1456  		v.AddArg(ptr)
  1457  		return true
  1458  	}
  1459  	// match: (ADDconst [c] y)
  1460  	// cond: c < 0
  1461  	// result: (SUBconst [-c] y)
  1462  	for {
  1463  		c := auxIntToInt64(v.AuxInt)
  1464  		y := v_0
  1465  		if !(c < 0) {
  1466  			break
  1467  		}
  1468  		v.reset(OpARM64SUBconst)
  1469  		v.AuxInt = int64ToAuxInt(-c)
  1470  		v.AddArg(y)
  1471  		return true
  1472  	}
  1473  	// match: (ADDconst [0] x)
  1474  	// result: x
  1475  	for {
  1476  		if auxIntToInt64(v.AuxInt) != 0 {
  1477  			break
  1478  		}
  1479  		x := v_0
  1480  		v.copyOf(x)
  1481  		return true
  1482  	}
  1483  	// match: (ADDconst [c] (MOVDconst [d]))
  1484  	// result: (MOVDconst [c+d])
  1485  	for {
  1486  		c := auxIntToInt64(v.AuxInt)
  1487  		if v_0.Op != OpARM64MOVDconst {
  1488  			break
  1489  		}
  1490  		d := auxIntToInt64(v_0.AuxInt)
  1491  		v.reset(OpARM64MOVDconst)
  1492  		v.AuxInt = int64ToAuxInt(c + d)
  1493  		return true
  1494  	}
  1495  	// match: (ADDconst [c] (ADDconst [d] x))
  1496  	// result: (ADDconst [c+d] x)
  1497  	for {
  1498  		c := auxIntToInt64(v.AuxInt)
  1499  		if v_0.Op != OpARM64ADDconst {
  1500  			break
  1501  		}
  1502  		d := auxIntToInt64(v_0.AuxInt)
  1503  		x := v_0.Args[0]
  1504  		v.reset(OpARM64ADDconst)
  1505  		v.AuxInt = int64ToAuxInt(c + d)
  1506  		v.AddArg(x)
  1507  		return true
  1508  	}
  1509  	// match: (ADDconst [c] (SUBconst [d] x))
  1510  	// result: (ADDconst [c-d] x)
  1511  	for {
  1512  		c := auxIntToInt64(v.AuxInt)
  1513  		if v_0.Op != OpARM64SUBconst {
  1514  			break
  1515  		}
  1516  		d := auxIntToInt64(v_0.AuxInt)
  1517  		x := v_0.Args[0]
  1518  		v.reset(OpARM64ADDconst)
  1519  		v.AuxInt = int64ToAuxInt(c - d)
  1520  		v.AddArg(x)
  1521  		return true
  1522  	}
  1523  	return false
  1524  }
  1525  func rewriteValueARM64_OpARM64ADDshiftLL(v *Value) bool {
  1526  	v_1 := v.Args[1]
  1527  	v_0 := v.Args[0]
  1528  	b := v.Block
  1529  	typ := &b.Func.Config.Types
  1530  	// match: (ADDshiftLL (MOVDconst [c]) x [d])
  1531  	// result: (ADDconst [c] (SLLconst <x.Type> x [d]))
  1532  	for {
  1533  		d := auxIntToInt64(v.AuxInt)
  1534  		if v_0.Op != OpARM64MOVDconst {
  1535  			break
  1536  		}
  1537  		c := auxIntToInt64(v_0.AuxInt)
  1538  		x := v_1
  1539  		v.reset(OpARM64ADDconst)
  1540  		v.AuxInt = int64ToAuxInt(c)
  1541  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  1542  		v0.AuxInt = int64ToAuxInt(d)
  1543  		v0.AddArg(x)
  1544  		v.AddArg(v0)
  1545  		return true
  1546  	}
  1547  	// match: (ADDshiftLL x (MOVDconst [c]) [d])
  1548  	// result: (ADDconst x [int64(uint64(c)<<uint64(d))])
  1549  	for {
  1550  		d := auxIntToInt64(v.AuxInt)
  1551  		x := v_0
  1552  		if v_1.Op != OpARM64MOVDconst {
  1553  			break
  1554  		}
  1555  		c := auxIntToInt64(v_1.AuxInt)
  1556  		v.reset(OpARM64ADDconst)
  1557  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  1558  		v.AddArg(x)
  1559  		return true
  1560  	}
  1561  	// match: (ADDshiftLL <typ.UInt16> [8] (UBFX <typ.UInt16> [armBFAuxInt(8, 8)] x) x)
  1562  	// result: (REV16W x)
  1563  	for {
  1564  		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) {
  1565  			break
  1566  		}
  1567  		x := v_0.Args[0]
  1568  		if x != v_1 {
  1569  			break
  1570  		}
  1571  		v.reset(OpARM64REV16W)
  1572  		v.AddArg(x)
  1573  		return true
  1574  	}
  1575  	// match: (ADDshiftLL [8] (UBFX [armBFAuxInt(8, 24)] (ANDconst [c1] x)) (ANDconst [c2] x))
  1576  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
  1577  	// result: (REV16W x)
  1578  	for {
  1579  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
  1580  			break
  1581  		}
  1582  		v_0_0 := v_0.Args[0]
  1583  		if v_0_0.Op != OpARM64ANDconst {
  1584  			break
  1585  		}
  1586  		c1 := auxIntToInt64(v_0_0.AuxInt)
  1587  		x := v_0_0.Args[0]
  1588  		if v_1.Op != OpARM64ANDconst {
  1589  			break
  1590  		}
  1591  		c2 := auxIntToInt64(v_1.AuxInt)
  1592  		if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
  1593  			break
  1594  		}
  1595  		v.reset(OpARM64REV16W)
  1596  		v.AddArg(x)
  1597  		return true
  1598  	}
  1599  	// match: (ADDshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
  1600  	// cond: (uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff)
  1601  	// result: (REV16 x)
  1602  	for {
  1603  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1604  			break
  1605  		}
  1606  		v_0_0 := v_0.Args[0]
  1607  		if v_0_0.Op != OpARM64ANDconst {
  1608  			break
  1609  		}
  1610  		c1 := auxIntToInt64(v_0_0.AuxInt)
  1611  		x := v_0_0.Args[0]
  1612  		if v_1.Op != OpARM64ANDconst {
  1613  			break
  1614  		}
  1615  		c2 := auxIntToInt64(v_1.AuxInt)
  1616  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
  1617  			break
  1618  		}
  1619  		v.reset(OpARM64REV16)
  1620  		v.AddArg(x)
  1621  		return true
  1622  	}
  1623  	// match: (ADDshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
  1624  	// cond: (uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff)
  1625  	// result: (REV16 (ANDconst <x.Type> [0xffffffff] x))
  1626  	for {
  1627  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
  1628  			break
  1629  		}
  1630  		v_0_0 := v_0.Args[0]
  1631  		if v_0_0.Op != OpARM64ANDconst {
  1632  			break
  1633  		}
  1634  		c1 := auxIntToInt64(v_0_0.AuxInt)
  1635  		x := v_0_0.Args[0]
  1636  		if v_1.Op != OpARM64ANDconst {
  1637  			break
  1638  		}
  1639  		c2 := auxIntToInt64(v_1.AuxInt)
  1640  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
  1641  			break
  1642  		}
  1643  		v.reset(OpARM64REV16)
  1644  		v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
  1645  		v0.AuxInt = int64ToAuxInt(0xffffffff)
  1646  		v0.AddArg(x)
  1647  		v.AddArg(v0)
  1648  		return true
  1649  	}
  1650  	// match: (ADDshiftLL [c] (SRLconst x [64-c]) x2)
  1651  	// result: (EXTRconst [64-c] x2 x)
  1652  	for {
  1653  		c := auxIntToInt64(v.AuxInt)
  1654  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
  1655  			break
  1656  		}
  1657  		x := v_0.Args[0]
  1658  		x2 := v_1
  1659  		v.reset(OpARM64EXTRconst)
  1660  		v.AuxInt = int64ToAuxInt(64 - c)
  1661  		v.AddArg2(x2, x)
  1662  		return true
  1663  	}
  1664  	// match: (ADDshiftLL <t> [c] (UBFX [bfc] x) x2)
  1665  	// cond: c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)
  1666  	// result: (EXTRWconst [32-c] x2 x)
  1667  	for {
  1668  		t := v.Type
  1669  		c := auxIntToInt64(v.AuxInt)
  1670  		if v_0.Op != OpARM64UBFX {
  1671  			break
  1672  		}
  1673  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  1674  		x := v_0.Args[0]
  1675  		x2 := v_1
  1676  		if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
  1677  			break
  1678  		}
  1679  		v.reset(OpARM64EXTRWconst)
  1680  		v.AuxInt = int64ToAuxInt(32 - c)
  1681  		v.AddArg2(x2, x)
  1682  		return true
  1683  	}
  1684  	return false
  1685  }
  1686  func rewriteValueARM64_OpARM64ADDshiftRA(v *Value) bool {
  1687  	v_1 := v.Args[1]
  1688  	v_0 := v.Args[0]
  1689  	b := v.Block
  1690  	// match: (ADDshiftRA (MOVDconst [c]) x [d])
  1691  	// result: (ADDconst [c] (SRAconst <x.Type> x [d]))
  1692  	for {
  1693  		d := auxIntToInt64(v.AuxInt)
  1694  		if v_0.Op != OpARM64MOVDconst {
  1695  			break
  1696  		}
  1697  		c := auxIntToInt64(v_0.AuxInt)
  1698  		x := v_1
  1699  		v.reset(OpARM64ADDconst)
  1700  		v.AuxInt = int64ToAuxInt(c)
  1701  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  1702  		v0.AuxInt = int64ToAuxInt(d)
  1703  		v0.AddArg(x)
  1704  		v.AddArg(v0)
  1705  		return true
  1706  	}
  1707  	// match: (ADDshiftRA x (MOVDconst [c]) [d])
  1708  	// result: (ADDconst x [c>>uint64(d)])
  1709  	for {
  1710  		d := auxIntToInt64(v.AuxInt)
  1711  		x := v_0
  1712  		if v_1.Op != OpARM64MOVDconst {
  1713  			break
  1714  		}
  1715  		c := auxIntToInt64(v_1.AuxInt)
  1716  		v.reset(OpARM64ADDconst)
  1717  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  1718  		v.AddArg(x)
  1719  		return true
  1720  	}
  1721  	return false
  1722  }
  1723  func rewriteValueARM64_OpARM64ADDshiftRL(v *Value) bool {
  1724  	v_1 := v.Args[1]
  1725  	v_0 := v.Args[0]
  1726  	b := v.Block
  1727  	// match: (ADDshiftRL (MOVDconst [c]) x [d])
  1728  	// result: (ADDconst [c] (SRLconst <x.Type> x [d]))
  1729  	for {
  1730  		d := auxIntToInt64(v.AuxInt)
  1731  		if v_0.Op != OpARM64MOVDconst {
  1732  			break
  1733  		}
  1734  		c := auxIntToInt64(v_0.AuxInt)
  1735  		x := v_1
  1736  		v.reset(OpARM64ADDconst)
  1737  		v.AuxInt = int64ToAuxInt(c)
  1738  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  1739  		v0.AuxInt = int64ToAuxInt(d)
  1740  		v0.AddArg(x)
  1741  		v.AddArg(v0)
  1742  		return true
  1743  	}
  1744  	// match: (ADDshiftRL x (MOVDconst [c]) [d])
  1745  	// result: (ADDconst x [int64(uint64(c)>>uint64(d))])
  1746  	for {
  1747  		d := auxIntToInt64(v.AuxInt)
  1748  		x := v_0
  1749  		if v_1.Op != OpARM64MOVDconst {
  1750  			break
  1751  		}
  1752  		c := auxIntToInt64(v_1.AuxInt)
  1753  		v.reset(OpARM64ADDconst)
  1754  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  1755  		v.AddArg(x)
  1756  		return true
  1757  	}
  1758  	return false
  1759  }
  1760  func rewriteValueARM64_OpARM64AND(v *Value) bool {
  1761  	v_1 := v.Args[1]
  1762  	v_0 := v.Args[0]
  1763  	// match: (AND x (MOVDconst [c]))
  1764  	// result: (ANDconst [c] x)
  1765  	for {
  1766  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1767  			x := v_0
  1768  			if v_1.Op != OpARM64MOVDconst {
  1769  				continue
  1770  			}
  1771  			c := auxIntToInt64(v_1.AuxInt)
  1772  			v.reset(OpARM64ANDconst)
  1773  			v.AuxInt = int64ToAuxInt(c)
  1774  			v.AddArg(x)
  1775  			return true
  1776  		}
  1777  		break
  1778  	}
  1779  	// match: (AND x x)
  1780  	// result: x
  1781  	for {
  1782  		x := v_0
  1783  		if x != v_1 {
  1784  			break
  1785  		}
  1786  		v.copyOf(x)
  1787  		return true
  1788  	}
  1789  	// match: (AND x (MVN y))
  1790  	// result: (BIC x y)
  1791  	for {
  1792  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1793  			x := v_0
  1794  			if v_1.Op != OpARM64MVN {
  1795  				continue
  1796  			}
  1797  			y := v_1.Args[0]
  1798  			v.reset(OpARM64BIC)
  1799  			v.AddArg2(x, y)
  1800  			return true
  1801  		}
  1802  		break
  1803  	}
  1804  	// match: (AND x0 x1:(SLLconst [c] y))
  1805  	// cond: clobberIfDead(x1)
  1806  	// result: (ANDshiftLL x0 y [c])
  1807  	for {
  1808  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1809  			x0 := v_0
  1810  			x1 := v_1
  1811  			if x1.Op != OpARM64SLLconst {
  1812  				continue
  1813  			}
  1814  			c := auxIntToInt64(x1.AuxInt)
  1815  			y := x1.Args[0]
  1816  			if !(clobberIfDead(x1)) {
  1817  				continue
  1818  			}
  1819  			v.reset(OpARM64ANDshiftLL)
  1820  			v.AuxInt = int64ToAuxInt(c)
  1821  			v.AddArg2(x0, y)
  1822  			return true
  1823  		}
  1824  		break
  1825  	}
  1826  	// match: (AND x0 x1:(SRLconst [c] y))
  1827  	// cond: clobberIfDead(x1)
  1828  	// result: (ANDshiftRL x0 y [c])
  1829  	for {
  1830  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1831  			x0 := v_0
  1832  			x1 := v_1
  1833  			if x1.Op != OpARM64SRLconst {
  1834  				continue
  1835  			}
  1836  			c := auxIntToInt64(x1.AuxInt)
  1837  			y := x1.Args[0]
  1838  			if !(clobberIfDead(x1)) {
  1839  				continue
  1840  			}
  1841  			v.reset(OpARM64ANDshiftRL)
  1842  			v.AuxInt = int64ToAuxInt(c)
  1843  			v.AddArg2(x0, y)
  1844  			return true
  1845  		}
  1846  		break
  1847  	}
  1848  	// match: (AND x0 x1:(SRAconst [c] y))
  1849  	// cond: clobberIfDead(x1)
  1850  	// result: (ANDshiftRA x0 y [c])
  1851  	for {
  1852  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1853  			x0 := v_0
  1854  			x1 := v_1
  1855  			if x1.Op != OpARM64SRAconst {
  1856  				continue
  1857  			}
  1858  			c := auxIntToInt64(x1.AuxInt)
  1859  			y := x1.Args[0]
  1860  			if !(clobberIfDead(x1)) {
  1861  				continue
  1862  			}
  1863  			v.reset(OpARM64ANDshiftRA)
  1864  			v.AuxInt = int64ToAuxInt(c)
  1865  			v.AddArg2(x0, y)
  1866  			return true
  1867  		}
  1868  		break
  1869  	}
  1870  	// match: (AND x0 x1:(RORconst [c] y))
  1871  	// cond: clobberIfDead(x1)
  1872  	// result: (ANDshiftRO x0 y [c])
  1873  	for {
  1874  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1875  			x0 := v_0
  1876  			x1 := v_1
  1877  			if x1.Op != OpARM64RORconst {
  1878  				continue
  1879  			}
  1880  			c := auxIntToInt64(x1.AuxInt)
  1881  			y := x1.Args[0]
  1882  			if !(clobberIfDead(x1)) {
  1883  				continue
  1884  			}
  1885  			v.reset(OpARM64ANDshiftRO)
  1886  			v.AuxInt = int64ToAuxInt(c)
  1887  			v.AddArg2(x0, y)
  1888  			return true
  1889  		}
  1890  		break
  1891  	}
  1892  	return false
  1893  }
  1894  func rewriteValueARM64_OpARM64ANDconst(v *Value) bool {
  1895  	v_0 := v.Args[0]
  1896  	// match: (ANDconst [0] _)
  1897  	// result: (MOVDconst [0])
  1898  	for {
  1899  		if auxIntToInt64(v.AuxInt) != 0 {
  1900  			break
  1901  		}
  1902  		v.reset(OpARM64MOVDconst)
  1903  		v.AuxInt = int64ToAuxInt(0)
  1904  		return true
  1905  	}
  1906  	// match: (ANDconst [-1] x)
  1907  	// result: x
  1908  	for {
  1909  		if auxIntToInt64(v.AuxInt) != -1 {
  1910  			break
  1911  		}
  1912  		x := v_0
  1913  		v.copyOf(x)
  1914  		return true
  1915  	}
  1916  	// match: (ANDconst [c] (MOVDconst [d]))
  1917  	// result: (MOVDconst [c&d])
  1918  	for {
  1919  		c := auxIntToInt64(v.AuxInt)
  1920  		if v_0.Op != OpARM64MOVDconst {
  1921  			break
  1922  		}
  1923  		d := auxIntToInt64(v_0.AuxInt)
  1924  		v.reset(OpARM64MOVDconst)
  1925  		v.AuxInt = int64ToAuxInt(c & d)
  1926  		return true
  1927  	}
  1928  	// match: (ANDconst [c] (ANDconst [d] x))
  1929  	// result: (ANDconst [c&d] x)
  1930  	for {
  1931  		c := auxIntToInt64(v.AuxInt)
  1932  		if v_0.Op != OpARM64ANDconst {
  1933  			break
  1934  		}
  1935  		d := auxIntToInt64(v_0.AuxInt)
  1936  		x := v_0.Args[0]
  1937  		v.reset(OpARM64ANDconst)
  1938  		v.AuxInt = int64ToAuxInt(c & d)
  1939  		v.AddArg(x)
  1940  		return true
  1941  	}
  1942  	// match: (ANDconst [c] (MOVWUreg x))
  1943  	// result: (ANDconst [c&(1<<32-1)] x)
  1944  	for {
  1945  		c := auxIntToInt64(v.AuxInt)
  1946  		if v_0.Op != OpARM64MOVWUreg {
  1947  			break
  1948  		}
  1949  		x := v_0.Args[0]
  1950  		v.reset(OpARM64ANDconst)
  1951  		v.AuxInt = int64ToAuxInt(c & (1<<32 - 1))
  1952  		v.AddArg(x)
  1953  		return true
  1954  	}
  1955  	// match: (ANDconst [c] (MOVHUreg x))
  1956  	// result: (ANDconst [c&(1<<16-1)] x)
  1957  	for {
  1958  		c := auxIntToInt64(v.AuxInt)
  1959  		if v_0.Op != OpARM64MOVHUreg {
  1960  			break
  1961  		}
  1962  		x := v_0.Args[0]
  1963  		v.reset(OpARM64ANDconst)
  1964  		v.AuxInt = int64ToAuxInt(c & (1<<16 - 1))
  1965  		v.AddArg(x)
  1966  		return true
  1967  	}
  1968  	// match: (ANDconst [c] (MOVBUreg x))
  1969  	// result: (ANDconst [c&(1<<8-1)] x)
  1970  	for {
  1971  		c := auxIntToInt64(v.AuxInt)
  1972  		if v_0.Op != OpARM64MOVBUreg {
  1973  			break
  1974  		}
  1975  		x := v_0.Args[0]
  1976  		v.reset(OpARM64ANDconst)
  1977  		v.AuxInt = int64ToAuxInt(c & (1<<8 - 1))
  1978  		v.AddArg(x)
  1979  		return true
  1980  	}
  1981  	// match: (ANDconst [ac] (SLLconst [sc] x))
  1982  	// cond: isARM64BFMask(sc, ac, sc)
  1983  	// result: (UBFIZ [armBFAuxInt(sc, arm64BFWidth(ac, sc))] x)
  1984  	for {
  1985  		ac := auxIntToInt64(v.AuxInt)
  1986  		if v_0.Op != OpARM64SLLconst {
  1987  			break
  1988  		}
  1989  		sc := auxIntToInt64(v_0.AuxInt)
  1990  		x := v_0.Args[0]
  1991  		if !(isARM64BFMask(sc, ac, sc)) {
  1992  			break
  1993  		}
  1994  		v.reset(OpARM64UBFIZ)
  1995  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, sc)))
  1996  		v.AddArg(x)
  1997  		return true
  1998  	}
  1999  	// match: (ANDconst [ac] (SRLconst [sc] x))
  2000  	// cond: isARM64BFMask(sc, ac, 0)
  2001  	// result: (UBFX [armBFAuxInt(sc, arm64BFWidth(ac, 0))] x)
  2002  	for {
  2003  		ac := auxIntToInt64(v.AuxInt)
  2004  		if v_0.Op != OpARM64SRLconst {
  2005  			break
  2006  		}
  2007  		sc := auxIntToInt64(v_0.AuxInt)
  2008  		x := v_0.Args[0]
  2009  		if !(isARM64BFMask(sc, ac, 0)) {
  2010  			break
  2011  		}
  2012  		v.reset(OpARM64UBFX)
  2013  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, 0)))
  2014  		v.AddArg(x)
  2015  		return true
  2016  	}
  2017  	// match: (ANDconst [c] (UBFX [bfc] x))
  2018  	// cond: isARM64BFMask(0, c, 0)
  2019  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), arm64BFWidth(c, 0)))] x)
  2020  	for {
  2021  		c := auxIntToInt64(v.AuxInt)
  2022  		if v_0.Op != OpARM64UBFX {
  2023  			break
  2024  		}
  2025  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  2026  		x := v_0.Args[0]
  2027  		if !(isARM64BFMask(0, c, 0)) {
  2028  			break
  2029  		}
  2030  		v.reset(OpARM64UBFX)
  2031  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), arm64BFWidth(c, 0))))
  2032  		v.AddArg(x)
  2033  		return true
  2034  	}
  2035  	return false
  2036  }
  2037  func rewriteValueARM64_OpARM64ANDshiftLL(v *Value) bool {
  2038  	v_1 := v.Args[1]
  2039  	v_0 := v.Args[0]
  2040  	b := v.Block
  2041  	// match: (ANDshiftLL (MOVDconst [c]) x [d])
  2042  	// result: (ANDconst [c] (SLLconst <x.Type> x [d]))
  2043  	for {
  2044  		d := auxIntToInt64(v.AuxInt)
  2045  		if v_0.Op != OpARM64MOVDconst {
  2046  			break
  2047  		}
  2048  		c := auxIntToInt64(v_0.AuxInt)
  2049  		x := v_1
  2050  		v.reset(OpARM64ANDconst)
  2051  		v.AuxInt = int64ToAuxInt(c)
  2052  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  2053  		v0.AuxInt = int64ToAuxInt(d)
  2054  		v0.AddArg(x)
  2055  		v.AddArg(v0)
  2056  		return true
  2057  	}
  2058  	// match: (ANDshiftLL x (MOVDconst [c]) [d])
  2059  	// result: (ANDconst x [int64(uint64(c)<<uint64(d))])
  2060  	for {
  2061  		d := auxIntToInt64(v.AuxInt)
  2062  		x := v_0
  2063  		if v_1.Op != OpARM64MOVDconst {
  2064  			break
  2065  		}
  2066  		c := auxIntToInt64(v_1.AuxInt)
  2067  		v.reset(OpARM64ANDconst)
  2068  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  2069  		v.AddArg(x)
  2070  		return true
  2071  	}
  2072  	// match: (ANDshiftLL y:(SLLconst x [c]) x [c])
  2073  	// result: y
  2074  	for {
  2075  		c := auxIntToInt64(v.AuxInt)
  2076  		y := v_0
  2077  		if y.Op != OpARM64SLLconst || auxIntToInt64(y.AuxInt) != c {
  2078  			break
  2079  		}
  2080  		x := y.Args[0]
  2081  		if x != v_1 {
  2082  			break
  2083  		}
  2084  		v.copyOf(y)
  2085  		return true
  2086  	}
  2087  	return false
  2088  }
  2089  func rewriteValueARM64_OpARM64ANDshiftRA(v *Value) bool {
  2090  	v_1 := v.Args[1]
  2091  	v_0 := v.Args[0]
  2092  	b := v.Block
  2093  	// match: (ANDshiftRA (MOVDconst [c]) x [d])
  2094  	// result: (ANDconst [c] (SRAconst <x.Type> x [d]))
  2095  	for {
  2096  		d := auxIntToInt64(v.AuxInt)
  2097  		if v_0.Op != OpARM64MOVDconst {
  2098  			break
  2099  		}
  2100  		c := auxIntToInt64(v_0.AuxInt)
  2101  		x := v_1
  2102  		v.reset(OpARM64ANDconst)
  2103  		v.AuxInt = int64ToAuxInt(c)
  2104  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  2105  		v0.AuxInt = int64ToAuxInt(d)
  2106  		v0.AddArg(x)
  2107  		v.AddArg(v0)
  2108  		return true
  2109  	}
  2110  	// match: (ANDshiftRA x (MOVDconst [c]) [d])
  2111  	// result: (ANDconst x [c>>uint64(d)])
  2112  	for {
  2113  		d := auxIntToInt64(v.AuxInt)
  2114  		x := v_0
  2115  		if v_1.Op != OpARM64MOVDconst {
  2116  			break
  2117  		}
  2118  		c := auxIntToInt64(v_1.AuxInt)
  2119  		v.reset(OpARM64ANDconst)
  2120  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  2121  		v.AddArg(x)
  2122  		return true
  2123  	}
  2124  	// match: (ANDshiftRA y:(SRAconst x [c]) x [c])
  2125  	// result: y
  2126  	for {
  2127  		c := auxIntToInt64(v.AuxInt)
  2128  		y := v_0
  2129  		if y.Op != OpARM64SRAconst || auxIntToInt64(y.AuxInt) != c {
  2130  			break
  2131  		}
  2132  		x := y.Args[0]
  2133  		if x != v_1 {
  2134  			break
  2135  		}
  2136  		v.copyOf(y)
  2137  		return true
  2138  	}
  2139  	return false
  2140  }
  2141  func rewriteValueARM64_OpARM64ANDshiftRL(v *Value) bool {
  2142  	v_1 := v.Args[1]
  2143  	v_0 := v.Args[0]
  2144  	b := v.Block
  2145  	// match: (ANDshiftRL (MOVDconst [c]) x [d])
  2146  	// result: (ANDconst [c] (SRLconst <x.Type> x [d]))
  2147  	for {
  2148  		d := auxIntToInt64(v.AuxInt)
  2149  		if v_0.Op != OpARM64MOVDconst {
  2150  			break
  2151  		}
  2152  		c := auxIntToInt64(v_0.AuxInt)
  2153  		x := v_1
  2154  		v.reset(OpARM64ANDconst)
  2155  		v.AuxInt = int64ToAuxInt(c)
  2156  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  2157  		v0.AuxInt = int64ToAuxInt(d)
  2158  		v0.AddArg(x)
  2159  		v.AddArg(v0)
  2160  		return true
  2161  	}
  2162  	// match: (ANDshiftRL x (MOVDconst [c]) [d])
  2163  	// result: (ANDconst x [int64(uint64(c)>>uint64(d))])
  2164  	for {
  2165  		d := auxIntToInt64(v.AuxInt)
  2166  		x := v_0
  2167  		if v_1.Op != OpARM64MOVDconst {
  2168  			break
  2169  		}
  2170  		c := auxIntToInt64(v_1.AuxInt)
  2171  		v.reset(OpARM64ANDconst)
  2172  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  2173  		v.AddArg(x)
  2174  		return true
  2175  	}
  2176  	// match: (ANDshiftRL y:(SRLconst x [c]) x [c])
  2177  	// result: y
  2178  	for {
  2179  		c := auxIntToInt64(v.AuxInt)
  2180  		y := v_0
  2181  		if y.Op != OpARM64SRLconst || auxIntToInt64(y.AuxInt) != c {
  2182  			break
  2183  		}
  2184  		x := y.Args[0]
  2185  		if x != v_1 {
  2186  			break
  2187  		}
  2188  		v.copyOf(y)
  2189  		return true
  2190  	}
  2191  	return false
  2192  }
  2193  func rewriteValueARM64_OpARM64ANDshiftRO(v *Value) bool {
  2194  	v_1 := v.Args[1]
  2195  	v_0 := v.Args[0]
  2196  	b := v.Block
  2197  	// match: (ANDshiftRO (MOVDconst [c]) x [d])
  2198  	// result: (ANDconst [c] (RORconst <x.Type> x [d]))
  2199  	for {
  2200  		d := auxIntToInt64(v.AuxInt)
  2201  		if v_0.Op != OpARM64MOVDconst {
  2202  			break
  2203  		}
  2204  		c := auxIntToInt64(v_0.AuxInt)
  2205  		x := v_1
  2206  		v.reset(OpARM64ANDconst)
  2207  		v.AuxInt = int64ToAuxInt(c)
  2208  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
  2209  		v0.AuxInt = int64ToAuxInt(d)
  2210  		v0.AddArg(x)
  2211  		v.AddArg(v0)
  2212  		return true
  2213  	}
  2214  	// match: (ANDshiftRO x (MOVDconst [c]) [d])
  2215  	// result: (ANDconst x [rotateRight64(c, d)])
  2216  	for {
  2217  		d := auxIntToInt64(v.AuxInt)
  2218  		x := v_0
  2219  		if v_1.Op != OpARM64MOVDconst {
  2220  			break
  2221  		}
  2222  		c := auxIntToInt64(v_1.AuxInt)
  2223  		v.reset(OpARM64ANDconst)
  2224  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
  2225  		v.AddArg(x)
  2226  		return true
  2227  	}
  2228  	// match: (ANDshiftRO y:(RORconst x [c]) x [c])
  2229  	// result: y
  2230  	for {
  2231  		c := auxIntToInt64(v.AuxInt)
  2232  		y := v_0
  2233  		if y.Op != OpARM64RORconst || auxIntToInt64(y.AuxInt) != c {
  2234  			break
  2235  		}
  2236  		x := y.Args[0]
  2237  		if x != v_1 {
  2238  			break
  2239  		}
  2240  		v.copyOf(y)
  2241  		return true
  2242  	}
  2243  	return false
  2244  }
  2245  func rewriteValueARM64_OpARM64BIC(v *Value) bool {
  2246  	v_1 := v.Args[1]
  2247  	v_0 := v.Args[0]
  2248  	// match: (BIC x (MOVDconst [c]))
  2249  	// result: (ANDconst [^c] x)
  2250  	for {
  2251  		x := v_0
  2252  		if v_1.Op != OpARM64MOVDconst {
  2253  			break
  2254  		}
  2255  		c := auxIntToInt64(v_1.AuxInt)
  2256  		v.reset(OpARM64ANDconst)
  2257  		v.AuxInt = int64ToAuxInt(^c)
  2258  		v.AddArg(x)
  2259  		return true
  2260  	}
  2261  	// match: (BIC x x)
  2262  	// result: (MOVDconst [0])
  2263  	for {
  2264  		x := v_0
  2265  		if x != v_1 {
  2266  			break
  2267  		}
  2268  		v.reset(OpARM64MOVDconst)
  2269  		v.AuxInt = int64ToAuxInt(0)
  2270  		return true
  2271  	}
  2272  	// match: (BIC x0 x1:(SLLconst [c] y))
  2273  	// cond: clobberIfDead(x1)
  2274  	// result: (BICshiftLL x0 y [c])
  2275  	for {
  2276  		x0 := v_0
  2277  		x1 := v_1
  2278  		if x1.Op != OpARM64SLLconst {
  2279  			break
  2280  		}
  2281  		c := auxIntToInt64(x1.AuxInt)
  2282  		y := x1.Args[0]
  2283  		if !(clobberIfDead(x1)) {
  2284  			break
  2285  		}
  2286  		v.reset(OpARM64BICshiftLL)
  2287  		v.AuxInt = int64ToAuxInt(c)
  2288  		v.AddArg2(x0, y)
  2289  		return true
  2290  	}
  2291  	// match: (BIC x0 x1:(SRLconst [c] y))
  2292  	// cond: clobberIfDead(x1)
  2293  	// result: (BICshiftRL x0 y [c])
  2294  	for {
  2295  		x0 := v_0
  2296  		x1 := v_1
  2297  		if x1.Op != OpARM64SRLconst {
  2298  			break
  2299  		}
  2300  		c := auxIntToInt64(x1.AuxInt)
  2301  		y := x1.Args[0]
  2302  		if !(clobberIfDead(x1)) {
  2303  			break
  2304  		}
  2305  		v.reset(OpARM64BICshiftRL)
  2306  		v.AuxInt = int64ToAuxInt(c)
  2307  		v.AddArg2(x0, y)
  2308  		return true
  2309  	}
  2310  	// match: (BIC x0 x1:(SRAconst [c] y))
  2311  	// cond: clobberIfDead(x1)
  2312  	// result: (BICshiftRA x0 y [c])
  2313  	for {
  2314  		x0 := v_0
  2315  		x1 := v_1
  2316  		if x1.Op != OpARM64SRAconst {
  2317  			break
  2318  		}
  2319  		c := auxIntToInt64(x1.AuxInt)
  2320  		y := x1.Args[0]
  2321  		if !(clobberIfDead(x1)) {
  2322  			break
  2323  		}
  2324  		v.reset(OpARM64BICshiftRA)
  2325  		v.AuxInt = int64ToAuxInt(c)
  2326  		v.AddArg2(x0, y)
  2327  		return true
  2328  	}
  2329  	// match: (BIC x0 x1:(RORconst [c] y))
  2330  	// cond: clobberIfDead(x1)
  2331  	// result: (BICshiftRO x0 y [c])
  2332  	for {
  2333  		x0 := v_0
  2334  		x1 := v_1
  2335  		if x1.Op != OpARM64RORconst {
  2336  			break
  2337  		}
  2338  		c := auxIntToInt64(x1.AuxInt)
  2339  		y := x1.Args[0]
  2340  		if !(clobberIfDead(x1)) {
  2341  			break
  2342  		}
  2343  		v.reset(OpARM64BICshiftRO)
  2344  		v.AuxInt = int64ToAuxInt(c)
  2345  		v.AddArg2(x0, y)
  2346  		return true
  2347  	}
  2348  	return false
  2349  }
  2350  func rewriteValueARM64_OpARM64BICshiftLL(v *Value) bool {
  2351  	v_1 := v.Args[1]
  2352  	v_0 := v.Args[0]
  2353  	// match: (BICshiftLL x (MOVDconst [c]) [d])
  2354  	// result: (ANDconst x [^int64(uint64(c)<<uint64(d))])
  2355  	for {
  2356  		d := auxIntToInt64(v.AuxInt)
  2357  		x := v_0
  2358  		if v_1.Op != OpARM64MOVDconst {
  2359  			break
  2360  		}
  2361  		c := auxIntToInt64(v_1.AuxInt)
  2362  		v.reset(OpARM64ANDconst)
  2363  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
  2364  		v.AddArg(x)
  2365  		return true
  2366  	}
  2367  	// match: (BICshiftLL (SLLconst x [c]) x [c])
  2368  	// result: (MOVDconst [0])
  2369  	for {
  2370  		c := auxIntToInt64(v.AuxInt)
  2371  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
  2372  			break
  2373  		}
  2374  		x := v_0.Args[0]
  2375  		if x != v_1 {
  2376  			break
  2377  		}
  2378  		v.reset(OpARM64MOVDconst)
  2379  		v.AuxInt = int64ToAuxInt(0)
  2380  		return true
  2381  	}
  2382  	return false
  2383  }
  2384  func rewriteValueARM64_OpARM64BICshiftRA(v *Value) bool {
  2385  	v_1 := v.Args[1]
  2386  	v_0 := v.Args[0]
  2387  	// match: (BICshiftRA x (MOVDconst [c]) [d])
  2388  	// result: (ANDconst x [^(c>>uint64(d))])
  2389  	for {
  2390  		d := auxIntToInt64(v.AuxInt)
  2391  		x := v_0
  2392  		if v_1.Op != OpARM64MOVDconst {
  2393  			break
  2394  		}
  2395  		c := auxIntToInt64(v_1.AuxInt)
  2396  		v.reset(OpARM64ANDconst)
  2397  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
  2398  		v.AddArg(x)
  2399  		return true
  2400  	}
  2401  	// match: (BICshiftRA (SRAconst x [c]) x [c])
  2402  	// result: (MOVDconst [0])
  2403  	for {
  2404  		c := auxIntToInt64(v.AuxInt)
  2405  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
  2406  			break
  2407  		}
  2408  		x := v_0.Args[0]
  2409  		if x != v_1 {
  2410  			break
  2411  		}
  2412  		v.reset(OpARM64MOVDconst)
  2413  		v.AuxInt = int64ToAuxInt(0)
  2414  		return true
  2415  	}
  2416  	return false
  2417  }
  2418  func rewriteValueARM64_OpARM64BICshiftRL(v *Value) bool {
  2419  	v_1 := v.Args[1]
  2420  	v_0 := v.Args[0]
  2421  	// match: (BICshiftRL x (MOVDconst [c]) [d])
  2422  	// result: (ANDconst x [^int64(uint64(c)>>uint64(d))])
  2423  	for {
  2424  		d := auxIntToInt64(v.AuxInt)
  2425  		x := v_0
  2426  		if v_1.Op != OpARM64MOVDconst {
  2427  			break
  2428  		}
  2429  		c := auxIntToInt64(v_1.AuxInt)
  2430  		v.reset(OpARM64ANDconst)
  2431  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
  2432  		v.AddArg(x)
  2433  		return true
  2434  	}
  2435  	// match: (BICshiftRL (SRLconst x [c]) x [c])
  2436  	// result: (MOVDconst [0])
  2437  	for {
  2438  		c := auxIntToInt64(v.AuxInt)
  2439  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
  2440  			break
  2441  		}
  2442  		x := v_0.Args[0]
  2443  		if x != v_1 {
  2444  			break
  2445  		}
  2446  		v.reset(OpARM64MOVDconst)
  2447  		v.AuxInt = int64ToAuxInt(0)
  2448  		return true
  2449  	}
  2450  	return false
  2451  }
  2452  func rewriteValueARM64_OpARM64BICshiftRO(v *Value) bool {
  2453  	v_1 := v.Args[1]
  2454  	v_0 := v.Args[0]
  2455  	// match: (BICshiftRO x (MOVDconst [c]) [d])
  2456  	// result: (ANDconst x [^rotateRight64(c, d)])
  2457  	for {
  2458  		d := auxIntToInt64(v.AuxInt)
  2459  		x := v_0
  2460  		if v_1.Op != OpARM64MOVDconst {
  2461  			break
  2462  		}
  2463  		c := auxIntToInt64(v_1.AuxInt)
  2464  		v.reset(OpARM64ANDconst)
  2465  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
  2466  		v.AddArg(x)
  2467  		return true
  2468  	}
  2469  	// match: (BICshiftRO (RORconst x [c]) x [c])
  2470  	// result: (MOVDconst [0])
  2471  	for {
  2472  		c := auxIntToInt64(v.AuxInt)
  2473  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
  2474  			break
  2475  		}
  2476  		x := v_0.Args[0]
  2477  		if x != v_1 {
  2478  			break
  2479  		}
  2480  		v.reset(OpARM64MOVDconst)
  2481  		v.AuxInt = int64ToAuxInt(0)
  2482  		return true
  2483  	}
  2484  	return false
  2485  }
  2486  func rewriteValueARM64_OpARM64CMN(v *Value) bool {
  2487  	v_1 := v.Args[1]
  2488  	v_0 := v.Args[0]
  2489  	// match: (CMN x (MOVDconst [c]))
  2490  	// result: (CMNconst [c] x)
  2491  	for {
  2492  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2493  			x := v_0
  2494  			if v_1.Op != OpARM64MOVDconst {
  2495  				continue
  2496  			}
  2497  			c := auxIntToInt64(v_1.AuxInt)
  2498  			v.reset(OpARM64CMNconst)
  2499  			v.AuxInt = int64ToAuxInt(c)
  2500  			v.AddArg(x)
  2501  			return true
  2502  		}
  2503  		break
  2504  	}
  2505  	// match: (CMN x0 x1:(SLLconst [c] y))
  2506  	// cond: clobberIfDead(x1)
  2507  	// result: (CMNshiftLL x0 y [c])
  2508  	for {
  2509  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2510  			x0 := v_0
  2511  			x1 := v_1
  2512  			if x1.Op != OpARM64SLLconst {
  2513  				continue
  2514  			}
  2515  			c := auxIntToInt64(x1.AuxInt)
  2516  			y := x1.Args[0]
  2517  			if !(clobberIfDead(x1)) {
  2518  				continue
  2519  			}
  2520  			v.reset(OpARM64CMNshiftLL)
  2521  			v.AuxInt = int64ToAuxInt(c)
  2522  			v.AddArg2(x0, y)
  2523  			return true
  2524  		}
  2525  		break
  2526  	}
  2527  	// match: (CMN x0 x1:(SRLconst [c] y))
  2528  	// cond: clobberIfDead(x1)
  2529  	// result: (CMNshiftRL x0 y [c])
  2530  	for {
  2531  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2532  			x0 := v_0
  2533  			x1 := v_1
  2534  			if x1.Op != OpARM64SRLconst {
  2535  				continue
  2536  			}
  2537  			c := auxIntToInt64(x1.AuxInt)
  2538  			y := x1.Args[0]
  2539  			if !(clobberIfDead(x1)) {
  2540  				continue
  2541  			}
  2542  			v.reset(OpARM64CMNshiftRL)
  2543  			v.AuxInt = int64ToAuxInt(c)
  2544  			v.AddArg2(x0, y)
  2545  			return true
  2546  		}
  2547  		break
  2548  	}
  2549  	// match: (CMN x0 x1:(SRAconst [c] y))
  2550  	// cond: clobberIfDead(x1)
  2551  	// result: (CMNshiftRA x0 y [c])
  2552  	for {
  2553  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2554  			x0 := v_0
  2555  			x1 := v_1
  2556  			if x1.Op != OpARM64SRAconst {
  2557  				continue
  2558  			}
  2559  			c := auxIntToInt64(x1.AuxInt)
  2560  			y := x1.Args[0]
  2561  			if !(clobberIfDead(x1)) {
  2562  				continue
  2563  			}
  2564  			v.reset(OpARM64CMNshiftRA)
  2565  			v.AuxInt = int64ToAuxInt(c)
  2566  			v.AddArg2(x0, y)
  2567  			return true
  2568  		}
  2569  		break
  2570  	}
  2571  	return false
  2572  }
  2573  func rewriteValueARM64_OpARM64CMNW(v *Value) bool {
  2574  	v_1 := v.Args[1]
  2575  	v_0 := v.Args[0]
  2576  	// match: (CMNW x (MOVDconst [c]))
  2577  	// result: (CMNWconst [int32(c)] x)
  2578  	for {
  2579  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2580  			x := v_0
  2581  			if v_1.Op != OpARM64MOVDconst {
  2582  				continue
  2583  			}
  2584  			c := auxIntToInt64(v_1.AuxInt)
  2585  			v.reset(OpARM64CMNWconst)
  2586  			v.AuxInt = int32ToAuxInt(int32(c))
  2587  			v.AddArg(x)
  2588  			return true
  2589  		}
  2590  		break
  2591  	}
  2592  	return false
  2593  }
  2594  func rewriteValueARM64_OpARM64CMNWconst(v *Value) bool {
  2595  	v_0 := v.Args[0]
  2596  	// match: (CMNWconst [c] y)
  2597  	// cond: c < 0 && c != -1<<31
  2598  	// result: (CMPWconst [-c] y)
  2599  	for {
  2600  		c := auxIntToInt32(v.AuxInt)
  2601  		y := v_0
  2602  		if !(c < 0 && c != -1<<31) {
  2603  			break
  2604  		}
  2605  		v.reset(OpARM64CMPWconst)
  2606  		v.AuxInt = int32ToAuxInt(-c)
  2607  		v.AddArg(y)
  2608  		return true
  2609  	}
  2610  	// match: (CMNWconst (MOVDconst [x]) [y])
  2611  	// result: (FlagConstant [addFlags32(int32(x),y)])
  2612  	for {
  2613  		y := auxIntToInt32(v.AuxInt)
  2614  		if v_0.Op != OpARM64MOVDconst {
  2615  			break
  2616  		}
  2617  		x := auxIntToInt64(v_0.AuxInt)
  2618  		v.reset(OpARM64FlagConstant)
  2619  		v.AuxInt = flagConstantToAuxInt(addFlags32(int32(x), y))
  2620  		return true
  2621  	}
  2622  	return false
  2623  }
  2624  func rewriteValueARM64_OpARM64CMNconst(v *Value) bool {
  2625  	v_0 := v.Args[0]
  2626  	// match: (CMNconst [c] y)
  2627  	// cond: c < 0 && c != -1<<63
  2628  	// result: (CMPconst [-c] y)
  2629  	for {
  2630  		c := auxIntToInt64(v.AuxInt)
  2631  		y := v_0
  2632  		if !(c < 0 && c != -1<<63) {
  2633  			break
  2634  		}
  2635  		v.reset(OpARM64CMPconst)
  2636  		v.AuxInt = int64ToAuxInt(-c)
  2637  		v.AddArg(y)
  2638  		return true
  2639  	}
  2640  	// match: (CMNconst (MOVDconst [x]) [y])
  2641  	// result: (FlagConstant [addFlags64(x,y)])
  2642  	for {
  2643  		y := auxIntToInt64(v.AuxInt)
  2644  		if v_0.Op != OpARM64MOVDconst {
  2645  			break
  2646  		}
  2647  		x := auxIntToInt64(v_0.AuxInt)
  2648  		v.reset(OpARM64FlagConstant)
  2649  		v.AuxInt = flagConstantToAuxInt(addFlags64(x, y))
  2650  		return true
  2651  	}
  2652  	return false
  2653  }
  2654  func rewriteValueARM64_OpARM64CMNshiftLL(v *Value) bool {
  2655  	v_1 := v.Args[1]
  2656  	v_0 := v.Args[0]
  2657  	b := v.Block
  2658  	// match: (CMNshiftLL (MOVDconst [c]) x [d])
  2659  	// result: (CMNconst [c] (SLLconst <x.Type> x [d]))
  2660  	for {
  2661  		d := auxIntToInt64(v.AuxInt)
  2662  		if v_0.Op != OpARM64MOVDconst {
  2663  			break
  2664  		}
  2665  		c := auxIntToInt64(v_0.AuxInt)
  2666  		x := v_1
  2667  		v.reset(OpARM64CMNconst)
  2668  		v.AuxInt = int64ToAuxInt(c)
  2669  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  2670  		v0.AuxInt = int64ToAuxInt(d)
  2671  		v0.AddArg(x)
  2672  		v.AddArg(v0)
  2673  		return true
  2674  	}
  2675  	// match: (CMNshiftLL x (MOVDconst [c]) [d])
  2676  	// result: (CMNconst x [int64(uint64(c)<<uint64(d))])
  2677  	for {
  2678  		d := auxIntToInt64(v.AuxInt)
  2679  		x := v_0
  2680  		if v_1.Op != OpARM64MOVDconst {
  2681  			break
  2682  		}
  2683  		c := auxIntToInt64(v_1.AuxInt)
  2684  		v.reset(OpARM64CMNconst)
  2685  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  2686  		v.AddArg(x)
  2687  		return true
  2688  	}
  2689  	return false
  2690  }
  2691  func rewriteValueARM64_OpARM64CMNshiftRA(v *Value) bool {
  2692  	v_1 := v.Args[1]
  2693  	v_0 := v.Args[0]
  2694  	b := v.Block
  2695  	// match: (CMNshiftRA (MOVDconst [c]) x [d])
  2696  	// result: (CMNconst [c] (SRAconst <x.Type> x [d]))
  2697  	for {
  2698  		d := auxIntToInt64(v.AuxInt)
  2699  		if v_0.Op != OpARM64MOVDconst {
  2700  			break
  2701  		}
  2702  		c := auxIntToInt64(v_0.AuxInt)
  2703  		x := v_1
  2704  		v.reset(OpARM64CMNconst)
  2705  		v.AuxInt = int64ToAuxInt(c)
  2706  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  2707  		v0.AuxInt = int64ToAuxInt(d)
  2708  		v0.AddArg(x)
  2709  		v.AddArg(v0)
  2710  		return true
  2711  	}
  2712  	// match: (CMNshiftRA x (MOVDconst [c]) [d])
  2713  	// result: (CMNconst x [c>>uint64(d)])
  2714  	for {
  2715  		d := auxIntToInt64(v.AuxInt)
  2716  		x := v_0
  2717  		if v_1.Op != OpARM64MOVDconst {
  2718  			break
  2719  		}
  2720  		c := auxIntToInt64(v_1.AuxInt)
  2721  		v.reset(OpARM64CMNconst)
  2722  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  2723  		v.AddArg(x)
  2724  		return true
  2725  	}
  2726  	return false
  2727  }
  2728  func rewriteValueARM64_OpARM64CMNshiftRL(v *Value) bool {
  2729  	v_1 := v.Args[1]
  2730  	v_0 := v.Args[0]
  2731  	b := v.Block
  2732  	// match: (CMNshiftRL (MOVDconst [c]) x [d])
  2733  	// result: (CMNconst [c] (SRLconst <x.Type> x [d]))
  2734  	for {
  2735  		d := auxIntToInt64(v.AuxInt)
  2736  		if v_0.Op != OpARM64MOVDconst {
  2737  			break
  2738  		}
  2739  		c := auxIntToInt64(v_0.AuxInt)
  2740  		x := v_1
  2741  		v.reset(OpARM64CMNconst)
  2742  		v.AuxInt = int64ToAuxInt(c)
  2743  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  2744  		v0.AuxInt = int64ToAuxInt(d)
  2745  		v0.AddArg(x)
  2746  		v.AddArg(v0)
  2747  		return true
  2748  	}
  2749  	// match: (CMNshiftRL x (MOVDconst [c]) [d])
  2750  	// result: (CMNconst x [int64(uint64(c)>>uint64(d))])
  2751  	for {
  2752  		d := auxIntToInt64(v.AuxInt)
  2753  		x := v_0
  2754  		if v_1.Op != OpARM64MOVDconst {
  2755  			break
  2756  		}
  2757  		c := auxIntToInt64(v_1.AuxInt)
  2758  		v.reset(OpARM64CMNconst)
  2759  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  2760  		v.AddArg(x)
  2761  		return true
  2762  	}
  2763  	return false
  2764  }
  2765  func rewriteValueARM64_OpARM64CMP(v *Value) bool {
  2766  	v_1 := v.Args[1]
  2767  	v_0 := v.Args[0]
  2768  	b := v.Block
  2769  	// match: (CMP x (MOVDconst [c]))
  2770  	// result: (CMPconst [c] x)
  2771  	for {
  2772  		x := v_0
  2773  		if v_1.Op != OpARM64MOVDconst {
  2774  			break
  2775  		}
  2776  		c := auxIntToInt64(v_1.AuxInt)
  2777  		v.reset(OpARM64CMPconst)
  2778  		v.AuxInt = int64ToAuxInt(c)
  2779  		v.AddArg(x)
  2780  		return true
  2781  	}
  2782  	// match: (CMP (MOVDconst [c]) x)
  2783  	// result: (InvertFlags (CMPconst [c] x))
  2784  	for {
  2785  		if v_0.Op != OpARM64MOVDconst {
  2786  			break
  2787  		}
  2788  		c := auxIntToInt64(v_0.AuxInt)
  2789  		x := v_1
  2790  		v.reset(OpARM64InvertFlags)
  2791  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  2792  		v0.AuxInt = int64ToAuxInt(c)
  2793  		v0.AddArg(x)
  2794  		v.AddArg(v0)
  2795  		return true
  2796  	}
  2797  	// match: (CMP x y)
  2798  	// cond: canonLessThan(x,y)
  2799  	// result: (InvertFlags (CMP y x))
  2800  	for {
  2801  		x := v_0
  2802  		y := v_1
  2803  		if !(canonLessThan(x, y)) {
  2804  			break
  2805  		}
  2806  		v.reset(OpARM64InvertFlags)
  2807  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  2808  		v0.AddArg2(y, x)
  2809  		v.AddArg(v0)
  2810  		return true
  2811  	}
  2812  	// match: (CMP x0 x1:(SLLconst [c] y))
  2813  	// cond: clobberIfDead(x1)
  2814  	// result: (CMPshiftLL x0 y [c])
  2815  	for {
  2816  		x0 := v_0
  2817  		x1 := v_1
  2818  		if x1.Op != OpARM64SLLconst {
  2819  			break
  2820  		}
  2821  		c := auxIntToInt64(x1.AuxInt)
  2822  		y := x1.Args[0]
  2823  		if !(clobberIfDead(x1)) {
  2824  			break
  2825  		}
  2826  		v.reset(OpARM64CMPshiftLL)
  2827  		v.AuxInt = int64ToAuxInt(c)
  2828  		v.AddArg2(x0, y)
  2829  		return true
  2830  	}
  2831  	// match: (CMP x0:(SLLconst [c] y) x1)
  2832  	// cond: clobberIfDead(x0)
  2833  	// result: (InvertFlags (CMPshiftLL x1 y [c]))
  2834  	for {
  2835  		x0 := v_0
  2836  		if x0.Op != OpARM64SLLconst {
  2837  			break
  2838  		}
  2839  		c := auxIntToInt64(x0.AuxInt)
  2840  		y := x0.Args[0]
  2841  		x1 := v_1
  2842  		if !(clobberIfDead(x0)) {
  2843  			break
  2844  		}
  2845  		v.reset(OpARM64InvertFlags)
  2846  		v0 := b.NewValue0(v.Pos, OpARM64CMPshiftLL, types.TypeFlags)
  2847  		v0.AuxInt = int64ToAuxInt(c)
  2848  		v0.AddArg2(x1, y)
  2849  		v.AddArg(v0)
  2850  		return true
  2851  	}
  2852  	// match: (CMP x0 x1:(SRLconst [c] y))
  2853  	// cond: clobberIfDead(x1)
  2854  	// result: (CMPshiftRL x0 y [c])
  2855  	for {
  2856  		x0 := v_0
  2857  		x1 := v_1
  2858  		if x1.Op != OpARM64SRLconst {
  2859  			break
  2860  		}
  2861  		c := auxIntToInt64(x1.AuxInt)
  2862  		y := x1.Args[0]
  2863  		if !(clobberIfDead(x1)) {
  2864  			break
  2865  		}
  2866  		v.reset(OpARM64CMPshiftRL)
  2867  		v.AuxInt = int64ToAuxInt(c)
  2868  		v.AddArg2(x0, y)
  2869  		return true
  2870  	}
  2871  	// match: (CMP x0:(SRLconst [c] y) x1)
  2872  	// cond: clobberIfDead(x0)
  2873  	// result: (InvertFlags (CMPshiftRL x1 y [c]))
  2874  	for {
  2875  		x0 := v_0
  2876  		if x0.Op != OpARM64SRLconst {
  2877  			break
  2878  		}
  2879  		c := auxIntToInt64(x0.AuxInt)
  2880  		y := x0.Args[0]
  2881  		x1 := v_1
  2882  		if !(clobberIfDead(x0)) {
  2883  			break
  2884  		}
  2885  		v.reset(OpARM64InvertFlags)
  2886  		v0 := b.NewValue0(v.Pos, OpARM64CMPshiftRL, types.TypeFlags)
  2887  		v0.AuxInt = int64ToAuxInt(c)
  2888  		v0.AddArg2(x1, y)
  2889  		v.AddArg(v0)
  2890  		return true
  2891  	}
  2892  	// match: (CMP x0 x1:(SRAconst [c] y))
  2893  	// cond: clobberIfDead(x1)
  2894  	// result: (CMPshiftRA x0 y [c])
  2895  	for {
  2896  		x0 := v_0
  2897  		x1 := v_1
  2898  		if x1.Op != OpARM64SRAconst {
  2899  			break
  2900  		}
  2901  		c := auxIntToInt64(x1.AuxInt)
  2902  		y := x1.Args[0]
  2903  		if !(clobberIfDead(x1)) {
  2904  			break
  2905  		}
  2906  		v.reset(OpARM64CMPshiftRA)
  2907  		v.AuxInt = int64ToAuxInt(c)
  2908  		v.AddArg2(x0, y)
  2909  		return true
  2910  	}
  2911  	// match: (CMP x0:(SRAconst [c] y) x1)
  2912  	// cond: clobberIfDead(x0)
  2913  	// result: (InvertFlags (CMPshiftRA x1 y [c]))
  2914  	for {
  2915  		x0 := v_0
  2916  		if x0.Op != OpARM64SRAconst {
  2917  			break
  2918  		}
  2919  		c := auxIntToInt64(x0.AuxInt)
  2920  		y := x0.Args[0]
  2921  		x1 := v_1
  2922  		if !(clobberIfDead(x0)) {
  2923  			break
  2924  		}
  2925  		v.reset(OpARM64InvertFlags)
  2926  		v0 := b.NewValue0(v.Pos, OpARM64CMPshiftRA, types.TypeFlags)
  2927  		v0.AuxInt = int64ToAuxInt(c)
  2928  		v0.AddArg2(x1, y)
  2929  		v.AddArg(v0)
  2930  		return true
  2931  	}
  2932  	return false
  2933  }
  2934  func rewriteValueARM64_OpARM64CMPW(v *Value) bool {
  2935  	v_1 := v.Args[1]
  2936  	v_0 := v.Args[0]
  2937  	b := v.Block
  2938  	// match: (CMPW x (MOVDconst [c]))
  2939  	// result: (CMPWconst [int32(c)] x)
  2940  	for {
  2941  		x := v_0
  2942  		if v_1.Op != OpARM64MOVDconst {
  2943  			break
  2944  		}
  2945  		c := auxIntToInt64(v_1.AuxInt)
  2946  		v.reset(OpARM64CMPWconst)
  2947  		v.AuxInt = int32ToAuxInt(int32(c))
  2948  		v.AddArg(x)
  2949  		return true
  2950  	}
  2951  	// match: (CMPW (MOVDconst [c]) x)
  2952  	// result: (InvertFlags (CMPWconst [int32(c)] x))
  2953  	for {
  2954  		if v_0.Op != OpARM64MOVDconst {
  2955  			break
  2956  		}
  2957  		c := auxIntToInt64(v_0.AuxInt)
  2958  		x := v_1
  2959  		v.reset(OpARM64InvertFlags)
  2960  		v0 := b.NewValue0(v.Pos, OpARM64CMPWconst, types.TypeFlags)
  2961  		v0.AuxInt = int32ToAuxInt(int32(c))
  2962  		v0.AddArg(x)
  2963  		v.AddArg(v0)
  2964  		return true
  2965  	}
  2966  	// match: (CMPW x y)
  2967  	// cond: canonLessThan(x,y)
  2968  	// result: (InvertFlags (CMPW y x))
  2969  	for {
  2970  		x := v_0
  2971  		y := v_1
  2972  		if !(canonLessThan(x, y)) {
  2973  			break
  2974  		}
  2975  		v.reset(OpARM64InvertFlags)
  2976  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  2977  		v0.AddArg2(y, x)
  2978  		v.AddArg(v0)
  2979  		return true
  2980  	}
  2981  	return false
  2982  }
  2983  func rewriteValueARM64_OpARM64CMPWconst(v *Value) bool {
  2984  	v_0 := v.Args[0]
  2985  	// match: (CMPWconst [c] y)
  2986  	// cond: c < 0 && c != -1<<31
  2987  	// result: (CMNWconst [-c] y)
  2988  	for {
  2989  		c := auxIntToInt32(v.AuxInt)
  2990  		y := v_0
  2991  		if !(c < 0 && c != -1<<31) {
  2992  			break
  2993  		}
  2994  		v.reset(OpARM64CMNWconst)
  2995  		v.AuxInt = int32ToAuxInt(-c)
  2996  		v.AddArg(y)
  2997  		return true
  2998  	}
  2999  	// match: (CMPWconst (MOVDconst [x]) [y])
  3000  	// result: (FlagConstant [subFlags32(int32(x),y)])
  3001  	for {
  3002  		y := auxIntToInt32(v.AuxInt)
  3003  		if v_0.Op != OpARM64MOVDconst {
  3004  			break
  3005  		}
  3006  		x := auxIntToInt64(v_0.AuxInt)
  3007  		v.reset(OpARM64FlagConstant)
  3008  		v.AuxInt = flagConstantToAuxInt(subFlags32(int32(x), y))
  3009  		return true
  3010  	}
  3011  	// match: (CMPWconst (MOVBUreg _) [c])
  3012  	// cond: 0xff < c
  3013  	// result: (FlagConstant [subFlags64(0,1)])
  3014  	for {
  3015  		c := auxIntToInt32(v.AuxInt)
  3016  		if v_0.Op != OpARM64MOVBUreg || !(0xff < c) {
  3017  			break
  3018  		}
  3019  		v.reset(OpARM64FlagConstant)
  3020  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3021  		return true
  3022  	}
  3023  	// match: (CMPWconst (MOVHUreg _) [c])
  3024  	// cond: 0xffff < c
  3025  	// result: (FlagConstant [subFlags64(0,1)])
  3026  	for {
  3027  		c := auxIntToInt32(v.AuxInt)
  3028  		if v_0.Op != OpARM64MOVHUreg || !(0xffff < c) {
  3029  			break
  3030  		}
  3031  		v.reset(OpARM64FlagConstant)
  3032  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3033  		return true
  3034  	}
  3035  	return false
  3036  }
  3037  func rewriteValueARM64_OpARM64CMPconst(v *Value) bool {
  3038  	v_0 := v.Args[0]
  3039  	// match: (CMPconst [c] y)
  3040  	// cond: c < 0 && c != -1<<63
  3041  	// result: (CMNconst [-c] y)
  3042  	for {
  3043  		c := auxIntToInt64(v.AuxInt)
  3044  		y := v_0
  3045  		if !(c < 0 && c != -1<<63) {
  3046  			break
  3047  		}
  3048  		v.reset(OpARM64CMNconst)
  3049  		v.AuxInt = int64ToAuxInt(-c)
  3050  		v.AddArg(y)
  3051  		return true
  3052  	}
  3053  	// match: (CMPconst (MOVDconst [x]) [y])
  3054  	// result: (FlagConstant [subFlags64(x,y)])
  3055  	for {
  3056  		y := auxIntToInt64(v.AuxInt)
  3057  		if v_0.Op != OpARM64MOVDconst {
  3058  			break
  3059  		}
  3060  		x := auxIntToInt64(v_0.AuxInt)
  3061  		v.reset(OpARM64FlagConstant)
  3062  		v.AuxInt = flagConstantToAuxInt(subFlags64(x, y))
  3063  		return true
  3064  	}
  3065  	// match: (CMPconst (MOVBUreg _) [c])
  3066  	// cond: 0xff < c
  3067  	// result: (FlagConstant [subFlags64(0,1)])
  3068  	for {
  3069  		c := auxIntToInt64(v.AuxInt)
  3070  		if v_0.Op != OpARM64MOVBUreg || !(0xff < c) {
  3071  			break
  3072  		}
  3073  		v.reset(OpARM64FlagConstant)
  3074  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3075  		return true
  3076  	}
  3077  	// match: (CMPconst (MOVHUreg _) [c])
  3078  	// cond: 0xffff < c
  3079  	// result: (FlagConstant [subFlags64(0,1)])
  3080  	for {
  3081  		c := auxIntToInt64(v.AuxInt)
  3082  		if v_0.Op != OpARM64MOVHUreg || !(0xffff < c) {
  3083  			break
  3084  		}
  3085  		v.reset(OpARM64FlagConstant)
  3086  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3087  		return true
  3088  	}
  3089  	// match: (CMPconst (MOVWUreg _) [c])
  3090  	// cond: 0xffffffff < c
  3091  	// result: (FlagConstant [subFlags64(0,1)])
  3092  	for {
  3093  		c := auxIntToInt64(v.AuxInt)
  3094  		if v_0.Op != OpARM64MOVWUreg || !(0xffffffff < c) {
  3095  			break
  3096  		}
  3097  		v.reset(OpARM64FlagConstant)
  3098  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3099  		return true
  3100  	}
  3101  	// match: (CMPconst (ANDconst _ [m]) [n])
  3102  	// cond: 0 <= m && m < n
  3103  	// result: (FlagConstant [subFlags64(0,1)])
  3104  	for {
  3105  		n := auxIntToInt64(v.AuxInt)
  3106  		if v_0.Op != OpARM64ANDconst {
  3107  			break
  3108  		}
  3109  		m := auxIntToInt64(v_0.AuxInt)
  3110  		if !(0 <= m && m < n) {
  3111  			break
  3112  		}
  3113  		v.reset(OpARM64FlagConstant)
  3114  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3115  		return true
  3116  	}
  3117  	// match: (CMPconst (SRLconst _ [c]) [n])
  3118  	// cond: 0 <= n && 0 < c && c <= 63 && (1<<uint64(64-c)) <= uint64(n)
  3119  	// result: (FlagConstant [subFlags64(0,1)])
  3120  	for {
  3121  		n := auxIntToInt64(v.AuxInt)
  3122  		if v_0.Op != OpARM64SRLconst {
  3123  			break
  3124  		}
  3125  		c := auxIntToInt64(v_0.AuxInt)
  3126  		if !(0 <= n && 0 < c && c <= 63 && (1<<uint64(64-c)) <= uint64(n)) {
  3127  			break
  3128  		}
  3129  		v.reset(OpARM64FlagConstant)
  3130  		v.AuxInt = flagConstantToAuxInt(subFlags64(0, 1))
  3131  		return true
  3132  	}
  3133  	return false
  3134  }
  3135  func rewriteValueARM64_OpARM64CMPshiftLL(v *Value) bool {
  3136  	v_1 := v.Args[1]
  3137  	v_0 := v.Args[0]
  3138  	b := v.Block
  3139  	// match: (CMPshiftLL (MOVDconst [c]) x [d])
  3140  	// result: (InvertFlags (CMPconst [c] (SLLconst <x.Type> x [d])))
  3141  	for {
  3142  		d := auxIntToInt64(v.AuxInt)
  3143  		if v_0.Op != OpARM64MOVDconst {
  3144  			break
  3145  		}
  3146  		c := auxIntToInt64(v_0.AuxInt)
  3147  		x := v_1
  3148  		v.reset(OpARM64InvertFlags)
  3149  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  3150  		v0.AuxInt = int64ToAuxInt(c)
  3151  		v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  3152  		v1.AuxInt = int64ToAuxInt(d)
  3153  		v1.AddArg(x)
  3154  		v0.AddArg(v1)
  3155  		v.AddArg(v0)
  3156  		return true
  3157  	}
  3158  	// match: (CMPshiftLL x (MOVDconst [c]) [d])
  3159  	// result: (CMPconst x [int64(uint64(c)<<uint64(d))])
  3160  	for {
  3161  		d := auxIntToInt64(v.AuxInt)
  3162  		x := v_0
  3163  		if v_1.Op != OpARM64MOVDconst {
  3164  			break
  3165  		}
  3166  		c := auxIntToInt64(v_1.AuxInt)
  3167  		v.reset(OpARM64CMPconst)
  3168  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
  3169  		v.AddArg(x)
  3170  		return true
  3171  	}
  3172  	return false
  3173  }
  3174  func rewriteValueARM64_OpARM64CMPshiftRA(v *Value) bool {
  3175  	v_1 := v.Args[1]
  3176  	v_0 := v.Args[0]
  3177  	b := v.Block
  3178  	// match: (CMPshiftRA (MOVDconst [c]) x [d])
  3179  	// result: (InvertFlags (CMPconst [c] (SRAconst <x.Type> x [d])))
  3180  	for {
  3181  		d := auxIntToInt64(v.AuxInt)
  3182  		if v_0.Op != OpARM64MOVDconst {
  3183  			break
  3184  		}
  3185  		c := auxIntToInt64(v_0.AuxInt)
  3186  		x := v_1
  3187  		v.reset(OpARM64InvertFlags)
  3188  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  3189  		v0.AuxInt = int64ToAuxInt(c)
  3190  		v1 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
  3191  		v1.AuxInt = int64ToAuxInt(d)
  3192  		v1.AddArg(x)
  3193  		v0.AddArg(v1)
  3194  		v.AddArg(v0)
  3195  		return true
  3196  	}
  3197  	// match: (CMPshiftRA x (MOVDconst [c]) [d])
  3198  	// result: (CMPconst x [c>>uint64(d)])
  3199  	for {
  3200  		d := auxIntToInt64(v.AuxInt)
  3201  		x := v_0
  3202  		if v_1.Op != OpARM64MOVDconst {
  3203  			break
  3204  		}
  3205  		c := auxIntToInt64(v_1.AuxInt)
  3206  		v.reset(OpARM64CMPconst)
  3207  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
  3208  		v.AddArg(x)
  3209  		return true
  3210  	}
  3211  	return false
  3212  }
  3213  func rewriteValueARM64_OpARM64CMPshiftRL(v *Value) bool {
  3214  	v_1 := v.Args[1]
  3215  	v_0 := v.Args[0]
  3216  	b := v.Block
  3217  	// match: (CMPshiftRL (MOVDconst [c]) x [d])
  3218  	// result: (InvertFlags (CMPconst [c] (SRLconst <x.Type> x [d])))
  3219  	for {
  3220  		d := auxIntToInt64(v.AuxInt)
  3221  		if v_0.Op != OpARM64MOVDconst {
  3222  			break
  3223  		}
  3224  		c := auxIntToInt64(v_0.AuxInt)
  3225  		x := v_1
  3226  		v.reset(OpARM64InvertFlags)
  3227  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
  3228  		v0.AuxInt = int64ToAuxInt(c)
  3229  		v1 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
  3230  		v1.AuxInt = int64ToAuxInt(d)
  3231  		v1.AddArg(x)
  3232  		v0.AddArg(v1)
  3233  		v.AddArg(v0)
  3234  		return true
  3235  	}
  3236  	// match: (CMPshiftRL x (MOVDconst [c]) [d])
  3237  	// result: (CMPconst x [int64(uint64(c)>>uint64(d))])
  3238  	for {
  3239  		d := auxIntToInt64(v.AuxInt)
  3240  		x := v_0
  3241  		if v_1.Op != OpARM64MOVDconst {
  3242  			break
  3243  		}
  3244  		c := auxIntToInt64(v_1.AuxInt)
  3245  		v.reset(OpARM64CMPconst)
  3246  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
  3247  		v.AddArg(x)
  3248  		return true
  3249  	}
  3250  	return false
  3251  }
  3252  func rewriteValueARM64_OpARM64CSEL(v *Value) bool {
  3253  	v_2 := v.Args[2]
  3254  	v_1 := v.Args[1]
  3255  	v_0 := v.Args[0]
  3256  	// match: (CSEL [cc] (MOVDconst [-1]) (MOVDconst [0]) flag)
  3257  	// result: (CSETM [cc] flag)
  3258  	for {
  3259  		cc := auxIntToOp(v.AuxInt)
  3260  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != -1 || v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  3261  			break
  3262  		}
  3263  		flag := v_2
  3264  		v.reset(OpARM64CSETM)
  3265  		v.AuxInt = opToAuxInt(cc)
  3266  		v.AddArg(flag)
  3267  		return true
  3268  	}
  3269  	// match: (CSEL [cc] (MOVDconst [0]) (MOVDconst [-1]) flag)
  3270  	// result: (CSETM [arm64Negate(cc)] flag)
  3271  	for {
  3272  		cc := auxIntToOp(v.AuxInt)
  3273  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 || v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  3274  			break
  3275  		}
  3276  		flag := v_2
  3277  		v.reset(OpARM64CSETM)
  3278  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3279  		v.AddArg(flag)
  3280  		return true
  3281  	}
  3282  	// match: (CSEL [cc] x (MOVDconst [0]) flag)
  3283  	// result: (CSEL0 [cc] x flag)
  3284  	for {
  3285  		cc := auxIntToOp(v.AuxInt)
  3286  		x := v_0
  3287  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  3288  			break
  3289  		}
  3290  		flag := v_2
  3291  		v.reset(OpARM64CSEL0)
  3292  		v.AuxInt = opToAuxInt(cc)
  3293  		v.AddArg2(x, flag)
  3294  		return true
  3295  	}
  3296  	// match: (CSEL [cc] (MOVDconst [0]) y flag)
  3297  	// result: (CSEL0 [arm64Negate(cc)] y flag)
  3298  	for {
  3299  		cc := auxIntToOp(v.AuxInt)
  3300  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
  3301  			break
  3302  		}
  3303  		y := v_1
  3304  		flag := v_2
  3305  		v.reset(OpARM64CSEL0)
  3306  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3307  		v.AddArg2(y, flag)
  3308  		return true
  3309  	}
  3310  	// match: (CSEL [cc] x (ADDconst [1] a) flag)
  3311  	// result: (CSINC [cc] x a flag)
  3312  	for {
  3313  		cc := auxIntToOp(v.AuxInt)
  3314  		x := v_0
  3315  		if v_1.Op != OpARM64ADDconst || auxIntToInt64(v_1.AuxInt) != 1 {
  3316  			break
  3317  		}
  3318  		a := v_1.Args[0]
  3319  		flag := v_2
  3320  		v.reset(OpARM64CSINC)
  3321  		v.AuxInt = opToAuxInt(cc)
  3322  		v.AddArg3(x, a, flag)
  3323  		return true
  3324  	}
  3325  	// match: (CSEL [cc] (ADDconst [1] a) x flag)
  3326  	// result: (CSINC [arm64Negate(cc)] x a flag)
  3327  	for {
  3328  		cc := auxIntToOp(v.AuxInt)
  3329  		if v_0.Op != OpARM64ADDconst || auxIntToInt64(v_0.AuxInt) != 1 {
  3330  			break
  3331  		}
  3332  		a := v_0.Args[0]
  3333  		x := v_1
  3334  		flag := v_2
  3335  		v.reset(OpARM64CSINC)
  3336  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3337  		v.AddArg3(x, a, flag)
  3338  		return true
  3339  	}
  3340  	// match: (CSEL [cc] x (MVN a) flag)
  3341  	// result: (CSINV [cc] x a flag)
  3342  	for {
  3343  		cc := auxIntToOp(v.AuxInt)
  3344  		x := v_0
  3345  		if v_1.Op != OpARM64MVN {
  3346  			break
  3347  		}
  3348  		a := v_1.Args[0]
  3349  		flag := v_2
  3350  		v.reset(OpARM64CSINV)
  3351  		v.AuxInt = opToAuxInt(cc)
  3352  		v.AddArg3(x, a, flag)
  3353  		return true
  3354  	}
  3355  	// match: (CSEL [cc] (MVN a) x flag)
  3356  	// result: (CSINV [arm64Negate(cc)] x a flag)
  3357  	for {
  3358  		cc := auxIntToOp(v.AuxInt)
  3359  		if v_0.Op != OpARM64MVN {
  3360  			break
  3361  		}
  3362  		a := v_0.Args[0]
  3363  		x := v_1
  3364  		flag := v_2
  3365  		v.reset(OpARM64CSINV)
  3366  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3367  		v.AddArg3(x, a, flag)
  3368  		return true
  3369  	}
  3370  	// match: (CSEL [cc] x (NEG a) flag)
  3371  	// result: (CSNEG [cc] x a flag)
  3372  	for {
  3373  		cc := auxIntToOp(v.AuxInt)
  3374  		x := v_0
  3375  		if v_1.Op != OpARM64NEG {
  3376  			break
  3377  		}
  3378  		a := v_1.Args[0]
  3379  		flag := v_2
  3380  		v.reset(OpARM64CSNEG)
  3381  		v.AuxInt = opToAuxInt(cc)
  3382  		v.AddArg3(x, a, flag)
  3383  		return true
  3384  	}
  3385  	// match: (CSEL [cc] (NEG a) x flag)
  3386  	// result: (CSNEG [arm64Negate(cc)] x a flag)
  3387  	for {
  3388  		cc := auxIntToOp(v.AuxInt)
  3389  		if v_0.Op != OpARM64NEG {
  3390  			break
  3391  		}
  3392  		a := v_0.Args[0]
  3393  		x := v_1
  3394  		flag := v_2
  3395  		v.reset(OpARM64CSNEG)
  3396  		v.AuxInt = opToAuxInt(arm64Negate(cc))
  3397  		v.AddArg3(x, a, flag)
  3398  		return true
  3399  	}
  3400  	// match: (CSEL [cc] x y (InvertFlags cmp))
  3401  	// result: (CSEL [arm64Invert(cc)] x y cmp)
  3402  	for {
  3403  		cc := auxIntToOp(v.AuxInt)
  3404  		x := v_0
  3405  		y := v_1
  3406  		if v_2.Op != OpARM64InvertFlags {
  3407  			break
  3408  		}
  3409  		cmp := v_2.Args[0]
  3410  		v.reset(OpARM64CSEL)
  3411  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3412  		v.AddArg3(x, y, cmp)
  3413  		return true
  3414  	}
  3415  	// match: (CSEL [cc] x _ flag)
  3416  	// cond: ccARM64Eval(cc, flag) > 0
  3417  	// result: x
  3418  	for {
  3419  		cc := auxIntToOp(v.AuxInt)
  3420  		x := v_0
  3421  		flag := v_2
  3422  		if !(ccARM64Eval(cc, flag) > 0) {
  3423  			break
  3424  		}
  3425  		v.copyOf(x)
  3426  		return true
  3427  	}
  3428  	// match: (CSEL [cc] _ y flag)
  3429  	// cond: ccARM64Eval(cc, flag) < 0
  3430  	// result: y
  3431  	for {
  3432  		cc := auxIntToOp(v.AuxInt)
  3433  		y := v_1
  3434  		flag := v_2
  3435  		if !(ccARM64Eval(cc, flag) < 0) {
  3436  			break
  3437  		}
  3438  		v.copyOf(y)
  3439  		return true
  3440  	}
  3441  	// match: (CSEL [cc] x y (CMPWconst [0] boolval))
  3442  	// cond: cc == OpARM64NotEqual && flagArg(boolval) != nil
  3443  	// result: (CSEL [boolval.Op] x y flagArg(boolval))
  3444  	for {
  3445  		cc := auxIntToOp(v.AuxInt)
  3446  		x := v_0
  3447  		y := v_1
  3448  		if v_2.Op != OpARM64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  3449  			break
  3450  		}
  3451  		boolval := v_2.Args[0]
  3452  		if !(cc == OpARM64NotEqual && flagArg(boolval) != nil) {
  3453  			break
  3454  		}
  3455  		v.reset(OpARM64CSEL)
  3456  		v.AuxInt = opToAuxInt(boolval.Op)
  3457  		v.AddArg3(x, y, flagArg(boolval))
  3458  		return true
  3459  	}
  3460  	// match: (CSEL [cc] x y (CMPWconst [0] boolval))
  3461  	// cond: cc == OpARM64Equal && flagArg(boolval) != nil
  3462  	// result: (CSEL [arm64Negate(boolval.Op)] x y flagArg(boolval))
  3463  	for {
  3464  		cc := auxIntToOp(v.AuxInt)
  3465  		x := v_0
  3466  		y := v_1
  3467  		if v_2.Op != OpARM64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  3468  			break
  3469  		}
  3470  		boolval := v_2.Args[0]
  3471  		if !(cc == OpARM64Equal && flagArg(boolval) != nil) {
  3472  			break
  3473  		}
  3474  		v.reset(OpARM64CSEL)
  3475  		v.AuxInt = opToAuxInt(arm64Negate(boolval.Op))
  3476  		v.AddArg3(x, y, flagArg(boolval))
  3477  		return true
  3478  	}
  3479  	return false
  3480  }
  3481  func rewriteValueARM64_OpARM64CSEL0(v *Value) bool {
  3482  	v_1 := v.Args[1]
  3483  	v_0 := v.Args[0]
  3484  	// match: (CSEL0 [cc] x (InvertFlags cmp))
  3485  	// result: (CSEL0 [arm64Invert(cc)] x cmp)
  3486  	for {
  3487  		cc := auxIntToOp(v.AuxInt)
  3488  		x := v_0
  3489  		if v_1.Op != OpARM64InvertFlags {
  3490  			break
  3491  		}
  3492  		cmp := v_1.Args[0]
  3493  		v.reset(OpARM64CSEL0)
  3494  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3495  		v.AddArg2(x, cmp)
  3496  		return true
  3497  	}
  3498  	// match: (CSEL0 [cc] x flag)
  3499  	// cond: ccARM64Eval(cc, flag) > 0
  3500  	// result: x
  3501  	for {
  3502  		cc := auxIntToOp(v.AuxInt)
  3503  		x := v_0
  3504  		flag := v_1
  3505  		if !(ccARM64Eval(cc, flag) > 0) {
  3506  			break
  3507  		}
  3508  		v.copyOf(x)
  3509  		return true
  3510  	}
  3511  	// match: (CSEL0 [cc] _ flag)
  3512  	// cond: ccARM64Eval(cc, flag) < 0
  3513  	// result: (MOVDconst [0])
  3514  	for {
  3515  		cc := auxIntToOp(v.AuxInt)
  3516  		flag := v_1
  3517  		if !(ccARM64Eval(cc, flag) < 0) {
  3518  			break
  3519  		}
  3520  		v.reset(OpARM64MOVDconst)
  3521  		v.AuxInt = int64ToAuxInt(0)
  3522  		return true
  3523  	}
  3524  	// match: (CSEL0 [cc] x (CMPWconst [0] boolval))
  3525  	// cond: cc == OpARM64NotEqual && flagArg(boolval) != nil
  3526  	// result: (CSEL0 [boolval.Op] x flagArg(boolval))
  3527  	for {
  3528  		cc := auxIntToOp(v.AuxInt)
  3529  		x := v_0
  3530  		if v_1.Op != OpARM64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 {
  3531  			break
  3532  		}
  3533  		boolval := v_1.Args[0]
  3534  		if !(cc == OpARM64NotEqual && flagArg(boolval) != nil) {
  3535  			break
  3536  		}
  3537  		v.reset(OpARM64CSEL0)
  3538  		v.AuxInt = opToAuxInt(boolval.Op)
  3539  		v.AddArg2(x, flagArg(boolval))
  3540  		return true
  3541  	}
  3542  	// match: (CSEL0 [cc] x (CMPWconst [0] boolval))
  3543  	// cond: cc == OpARM64Equal && flagArg(boolval) != nil
  3544  	// result: (CSEL0 [arm64Negate(boolval.Op)] x flagArg(boolval))
  3545  	for {
  3546  		cc := auxIntToOp(v.AuxInt)
  3547  		x := v_0
  3548  		if v_1.Op != OpARM64CMPWconst || auxIntToInt32(v_1.AuxInt) != 0 {
  3549  			break
  3550  		}
  3551  		boolval := v_1.Args[0]
  3552  		if !(cc == OpARM64Equal && flagArg(boolval) != nil) {
  3553  			break
  3554  		}
  3555  		v.reset(OpARM64CSEL0)
  3556  		v.AuxInt = opToAuxInt(arm64Negate(boolval.Op))
  3557  		v.AddArg2(x, flagArg(boolval))
  3558  		return true
  3559  	}
  3560  	return false
  3561  }
  3562  func rewriteValueARM64_OpARM64CSETM(v *Value) bool {
  3563  	v_0 := v.Args[0]
  3564  	// match: (CSETM [cc] (InvertFlags cmp))
  3565  	// result: (CSETM [arm64Invert(cc)] cmp)
  3566  	for {
  3567  		cc := auxIntToOp(v.AuxInt)
  3568  		if v_0.Op != OpARM64InvertFlags {
  3569  			break
  3570  		}
  3571  		cmp := v_0.Args[0]
  3572  		v.reset(OpARM64CSETM)
  3573  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3574  		v.AddArg(cmp)
  3575  		return true
  3576  	}
  3577  	// match: (CSETM [cc] flag)
  3578  	// cond: ccARM64Eval(cc, flag) > 0
  3579  	// result: (MOVDconst [-1])
  3580  	for {
  3581  		cc := auxIntToOp(v.AuxInt)
  3582  		flag := v_0
  3583  		if !(ccARM64Eval(cc, flag) > 0) {
  3584  			break
  3585  		}
  3586  		v.reset(OpARM64MOVDconst)
  3587  		v.AuxInt = int64ToAuxInt(-1)
  3588  		return true
  3589  	}
  3590  	// match: (CSETM [cc] flag)
  3591  	// cond: ccARM64Eval(cc, flag) < 0
  3592  	// result: (MOVDconst [0])
  3593  	for {
  3594  		cc := auxIntToOp(v.AuxInt)
  3595  		flag := v_0
  3596  		if !(ccARM64Eval(cc, flag) < 0) {
  3597  			break
  3598  		}
  3599  		v.reset(OpARM64MOVDconst)
  3600  		v.AuxInt = int64ToAuxInt(0)
  3601  		return true
  3602  	}
  3603  	return false
  3604  }
  3605  func rewriteValueARM64_OpARM64CSINC(v *Value) bool {
  3606  	v_2 := v.Args[2]
  3607  	v_1 := v.Args[1]
  3608  	v_0 := v.Args[0]
  3609  	// match: (CSINC [cc] x y (InvertFlags cmp))
  3610  	// result: (CSINC [arm64Invert(cc)] x y cmp)
  3611  	for {
  3612  		cc := auxIntToOp(v.AuxInt)
  3613  		x := v_0
  3614  		y := v_1
  3615  		if v_2.Op != OpARM64InvertFlags {
  3616  			break
  3617  		}
  3618  		cmp := v_2.Args[0]
  3619  		v.reset(OpARM64CSINC)
  3620  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3621  		v.AddArg3(x, y, cmp)
  3622  		return true
  3623  	}
  3624  	// match: (CSINC [cc] x _ flag)
  3625  	// cond: ccARM64Eval(cc, flag) > 0
  3626  	// result: x
  3627  	for {
  3628  		cc := auxIntToOp(v.AuxInt)
  3629  		x := v_0
  3630  		flag := v_2
  3631  		if !(ccARM64Eval(cc, flag) > 0) {
  3632  			break
  3633  		}
  3634  		v.copyOf(x)
  3635  		return true
  3636  	}
  3637  	// match: (CSINC [cc] _ y flag)
  3638  	// cond: ccARM64Eval(cc, flag) < 0
  3639  	// result: (ADDconst [1] y)
  3640  	for {
  3641  		cc := auxIntToOp(v.AuxInt)
  3642  		y := v_1
  3643  		flag := v_2
  3644  		if !(ccARM64Eval(cc, flag) < 0) {
  3645  			break
  3646  		}
  3647  		v.reset(OpARM64ADDconst)
  3648  		v.AuxInt = int64ToAuxInt(1)
  3649  		v.AddArg(y)
  3650  		return true
  3651  	}
  3652  	return false
  3653  }
  3654  func rewriteValueARM64_OpARM64CSINV(v *Value) bool {
  3655  	v_2 := v.Args[2]
  3656  	v_1 := v.Args[1]
  3657  	v_0 := v.Args[0]
  3658  	// match: (CSINV [cc] x y (InvertFlags cmp))
  3659  	// result: (CSINV [arm64Invert(cc)] x y cmp)
  3660  	for {
  3661  		cc := auxIntToOp(v.AuxInt)
  3662  		x := v_0
  3663  		y := v_1
  3664  		if v_2.Op != OpARM64InvertFlags {
  3665  			break
  3666  		}
  3667  		cmp := v_2.Args[0]
  3668  		v.reset(OpARM64CSINV)
  3669  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3670  		v.AddArg3(x, y, cmp)
  3671  		return true
  3672  	}
  3673  	// match: (CSINV [cc] x _ flag)
  3674  	// cond: ccARM64Eval(cc, flag) > 0
  3675  	// result: x
  3676  	for {
  3677  		cc := auxIntToOp(v.AuxInt)
  3678  		x := v_0
  3679  		flag := v_2
  3680  		if !(ccARM64Eval(cc, flag) > 0) {
  3681  			break
  3682  		}
  3683  		v.copyOf(x)
  3684  		return true
  3685  	}
  3686  	// match: (CSINV [cc] _ y flag)
  3687  	// cond: ccARM64Eval(cc, flag) < 0
  3688  	// result: (Not y)
  3689  	for {
  3690  		cc := auxIntToOp(v.AuxInt)
  3691  		y := v_1
  3692  		flag := v_2
  3693  		if !(ccARM64Eval(cc, flag) < 0) {
  3694  			break
  3695  		}
  3696  		v.reset(OpNot)
  3697  		v.AddArg(y)
  3698  		return true
  3699  	}
  3700  	return false
  3701  }
  3702  func rewriteValueARM64_OpARM64CSNEG(v *Value) bool {
  3703  	v_2 := v.Args[2]
  3704  	v_1 := v.Args[1]
  3705  	v_0 := v.Args[0]
  3706  	// match: (CSNEG [cc] x y (InvertFlags cmp))
  3707  	// result: (CSNEG [arm64Invert(cc)] x y cmp)
  3708  	for {
  3709  		cc := auxIntToOp(v.AuxInt)
  3710  		x := v_0
  3711  		y := v_1
  3712  		if v_2.Op != OpARM64InvertFlags {
  3713  			break
  3714  		}
  3715  		cmp := v_2.Args[0]
  3716  		v.reset(OpARM64CSNEG)
  3717  		v.AuxInt = opToAuxInt(arm64Invert(cc))
  3718  		v.AddArg3(x, y, cmp)
  3719  		return true
  3720  	}
  3721  	// match: (CSNEG [cc] x _ flag)
  3722  	// cond: ccARM64Eval(cc, flag) > 0
  3723  	// result: x
  3724  	for {
  3725  		cc := auxIntToOp(v.AuxInt)
  3726  		x := v_0
  3727  		flag := v_2
  3728  		if !(ccARM64Eval(cc, flag) > 0) {
  3729  			break
  3730  		}
  3731  		v.copyOf(x)
  3732  		return true
  3733  	}
  3734  	// match: (CSNEG [cc] _ y flag)
  3735  	// cond: ccARM64Eval(cc, flag) < 0
  3736  	// result: (NEG y)
  3737  	for {
  3738  		cc := auxIntToOp(v.AuxInt)
  3739  		y := v_1
  3740  		flag := v_2
  3741  		if !(ccARM64Eval(cc, flag) < 0) {
  3742  			break
  3743  		}
  3744  		v.reset(OpARM64NEG)
  3745  		v.AddArg(y)
  3746  		return true
  3747  	}
  3748  	return false
  3749  }
  3750  func rewriteValueARM64_OpARM64DIV(v *Value) bool {
  3751  	v_1 := v.Args[1]
  3752  	v_0 := v.Args[0]
  3753  	// match: (DIV (MOVDconst [c]) (MOVDconst [d]))
  3754  	// cond: d != 0
  3755  	// result: (MOVDconst [c/d])
  3756  	for {
  3757  		if v_0.Op != OpARM64MOVDconst {
  3758  			break
  3759  		}
  3760  		c := auxIntToInt64(v_0.AuxInt)
  3761  		if v_1.Op != OpARM64MOVDconst {
  3762  			break
  3763  		}
  3764  		d := auxIntToInt64(v_1.AuxInt)
  3765  		if !(d != 0) {
  3766  			break
  3767  		}
  3768  		v.reset(OpARM64MOVDconst)
  3769  		v.AuxInt = int64ToAuxInt(c / d)
  3770  		return true
  3771  	}
  3772  	return false
  3773  }
  3774  func rewriteValueARM64_OpARM64DIVW(v *Value) bool {
  3775  	v_1 := v.Args[1]
  3776  	v_0 := v.Args[0]
  3777  	// match: (DIVW (MOVDconst [c]) (MOVDconst [d]))
  3778  	// cond: d != 0
  3779  	// result: (MOVDconst [int64(uint32(int32(c)/int32(d)))])
  3780  	for {
  3781  		if v_0.Op != OpARM64MOVDconst {
  3782  			break
  3783  		}
  3784  		c := auxIntToInt64(v_0.AuxInt)
  3785  		if v_1.Op != OpARM64MOVDconst {
  3786  			break
  3787  		}
  3788  		d := auxIntToInt64(v_1.AuxInt)
  3789  		if !(d != 0) {
  3790  			break
  3791  		}
  3792  		v.reset(OpARM64MOVDconst)
  3793  		v.AuxInt = int64ToAuxInt(int64(uint32(int32(c) / int32(d))))
  3794  		return true
  3795  	}
  3796  	return false
  3797  }
  3798  func rewriteValueARM64_OpARM64EON(v *Value) bool {
  3799  	v_1 := v.Args[1]
  3800  	v_0 := v.Args[0]
  3801  	// match: (EON x (MOVDconst [c]))
  3802  	// result: (XORconst [^c] x)
  3803  	for {
  3804  		x := v_0
  3805  		if v_1.Op != OpARM64MOVDconst {
  3806  			break
  3807  		}
  3808  		c := auxIntToInt64(v_1.AuxInt)
  3809  		v.reset(OpARM64XORconst)
  3810  		v.AuxInt = int64ToAuxInt(^c)
  3811  		v.AddArg(x)
  3812  		return true
  3813  	}
  3814  	// match: (EON x x)
  3815  	// result: (MOVDconst [-1])
  3816  	for {
  3817  		x := v_0
  3818  		if x != v_1 {
  3819  			break
  3820  		}
  3821  		v.reset(OpARM64MOVDconst)
  3822  		v.AuxInt = int64ToAuxInt(-1)
  3823  		return true
  3824  	}
  3825  	// match: (EON x0 x1:(SLLconst [c] y))
  3826  	// cond: clobberIfDead(x1)
  3827  	// result: (EONshiftLL x0 y [c])
  3828  	for {
  3829  		x0 := v_0
  3830  		x1 := v_1
  3831  		if x1.Op != OpARM64SLLconst {
  3832  			break
  3833  		}
  3834  		c := auxIntToInt64(x1.AuxInt)
  3835  		y := x1.Args[0]
  3836  		if !(clobberIfDead(x1)) {
  3837  			break
  3838  		}
  3839  		v.reset(OpARM64EONshiftLL)
  3840  		v.AuxInt = int64ToAuxInt(c)
  3841  		v.AddArg2(x0, y)
  3842  		return true
  3843  	}
  3844  	// match: (EON x0 x1:(SRLconst [c] y))
  3845  	// cond: clobberIfDead(x1)
  3846  	// result: (EONshiftRL x0 y [c])
  3847  	for {
  3848  		x0 := v_0
  3849  		x1 := v_1
  3850  		if x1.Op != OpARM64SRLconst {
  3851  			break
  3852  		}
  3853  		c := auxIntToInt64(x1.AuxInt)
  3854  		y := x1.Args[0]
  3855  		if !(clobberIfDead(x1)) {
  3856  			break
  3857  		}
  3858  		v.reset(OpARM64EONshiftRL)
  3859  		v.AuxInt = int64ToAuxInt(c)
  3860  		v.AddArg2(x0, y)
  3861  		return true
  3862  	}
  3863  	// match: (EON x0 x1:(SRAconst [c] y))
  3864  	// cond: clobberIfDead(x1)
  3865  	// result: (EONshiftRA x0 y [c])
  3866  	for {
  3867  		x0 := v_0
  3868  		x1 := v_1
  3869  		if x1.Op != OpARM64SRAconst {
  3870  			break
  3871  		}
  3872  		c := auxIntToInt64(x1.AuxInt)
  3873  		y := x1.Args[0]
  3874  		if !(clobberIfDead(x1)) {
  3875  			break
  3876  		}
  3877  		v.reset(OpARM64EONshiftRA)
  3878  		v.AuxInt = int64ToAuxInt(c)
  3879  		v.AddArg2(x0, y)
  3880  		return true
  3881  	}
  3882  	// match: (EON x0 x1:(RORconst [c] y))
  3883  	// cond: clobberIfDead(x1)
  3884  	// result: (EONshiftRO x0 y [c])
  3885  	for {
  3886  		x0 := v_0
  3887  		x1 := v_1
  3888  		if x1.Op != OpARM64RORconst {
  3889  			break
  3890  		}
  3891  		c := auxIntToInt64(x1.AuxInt)
  3892  		y := x1.Args[0]
  3893  		if !(clobberIfDead(x1)) {
  3894  			break
  3895  		}
  3896  		v.reset(OpARM64EONshiftRO)
  3897  		v.AuxInt = int64ToAuxInt(c)
  3898  		v.AddArg2(x0, y)
  3899  		return true
  3900  	}
  3901  	return false
  3902  }
  3903  func rewriteValueARM64_OpARM64EONshiftLL(v *Value) bool {
  3904  	v_1 := v.Args[1]
  3905  	v_0 := v.Args[0]
  3906  	// match: (EONshiftLL x (MOVDconst [c]) [d])
  3907  	// result: (XORconst x [^int64(uint64(c)<<uint64(d))])
  3908  	for {
  3909  		d := auxIntToInt64(v.AuxInt)
  3910  		x := v_0
  3911  		if v_1.Op != OpARM64MOVDconst {
  3912  			break
  3913  		}
  3914  		c := auxIntToInt64(v_1.AuxInt)
  3915  		v.reset(OpARM64XORconst)
  3916  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
  3917  		v.AddArg(x)
  3918  		return true
  3919  	}
  3920  	// match: (EONshiftLL (SLLconst x [c]) x [c])
  3921  	// result: (MOVDconst [-1])
  3922  	for {
  3923  		c := auxIntToInt64(v.AuxInt)
  3924  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
  3925  			break
  3926  		}
  3927  		x := v_0.Args[0]
  3928  		if x != v_1 {
  3929  			break
  3930  		}
  3931  		v.reset(OpARM64MOVDconst)
  3932  		v.AuxInt = int64ToAuxInt(-1)
  3933  		return true
  3934  	}
  3935  	return false
  3936  }
  3937  func rewriteValueARM64_OpARM64EONshiftRA(v *Value) bool {
  3938  	v_1 := v.Args[1]
  3939  	v_0 := v.Args[0]
  3940  	// match: (EONshiftRA x (MOVDconst [c]) [d])
  3941  	// result: (XORconst x [^(c>>uint64(d))])
  3942  	for {
  3943  		d := auxIntToInt64(v.AuxInt)
  3944  		x := v_0
  3945  		if v_1.Op != OpARM64MOVDconst {
  3946  			break
  3947  		}
  3948  		c := auxIntToInt64(v_1.AuxInt)
  3949  		v.reset(OpARM64XORconst)
  3950  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
  3951  		v.AddArg(x)
  3952  		return true
  3953  	}
  3954  	// match: (EONshiftRA (SRAconst x [c]) x [c])
  3955  	// result: (MOVDconst [-1])
  3956  	for {
  3957  		c := auxIntToInt64(v.AuxInt)
  3958  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
  3959  			break
  3960  		}
  3961  		x := v_0.Args[0]
  3962  		if x != v_1 {
  3963  			break
  3964  		}
  3965  		v.reset(OpARM64MOVDconst)
  3966  		v.AuxInt = int64ToAuxInt(-1)
  3967  		return true
  3968  	}
  3969  	return false
  3970  }
  3971  func rewriteValueARM64_OpARM64EONshiftRL(v *Value) bool {
  3972  	v_1 := v.Args[1]
  3973  	v_0 := v.Args[0]
  3974  	// match: (EONshiftRL x (MOVDconst [c]) [d])
  3975  	// result: (XORconst x [^int64(uint64(c)>>uint64(d))])
  3976  	for {
  3977  		d := auxIntToInt64(v.AuxInt)
  3978  		x := v_0
  3979  		if v_1.Op != OpARM64MOVDconst {
  3980  			break
  3981  		}
  3982  		c := auxIntToInt64(v_1.AuxInt)
  3983  		v.reset(OpARM64XORconst)
  3984  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
  3985  		v.AddArg(x)
  3986  		return true
  3987  	}
  3988  	// match: (EONshiftRL (SRLconst x [c]) x [c])
  3989  	// result: (MOVDconst [-1])
  3990  	for {
  3991  		c := auxIntToInt64(v.AuxInt)
  3992  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
  3993  			break
  3994  		}
  3995  		x := v_0.Args[0]
  3996  		if x != v_1 {
  3997  			break
  3998  		}
  3999  		v.reset(OpARM64MOVDconst)
  4000  		v.AuxInt = int64ToAuxInt(-1)
  4001  		return true
  4002  	}
  4003  	return false
  4004  }
  4005  func rewriteValueARM64_OpARM64EONshiftRO(v *Value) bool {
  4006  	v_1 := v.Args[1]
  4007  	v_0 := v.Args[0]
  4008  	// match: (EONshiftRO x (MOVDconst [c]) [d])
  4009  	// result: (XORconst x [^rotateRight64(c, d)])
  4010  	for {
  4011  		d := auxIntToInt64(v.AuxInt)
  4012  		x := v_0
  4013  		if v_1.Op != OpARM64MOVDconst {
  4014  			break
  4015  		}
  4016  		c := auxIntToInt64(v_1.AuxInt)
  4017  		v.reset(OpARM64XORconst)
  4018  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
  4019  		v.AddArg(x)
  4020  		return true
  4021  	}
  4022  	// match: (EONshiftRO (RORconst x [c]) x [c])
  4023  	// result: (MOVDconst [-1])
  4024  	for {
  4025  		c := auxIntToInt64(v.AuxInt)
  4026  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
  4027  			break
  4028  		}
  4029  		x := v_0.Args[0]
  4030  		if x != v_1 {
  4031  			break
  4032  		}
  4033  		v.reset(OpARM64MOVDconst)
  4034  		v.AuxInt = int64ToAuxInt(-1)
  4035  		return true
  4036  	}
  4037  	return false
  4038  }
  4039  func rewriteValueARM64_OpARM64Equal(v *Value) bool {
  4040  	v_0 := v.Args[0]
  4041  	b := v.Block
  4042  	// match: (Equal (CMPconst [0] z:(AND x y)))
  4043  	// cond: z.Uses == 1
  4044  	// result: (Equal (TST x y))
  4045  	for {
  4046  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4047  			break
  4048  		}
  4049  		z := v_0.Args[0]
  4050  		if z.Op != OpARM64AND {
  4051  			break
  4052  		}
  4053  		y := z.Args[1]
  4054  		x := z.Args[0]
  4055  		if !(z.Uses == 1) {
  4056  			break
  4057  		}
  4058  		v.reset(OpARM64Equal)
  4059  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  4060  		v0.AddArg2(x, y)
  4061  		v.AddArg(v0)
  4062  		return true
  4063  	}
  4064  	// match: (Equal (CMPWconst [0] x:(ANDconst [c] y)))
  4065  	// cond: x.Uses == 1
  4066  	// result: (Equal (TSTWconst [int32(c)] y))
  4067  	for {
  4068  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4069  			break
  4070  		}
  4071  		x := v_0.Args[0]
  4072  		if x.Op != OpARM64ANDconst {
  4073  			break
  4074  		}
  4075  		c := auxIntToInt64(x.AuxInt)
  4076  		y := x.Args[0]
  4077  		if !(x.Uses == 1) {
  4078  			break
  4079  		}
  4080  		v.reset(OpARM64Equal)
  4081  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  4082  		v0.AuxInt = int32ToAuxInt(int32(c))
  4083  		v0.AddArg(y)
  4084  		v.AddArg(v0)
  4085  		return true
  4086  	}
  4087  	// match: (Equal (CMPWconst [0] z:(AND x y)))
  4088  	// cond: z.Uses == 1
  4089  	// result: (Equal (TSTW x y))
  4090  	for {
  4091  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4092  			break
  4093  		}
  4094  		z := v_0.Args[0]
  4095  		if z.Op != OpARM64AND {
  4096  			break
  4097  		}
  4098  		y := z.Args[1]
  4099  		x := z.Args[0]
  4100  		if !(z.Uses == 1) {
  4101  			break
  4102  		}
  4103  		v.reset(OpARM64Equal)
  4104  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  4105  		v0.AddArg2(x, y)
  4106  		v.AddArg(v0)
  4107  		return true
  4108  	}
  4109  	// match: (Equal (CMPconst [0] x:(ANDconst [c] y)))
  4110  	// cond: x.Uses == 1
  4111  	// result: (Equal (TSTconst [c] y))
  4112  	for {
  4113  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4114  			break
  4115  		}
  4116  		x := v_0.Args[0]
  4117  		if x.Op != OpARM64ANDconst {
  4118  			break
  4119  		}
  4120  		c := auxIntToInt64(x.AuxInt)
  4121  		y := x.Args[0]
  4122  		if !(x.Uses == 1) {
  4123  			break
  4124  		}
  4125  		v.reset(OpARM64Equal)
  4126  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  4127  		v0.AuxInt = int64ToAuxInt(c)
  4128  		v0.AddArg(y)
  4129  		v.AddArg(v0)
  4130  		return true
  4131  	}
  4132  	// match: (Equal (CMP x z:(NEG y)))
  4133  	// cond: z.Uses == 1
  4134  	// result: (Equal (CMN x y))
  4135  	for {
  4136  		if v_0.Op != OpARM64CMP {
  4137  			break
  4138  		}
  4139  		_ = v_0.Args[1]
  4140  		x := v_0.Args[0]
  4141  		z := v_0.Args[1]
  4142  		if z.Op != OpARM64NEG {
  4143  			break
  4144  		}
  4145  		y := z.Args[0]
  4146  		if !(z.Uses == 1) {
  4147  			break
  4148  		}
  4149  		v.reset(OpARM64Equal)
  4150  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  4151  		v0.AddArg2(x, y)
  4152  		v.AddArg(v0)
  4153  		return true
  4154  	}
  4155  	// match: (Equal (CMPW x z:(NEG y)))
  4156  	// cond: z.Uses == 1
  4157  	// result: (Equal (CMNW x y))
  4158  	for {
  4159  		if v_0.Op != OpARM64CMPW {
  4160  			break
  4161  		}
  4162  		_ = v_0.Args[1]
  4163  		x := v_0.Args[0]
  4164  		z := v_0.Args[1]
  4165  		if z.Op != OpARM64NEG {
  4166  			break
  4167  		}
  4168  		y := z.Args[0]
  4169  		if !(z.Uses == 1) {
  4170  			break
  4171  		}
  4172  		v.reset(OpARM64Equal)
  4173  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  4174  		v0.AddArg2(x, y)
  4175  		v.AddArg(v0)
  4176  		return true
  4177  	}
  4178  	// match: (Equal (CMPconst [0] x:(ADDconst [c] y)))
  4179  	// cond: x.Uses == 1
  4180  	// result: (Equal (CMNconst [c] y))
  4181  	for {
  4182  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4183  			break
  4184  		}
  4185  		x := v_0.Args[0]
  4186  		if x.Op != OpARM64ADDconst {
  4187  			break
  4188  		}
  4189  		c := auxIntToInt64(x.AuxInt)
  4190  		y := x.Args[0]
  4191  		if !(x.Uses == 1) {
  4192  			break
  4193  		}
  4194  		v.reset(OpARM64Equal)
  4195  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
  4196  		v0.AuxInt = int64ToAuxInt(c)
  4197  		v0.AddArg(y)
  4198  		v.AddArg(v0)
  4199  		return true
  4200  	}
  4201  	// match: (Equal (CMPWconst [0] x:(ADDconst [c] y)))
  4202  	// cond: x.Uses == 1
  4203  	// result: (Equal (CMNWconst [int32(c)] y))
  4204  	for {
  4205  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4206  			break
  4207  		}
  4208  		x := v_0.Args[0]
  4209  		if x.Op != OpARM64ADDconst {
  4210  			break
  4211  		}
  4212  		c := auxIntToInt64(x.AuxInt)
  4213  		y := x.Args[0]
  4214  		if !(x.Uses == 1) {
  4215  			break
  4216  		}
  4217  		v.reset(OpARM64Equal)
  4218  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
  4219  		v0.AuxInt = int32ToAuxInt(int32(c))
  4220  		v0.AddArg(y)
  4221  		v.AddArg(v0)
  4222  		return true
  4223  	}
  4224  	// match: (Equal (CMPconst [0] z:(ADD x y)))
  4225  	// cond: z.Uses == 1
  4226  	// result: (Equal (CMN x y))
  4227  	for {
  4228  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4229  			break
  4230  		}
  4231  		z := v_0.Args[0]
  4232  		if z.Op != OpARM64ADD {
  4233  			break
  4234  		}
  4235  		y := z.Args[1]
  4236  		x := z.Args[0]
  4237  		if !(z.Uses == 1) {
  4238  			break
  4239  		}
  4240  		v.reset(OpARM64Equal)
  4241  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  4242  		v0.AddArg2(x, y)
  4243  		v.AddArg(v0)
  4244  		return true
  4245  	}
  4246  	// match: (Equal (CMPWconst [0] z:(ADD x y)))
  4247  	// cond: z.Uses == 1
  4248  	// result: (Equal (CMNW x y))
  4249  	for {
  4250  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4251  			break
  4252  		}
  4253  		z := v_0.Args[0]
  4254  		if z.Op != OpARM64ADD {
  4255  			break
  4256  		}
  4257  		y := z.Args[1]
  4258  		x := z.Args[0]
  4259  		if !(z.Uses == 1) {
  4260  			break
  4261  		}
  4262  		v.reset(OpARM64Equal)
  4263  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  4264  		v0.AddArg2(x, y)
  4265  		v.AddArg(v0)
  4266  		return true
  4267  	}
  4268  	// match: (Equal (CMPconst [0] z:(MADD a x y)))
  4269  	// cond: z.Uses == 1
  4270  	// result: (Equal (CMN a (MUL <x.Type> x y)))
  4271  	for {
  4272  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4273  			break
  4274  		}
  4275  		z := v_0.Args[0]
  4276  		if z.Op != OpARM64MADD {
  4277  			break
  4278  		}
  4279  		y := z.Args[2]
  4280  		a := z.Args[0]
  4281  		x := z.Args[1]
  4282  		if !(z.Uses == 1) {
  4283  			break
  4284  		}
  4285  		v.reset(OpARM64Equal)
  4286  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  4287  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  4288  		v1.AddArg2(x, y)
  4289  		v0.AddArg2(a, v1)
  4290  		v.AddArg(v0)
  4291  		return true
  4292  	}
  4293  	// match: (Equal (CMPconst [0] z:(MSUB a x y)))
  4294  	// cond: z.Uses == 1
  4295  	// result: (Equal (CMP a (MUL <x.Type> 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 != OpARM64MSUB {
  4302  			break
  4303  		}
  4304  		y := z.Args[2]
  4305  		a := z.Args[0]
  4306  		x := z.Args[1]
  4307  		if !(z.Uses == 1) {
  4308  			break
  4309  		}
  4310  		v.reset(OpARM64Equal)
  4311  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  4312  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  4313  		v1.AddArg2(x, y)
  4314  		v0.AddArg2(a, v1)
  4315  		v.AddArg(v0)
  4316  		return true
  4317  	}
  4318  	// match: (Equal (CMPWconst [0] z:(MADDW a x y)))
  4319  	// cond: z.Uses == 1
  4320  	// result: (Equal (CMNW a (MULW <x.Type> x y)))
  4321  	for {
  4322  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4323  			break
  4324  		}
  4325  		z := v_0.Args[0]
  4326  		if z.Op != OpARM64MADDW {
  4327  			break
  4328  		}
  4329  		y := z.Args[2]
  4330  		a := z.Args[0]
  4331  		x := z.Args[1]
  4332  		if !(z.Uses == 1) {
  4333  			break
  4334  		}
  4335  		v.reset(OpARM64Equal)
  4336  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  4337  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  4338  		v1.AddArg2(x, y)
  4339  		v0.AddArg2(a, v1)
  4340  		v.AddArg(v0)
  4341  		return true
  4342  	}
  4343  	// match: (Equal (CMPWconst [0] z:(MSUBW a x y)))
  4344  	// cond: z.Uses == 1
  4345  	// result: (Equal (CMPW a (MULW <x.Type> x y)))
  4346  	for {
  4347  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  4348  			break
  4349  		}
  4350  		z := v_0.Args[0]
  4351  		if z.Op != OpARM64MSUBW {
  4352  			break
  4353  		}
  4354  		y := z.Args[2]
  4355  		a := z.Args[0]
  4356  		x := z.Args[1]
  4357  		if !(z.Uses == 1) {
  4358  			break
  4359  		}
  4360  		v.reset(OpARM64Equal)
  4361  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  4362  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  4363  		v1.AddArg2(x, y)
  4364  		v0.AddArg2(a, v1)
  4365  		v.AddArg(v0)
  4366  		return true
  4367  	}
  4368  	// match: (Equal (FlagConstant [fc]))
  4369  	// result: (MOVDconst [b2i(fc.eq())])
  4370  	for {
  4371  		if v_0.Op != OpARM64FlagConstant {
  4372  			break
  4373  		}
  4374  		fc := auxIntToFlagConstant(v_0.AuxInt)
  4375  		v.reset(OpARM64MOVDconst)
  4376  		v.AuxInt = int64ToAuxInt(b2i(fc.eq()))
  4377  		return true
  4378  	}
  4379  	// match: (Equal (InvertFlags x))
  4380  	// result: (Equal x)
  4381  	for {
  4382  		if v_0.Op != OpARM64InvertFlags {
  4383  			break
  4384  		}
  4385  		x := v_0.Args[0]
  4386  		v.reset(OpARM64Equal)
  4387  		v.AddArg(x)
  4388  		return true
  4389  	}
  4390  	return false
  4391  }
  4392  func rewriteValueARM64_OpARM64FADDD(v *Value) bool {
  4393  	v_1 := v.Args[1]
  4394  	v_0 := v.Args[0]
  4395  	// match: (FADDD a (FMULD x y))
  4396  	// cond: a.Block.Func.useFMA(v)
  4397  	// result: (FMADDD a x y)
  4398  	for {
  4399  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4400  			a := v_0
  4401  			if v_1.Op != OpARM64FMULD {
  4402  				continue
  4403  			}
  4404  			y := v_1.Args[1]
  4405  			x := v_1.Args[0]
  4406  			if !(a.Block.Func.useFMA(v)) {
  4407  				continue
  4408  			}
  4409  			v.reset(OpARM64FMADDD)
  4410  			v.AddArg3(a, x, y)
  4411  			return true
  4412  		}
  4413  		break
  4414  	}
  4415  	// match: (FADDD a (FNMULD x y))
  4416  	// cond: a.Block.Func.useFMA(v)
  4417  	// result: (FMSUBD a x y)
  4418  	for {
  4419  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4420  			a := v_0
  4421  			if v_1.Op != OpARM64FNMULD {
  4422  				continue
  4423  			}
  4424  			y := v_1.Args[1]
  4425  			x := v_1.Args[0]
  4426  			if !(a.Block.Func.useFMA(v)) {
  4427  				continue
  4428  			}
  4429  			v.reset(OpARM64FMSUBD)
  4430  			v.AddArg3(a, x, y)
  4431  			return true
  4432  		}
  4433  		break
  4434  	}
  4435  	return false
  4436  }
  4437  func rewriteValueARM64_OpARM64FADDS(v *Value) bool {
  4438  	v_1 := v.Args[1]
  4439  	v_0 := v.Args[0]
  4440  	// match: (FADDS a (FMULS x y))
  4441  	// cond: a.Block.Func.useFMA(v)
  4442  	// result: (FMADDS a x y)
  4443  	for {
  4444  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4445  			a := v_0
  4446  			if v_1.Op != OpARM64FMULS {
  4447  				continue
  4448  			}
  4449  			y := v_1.Args[1]
  4450  			x := v_1.Args[0]
  4451  			if !(a.Block.Func.useFMA(v)) {
  4452  				continue
  4453  			}
  4454  			v.reset(OpARM64FMADDS)
  4455  			v.AddArg3(a, x, y)
  4456  			return true
  4457  		}
  4458  		break
  4459  	}
  4460  	// match: (FADDS a (FNMULS x y))
  4461  	// cond: a.Block.Func.useFMA(v)
  4462  	// result: (FMSUBS a x y)
  4463  	for {
  4464  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4465  			a := v_0
  4466  			if v_1.Op != OpARM64FNMULS {
  4467  				continue
  4468  			}
  4469  			y := v_1.Args[1]
  4470  			x := v_1.Args[0]
  4471  			if !(a.Block.Func.useFMA(v)) {
  4472  				continue
  4473  			}
  4474  			v.reset(OpARM64FMSUBS)
  4475  			v.AddArg3(a, x, y)
  4476  			return true
  4477  		}
  4478  		break
  4479  	}
  4480  	return false
  4481  }
  4482  func rewriteValueARM64_OpARM64FCMPD(v *Value) bool {
  4483  	v_1 := v.Args[1]
  4484  	v_0 := v.Args[0]
  4485  	b := v.Block
  4486  	// match: (FCMPD x (FMOVDconst [0]))
  4487  	// result: (FCMPD0 x)
  4488  	for {
  4489  		x := v_0
  4490  		if v_1.Op != OpARM64FMOVDconst || auxIntToFloat64(v_1.AuxInt) != 0 {
  4491  			break
  4492  		}
  4493  		v.reset(OpARM64FCMPD0)
  4494  		v.AddArg(x)
  4495  		return true
  4496  	}
  4497  	// match: (FCMPD (FMOVDconst [0]) x)
  4498  	// result: (InvertFlags (FCMPD0 x))
  4499  	for {
  4500  		if v_0.Op != OpARM64FMOVDconst || auxIntToFloat64(v_0.AuxInt) != 0 {
  4501  			break
  4502  		}
  4503  		x := v_1
  4504  		v.reset(OpARM64InvertFlags)
  4505  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD0, types.TypeFlags)
  4506  		v0.AddArg(x)
  4507  		v.AddArg(v0)
  4508  		return true
  4509  	}
  4510  	return false
  4511  }
  4512  func rewriteValueARM64_OpARM64FCMPS(v *Value) bool {
  4513  	v_1 := v.Args[1]
  4514  	v_0 := v.Args[0]
  4515  	b := v.Block
  4516  	// match: (FCMPS x (FMOVSconst [0]))
  4517  	// result: (FCMPS0 x)
  4518  	for {
  4519  		x := v_0
  4520  		if v_1.Op != OpARM64FMOVSconst || auxIntToFloat64(v_1.AuxInt) != 0 {
  4521  			break
  4522  		}
  4523  		v.reset(OpARM64FCMPS0)
  4524  		v.AddArg(x)
  4525  		return true
  4526  	}
  4527  	// match: (FCMPS (FMOVSconst [0]) x)
  4528  	// result: (InvertFlags (FCMPS0 x))
  4529  	for {
  4530  		if v_0.Op != OpARM64FMOVSconst || auxIntToFloat64(v_0.AuxInt) != 0 {
  4531  			break
  4532  		}
  4533  		x := v_1
  4534  		v.reset(OpARM64InvertFlags)
  4535  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS0, types.TypeFlags)
  4536  		v0.AddArg(x)
  4537  		v.AddArg(v0)
  4538  		return true
  4539  	}
  4540  	return false
  4541  }
  4542  func rewriteValueARM64_OpARM64FMOVDfpgp(v *Value) bool {
  4543  	v_0 := v.Args[0]
  4544  	b := v.Block
  4545  	// match: (FMOVDfpgp <t> (Arg [off] {sym}))
  4546  	// result: @b.Func.Entry (Arg <t> [off] {sym})
  4547  	for {
  4548  		t := v.Type
  4549  		if v_0.Op != OpArg {
  4550  			break
  4551  		}
  4552  		off := auxIntToInt32(v_0.AuxInt)
  4553  		sym := auxToSym(v_0.Aux)
  4554  		b = b.Func.Entry
  4555  		v0 := b.NewValue0(v.Pos, OpArg, t)
  4556  		v.copyOf(v0)
  4557  		v0.AuxInt = int32ToAuxInt(off)
  4558  		v0.Aux = symToAux(sym)
  4559  		return true
  4560  	}
  4561  	return false
  4562  }
  4563  func rewriteValueARM64_OpARM64FMOVDgpfp(v *Value) bool {
  4564  	v_0 := v.Args[0]
  4565  	b := v.Block
  4566  	// match: (FMOVDgpfp <t> (Arg [off] {sym}))
  4567  	// result: @b.Func.Entry (Arg <t> [off] {sym})
  4568  	for {
  4569  		t := v.Type
  4570  		if v_0.Op != OpArg {
  4571  			break
  4572  		}
  4573  		off := auxIntToInt32(v_0.AuxInt)
  4574  		sym := auxToSym(v_0.Aux)
  4575  		b = b.Func.Entry
  4576  		v0 := b.NewValue0(v.Pos, OpArg, t)
  4577  		v.copyOf(v0)
  4578  		v0.AuxInt = int32ToAuxInt(off)
  4579  		v0.Aux = symToAux(sym)
  4580  		return true
  4581  	}
  4582  	return false
  4583  }
  4584  func rewriteValueARM64_OpARM64FMOVDload(v *Value) bool {
  4585  	v_1 := v.Args[1]
  4586  	v_0 := v.Args[0]
  4587  	b := v.Block
  4588  	config := b.Func.Config
  4589  	// match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr val _))
  4590  	// result: (FMOVDgpfp val)
  4591  	for {
  4592  		off := auxIntToInt32(v.AuxInt)
  4593  		sym := auxToSym(v.Aux)
  4594  		ptr := v_0
  4595  		if v_1.Op != OpARM64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  4596  			break
  4597  		}
  4598  		val := v_1.Args[1]
  4599  		if ptr != v_1.Args[0] {
  4600  			break
  4601  		}
  4602  		v.reset(OpARM64FMOVDgpfp)
  4603  		v.AddArg(val)
  4604  		return true
  4605  	}
  4606  	// match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  4607  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4608  	// result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
  4609  	for {
  4610  		off1 := auxIntToInt32(v.AuxInt)
  4611  		sym := auxToSym(v.Aux)
  4612  		if v_0.Op != OpARM64ADDconst {
  4613  			break
  4614  		}
  4615  		off2 := auxIntToInt64(v_0.AuxInt)
  4616  		ptr := v_0.Args[0]
  4617  		mem := v_1
  4618  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4619  			break
  4620  		}
  4621  		v.reset(OpARM64FMOVDload)
  4622  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4623  		v.Aux = symToAux(sym)
  4624  		v.AddArg2(ptr, mem)
  4625  		return true
  4626  	}
  4627  	// match: (FMOVDload [off] {sym} (ADD ptr idx) mem)
  4628  	// cond: off == 0 && sym == nil
  4629  	// result: (FMOVDloadidx ptr idx mem)
  4630  	for {
  4631  		off := auxIntToInt32(v.AuxInt)
  4632  		sym := auxToSym(v.Aux)
  4633  		if v_0.Op != OpARM64ADD {
  4634  			break
  4635  		}
  4636  		idx := v_0.Args[1]
  4637  		ptr := v_0.Args[0]
  4638  		mem := v_1
  4639  		if !(off == 0 && sym == nil) {
  4640  			break
  4641  		}
  4642  		v.reset(OpARM64FMOVDloadidx)
  4643  		v.AddArg3(ptr, idx, mem)
  4644  		return true
  4645  	}
  4646  	// match: (FMOVDload [off] {sym} (ADDshiftLL [3] ptr idx) mem)
  4647  	// cond: off == 0 && sym == nil
  4648  	// result: (FMOVDloadidx8 ptr idx mem)
  4649  	for {
  4650  		off := auxIntToInt32(v.AuxInt)
  4651  		sym := auxToSym(v.Aux)
  4652  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  4653  			break
  4654  		}
  4655  		idx := v_0.Args[1]
  4656  		ptr := v_0.Args[0]
  4657  		mem := v_1
  4658  		if !(off == 0 && sym == nil) {
  4659  			break
  4660  		}
  4661  		v.reset(OpARM64FMOVDloadidx8)
  4662  		v.AddArg3(ptr, idx, mem)
  4663  		return true
  4664  	}
  4665  	// match: (FMOVDload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  4666  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4667  	// result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  4668  	for {
  4669  		off1 := auxIntToInt32(v.AuxInt)
  4670  		sym1 := auxToSym(v.Aux)
  4671  		if v_0.Op != OpARM64MOVDaddr {
  4672  			break
  4673  		}
  4674  		off2 := auxIntToInt32(v_0.AuxInt)
  4675  		sym2 := auxToSym(v_0.Aux)
  4676  		ptr := v_0.Args[0]
  4677  		mem := v_1
  4678  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4679  			break
  4680  		}
  4681  		v.reset(OpARM64FMOVDload)
  4682  		v.AuxInt = int32ToAuxInt(off1 + off2)
  4683  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4684  		v.AddArg2(ptr, mem)
  4685  		return true
  4686  	}
  4687  	return false
  4688  }
  4689  func rewriteValueARM64_OpARM64FMOVDloadidx(v *Value) bool {
  4690  	v_2 := v.Args[2]
  4691  	v_1 := v.Args[1]
  4692  	v_0 := v.Args[0]
  4693  	// match: (FMOVDloadidx ptr (MOVDconst [c]) mem)
  4694  	// cond: is32Bit(c)
  4695  	// result: (FMOVDload [int32(c)] ptr mem)
  4696  	for {
  4697  		ptr := v_0
  4698  		if v_1.Op != OpARM64MOVDconst {
  4699  			break
  4700  		}
  4701  		c := auxIntToInt64(v_1.AuxInt)
  4702  		mem := v_2
  4703  		if !(is32Bit(c)) {
  4704  			break
  4705  		}
  4706  		v.reset(OpARM64FMOVDload)
  4707  		v.AuxInt = int32ToAuxInt(int32(c))
  4708  		v.AddArg2(ptr, mem)
  4709  		return true
  4710  	}
  4711  	// match: (FMOVDloadidx (MOVDconst [c]) ptr mem)
  4712  	// cond: is32Bit(c)
  4713  	// result: (FMOVDload [int32(c)] ptr mem)
  4714  	for {
  4715  		if v_0.Op != OpARM64MOVDconst {
  4716  			break
  4717  		}
  4718  		c := auxIntToInt64(v_0.AuxInt)
  4719  		ptr := v_1
  4720  		mem := v_2
  4721  		if !(is32Bit(c)) {
  4722  			break
  4723  		}
  4724  		v.reset(OpARM64FMOVDload)
  4725  		v.AuxInt = int32ToAuxInt(int32(c))
  4726  		v.AddArg2(ptr, mem)
  4727  		return true
  4728  	}
  4729  	// match: (FMOVDloadidx ptr (SLLconst [3] idx) mem)
  4730  	// result: (FMOVDloadidx8 ptr idx mem)
  4731  	for {
  4732  		ptr := v_0
  4733  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  4734  			break
  4735  		}
  4736  		idx := v_1.Args[0]
  4737  		mem := v_2
  4738  		v.reset(OpARM64FMOVDloadidx8)
  4739  		v.AddArg3(ptr, idx, mem)
  4740  		return true
  4741  	}
  4742  	// match: (FMOVDloadidx (SLLconst [3] idx) ptr mem)
  4743  	// result: (FMOVDloadidx8 ptr idx mem)
  4744  	for {
  4745  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  4746  			break
  4747  		}
  4748  		idx := v_0.Args[0]
  4749  		ptr := v_1
  4750  		mem := v_2
  4751  		v.reset(OpARM64FMOVDloadidx8)
  4752  		v.AddArg3(ptr, idx, mem)
  4753  		return true
  4754  	}
  4755  	return false
  4756  }
  4757  func rewriteValueARM64_OpARM64FMOVDloadidx8(v *Value) bool {
  4758  	v_2 := v.Args[2]
  4759  	v_1 := v.Args[1]
  4760  	v_0 := v.Args[0]
  4761  	// match: (FMOVDloadidx8 ptr (MOVDconst [c]) mem)
  4762  	// cond: is32Bit(c<<3)
  4763  	// result: (FMOVDload ptr [int32(c)<<3] mem)
  4764  	for {
  4765  		ptr := v_0
  4766  		if v_1.Op != OpARM64MOVDconst {
  4767  			break
  4768  		}
  4769  		c := auxIntToInt64(v_1.AuxInt)
  4770  		mem := v_2
  4771  		if !(is32Bit(c << 3)) {
  4772  			break
  4773  		}
  4774  		v.reset(OpARM64FMOVDload)
  4775  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  4776  		v.AddArg2(ptr, mem)
  4777  		return true
  4778  	}
  4779  	return false
  4780  }
  4781  func rewriteValueARM64_OpARM64FMOVDstore(v *Value) bool {
  4782  	v_2 := v.Args[2]
  4783  	v_1 := v.Args[1]
  4784  	v_0 := v.Args[0]
  4785  	b := v.Block
  4786  	config := b.Func.Config
  4787  	// match: (FMOVDstore [off] {sym} ptr (FMOVDgpfp val) mem)
  4788  	// result: (MOVDstore [off] {sym} ptr val mem)
  4789  	for {
  4790  		off := auxIntToInt32(v.AuxInt)
  4791  		sym := auxToSym(v.Aux)
  4792  		ptr := v_0
  4793  		if v_1.Op != OpARM64FMOVDgpfp {
  4794  			break
  4795  		}
  4796  		val := v_1.Args[0]
  4797  		mem := v_2
  4798  		v.reset(OpARM64MOVDstore)
  4799  		v.AuxInt = int32ToAuxInt(off)
  4800  		v.Aux = symToAux(sym)
  4801  		v.AddArg3(ptr, val, mem)
  4802  		return true
  4803  	}
  4804  	// match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  4805  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4806  	// result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
  4807  	for {
  4808  		off1 := auxIntToInt32(v.AuxInt)
  4809  		sym := auxToSym(v.Aux)
  4810  		if v_0.Op != OpARM64ADDconst {
  4811  			break
  4812  		}
  4813  		off2 := auxIntToInt64(v_0.AuxInt)
  4814  		ptr := v_0.Args[0]
  4815  		val := v_1
  4816  		mem := v_2
  4817  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4818  			break
  4819  		}
  4820  		v.reset(OpARM64FMOVDstore)
  4821  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  4822  		v.Aux = symToAux(sym)
  4823  		v.AddArg3(ptr, val, mem)
  4824  		return true
  4825  	}
  4826  	// match: (FMOVDstore [off] {sym} (ADD ptr idx) val mem)
  4827  	// cond: off == 0 && sym == nil
  4828  	// result: (FMOVDstoreidx ptr idx val mem)
  4829  	for {
  4830  		off := auxIntToInt32(v.AuxInt)
  4831  		sym := auxToSym(v.Aux)
  4832  		if v_0.Op != OpARM64ADD {
  4833  			break
  4834  		}
  4835  		idx := v_0.Args[1]
  4836  		ptr := v_0.Args[0]
  4837  		val := v_1
  4838  		mem := v_2
  4839  		if !(off == 0 && sym == nil) {
  4840  			break
  4841  		}
  4842  		v.reset(OpARM64FMOVDstoreidx)
  4843  		v.AddArg4(ptr, idx, val, mem)
  4844  		return true
  4845  	}
  4846  	// match: (FMOVDstore [off] {sym} (ADDshiftLL [3] ptr idx) val mem)
  4847  	// cond: off == 0 && sym == nil
  4848  	// result: (FMOVDstoreidx8 ptr idx val mem)
  4849  	for {
  4850  		off := auxIntToInt32(v.AuxInt)
  4851  		sym := auxToSym(v.Aux)
  4852  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  4853  			break
  4854  		}
  4855  		idx := v_0.Args[1]
  4856  		ptr := v_0.Args[0]
  4857  		val := v_1
  4858  		mem := v_2
  4859  		if !(off == 0 && sym == nil) {
  4860  			break
  4861  		}
  4862  		v.reset(OpARM64FMOVDstoreidx8)
  4863  		v.AddArg4(ptr, idx, val, mem)
  4864  		return true
  4865  	}
  4866  	// match: (FMOVDstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  4867  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  4868  	// result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  4869  	for {
  4870  		off1 := auxIntToInt32(v.AuxInt)
  4871  		sym1 := auxToSym(v.Aux)
  4872  		if v_0.Op != OpARM64MOVDaddr {
  4873  			break
  4874  		}
  4875  		off2 := auxIntToInt32(v_0.AuxInt)
  4876  		sym2 := auxToSym(v_0.Aux)
  4877  		ptr := v_0.Args[0]
  4878  		val := v_1
  4879  		mem := v_2
  4880  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  4881  			break
  4882  		}
  4883  		v.reset(OpARM64FMOVDstore)
  4884  		v.AuxInt = int32ToAuxInt(off1 + off2)
  4885  		v.Aux = symToAux(mergeSym(sym1, sym2))
  4886  		v.AddArg3(ptr, val, mem)
  4887  		return true
  4888  	}
  4889  	return false
  4890  }
  4891  func rewriteValueARM64_OpARM64FMOVDstoreidx(v *Value) bool {
  4892  	v_3 := v.Args[3]
  4893  	v_2 := v.Args[2]
  4894  	v_1 := v.Args[1]
  4895  	v_0 := v.Args[0]
  4896  	// match: (FMOVDstoreidx ptr (MOVDconst [c]) val mem)
  4897  	// cond: is32Bit(c)
  4898  	// result: (FMOVDstore [int32(c)] ptr val mem)
  4899  	for {
  4900  		ptr := v_0
  4901  		if v_1.Op != OpARM64MOVDconst {
  4902  			break
  4903  		}
  4904  		c := auxIntToInt64(v_1.AuxInt)
  4905  		val := v_2
  4906  		mem := v_3
  4907  		if !(is32Bit(c)) {
  4908  			break
  4909  		}
  4910  		v.reset(OpARM64FMOVDstore)
  4911  		v.AuxInt = int32ToAuxInt(int32(c))
  4912  		v.AddArg3(ptr, val, mem)
  4913  		return true
  4914  	}
  4915  	// match: (FMOVDstoreidx (MOVDconst [c]) idx val mem)
  4916  	// cond: is32Bit(c)
  4917  	// result: (FMOVDstore [int32(c)] idx val mem)
  4918  	for {
  4919  		if v_0.Op != OpARM64MOVDconst {
  4920  			break
  4921  		}
  4922  		c := auxIntToInt64(v_0.AuxInt)
  4923  		idx := v_1
  4924  		val := v_2
  4925  		mem := v_3
  4926  		if !(is32Bit(c)) {
  4927  			break
  4928  		}
  4929  		v.reset(OpARM64FMOVDstore)
  4930  		v.AuxInt = int32ToAuxInt(int32(c))
  4931  		v.AddArg3(idx, val, mem)
  4932  		return true
  4933  	}
  4934  	// match: (FMOVDstoreidx ptr (SLLconst [3] idx) val mem)
  4935  	// result: (FMOVDstoreidx8 ptr idx val mem)
  4936  	for {
  4937  		ptr := v_0
  4938  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  4939  			break
  4940  		}
  4941  		idx := v_1.Args[0]
  4942  		val := v_2
  4943  		mem := v_3
  4944  		v.reset(OpARM64FMOVDstoreidx8)
  4945  		v.AddArg4(ptr, idx, val, mem)
  4946  		return true
  4947  	}
  4948  	// match: (FMOVDstoreidx (SLLconst [3] idx) ptr val mem)
  4949  	// result: (FMOVDstoreidx8 ptr idx val mem)
  4950  	for {
  4951  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  4952  			break
  4953  		}
  4954  		idx := v_0.Args[0]
  4955  		ptr := v_1
  4956  		val := v_2
  4957  		mem := v_3
  4958  		v.reset(OpARM64FMOVDstoreidx8)
  4959  		v.AddArg4(ptr, idx, val, mem)
  4960  		return true
  4961  	}
  4962  	return false
  4963  }
  4964  func rewriteValueARM64_OpARM64FMOVDstoreidx8(v *Value) bool {
  4965  	v_3 := v.Args[3]
  4966  	v_2 := v.Args[2]
  4967  	v_1 := v.Args[1]
  4968  	v_0 := v.Args[0]
  4969  	// match: (FMOVDstoreidx8 ptr (MOVDconst [c]) val mem)
  4970  	// cond: is32Bit(c<<3)
  4971  	// result: (FMOVDstore [int32(c)<<3] ptr val mem)
  4972  	for {
  4973  		ptr := v_0
  4974  		if v_1.Op != OpARM64MOVDconst {
  4975  			break
  4976  		}
  4977  		c := auxIntToInt64(v_1.AuxInt)
  4978  		val := v_2
  4979  		mem := v_3
  4980  		if !(is32Bit(c << 3)) {
  4981  			break
  4982  		}
  4983  		v.reset(OpARM64FMOVDstore)
  4984  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  4985  		v.AddArg3(ptr, val, mem)
  4986  		return true
  4987  	}
  4988  	return false
  4989  }
  4990  func rewriteValueARM64_OpARM64FMOVSload(v *Value) bool {
  4991  	v_1 := v.Args[1]
  4992  	v_0 := v.Args[0]
  4993  	b := v.Block
  4994  	config := b.Func.Config
  4995  	// match: (FMOVSload [off] {sym} ptr (MOVWstore [off] {sym} ptr val _))
  4996  	// result: (FMOVSgpfp val)
  4997  	for {
  4998  		off := auxIntToInt32(v.AuxInt)
  4999  		sym := auxToSym(v.Aux)
  5000  		ptr := v_0
  5001  		if v_1.Op != OpARM64MOVWstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5002  			break
  5003  		}
  5004  		val := v_1.Args[1]
  5005  		if ptr != v_1.Args[0] {
  5006  			break
  5007  		}
  5008  		v.reset(OpARM64FMOVSgpfp)
  5009  		v.AddArg(val)
  5010  		return true
  5011  	}
  5012  	// match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
  5013  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5014  	// result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
  5015  	for {
  5016  		off1 := auxIntToInt32(v.AuxInt)
  5017  		sym := auxToSym(v.Aux)
  5018  		if v_0.Op != OpARM64ADDconst {
  5019  			break
  5020  		}
  5021  		off2 := auxIntToInt64(v_0.AuxInt)
  5022  		ptr := v_0.Args[0]
  5023  		mem := v_1
  5024  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5025  			break
  5026  		}
  5027  		v.reset(OpARM64FMOVSload)
  5028  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5029  		v.Aux = symToAux(sym)
  5030  		v.AddArg2(ptr, mem)
  5031  		return true
  5032  	}
  5033  	// match: (FMOVSload [off] {sym} (ADD ptr idx) mem)
  5034  	// cond: off == 0 && sym == nil
  5035  	// result: (FMOVSloadidx ptr idx mem)
  5036  	for {
  5037  		off := auxIntToInt32(v.AuxInt)
  5038  		sym := auxToSym(v.Aux)
  5039  		if v_0.Op != OpARM64ADD {
  5040  			break
  5041  		}
  5042  		idx := v_0.Args[1]
  5043  		ptr := v_0.Args[0]
  5044  		mem := v_1
  5045  		if !(off == 0 && sym == nil) {
  5046  			break
  5047  		}
  5048  		v.reset(OpARM64FMOVSloadidx)
  5049  		v.AddArg3(ptr, idx, mem)
  5050  		return true
  5051  	}
  5052  	// match: (FMOVSload [off] {sym} (ADDshiftLL [2] ptr idx) mem)
  5053  	// cond: off == 0 && sym == nil
  5054  	// result: (FMOVSloadidx4 ptr idx mem)
  5055  	for {
  5056  		off := auxIntToInt32(v.AuxInt)
  5057  		sym := auxToSym(v.Aux)
  5058  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
  5059  			break
  5060  		}
  5061  		idx := v_0.Args[1]
  5062  		ptr := v_0.Args[0]
  5063  		mem := v_1
  5064  		if !(off == 0 && sym == nil) {
  5065  			break
  5066  		}
  5067  		v.reset(OpARM64FMOVSloadidx4)
  5068  		v.AddArg3(ptr, idx, mem)
  5069  		return true
  5070  	}
  5071  	// match: (FMOVSload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  5072  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5073  	// result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5074  	for {
  5075  		off1 := auxIntToInt32(v.AuxInt)
  5076  		sym1 := auxToSym(v.Aux)
  5077  		if v_0.Op != OpARM64MOVDaddr {
  5078  			break
  5079  		}
  5080  		off2 := auxIntToInt32(v_0.AuxInt)
  5081  		sym2 := auxToSym(v_0.Aux)
  5082  		ptr := v_0.Args[0]
  5083  		mem := v_1
  5084  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5085  			break
  5086  		}
  5087  		v.reset(OpARM64FMOVSload)
  5088  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5089  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5090  		v.AddArg2(ptr, mem)
  5091  		return true
  5092  	}
  5093  	return false
  5094  }
  5095  func rewriteValueARM64_OpARM64FMOVSloadidx(v *Value) bool {
  5096  	v_2 := v.Args[2]
  5097  	v_1 := v.Args[1]
  5098  	v_0 := v.Args[0]
  5099  	// match: (FMOVSloadidx ptr (MOVDconst [c]) mem)
  5100  	// cond: is32Bit(c)
  5101  	// result: (FMOVSload [int32(c)] ptr mem)
  5102  	for {
  5103  		ptr := v_0
  5104  		if v_1.Op != OpARM64MOVDconst {
  5105  			break
  5106  		}
  5107  		c := auxIntToInt64(v_1.AuxInt)
  5108  		mem := v_2
  5109  		if !(is32Bit(c)) {
  5110  			break
  5111  		}
  5112  		v.reset(OpARM64FMOVSload)
  5113  		v.AuxInt = int32ToAuxInt(int32(c))
  5114  		v.AddArg2(ptr, mem)
  5115  		return true
  5116  	}
  5117  	// match: (FMOVSloadidx (MOVDconst [c]) ptr mem)
  5118  	// cond: is32Bit(c)
  5119  	// result: (FMOVSload [int32(c)] ptr mem)
  5120  	for {
  5121  		if v_0.Op != OpARM64MOVDconst {
  5122  			break
  5123  		}
  5124  		c := auxIntToInt64(v_0.AuxInt)
  5125  		ptr := v_1
  5126  		mem := v_2
  5127  		if !(is32Bit(c)) {
  5128  			break
  5129  		}
  5130  		v.reset(OpARM64FMOVSload)
  5131  		v.AuxInt = int32ToAuxInt(int32(c))
  5132  		v.AddArg2(ptr, mem)
  5133  		return true
  5134  	}
  5135  	// match: (FMOVSloadidx ptr (SLLconst [2] idx) mem)
  5136  	// result: (FMOVSloadidx4 ptr idx mem)
  5137  	for {
  5138  		ptr := v_0
  5139  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
  5140  			break
  5141  		}
  5142  		idx := v_1.Args[0]
  5143  		mem := v_2
  5144  		v.reset(OpARM64FMOVSloadidx4)
  5145  		v.AddArg3(ptr, idx, mem)
  5146  		return true
  5147  	}
  5148  	// match: (FMOVSloadidx (SLLconst [2] idx) ptr mem)
  5149  	// result: (FMOVSloadidx4 ptr idx mem)
  5150  	for {
  5151  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
  5152  			break
  5153  		}
  5154  		idx := v_0.Args[0]
  5155  		ptr := v_1
  5156  		mem := v_2
  5157  		v.reset(OpARM64FMOVSloadidx4)
  5158  		v.AddArg3(ptr, idx, mem)
  5159  		return true
  5160  	}
  5161  	return false
  5162  }
  5163  func rewriteValueARM64_OpARM64FMOVSloadidx4(v *Value) bool {
  5164  	v_2 := v.Args[2]
  5165  	v_1 := v.Args[1]
  5166  	v_0 := v.Args[0]
  5167  	// match: (FMOVSloadidx4 ptr (MOVDconst [c]) mem)
  5168  	// cond: is32Bit(c<<2)
  5169  	// result: (FMOVSload ptr [int32(c)<<2] mem)
  5170  	for {
  5171  		ptr := v_0
  5172  		if v_1.Op != OpARM64MOVDconst {
  5173  			break
  5174  		}
  5175  		c := auxIntToInt64(v_1.AuxInt)
  5176  		mem := v_2
  5177  		if !(is32Bit(c << 2)) {
  5178  			break
  5179  		}
  5180  		v.reset(OpARM64FMOVSload)
  5181  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
  5182  		v.AddArg2(ptr, mem)
  5183  		return true
  5184  	}
  5185  	return false
  5186  }
  5187  func rewriteValueARM64_OpARM64FMOVSstore(v *Value) bool {
  5188  	v_2 := v.Args[2]
  5189  	v_1 := v.Args[1]
  5190  	v_0 := v.Args[0]
  5191  	b := v.Block
  5192  	config := b.Func.Config
  5193  	// match: (FMOVSstore [off] {sym} ptr (FMOVSgpfp val) mem)
  5194  	// result: (MOVWstore [off] {sym} ptr val mem)
  5195  	for {
  5196  		off := auxIntToInt32(v.AuxInt)
  5197  		sym := auxToSym(v.Aux)
  5198  		ptr := v_0
  5199  		if v_1.Op != OpARM64FMOVSgpfp {
  5200  			break
  5201  		}
  5202  		val := v_1.Args[0]
  5203  		mem := v_2
  5204  		v.reset(OpARM64MOVWstore)
  5205  		v.AuxInt = int32ToAuxInt(off)
  5206  		v.Aux = symToAux(sym)
  5207  		v.AddArg3(ptr, val, mem)
  5208  		return true
  5209  	}
  5210  	// match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5211  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5212  	// result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
  5213  	for {
  5214  		off1 := auxIntToInt32(v.AuxInt)
  5215  		sym := auxToSym(v.Aux)
  5216  		if v_0.Op != OpARM64ADDconst {
  5217  			break
  5218  		}
  5219  		off2 := auxIntToInt64(v_0.AuxInt)
  5220  		ptr := v_0.Args[0]
  5221  		val := v_1
  5222  		mem := v_2
  5223  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5224  			break
  5225  		}
  5226  		v.reset(OpARM64FMOVSstore)
  5227  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5228  		v.Aux = symToAux(sym)
  5229  		v.AddArg3(ptr, val, mem)
  5230  		return true
  5231  	}
  5232  	// match: (FMOVSstore [off] {sym} (ADD ptr idx) val mem)
  5233  	// cond: off == 0 && sym == nil
  5234  	// result: (FMOVSstoreidx ptr idx val mem)
  5235  	for {
  5236  		off := auxIntToInt32(v.AuxInt)
  5237  		sym := auxToSym(v.Aux)
  5238  		if v_0.Op != OpARM64ADD {
  5239  			break
  5240  		}
  5241  		idx := v_0.Args[1]
  5242  		ptr := v_0.Args[0]
  5243  		val := v_1
  5244  		mem := v_2
  5245  		if !(off == 0 && sym == nil) {
  5246  			break
  5247  		}
  5248  		v.reset(OpARM64FMOVSstoreidx)
  5249  		v.AddArg4(ptr, idx, val, mem)
  5250  		return true
  5251  	}
  5252  	// match: (FMOVSstore [off] {sym} (ADDshiftLL [2] ptr idx) val mem)
  5253  	// cond: off == 0 && sym == nil
  5254  	// result: (FMOVSstoreidx4 ptr idx val mem)
  5255  	for {
  5256  		off := auxIntToInt32(v.AuxInt)
  5257  		sym := auxToSym(v.Aux)
  5258  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
  5259  			break
  5260  		}
  5261  		idx := v_0.Args[1]
  5262  		ptr := v_0.Args[0]
  5263  		val := v_1
  5264  		mem := v_2
  5265  		if !(off == 0 && sym == nil) {
  5266  			break
  5267  		}
  5268  		v.reset(OpARM64FMOVSstoreidx4)
  5269  		v.AddArg4(ptr, idx, val, mem)
  5270  		return true
  5271  	}
  5272  	// match: (FMOVSstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  5273  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  5274  	// result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5275  	for {
  5276  		off1 := auxIntToInt32(v.AuxInt)
  5277  		sym1 := auxToSym(v.Aux)
  5278  		if v_0.Op != OpARM64MOVDaddr {
  5279  			break
  5280  		}
  5281  		off2 := auxIntToInt32(v_0.AuxInt)
  5282  		sym2 := auxToSym(v_0.Aux)
  5283  		ptr := v_0.Args[0]
  5284  		val := v_1
  5285  		mem := v_2
  5286  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  5287  			break
  5288  		}
  5289  		v.reset(OpARM64FMOVSstore)
  5290  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5291  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5292  		v.AddArg3(ptr, val, mem)
  5293  		return true
  5294  	}
  5295  	return false
  5296  }
  5297  func rewriteValueARM64_OpARM64FMOVSstoreidx(v *Value) bool {
  5298  	v_3 := v.Args[3]
  5299  	v_2 := v.Args[2]
  5300  	v_1 := v.Args[1]
  5301  	v_0 := v.Args[0]
  5302  	// match: (FMOVSstoreidx ptr (MOVDconst [c]) val mem)
  5303  	// cond: is32Bit(c)
  5304  	// result: (FMOVSstore [int32(c)] ptr val mem)
  5305  	for {
  5306  		ptr := v_0
  5307  		if v_1.Op != OpARM64MOVDconst {
  5308  			break
  5309  		}
  5310  		c := auxIntToInt64(v_1.AuxInt)
  5311  		val := v_2
  5312  		mem := v_3
  5313  		if !(is32Bit(c)) {
  5314  			break
  5315  		}
  5316  		v.reset(OpARM64FMOVSstore)
  5317  		v.AuxInt = int32ToAuxInt(int32(c))
  5318  		v.AddArg3(ptr, val, mem)
  5319  		return true
  5320  	}
  5321  	// match: (FMOVSstoreidx (MOVDconst [c]) idx val mem)
  5322  	// cond: is32Bit(c)
  5323  	// result: (FMOVSstore [int32(c)] idx val mem)
  5324  	for {
  5325  		if v_0.Op != OpARM64MOVDconst {
  5326  			break
  5327  		}
  5328  		c := auxIntToInt64(v_0.AuxInt)
  5329  		idx := v_1
  5330  		val := v_2
  5331  		mem := v_3
  5332  		if !(is32Bit(c)) {
  5333  			break
  5334  		}
  5335  		v.reset(OpARM64FMOVSstore)
  5336  		v.AuxInt = int32ToAuxInt(int32(c))
  5337  		v.AddArg3(idx, val, mem)
  5338  		return true
  5339  	}
  5340  	// match: (FMOVSstoreidx ptr (SLLconst [2] idx) val mem)
  5341  	// result: (FMOVSstoreidx4 ptr idx val mem)
  5342  	for {
  5343  		ptr := v_0
  5344  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
  5345  			break
  5346  		}
  5347  		idx := v_1.Args[0]
  5348  		val := v_2
  5349  		mem := v_3
  5350  		v.reset(OpARM64FMOVSstoreidx4)
  5351  		v.AddArg4(ptr, idx, val, mem)
  5352  		return true
  5353  	}
  5354  	// match: (FMOVSstoreidx (SLLconst [2] idx) ptr val mem)
  5355  	// result: (FMOVSstoreidx4 ptr idx val mem)
  5356  	for {
  5357  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
  5358  			break
  5359  		}
  5360  		idx := v_0.Args[0]
  5361  		ptr := v_1
  5362  		val := v_2
  5363  		mem := v_3
  5364  		v.reset(OpARM64FMOVSstoreidx4)
  5365  		v.AddArg4(ptr, idx, val, mem)
  5366  		return true
  5367  	}
  5368  	return false
  5369  }
  5370  func rewriteValueARM64_OpARM64FMOVSstoreidx4(v *Value) bool {
  5371  	v_3 := v.Args[3]
  5372  	v_2 := v.Args[2]
  5373  	v_1 := v.Args[1]
  5374  	v_0 := v.Args[0]
  5375  	// match: (FMOVSstoreidx4 ptr (MOVDconst [c]) val mem)
  5376  	// cond: is32Bit(c<<2)
  5377  	// result: (FMOVSstore [int32(c)<<2] ptr val mem)
  5378  	for {
  5379  		ptr := v_0
  5380  		if v_1.Op != OpARM64MOVDconst {
  5381  			break
  5382  		}
  5383  		c := auxIntToInt64(v_1.AuxInt)
  5384  		val := v_2
  5385  		mem := v_3
  5386  		if !(is32Bit(c << 2)) {
  5387  			break
  5388  		}
  5389  		v.reset(OpARM64FMOVSstore)
  5390  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
  5391  		v.AddArg3(ptr, val, mem)
  5392  		return true
  5393  	}
  5394  	return false
  5395  }
  5396  func rewriteValueARM64_OpARM64FMULD(v *Value) bool {
  5397  	v_1 := v.Args[1]
  5398  	v_0 := v.Args[0]
  5399  	// match: (FMULD (FNEGD x) y)
  5400  	// result: (FNMULD x y)
  5401  	for {
  5402  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5403  			if v_0.Op != OpARM64FNEGD {
  5404  				continue
  5405  			}
  5406  			x := v_0.Args[0]
  5407  			y := v_1
  5408  			v.reset(OpARM64FNMULD)
  5409  			v.AddArg2(x, y)
  5410  			return true
  5411  		}
  5412  		break
  5413  	}
  5414  	return false
  5415  }
  5416  func rewriteValueARM64_OpARM64FMULS(v *Value) bool {
  5417  	v_1 := v.Args[1]
  5418  	v_0 := v.Args[0]
  5419  	// match: (FMULS (FNEGS x) y)
  5420  	// result: (FNMULS x y)
  5421  	for {
  5422  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5423  			if v_0.Op != OpARM64FNEGS {
  5424  				continue
  5425  			}
  5426  			x := v_0.Args[0]
  5427  			y := v_1
  5428  			v.reset(OpARM64FNMULS)
  5429  			v.AddArg2(x, y)
  5430  			return true
  5431  		}
  5432  		break
  5433  	}
  5434  	return false
  5435  }
  5436  func rewriteValueARM64_OpARM64FNEGD(v *Value) bool {
  5437  	v_0 := v.Args[0]
  5438  	// match: (FNEGD (FMULD x y))
  5439  	// result: (FNMULD x y)
  5440  	for {
  5441  		if v_0.Op != OpARM64FMULD {
  5442  			break
  5443  		}
  5444  		y := v_0.Args[1]
  5445  		x := v_0.Args[0]
  5446  		v.reset(OpARM64FNMULD)
  5447  		v.AddArg2(x, y)
  5448  		return true
  5449  	}
  5450  	// match: (FNEGD (FNMULD x y))
  5451  	// result: (FMULD x y)
  5452  	for {
  5453  		if v_0.Op != OpARM64FNMULD {
  5454  			break
  5455  		}
  5456  		y := v_0.Args[1]
  5457  		x := v_0.Args[0]
  5458  		v.reset(OpARM64FMULD)
  5459  		v.AddArg2(x, y)
  5460  		return true
  5461  	}
  5462  	return false
  5463  }
  5464  func rewriteValueARM64_OpARM64FNEGS(v *Value) bool {
  5465  	v_0 := v.Args[0]
  5466  	// match: (FNEGS (FMULS x y))
  5467  	// result: (FNMULS x y)
  5468  	for {
  5469  		if v_0.Op != OpARM64FMULS {
  5470  			break
  5471  		}
  5472  		y := v_0.Args[1]
  5473  		x := v_0.Args[0]
  5474  		v.reset(OpARM64FNMULS)
  5475  		v.AddArg2(x, y)
  5476  		return true
  5477  	}
  5478  	// match: (FNEGS (FNMULS x y))
  5479  	// result: (FMULS x y)
  5480  	for {
  5481  		if v_0.Op != OpARM64FNMULS {
  5482  			break
  5483  		}
  5484  		y := v_0.Args[1]
  5485  		x := v_0.Args[0]
  5486  		v.reset(OpARM64FMULS)
  5487  		v.AddArg2(x, y)
  5488  		return true
  5489  	}
  5490  	return false
  5491  }
  5492  func rewriteValueARM64_OpARM64FNMULD(v *Value) bool {
  5493  	v_1 := v.Args[1]
  5494  	v_0 := v.Args[0]
  5495  	// match: (FNMULD (FNEGD x) y)
  5496  	// result: (FMULD x y)
  5497  	for {
  5498  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5499  			if v_0.Op != OpARM64FNEGD {
  5500  				continue
  5501  			}
  5502  			x := v_0.Args[0]
  5503  			y := v_1
  5504  			v.reset(OpARM64FMULD)
  5505  			v.AddArg2(x, y)
  5506  			return true
  5507  		}
  5508  		break
  5509  	}
  5510  	return false
  5511  }
  5512  func rewriteValueARM64_OpARM64FNMULS(v *Value) bool {
  5513  	v_1 := v.Args[1]
  5514  	v_0 := v.Args[0]
  5515  	// match: (FNMULS (FNEGS x) y)
  5516  	// result: (FMULS x y)
  5517  	for {
  5518  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5519  			if v_0.Op != OpARM64FNEGS {
  5520  				continue
  5521  			}
  5522  			x := v_0.Args[0]
  5523  			y := v_1
  5524  			v.reset(OpARM64FMULS)
  5525  			v.AddArg2(x, y)
  5526  			return true
  5527  		}
  5528  		break
  5529  	}
  5530  	return false
  5531  }
  5532  func rewriteValueARM64_OpARM64FSUBD(v *Value) bool {
  5533  	v_1 := v.Args[1]
  5534  	v_0 := v.Args[0]
  5535  	// match: (FSUBD a (FMULD x y))
  5536  	// cond: a.Block.Func.useFMA(v)
  5537  	// result: (FMSUBD a x y)
  5538  	for {
  5539  		a := v_0
  5540  		if v_1.Op != OpARM64FMULD {
  5541  			break
  5542  		}
  5543  		y := v_1.Args[1]
  5544  		x := v_1.Args[0]
  5545  		if !(a.Block.Func.useFMA(v)) {
  5546  			break
  5547  		}
  5548  		v.reset(OpARM64FMSUBD)
  5549  		v.AddArg3(a, x, y)
  5550  		return true
  5551  	}
  5552  	// match: (FSUBD (FMULD x y) a)
  5553  	// cond: a.Block.Func.useFMA(v)
  5554  	// result: (FNMSUBD a x y)
  5555  	for {
  5556  		if v_0.Op != OpARM64FMULD {
  5557  			break
  5558  		}
  5559  		y := v_0.Args[1]
  5560  		x := v_0.Args[0]
  5561  		a := v_1
  5562  		if !(a.Block.Func.useFMA(v)) {
  5563  			break
  5564  		}
  5565  		v.reset(OpARM64FNMSUBD)
  5566  		v.AddArg3(a, x, y)
  5567  		return true
  5568  	}
  5569  	// match: (FSUBD a (FNMULD x y))
  5570  	// cond: a.Block.Func.useFMA(v)
  5571  	// result: (FMADDD a x y)
  5572  	for {
  5573  		a := v_0
  5574  		if v_1.Op != OpARM64FNMULD {
  5575  			break
  5576  		}
  5577  		y := v_1.Args[1]
  5578  		x := v_1.Args[0]
  5579  		if !(a.Block.Func.useFMA(v)) {
  5580  			break
  5581  		}
  5582  		v.reset(OpARM64FMADDD)
  5583  		v.AddArg3(a, x, y)
  5584  		return true
  5585  	}
  5586  	// match: (FSUBD (FNMULD x y) a)
  5587  	// cond: a.Block.Func.useFMA(v)
  5588  	// result: (FNMADDD a x y)
  5589  	for {
  5590  		if v_0.Op != OpARM64FNMULD {
  5591  			break
  5592  		}
  5593  		y := v_0.Args[1]
  5594  		x := v_0.Args[0]
  5595  		a := v_1
  5596  		if !(a.Block.Func.useFMA(v)) {
  5597  			break
  5598  		}
  5599  		v.reset(OpARM64FNMADDD)
  5600  		v.AddArg3(a, x, y)
  5601  		return true
  5602  	}
  5603  	return false
  5604  }
  5605  func rewriteValueARM64_OpARM64FSUBS(v *Value) bool {
  5606  	v_1 := v.Args[1]
  5607  	v_0 := v.Args[0]
  5608  	// match: (FSUBS a (FMULS x y))
  5609  	// cond: a.Block.Func.useFMA(v)
  5610  	// result: (FMSUBS a x y)
  5611  	for {
  5612  		a := v_0
  5613  		if v_1.Op != OpARM64FMULS {
  5614  			break
  5615  		}
  5616  		y := v_1.Args[1]
  5617  		x := v_1.Args[0]
  5618  		if !(a.Block.Func.useFMA(v)) {
  5619  			break
  5620  		}
  5621  		v.reset(OpARM64FMSUBS)
  5622  		v.AddArg3(a, x, y)
  5623  		return true
  5624  	}
  5625  	// match: (FSUBS (FMULS x y) a)
  5626  	// cond: a.Block.Func.useFMA(v)
  5627  	// result: (FNMSUBS a x y)
  5628  	for {
  5629  		if v_0.Op != OpARM64FMULS {
  5630  			break
  5631  		}
  5632  		y := v_0.Args[1]
  5633  		x := v_0.Args[0]
  5634  		a := v_1
  5635  		if !(a.Block.Func.useFMA(v)) {
  5636  			break
  5637  		}
  5638  		v.reset(OpARM64FNMSUBS)
  5639  		v.AddArg3(a, x, y)
  5640  		return true
  5641  	}
  5642  	// match: (FSUBS a (FNMULS x y))
  5643  	// cond: a.Block.Func.useFMA(v)
  5644  	// result: (FMADDS a x y)
  5645  	for {
  5646  		a := v_0
  5647  		if v_1.Op != OpARM64FNMULS {
  5648  			break
  5649  		}
  5650  		y := v_1.Args[1]
  5651  		x := v_1.Args[0]
  5652  		if !(a.Block.Func.useFMA(v)) {
  5653  			break
  5654  		}
  5655  		v.reset(OpARM64FMADDS)
  5656  		v.AddArg3(a, x, y)
  5657  		return true
  5658  	}
  5659  	// match: (FSUBS (FNMULS x y) a)
  5660  	// cond: a.Block.Func.useFMA(v)
  5661  	// result: (FNMADDS a x y)
  5662  	for {
  5663  		if v_0.Op != OpARM64FNMULS {
  5664  			break
  5665  		}
  5666  		y := v_0.Args[1]
  5667  		x := v_0.Args[0]
  5668  		a := v_1
  5669  		if !(a.Block.Func.useFMA(v)) {
  5670  			break
  5671  		}
  5672  		v.reset(OpARM64FNMADDS)
  5673  		v.AddArg3(a, x, y)
  5674  		return true
  5675  	}
  5676  	return false
  5677  }
  5678  func rewriteValueARM64_OpARM64GreaterEqual(v *Value) bool {
  5679  	v_0 := v.Args[0]
  5680  	b := v.Block
  5681  	// match: (GreaterEqual (CMPconst [0] z:(AND x y)))
  5682  	// cond: z.Uses == 1
  5683  	// result: (GreaterEqual (TST x y))
  5684  	for {
  5685  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  5686  			break
  5687  		}
  5688  		z := v_0.Args[0]
  5689  		if z.Op != OpARM64AND {
  5690  			break
  5691  		}
  5692  		y := z.Args[1]
  5693  		x := z.Args[0]
  5694  		if !(z.Uses == 1) {
  5695  			break
  5696  		}
  5697  		v.reset(OpARM64GreaterEqual)
  5698  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  5699  		v0.AddArg2(x, y)
  5700  		v.AddArg(v0)
  5701  		return true
  5702  	}
  5703  	// match: (GreaterEqual (CMPWconst [0] x:(ANDconst [c] y)))
  5704  	// cond: x.Uses == 1
  5705  	// result: (GreaterEqual (TSTWconst [int32(c)] y))
  5706  	for {
  5707  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5708  			break
  5709  		}
  5710  		x := v_0.Args[0]
  5711  		if x.Op != OpARM64ANDconst {
  5712  			break
  5713  		}
  5714  		c := auxIntToInt64(x.AuxInt)
  5715  		y := x.Args[0]
  5716  		if !(x.Uses == 1) {
  5717  			break
  5718  		}
  5719  		v.reset(OpARM64GreaterEqual)
  5720  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  5721  		v0.AuxInt = int32ToAuxInt(int32(c))
  5722  		v0.AddArg(y)
  5723  		v.AddArg(v0)
  5724  		return true
  5725  	}
  5726  	// match: (GreaterEqual (CMPWconst [0] z:(AND x y)))
  5727  	// cond: z.Uses == 1
  5728  	// result: (GreaterEqual (TSTW x y))
  5729  	for {
  5730  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5731  			break
  5732  		}
  5733  		z := v_0.Args[0]
  5734  		if z.Op != OpARM64AND {
  5735  			break
  5736  		}
  5737  		y := z.Args[1]
  5738  		x := z.Args[0]
  5739  		if !(z.Uses == 1) {
  5740  			break
  5741  		}
  5742  		v.reset(OpARM64GreaterEqual)
  5743  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  5744  		v0.AddArg2(x, y)
  5745  		v.AddArg(v0)
  5746  		return true
  5747  	}
  5748  	// match: (GreaterEqual (CMPconst [0] x:(ANDconst [c] y)))
  5749  	// cond: x.Uses == 1
  5750  	// result: (GreaterEqual (TSTconst [c] y))
  5751  	for {
  5752  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  5753  			break
  5754  		}
  5755  		x := v_0.Args[0]
  5756  		if x.Op != OpARM64ANDconst {
  5757  			break
  5758  		}
  5759  		c := auxIntToInt64(x.AuxInt)
  5760  		y := x.Args[0]
  5761  		if !(x.Uses == 1) {
  5762  			break
  5763  		}
  5764  		v.reset(OpARM64GreaterEqual)
  5765  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  5766  		v0.AuxInt = int64ToAuxInt(c)
  5767  		v0.AddArg(y)
  5768  		v.AddArg(v0)
  5769  		return true
  5770  	}
  5771  	// match: (GreaterEqual (CMPconst [0] x:(ADDconst [c] y)))
  5772  	// cond: x.Uses == 1
  5773  	// result: (GreaterEqualNoov (CMNconst [c] y))
  5774  	for {
  5775  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  5776  			break
  5777  		}
  5778  		x := v_0.Args[0]
  5779  		if x.Op != OpARM64ADDconst {
  5780  			break
  5781  		}
  5782  		c := auxIntToInt64(x.AuxInt)
  5783  		y := x.Args[0]
  5784  		if !(x.Uses == 1) {
  5785  			break
  5786  		}
  5787  		v.reset(OpARM64GreaterEqualNoov)
  5788  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
  5789  		v0.AuxInt = int64ToAuxInt(c)
  5790  		v0.AddArg(y)
  5791  		v.AddArg(v0)
  5792  		return true
  5793  	}
  5794  	// match: (GreaterEqual (CMPWconst [0] x:(ADDconst [c] y)))
  5795  	// cond: x.Uses == 1
  5796  	// result: (GreaterEqualNoov (CMNWconst [int32(c)] y))
  5797  	for {
  5798  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5799  			break
  5800  		}
  5801  		x := v_0.Args[0]
  5802  		if x.Op != OpARM64ADDconst {
  5803  			break
  5804  		}
  5805  		c := auxIntToInt64(x.AuxInt)
  5806  		y := x.Args[0]
  5807  		if !(x.Uses == 1) {
  5808  			break
  5809  		}
  5810  		v.reset(OpARM64GreaterEqualNoov)
  5811  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
  5812  		v0.AuxInt = int32ToAuxInt(int32(c))
  5813  		v0.AddArg(y)
  5814  		v.AddArg(v0)
  5815  		return true
  5816  	}
  5817  	// match: (GreaterEqual (CMPconst [0] z:(ADD x y)))
  5818  	// cond: z.Uses == 1
  5819  	// result: (GreaterEqualNoov (CMN x y))
  5820  	for {
  5821  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  5822  			break
  5823  		}
  5824  		z := v_0.Args[0]
  5825  		if z.Op != OpARM64ADD {
  5826  			break
  5827  		}
  5828  		y := z.Args[1]
  5829  		x := z.Args[0]
  5830  		if !(z.Uses == 1) {
  5831  			break
  5832  		}
  5833  		v.reset(OpARM64GreaterEqualNoov)
  5834  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  5835  		v0.AddArg2(x, y)
  5836  		v.AddArg(v0)
  5837  		return true
  5838  	}
  5839  	// match: (GreaterEqual (CMPWconst [0] z:(ADD x y)))
  5840  	// cond: z.Uses == 1
  5841  	// result: (GreaterEqualNoov (CMNW x y))
  5842  	for {
  5843  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5844  			break
  5845  		}
  5846  		z := v_0.Args[0]
  5847  		if z.Op != OpARM64ADD {
  5848  			break
  5849  		}
  5850  		y := z.Args[1]
  5851  		x := z.Args[0]
  5852  		if !(z.Uses == 1) {
  5853  			break
  5854  		}
  5855  		v.reset(OpARM64GreaterEqualNoov)
  5856  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  5857  		v0.AddArg2(x, y)
  5858  		v.AddArg(v0)
  5859  		return true
  5860  	}
  5861  	// match: (GreaterEqual (CMPconst [0] z:(MADD a x y)))
  5862  	// cond: z.Uses == 1
  5863  	// result: (GreaterEqualNoov (CMN a (MUL <x.Type> x y)))
  5864  	for {
  5865  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  5866  			break
  5867  		}
  5868  		z := v_0.Args[0]
  5869  		if z.Op != OpARM64MADD {
  5870  			break
  5871  		}
  5872  		y := z.Args[2]
  5873  		a := z.Args[0]
  5874  		x := z.Args[1]
  5875  		if !(z.Uses == 1) {
  5876  			break
  5877  		}
  5878  		v.reset(OpARM64GreaterEqualNoov)
  5879  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  5880  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  5881  		v1.AddArg2(x, y)
  5882  		v0.AddArg2(a, v1)
  5883  		v.AddArg(v0)
  5884  		return true
  5885  	}
  5886  	// match: (GreaterEqual (CMPconst [0] z:(MSUB a x y)))
  5887  	// cond: z.Uses == 1
  5888  	// result: (GreaterEqualNoov (CMP a (MUL <x.Type> x y)))
  5889  	for {
  5890  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  5891  			break
  5892  		}
  5893  		z := v_0.Args[0]
  5894  		if z.Op != OpARM64MSUB {
  5895  			break
  5896  		}
  5897  		y := z.Args[2]
  5898  		a := z.Args[0]
  5899  		x := z.Args[1]
  5900  		if !(z.Uses == 1) {
  5901  			break
  5902  		}
  5903  		v.reset(OpARM64GreaterEqualNoov)
  5904  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  5905  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  5906  		v1.AddArg2(x, y)
  5907  		v0.AddArg2(a, v1)
  5908  		v.AddArg(v0)
  5909  		return true
  5910  	}
  5911  	// match: (GreaterEqual (CMPWconst [0] z:(MADDW a x y)))
  5912  	// cond: z.Uses == 1
  5913  	// result: (GreaterEqualNoov (CMNW a (MULW <x.Type> x y)))
  5914  	for {
  5915  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5916  			break
  5917  		}
  5918  		z := v_0.Args[0]
  5919  		if z.Op != OpARM64MADDW {
  5920  			break
  5921  		}
  5922  		y := z.Args[2]
  5923  		a := z.Args[0]
  5924  		x := z.Args[1]
  5925  		if !(z.Uses == 1) {
  5926  			break
  5927  		}
  5928  		v.reset(OpARM64GreaterEqualNoov)
  5929  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  5930  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  5931  		v1.AddArg2(x, y)
  5932  		v0.AddArg2(a, v1)
  5933  		v.AddArg(v0)
  5934  		return true
  5935  	}
  5936  	// match: (GreaterEqual (CMPWconst [0] z:(MSUBW a x y)))
  5937  	// cond: z.Uses == 1
  5938  	// result: (GreaterEqualNoov (CMPW a (MULW <x.Type> x y)))
  5939  	for {
  5940  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  5941  			break
  5942  		}
  5943  		z := v_0.Args[0]
  5944  		if z.Op != OpARM64MSUBW {
  5945  			break
  5946  		}
  5947  		y := z.Args[2]
  5948  		a := z.Args[0]
  5949  		x := z.Args[1]
  5950  		if !(z.Uses == 1) {
  5951  			break
  5952  		}
  5953  		v.reset(OpARM64GreaterEqualNoov)
  5954  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  5955  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  5956  		v1.AddArg2(x, y)
  5957  		v0.AddArg2(a, v1)
  5958  		v.AddArg(v0)
  5959  		return true
  5960  	}
  5961  	// match: (GreaterEqual (FlagConstant [fc]))
  5962  	// result: (MOVDconst [b2i(fc.ge())])
  5963  	for {
  5964  		if v_0.Op != OpARM64FlagConstant {
  5965  			break
  5966  		}
  5967  		fc := auxIntToFlagConstant(v_0.AuxInt)
  5968  		v.reset(OpARM64MOVDconst)
  5969  		v.AuxInt = int64ToAuxInt(b2i(fc.ge()))
  5970  		return true
  5971  	}
  5972  	// match: (GreaterEqual (InvertFlags x))
  5973  	// result: (LessEqual x)
  5974  	for {
  5975  		if v_0.Op != OpARM64InvertFlags {
  5976  			break
  5977  		}
  5978  		x := v_0.Args[0]
  5979  		v.reset(OpARM64LessEqual)
  5980  		v.AddArg(x)
  5981  		return true
  5982  	}
  5983  	return false
  5984  }
  5985  func rewriteValueARM64_OpARM64GreaterEqualF(v *Value) bool {
  5986  	v_0 := v.Args[0]
  5987  	// match: (GreaterEqualF (InvertFlags x))
  5988  	// result: (LessEqualF x)
  5989  	for {
  5990  		if v_0.Op != OpARM64InvertFlags {
  5991  			break
  5992  		}
  5993  		x := v_0.Args[0]
  5994  		v.reset(OpARM64LessEqualF)
  5995  		v.AddArg(x)
  5996  		return true
  5997  	}
  5998  	return false
  5999  }
  6000  func rewriteValueARM64_OpARM64GreaterEqualNoov(v *Value) bool {
  6001  	v_0 := v.Args[0]
  6002  	b := v.Block
  6003  	typ := &b.Func.Config.Types
  6004  	// match: (GreaterEqualNoov (InvertFlags x))
  6005  	// result: (CSINC [OpARM64NotEqual] (LessThanNoov <typ.Bool> x) (MOVDconst [0]) x)
  6006  	for {
  6007  		if v_0.Op != OpARM64InvertFlags {
  6008  			break
  6009  		}
  6010  		x := v_0.Args[0]
  6011  		v.reset(OpARM64CSINC)
  6012  		v.AuxInt = opToAuxInt(OpARM64NotEqual)
  6013  		v0 := b.NewValue0(v.Pos, OpARM64LessThanNoov, typ.Bool)
  6014  		v0.AddArg(x)
  6015  		v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
  6016  		v1.AuxInt = int64ToAuxInt(0)
  6017  		v.AddArg3(v0, v1, x)
  6018  		return true
  6019  	}
  6020  	return false
  6021  }
  6022  func rewriteValueARM64_OpARM64GreaterEqualU(v *Value) bool {
  6023  	v_0 := v.Args[0]
  6024  	// match: (GreaterEqualU (FlagConstant [fc]))
  6025  	// result: (MOVDconst [b2i(fc.uge())])
  6026  	for {
  6027  		if v_0.Op != OpARM64FlagConstant {
  6028  			break
  6029  		}
  6030  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6031  		v.reset(OpARM64MOVDconst)
  6032  		v.AuxInt = int64ToAuxInt(b2i(fc.uge()))
  6033  		return true
  6034  	}
  6035  	// match: (GreaterEqualU (InvertFlags x))
  6036  	// result: (LessEqualU x)
  6037  	for {
  6038  		if v_0.Op != OpARM64InvertFlags {
  6039  			break
  6040  		}
  6041  		x := v_0.Args[0]
  6042  		v.reset(OpARM64LessEqualU)
  6043  		v.AddArg(x)
  6044  		return true
  6045  	}
  6046  	return false
  6047  }
  6048  func rewriteValueARM64_OpARM64GreaterThan(v *Value) bool {
  6049  	v_0 := v.Args[0]
  6050  	b := v.Block
  6051  	// match: (GreaterThan (CMPconst [0] z:(AND x y)))
  6052  	// cond: z.Uses == 1
  6053  	// result: (GreaterThan (TST x y))
  6054  	for {
  6055  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6056  			break
  6057  		}
  6058  		z := v_0.Args[0]
  6059  		if z.Op != OpARM64AND {
  6060  			break
  6061  		}
  6062  		y := z.Args[1]
  6063  		x := z.Args[0]
  6064  		if !(z.Uses == 1) {
  6065  			break
  6066  		}
  6067  		v.reset(OpARM64GreaterThan)
  6068  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  6069  		v0.AddArg2(x, y)
  6070  		v.AddArg(v0)
  6071  		return true
  6072  	}
  6073  	// match: (GreaterThan (CMPWconst [0] x:(ANDconst [c] y)))
  6074  	// cond: x.Uses == 1
  6075  	// result: (GreaterThan (TSTWconst [int32(c)] y))
  6076  	for {
  6077  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6078  			break
  6079  		}
  6080  		x := v_0.Args[0]
  6081  		if x.Op != OpARM64ANDconst {
  6082  			break
  6083  		}
  6084  		c := auxIntToInt64(x.AuxInt)
  6085  		y := x.Args[0]
  6086  		if !(x.Uses == 1) {
  6087  			break
  6088  		}
  6089  		v.reset(OpARM64GreaterThan)
  6090  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  6091  		v0.AuxInt = int32ToAuxInt(int32(c))
  6092  		v0.AddArg(y)
  6093  		v.AddArg(v0)
  6094  		return true
  6095  	}
  6096  	// match: (GreaterThan (CMPWconst [0] z:(AND x y)))
  6097  	// cond: z.Uses == 1
  6098  	// result: (GreaterThan (TSTW x y))
  6099  	for {
  6100  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6101  			break
  6102  		}
  6103  		z := v_0.Args[0]
  6104  		if z.Op != OpARM64AND {
  6105  			break
  6106  		}
  6107  		y := z.Args[1]
  6108  		x := z.Args[0]
  6109  		if !(z.Uses == 1) {
  6110  			break
  6111  		}
  6112  		v.reset(OpARM64GreaterThan)
  6113  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  6114  		v0.AddArg2(x, y)
  6115  		v.AddArg(v0)
  6116  		return true
  6117  	}
  6118  	// match: (GreaterThan (CMPconst [0] x:(ANDconst [c] y)))
  6119  	// cond: x.Uses == 1
  6120  	// result: (GreaterThan (TSTconst [c] y))
  6121  	for {
  6122  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6123  			break
  6124  		}
  6125  		x := v_0.Args[0]
  6126  		if x.Op != OpARM64ANDconst {
  6127  			break
  6128  		}
  6129  		c := auxIntToInt64(x.AuxInt)
  6130  		y := x.Args[0]
  6131  		if !(x.Uses == 1) {
  6132  			break
  6133  		}
  6134  		v.reset(OpARM64GreaterThan)
  6135  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  6136  		v0.AuxInt = int64ToAuxInt(c)
  6137  		v0.AddArg(y)
  6138  		v.AddArg(v0)
  6139  		return true
  6140  	}
  6141  	// match: (GreaterThan (FlagConstant [fc]))
  6142  	// result: (MOVDconst [b2i(fc.gt())])
  6143  	for {
  6144  		if v_0.Op != OpARM64FlagConstant {
  6145  			break
  6146  		}
  6147  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6148  		v.reset(OpARM64MOVDconst)
  6149  		v.AuxInt = int64ToAuxInt(b2i(fc.gt()))
  6150  		return true
  6151  	}
  6152  	// match: (GreaterThan (InvertFlags x))
  6153  	// result: (LessThan x)
  6154  	for {
  6155  		if v_0.Op != OpARM64InvertFlags {
  6156  			break
  6157  		}
  6158  		x := v_0.Args[0]
  6159  		v.reset(OpARM64LessThan)
  6160  		v.AddArg(x)
  6161  		return true
  6162  	}
  6163  	return false
  6164  }
  6165  func rewriteValueARM64_OpARM64GreaterThanF(v *Value) bool {
  6166  	v_0 := v.Args[0]
  6167  	// match: (GreaterThanF (InvertFlags x))
  6168  	// result: (LessThanF x)
  6169  	for {
  6170  		if v_0.Op != OpARM64InvertFlags {
  6171  			break
  6172  		}
  6173  		x := v_0.Args[0]
  6174  		v.reset(OpARM64LessThanF)
  6175  		v.AddArg(x)
  6176  		return true
  6177  	}
  6178  	return false
  6179  }
  6180  func rewriteValueARM64_OpARM64GreaterThanU(v *Value) bool {
  6181  	v_0 := v.Args[0]
  6182  	// match: (GreaterThanU (FlagConstant [fc]))
  6183  	// result: (MOVDconst [b2i(fc.ugt())])
  6184  	for {
  6185  		if v_0.Op != OpARM64FlagConstant {
  6186  			break
  6187  		}
  6188  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6189  		v.reset(OpARM64MOVDconst)
  6190  		v.AuxInt = int64ToAuxInt(b2i(fc.ugt()))
  6191  		return true
  6192  	}
  6193  	// match: (GreaterThanU (InvertFlags x))
  6194  	// result: (LessThanU x)
  6195  	for {
  6196  		if v_0.Op != OpARM64InvertFlags {
  6197  			break
  6198  		}
  6199  		x := v_0.Args[0]
  6200  		v.reset(OpARM64LessThanU)
  6201  		v.AddArg(x)
  6202  		return true
  6203  	}
  6204  	return false
  6205  }
  6206  func rewriteValueARM64_OpARM64LDP(v *Value) bool {
  6207  	v_1 := v.Args[1]
  6208  	v_0 := v.Args[0]
  6209  	b := v.Block
  6210  	config := b.Func.Config
  6211  	// match: (LDP [off1] {sym} (ADDconst [off2] ptr) mem)
  6212  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  6213  	// result: (LDP [off1+int32(off2)] {sym} ptr mem)
  6214  	for {
  6215  		off1 := auxIntToInt32(v.AuxInt)
  6216  		sym := auxToSym(v.Aux)
  6217  		if v_0.Op != OpARM64ADDconst {
  6218  			break
  6219  		}
  6220  		off2 := auxIntToInt64(v_0.AuxInt)
  6221  		ptr := v_0.Args[0]
  6222  		mem := v_1
  6223  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  6224  			break
  6225  		}
  6226  		v.reset(OpARM64LDP)
  6227  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6228  		v.Aux = symToAux(sym)
  6229  		v.AddArg2(ptr, mem)
  6230  		return true
  6231  	}
  6232  	// match: (LDP [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  6233  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  6234  	// result: (LDP [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6235  	for {
  6236  		off1 := auxIntToInt32(v.AuxInt)
  6237  		sym1 := auxToSym(v.Aux)
  6238  		if v_0.Op != OpARM64MOVDaddr {
  6239  			break
  6240  		}
  6241  		off2 := auxIntToInt32(v_0.AuxInt)
  6242  		sym2 := auxToSym(v_0.Aux)
  6243  		ptr := v_0.Args[0]
  6244  		mem := v_1
  6245  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  6246  			break
  6247  		}
  6248  		v.reset(OpARM64LDP)
  6249  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6250  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6251  		v.AddArg2(ptr, mem)
  6252  		return true
  6253  	}
  6254  	return false
  6255  }
  6256  func rewriteValueARM64_OpARM64LessEqual(v *Value) bool {
  6257  	v_0 := v.Args[0]
  6258  	b := v.Block
  6259  	// match: (LessEqual (CMPconst [0] z:(AND x y)))
  6260  	// cond: z.Uses == 1
  6261  	// result: (LessEqual (TST x y))
  6262  	for {
  6263  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6264  			break
  6265  		}
  6266  		z := v_0.Args[0]
  6267  		if z.Op != OpARM64AND {
  6268  			break
  6269  		}
  6270  		y := z.Args[1]
  6271  		x := z.Args[0]
  6272  		if !(z.Uses == 1) {
  6273  			break
  6274  		}
  6275  		v.reset(OpARM64LessEqual)
  6276  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  6277  		v0.AddArg2(x, y)
  6278  		v.AddArg(v0)
  6279  		return true
  6280  	}
  6281  	// match: (LessEqual (CMPWconst [0] x:(ANDconst [c] y)))
  6282  	// cond: x.Uses == 1
  6283  	// result: (LessEqual (TSTWconst [int32(c)] y))
  6284  	for {
  6285  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6286  			break
  6287  		}
  6288  		x := v_0.Args[0]
  6289  		if x.Op != OpARM64ANDconst {
  6290  			break
  6291  		}
  6292  		c := auxIntToInt64(x.AuxInt)
  6293  		y := x.Args[0]
  6294  		if !(x.Uses == 1) {
  6295  			break
  6296  		}
  6297  		v.reset(OpARM64LessEqual)
  6298  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  6299  		v0.AuxInt = int32ToAuxInt(int32(c))
  6300  		v0.AddArg(y)
  6301  		v.AddArg(v0)
  6302  		return true
  6303  	}
  6304  	// match: (LessEqual (CMPWconst [0] z:(AND x y)))
  6305  	// cond: z.Uses == 1
  6306  	// result: (LessEqual (TSTW x y))
  6307  	for {
  6308  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6309  			break
  6310  		}
  6311  		z := v_0.Args[0]
  6312  		if z.Op != OpARM64AND {
  6313  			break
  6314  		}
  6315  		y := z.Args[1]
  6316  		x := z.Args[0]
  6317  		if !(z.Uses == 1) {
  6318  			break
  6319  		}
  6320  		v.reset(OpARM64LessEqual)
  6321  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  6322  		v0.AddArg2(x, y)
  6323  		v.AddArg(v0)
  6324  		return true
  6325  	}
  6326  	// match: (LessEqual (CMPconst [0] x:(ANDconst [c] y)))
  6327  	// cond: x.Uses == 1
  6328  	// result: (LessEqual (TSTconst [c] y))
  6329  	for {
  6330  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6331  			break
  6332  		}
  6333  		x := v_0.Args[0]
  6334  		if x.Op != OpARM64ANDconst {
  6335  			break
  6336  		}
  6337  		c := auxIntToInt64(x.AuxInt)
  6338  		y := x.Args[0]
  6339  		if !(x.Uses == 1) {
  6340  			break
  6341  		}
  6342  		v.reset(OpARM64LessEqual)
  6343  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  6344  		v0.AuxInt = int64ToAuxInt(c)
  6345  		v0.AddArg(y)
  6346  		v.AddArg(v0)
  6347  		return true
  6348  	}
  6349  	// match: (LessEqual (FlagConstant [fc]))
  6350  	// result: (MOVDconst [b2i(fc.le())])
  6351  	for {
  6352  		if v_0.Op != OpARM64FlagConstant {
  6353  			break
  6354  		}
  6355  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6356  		v.reset(OpARM64MOVDconst)
  6357  		v.AuxInt = int64ToAuxInt(b2i(fc.le()))
  6358  		return true
  6359  	}
  6360  	// match: (LessEqual (InvertFlags x))
  6361  	// result: (GreaterEqual x)
  6362  	for {
  6363  		if v_0.Op != OpARM64InvertFlags {
  6364  			break
  6365  		}
  6366  		x := v_0.Args[0]
  6367  		v.reset(OpARM64GreaterEqual)
  6368  		v.AddArg(x)
  6369  		return true
  6370  	}
  6371  	return false
  6372  }
  6373  func rewriteValueARM64_OpARM64LessEqualF(v *Value) bool {
  6374  	v_0 := v.Args[0]
  6375  	// match: (LessEqualF (InvertFlags x))
  6376  	// result: (GreaterEqualF x)
  6377  	for {
  6378  		if v_0.Op != OpARM64InvertFlags {
  6379  			break
  6380  		}
  6381  		x := v_0.Args[0]
  6382  		v.reset(OpARM64GreaterEqualF)
  6383  		v.AddArg(x)
  6384  		return true
  6385  	}
  6386  	return false
  6387  }
  6388  func rewriteValueARM64_OpARM64LessEqualU(v *Value) bool {
  6389  	v_0 := v.Args[0]
  6390  	// match: (LessEqualU (FlagConstant [fc]))
  6391  	// result: (MOVDconst [b2i(fc.ule())])
  6392  	for {
  6393  		if v_0.Op != OpARM64FlagConstant {
  6394  			break
  6395  		}
  6396  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6397  		v.reset(OpARM64MOVDconst)
  6398  		v.AuxInt = int64ToAuxInt(b2i(fc.ule()))
  6399  		return true
  6400  	}
  6401  	// match: (LessEqualU (InvertFlags x))
  6402  	// result: (GreaterEqualU x)
  6403  	for {
  6404  		if v_0.Op != OpARM64InvertFlags {
  6405  			break
  6406  		}
  6407  		x := v_0.Args[0]
  6408  		v.reset(OpARM64GreaterEqualU)
  6409  		v.AddArg(x)
  6410  		return true
  6411  	}
  6412  	return false
  6413  }
  6414  func rewriteValueARM64_OpARM64LessThan(v *Value) bool {
  6415  	v_0 := v.Args[0]
  6416  	b := v.Block
  6417  	// match: (LessThan (CMPconst [0] z:(AND x y)))
  6418  	// cond: z.Uses == 1
  6419  	// result: (LessThan (TST x y))
  6420  	for {
  6421  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6422  			break
  6423  		}
  6424  		z := v_0.Args[0]
  6425  		if z.Op != OpARM64AND {
  6426  			break
  6427  		}
  6428  		y := z.Args[1]
  6429  		x := z.Args[0]
  6430  		if !(z.Uses == 1) {
  6431  			break
  6432  		}
  6433  		v.reset(OpARM64LessThan)
  6434  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
  6435  		v0.AddArg2(x, y)
  6436  		v.AddArg(v0)
  6437  		return true
  6438  	}
  6439  	// match: (LessThan (CMPWconst [0] x:(ANDconst [c] y)))
  6440  	// cond: x.Uses == 1
  6441  	// result: (LessThan (TSTWconst [int32(c)] y))
  6442  	for {
  6443  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6444  			break
  6445  		}
  6446  		x := v_0.Args[0]
  6447  		if x.Op != OpARM64ANDconst {
  6448  			break
  6449  		}
  6450  		c := auxIntToInt64(x.AuxInt)
  6451  		y := x.Args[0]
  6452  		if !(x.Uses == 1) {
  6453  			break
  6454  		}
  6455  		v.reset(OpARM64LessThan)
  6456  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
  6457  		v0.AuxInt = int32ToAuxInt(int32(c))
  6458  		v0.AddArg(y)
  6459  		v.AddArg(v0)
  6460  		return true
  6461  	}
  6462  	// match: (LessThan (CMPWconst [0] z:(AND x y)))
  6463  	// cond: z.Uses == 1
  6464  	// result: (LessThan (TSTW x y))
  6465  	for {
  6466  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6467  			break
  6468  		}
  6469  		z := v_0.Args[0]
  6470  		if z.Op != OpARM64AND {
  6471  			break
  6472  		}
  6473  		y := z.Args[1]
  6474  		x := z.Args[0]
  6475  		if !(z.Uses == 1) {
  6476  			break
  6477  		}
  6478  		v.reset(OpARM64LessThan)
  6479  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
  6480  		v0.AddArg2(x, y)
  6481  		v.AddArg(v0)
  6482  		return true
  6483  	}
  6484  	// match: (LessThan (CMPconst [0] x:(ANDconst [c] y)))
  6485  	// cond: x.Uses == 1
  6486  	// result: (LessThan (TSTconst [c] y))
  6487  	for {
  6488  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6489  			break
  6490  		}
  6491  		x := v_0.Args[0]
  6492  		if x.Op != OpARM64ANDconst {
  6493  			break
  6494  		}
  6495  		c := auxIntToInt64(x.AuxInt)
  6496  		y := x.Args[0]
  6497  		if !(x.Uses == 1) {
  6498  			break
  6499  		}
  6500  		v.reset(OpARM64LessThan)
  6501  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
  6502  		v0.AuxInt = int64ToAuxInt(c)
  6503  		v0.AddArg(y)
  6504  		v.AddArg(v0)
  6505  		return true
  6506  	}
  6507  	// match: (LessThan (CMPconst [0] x:(ADDconst [c] y)))
  6508  	// cond: x.Uses == 1
  6509  	// result: (LessThanNoov (CMNconst [c] y))
  6510  	for {
  6511  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6512  			break
  6513  		}
  6514  		x := v_0.Args[0]
  6515  		if x.Op != OpARM64ADDconst {
  6516  			break
  6517  		}
  6518  		c := auxIntToInt64(x.AuxInt)
  6519  		y := x.Args[0]
  6520  		if !(x.Uses == 1) {
  6521  			break
  6522  		}
  6523  		v.reset(OpARM64LessThanNoov)
  6524  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
  6525  		v0.AuxInt = int64ToAuxInt(c)
  6526  		v0.AddArg(y)
  6527  		v.AddArg(v0)
  6528  		return true
  6529  	}
  6530  	// match: (LessThan (CMPWconst [0] x:(ADDconst [c] y)))
  6531  	// cond: x.Uses == 1
  6532  	// result: (LessThanNoov (CMNWconst [int32(c)] y))
  6533  	for {
  6534  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6535  			break
  6536  		}
  6537  		x := v_0.Args[0]
  6538  		if x.Op != OpARM64ADDconst {
  6539  			break
  6540  		}
  6541  		c := auxIntToInt64(x.AuxInt)
  6542  		y := x.Args[0]
  6543  		if !(x.Uses == 1) {
  6544  			break
  6545  		}
  6546  		v.reset(OpARM64LessThanNoov)
  6547  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
  6548  		v0.AuxInt = int32ToAuxInt(int32(c))
  6549  		v0.AddArg(y)
  6550  		v.AddArg(v0)
  6551  		return true
  6552  	}
  6553  	// match: (LessThan (CMPconst [0] z:(ADD x y)))
  6554  	// cond: z.Uses == 1
  6555  	// result: (LessThanNoov (CMN x y))
  6556  	for {
  6557  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6558  			break
  6559  		}
  6560  		z := v_0.Args[0]
  6561  		if z.Op != OpARM64ADD {
  6562  			break
  6563  		}
  6564  		y := z.Args[1]
  6565  		x := z.Args[0]
  6566  		if !(z.Uses == 1) {
  6567  			break
  6568  		}
  6569  		v.reset(OpARM64LessThanNoov)
  6570  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  6571  		v0.AddArg2(x, y)
  6572  		v.AddArg(v0)
  6573  		return true
  6574  	}
  6575  	// match: (LessThan (CMPWconst [0] z:(ADD x y)))
  6576  	// cond: z.Uses == 1
  6577  	// result: (LessThanNoov (CMNW x y))
  6578  	for {
  6579  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6580  			break
  6581  		}
  6582  		z := v_0.Args[0]
  6583  		if z.Op != OpARM64ADD {
  6584  			break
  6585  		}
  6586  		y := z.Args[1]
  6587  		x := z.Args[0]
  6588  		if !(z.Uses == 1) {
  6589  			break
  6590  		}
  6591  		v.reset(OpARM64LessThanNoov)
  6592  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  6593  		v0.AddArg2(x, y)
  6594  		v.AddArg(v0)
  6595  		return true
  6596  	}
  6597  	// match: (LessThan (CMPconst [0] z:(MADD a x y)))
  6598  	// cond: z.Uses == 1
  6599  	// result: (LessThanNoov (CMN a (MUL <x.Type> x y)))
  6600  	for {
  6601  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6602  			break
  6603  		}
  6604  		z := v_0.Args[0]
  6605  		if z.Op != OpARM64MADD {
  6606  			break
  6607  		}
  6608  		y := z.Args[2]
  6609  		a := z.Args[0]
  6610  		x := z.Args[1]
  6611  		if !(z.Uses == 1) {
  6612  			break
  6613  		}
  6614  		v.reset(OpARM64LessThanNoov)
  6615  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
  6616  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  6617  		v1.AddArg2(x, y)
  6618  		v0.AddArg2(a, v1)
  6619  		v.AddArg(v0)
  6620  		return true
  6621  	}
  6622  	// match: (LessThan (CMPconst [0] z:(MSUB a x y)))
  6623  	// cond: z.Uses == 1
  6624  	// result: (LessThanNoov (CMP a (MUL <x.Type> x y)))
  6625  	for {
  6626  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
  6627  			break
  6628  		}
  6629  		z := v_0.Args[0]
  6630  		if z.Op != OpARM64MSUB {
  6631  			break
  6632  		}
  6633  		y := z.Args[2]
  6634  		a := z.Args[0]
  6635  		x := z.Args[1]
  6636  		if !(z.Uses == 1) {
  6637  			break
  6638  		}
  6639  		v.reset(OpARM64LessThanNoov)
  6640  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
  6641  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  6642  		v1.AddArg2(x, y)
  6643  		v0.AddArg2(a, v1)
  6644  		v.AddArg(v0)
  6645  		return true
  6646  	}
  6647  	// match: (LessThan (CMPWconst [0] z:(MADDW a x y)))
  6648  	// cond: z.Uses == 1
  6649  	// result: (LessThanNoov (CMNW a (MULW <x.Type> x y)))
  6650  	for {
  6651  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6652  			break
  6653  		}
  6654  		z := v_0.Args[0]
  6655  		if z.Op != OpARM64MADDW {
  6656  			break
  6657  		}
  6658  		y := z.Args[2]
  6659  		a := z.Args[0]
  6660  		x := z.Args[1]
  6661  		if !(z.Uses == 1) {
  6662  			break
  6663  		}
  6664  		v.reset(OpARM64LessThanNoov)
  6665  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
  6666  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  6667  		v1.AddArg2(x, y)
  6668  		v0.AddArg2(a, v1)
  6669  		v.AddArg(v0)
  6670  		return true
  6671  	}
  6672  	// match: (LessThan (CMPWconst [0] z:(MSUBW a x y)))
  6673  	// cond: z.Uses == 1
  6674  	// result: (LessThanNoov (CMPW a (MULW <x.Type> x y)))
  6675  	for {
  6676  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
  6677  			break
  6678  		}
  6679  		z := v_0.Args[0]
  6680  		if z.Op != OpARM64MSUBW {
  6681  			break
  6682  		}
  6683  		y := z.Args[2]
  6684  		a := z.Args[0]
  6685  		x := z.Args[1]
  6686  		if !(z.Uses == 1) {
  6687  			break
  6688  		}
  6689  		v.reset(OpARM64LessThanNoov)
  6690  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
  6691  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  6692  		v1.AddArg2(x, y)
  6693  		v0.AddArg2(a, v1)
  6694  		v.AddArg(v0)
  6695  		return true
  6696  	}
  6697  	// match: (LessThan (FlagConstant [fc]))
  6698  	// result: (MOVDconst [b2i(fc.lt())])
  6699  	for {
  6700  		if v_0.Op != OpARM64FlagConstant {
  6701  			break
  6702  		}
  6703  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6704  		v.reset(OpARM64MOVDconst)
  6705  		v.AuxInt = int64ToAuxInt(b2i(fc.lt()))
  6706  		return true
  6707  	}
  6708  	// match: (LessThan (InvertFlags x))
  6709  	// result: (GreaterThan x)
  6710  	for {
  6711  		if v_0.Op != OpARM64InvertFlags {
  6712  			break
  6713  		}
  6714  		x := v_0.Args[0]
  6715  		v.reset(OpARM64GreaterThan)
  6716  		v.AddArg(x)
  6717  		return true
  6718  	}
  6719  	return false
  6720  }
  6721  func rewriteValueARM64_OpARM64LessThanF(v *Value) bool {
  6722  	v_0 := v.Args[0]
  6723  	// match: (LessThanF (InvertFlags x))
  6724  	// result: (GreaterThanF x)
  6725  	for {
  6726  		if v_0.Op != OpARM64InvertFlags {
  6727  			break
  6728  		}
  6729  		x := v_0.Args[0]
  6730  		v.reset(OpARM64GreaterThanF)
  6731  		v.AddArg(x)
  6732  		return true
  6733  	}
  6734  	return false
  6735  }
  6736  func rewriteValueARM64_OpARM64LessThanNoov(v *Value) bool {
  6737  	v_0 := v.Args[0]
  6738  	b := v.Block
  6739  	typ := &b.Func.Config.Types
  6740  	// match: (LessThanNoov (InvertFlags x))
  6741  	// result: (CSEL0 [OpARM64NotEqual] (GreaterEqualNoov <typ.Bool> x) x)
  6742  	for {
  6743  		if v_0.Op != OpARM64InvertFlags {
  6744  			break
  6745  		}
  6746  		x := v_0.Args[0]
  6747  		v.reset(OpARM64CSEL0)
  6748  		v.AuxInt = opToAuxInt(OpARM64NotEqual)
  6749  		v0 := b.NewValue0(v.Pos, OpARM64GreaterEqualNoov, typ.Bool)
  6750  		v0.AddArg(x)
  6751  		v.AddArg2(v0, x)
  6752  		return true
  6753  	}
  6754  	return false
  6755  }
  6756  func rewriteValueARM64_OpARM64LessThanU(v *Value) bool {
  6757  	v_0 := v.Args[0]
  6758  	// match: (LessThanU (FlagConstant [fc]))
  6759  	// result: (MOVDconst [b2i(fc.ult())])
  6760  	for {
  6761  		if v_0.Op != OpARM64FlagConstant {
  6762  			break
  6763  		}
  6764  		fc := auxIntToFlagConstant(v_0.AuxInt)
  6765  		v.reset(OpARM64MOVDconst)
  6766  		v.AuxInt = int64ToAuxInt(b2i(fc.ult()))
  6767  		return true
  6768  	}
  6769  	// match: (LessThanU (InvertFlags x))
  6770  	// result: (GreaterThanU x)
  6771  	for {
  6772  		if v_0.Op != OpARM64InvertFlags {
  6773  			break
  6774  		}
  6775  		x := v_0.Args[0]
  6776  		v.reset(OpARM64GreaterThanU)
  6777  		v.AddArg(x)
  6778  		return true
  6779  	}
  6780  	return false
  6781  }
  6782  func rewriteValueARM64_OpARM64MADD(v *Value) bool {
  6783  	v_2 := v.Args[2]
  6784  	v_1 := v.Args[1]
  6785  	v_0 := v.Args[0]
  6786  	b := v.Block
  6787  	// match: (MADD a x (MOVDconst [-1]))
  6788  	// result: (SUB a x)
  6789  	for {
  6790  		a := v_0
  6791  		x := v_1
  6792  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != -1 {
  6793  			break
  6794  		}
  6795  		v.reset(OpARM64SUB)
  6796  		v.AddArg2(a, x)
  6797  		return true
  6798  	}
  6799  	// match: (MADD a _ (MOVDconst [0]))
  6800  	// result: a
  6801  	for {
  6802  		a := v_0
  6803  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6804  			break
  6805  		}
  6806  		v.copyOf(a)
  6807  		return true
  6808  	}
  6809  	// match: (MADD a x (MOVDconst [1]))
  6810  	// result: (ADD a x)
  6811  	for {
  6812  		a := v_0
  6813  		x := v_1
  6814  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 1 {
  6815  			break
  6816  		}
  6817  		v.reset(OpARM64ADD)
  6818  		v.AddArg2(a, x)
  6819  		return true
  6820  	}
  6821  	// match: (MADD a x (MOVDconst [c]))
  6822  	// cond: isPowerOfTwo(c)
  6823  	// result: (ADDshiftLL a x [log64(c)])
  6824  	for {
  6825  		a := v_0
  6826  		x := v_1
  6827  		if v_2.Op != OpARM64MOVDconst {
  6828  			break
  6829  		}
  6830  		c := auxIntToInt64(v_2.AuxInt)
  6831  		if !(isPowerOfTwo(c)) {
  6832  			break
  6833  		}
  6834  		v.reset(OpARM64ADDshiftLL)
  6835  		v.AuxInt = int64ToAuxInt(log64(c))
  6836  		v.AddArg2(a, x)
  6837  		return true
  6838  	}
  6839  	// match: (MADD a x (MOVDconst [c]))
  6840  	// cond: isPowerOfTwo(c-1) && c>=3
  6841  	// result: (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
  6842  	for {
  6843  		a := v_0
  6844  		x := v_1
  6845  		if v_2.Op != OpARM64MOVDconst {
  6846  			break
  6847  		}
  6848  		c := auxIntToInt64(v_2.AuxInt)
  6849  		if !(isPowerOfTwo(c-1) && c >= 3) {
  6850  			break
  6851  		}
  6852  		v.reset(OpARM64ADD)
  6853  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  6854  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
  6855  		v0.AddArg2(x, x)
  6856  		v.AddArg2(a, v0)
  6857  		return true
  6858  	}
  6859  	// match: (MADD a x (MOVDconst [c]))
  6860  	// cond: isPowerOfTwo(c+1) && c>=7
  6861  	// result: (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
  6862  	for {
  6863  		a := v_0
  6864  		x := v_1
  6865  		if v_2.Op != OpARM64MOVDconst {
  6866  			break
  6867  		}
  6868  		c := auxIntToInt64(v_2.AuxInt)
  6869  		if !(isPowerOfTwo(c+1) && c >= 7) {
  6870  			break
  6871  		}
  6872  		v.reset(OpARM64SUB)
  6873  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  6874  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
  6875  		v0.AddArg2(x, x)
  6876  		v.AddArg2(a, v0)
  6877  		return true
  6878  	}
  6879  	// match: (MADD a x (MOVDconst [c]))
  6880  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
  6881  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
  6882  	for {
  6883  		a := v_0
  6884  		x := v_1
  6885  		if v_2.Op != OpARM64MOVDconst {
  6886  			break
  6887  		}
  6888  		c := auxIntToInt64(v_2.AuxInt)
  6889  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
  6890  			break
  6891  		}
  6892  		v.reset(OpARM64SUBshiftLL)
  6893  		v.AuxInt = int64ToAuxInt(log64(c / 3))
  6894  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  6895  		v0.AuxInt = int64ToAuxInt(2)
  6896  		v0.AddArg2(x, x)
  6897  		v.AddArg2(a, v0)
  6898  		return true
  6899  	}
  6900  	// match: (MADD a x (MOVDconst [c]))
  6901  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
  6902  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
  6903  	for {
  6904  		a := v_0
  6905  		x := v_1
  6906  		if v_2.Op != OpARM64MOVDconst {
  6907  			break
  6908  		}
  6909  		c := auxIntToInt64(v_2.AuxInt)
  6910  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
  6911  			break
  6912  		}
  6913  		v.reset(OpARM64ADDshiftLL)
  6914  		v.AuxInt = int64ToAuxInt(log64(c / 5))
  6915  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  6916  		v0.AuxInt = int64ToAuxInt(2)
  6917  		v0.AddArg2(x, x)
  6918  		v.AddArg2(a, v0)
  6919  		return true
  6920  	}
  6921  	// match: (MADD a x (MOVDconst [c]))
  6922  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
  6923  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
  6924  	for {
  6925  		a := v_0
  6926  		x := v_1
  6927  		if v_2.Op != OpARM64MOVDconst {
  6928  			break
  6929  		}
  6930  		c := auxIntToInt64(v_2.AuxInt)
  6931  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
  6932  			break
  6933  		}
  6934  		v.reset(OpARM64SUBshiftLL)
  6935  		v.AuxInt = int64ToAuxInt(log64(c / 7))
  6936  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  6937  		v0.AuxInt = int64ToAuxInt(3)
  6938  		v0.AddArg2(x, x)
  6939  		v.AddArg2(a, v0)
  6940  		return true
  6941  	}
  6942  	// match: (MADD a x (MOVDconst [c]))
  6943  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
  6944  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
  6945  	for {
  6946  		a := v_0
  6947  		x := v_1
  6948  		if v_2.Op != OpARM64MOVDconst {
  6949  			break
  6950  		}
  6951  		c := auxIntToInt64(v_2.AuxInt)
  6952  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
  6953  			break
  6954  		}
  6955  		v.reset(OpARM64ADDshiftLL)
  6956  		v.AuxInt = int64ToAuxInt(log64(c / 9))
  6957  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  6958  		v0.AuxInt = int64ToAuxInt(3)
  6959  		v0.AddArg2(x, x)
  6960  		v.AddArg2(a, v0)
  6961  		return true
  6962  	}
  6963  	// match: (MADD a (MOVDconst [-1]) x)
  6964  	// result: (SUB a x)
  6965  	for {
  6966  		a := v_0
  6967  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  6968  			break
  6969  		}
  6970  		x := v_2
  6971  		v.reset(OpARM64SUB)
  6972  		v.AddArg2(a, x)
  6973  		return true
  6974  	}
  6975  	// match: (MADD a (MOVDconst [0]) _)
  6976  	// result: a
  6977  	for {
  6978  		a := v_0
  6979  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  6980  			break
  6981  		}
  6982  		v.copyOf(a)
  6983  		return true
  6984  	}
  6985  	// match: (MADD a (MOVDconst [1]) x)
  6986  	// result: (ADD a x)
  6987  	for {
  6988  		a := v_0
  6989  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
  6990  			break
  6991  		}
  6992  		x := v_2
  6993  		v.reset(OpARM64ADD)
  6994  		v.AddArg2(a, x)
  6995  		return true
  6996  	}
  6997  	// match: (MADD a (MOVDconst [c]) x)
  6998  	// cond: isPowerOfTwo(c)
  6999  	// result: (ADDshiftLL a x [log64(c)])
  7000  	for {
  7001  		a := v_0
  7002  		if v_1.Op != OpARM64MOVDconst {
  7003  			break
  7004  		}
  7005  		c := auxIntToInt64(v_1.AuxInt)
  7006  		x := v_2
  7007  		if !(isPowerOfTwo(c)) {
  7008  			break
  7009  		}
  7010  		v.reset(OpARM64ADDshiftLL)
  7011  		v.AuxInt = int64ToAuxInt(log64(c))
  7012  		v.AddArg2(a, x)
  7013  		return true
  7014  	}
  7015  	// match: (MADD a (MOVDconst [c]) x)
  7016  	// cond: isPowerOfTwo(c-1) && c>=3
  7017  	// result: (ADD a (ADDshiftLL <x.Type> x x [log64(c-1)]))
  7018  	for {
  7019  		a := v_0
  7020  		if v_1.Op != OpARM64MOVDconst {
  7021  			break
  7022  		}
  7023  		c := auxIntToInt64(v_1.AuxInt)
  7024  		x := v_2
  7025  		if !(isPowerOfTwo(c-1) && c >= 3) {
  7026  			break
  7027  		}
  7028  		v.reset(OpARM64ADD)
  7029  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7030  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
  7031  		v0.AddArg2(x, x)
  7032  		v.AddArg2(a, v0)
  7033  		return true
  7034  	}
  7035  	// match: (MADD a (MOVDconst [c]) x)
  7036  	// cond: isPowerOfTwo(c+1) && c>=7
  7037  	// result: (SUB a (SUBshiftLL <x.Type> x x [log64(c+1)]))
  7038  	for {
  7039  		a := v_0
  7040  		if v_1.Op != OpARM64MOVDconst {
  7041  			break
  7042  		}
  7043  		c := auxIntToInt64(v_1.AuxInt)
  7044  		x := v_2
  7045  		if !(isPowerOfTwo(c+1) && c >= 7) {
  7046  			break
  7047  		}
  7048  		v.reset(OpARM64SUB)
  7049  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7050  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
  7051  		v0.AddArg2(x, x)
  7052  		v.AddArg2(a, v0)
  7053  		return true
  7054  	}
  7055  	// match: (MADD a (MOVDconst [c]) x)
  7056  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
  7057  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
  7058  	for {
  7059  		a := v_0
  7060  		if v_1.Op != OpARM64MOVDconst {
  7061  			break
  7062  		}
  7063  		c := auxIntToInt64(v_1.AuxInt)
  7064  		x := v_2
  7065  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
  7066  			break
  7067  		}
  7068  		v.reset(OpARM64SUBshiftLL)
  7069  		v.AuxInt = int64ToAuxInt(log64(c / 3))
  7070  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7071  		v0.AuxInt = int64ToAuxInt(2)
  7072  		v0.AddArg2(x, x)
  7073  		v.AddArg2(a, v0)
  7074  		return true
  7075  	}
  7076  	// match: (MADD a (MOVDconst [c]) x)
  7077  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
  7078  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
  7079  	for {
  7080  		a := v_0
  7081  		if v_1.Op != OpARM64MOVDconst {
  7082  			break
  7083  		}
  7084  		c := auxIntToInt64(v_1.AuxInt)
  7085  		x := v_2
  7086  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
  7087  			break
  7088  		}
  7089  		v.reset(OpARM64ADDshiftLL)
  7090  		v.AuxInt = int64ToAuxInt(log64(c / 5))
  7091  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7092  		v0.AuxInt = int64ToAuxInt(2)
  7093  		v0.AddArg2(x, x)
  7094  		v.AddArg2(a, v0)
  7095  		return true
  7096  	}
  7097  	// match: (MADD a (MOVDconst [c]) x)
  7098  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
  7099  	// result: (SUBshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
  7100  	for {
  7101  		a := v_0
  7102  		if v_1.Op != OpARM64MOVDconst {
  7103  			break
  7104  		}
  7105  		c := auxIntToInt64(v_1.AuxInt)
  7106  		x := v_2
  7107  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
  7108  			break
  7109  		}
  7110  		v.reset(OpARM64SUBshiftLL)
  7111  		v.AuxInt = int64ToAuxInt(log64(c / 7))
  7112  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7113  		v0.AuxInt = int64ToAuxInt(3)
  7114  		v0.AddArg2(x, x)
  7115  		v.AddArg2(a, v0)
  7116  		return true
  7117  	}
  7118  	// match: (MADD a (MOVDconst [c]) x)
  7119  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
  7120  	// result: (ADDshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
  7121  	for {
  7122  		a := v_0
  7123  		if v_1.Op != OpARM64MOVDconst {
  7124  			break
  7125  		}
  7126  		c := auxIntToInt64(v_1.AuxInt)
  7127  		x := v_2
  7128  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
  7129  			break
  7130  		}
  7131  		v.reset(OpARM64ADDshiftLL)
  7132  		v.AuxInt = int64ToAuxInt(log64(c / 9))
  7133  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7134  		v0.AuxInt = int64ToAuxInt(3)
  7135  		v0.AddArg2(x, x)
  7136  		v.AddArg2(a, v0)
  7137  		return true
  7138  	}
  7139  	// match: (MADD (MOVDconst [c]) x y)
  7140  	// result: (ADDconst [c] (MUL <x.Type> x y))
  7141  	for {
  7142  		if v_0.Op != OpARM64MOVDconst {
  7143  			break
  7144  		}
  7145  		c := auxIntToInt64(v_0.AuxInt)
  7146  		x := v_1
  7147  		y := v_2
  7148  		v.reset(OpARM64ADDconst)
  7149  		v.AuxInt = int64ToAuxInt(c)
  7150  		v0 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
  7151  		v0.AddArg2(x, y)
  7152  		v.AddArg(v0)
  7153  		return true
  7154  	}
  7155  	// match: (MADD a (MOVDconst [c]) (MOVDconst [d]))
  7156  	// result: (ADDconst [c*d] a)
  7157  	for {
  7158  		a := v_0
  7159  		if v_1.Op != OpARM64MOVDconst {
  7160  			break
  7161  		}
  7162  		c := auxIntToInt64(v_1.AuxInt)
  7163  		if v_2.Op != OpARM64MOVDconst {
  7164  			break
  7165  		}
  7166  		d := auxIntToInt64(v_2.AuxInt)
  7167  		v.reset(OpARM64ADDconst)
  7168  		v.AuxInt = int64ToAuxInt(c * d)
  7169  		v.AddArg(a)
  7170  		return true
  7171  	}
  7172  	return false
  7173  }
  7174  func rewriteValueARM64_OpARM64MADDW(v *Value) bool {
  7175  	v_2 := v.Args[2]
  7176  	v_1 := v.Args[1]
  7177  	v_0 := v.Args[0]
  7178  	b := v.Block
  7179  	// match: (MADDW a x (MOVDconst [c]))
  7180  	// cond: int32(c)==-1
  7181  	// result: (MOVWUreg (SUB <a.Type> a x))
  7182  	for {
  7183  		a := v_0
  7184  		x := v_1
  7185  		if v_2.Op != OpARM64MOVDconst {
  7186  			break
  7187  		}
  7188  		c := auxIntToInt64(v_2.AuxInt)
  7189  		if !(int32(c) == -1) {
  7190  			break
  7191  		}
  7192  		v.reset(OpARM64MOVWUreg)
  7193  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7194  		v0.AddArg2(a, x)
  7195  		v.AddArg(v0)
  7196  		return true
  7197  	}
  7198  	// match: (MADDW a _ (MOVDconst [c]))
  7199  	// cond: int32(c)==0
  7200  	// result: (MOVWUreg a)
  7201  	for {
  7202  		a := v_0
  7203  		if v_2.Op != OpARM64MOVDconst {
  7204  			break
  7205  		}
  7206  		c := auxIntToInt64(v_2.AuxInt)
  7207  		if !(int32(c) == 0) {
  7208  			break
  7209  		}
  7210  		v.reset(OpARM64MOVWUreg)
  7211  		v.AddArg(a)
  7212  		return true
  7213  	}
  7214  	// match: (MADDW a x (MOVDconst [c]))
  7215  	// cond: int32(c)==1
  7216  	// result: (MOVWUreg (ADD <a.Type> a x))
  7217  	for {
  7218  		a := v_0
  7219  		x := v_1
  7220  		if v_2.Op != OpARM64MOVDconst {
  7221  			break
  7222  		}
  7223  		c := auxIntToInt64(v_2.AuxInt)
  7224  		if !(int32(c) == 1) {
  7225  			break
  7226  		}
  7227  		v.reset(OpARM64MOVWUreg)
  7228  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7229  		v0.AddArg2(a, x)
  7230  		v.AddArg(v0)
  7231  		return true
  7232  	}
  7233  	// match: (MADDW a x (MOVDconst [c]))
  7234  	// cond: isPowerOfTwo(c)
  7235  	// result: (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
  7236  	for {
  7237  		a := v_0
  7238  		x := v_1
  7239  		if v_2.Op != OpARM64MOVDconst {
  7240  			break
  7241  		}
  7242  		c := auxIntToInt64(v_2.AuxInt)
  7243  		if !(isPowerOfTwo(c)) {
  7244  			break
  7245  		}
  7246  		v.reset(OpARM64MOVWUreg)
  7247  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7248  		v0.AuxInt = int64ToAuxInt(log64(c))
  7249  		v0.AddArg2(a, x)
  7250  		v.AddArg(v0)
  7251  		return true
  7252  	}
  7253  	// match: (MADDW a x (MOVDconst [c]))
  7254  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
  7255  	// result: (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
  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 !(isPowerOfTwo(c-1) && int32(c) >= 3) {
  7264  			break
  7265  		}
  7266  		v.reset(OpARM64MOVWUreg)
  7267  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7268  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7269  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
  7270  		v1.AddArg2(x, x)
  7271  		v0.AddArg2(a, v1)
  7272  		v.AddArg(v0)
  7273  		return true
  7274  	}
  7275  	// match: (MADDW a x (MOVDconst [c]))
  7276  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
  7277  	// result: (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
  7278  	for {
  7279  		a := v_0
  7280  		x := v_1
  7281  		if v_2.Op != OpARM64MOVDconst {
  7282  			break
  7283  		}
  7284  		c := auxIntToInt64(v_2.AuxInt)
  7285  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
  7286  			break
  7287  		}
  7288  		v.reset(OpARM64MOVWUreg)
  7289  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7290  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7291  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
  7292  		v1.AddArg2(x, x)
  7293  		v0.AddArg2(a, v1)
  7294  		v.AddArg(v0)
  7295  		return true
  7296  	}
  7297  	// match: (MADDW a x (MOVDconst [c]))
  7298  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
  7299  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
  7300  	for {
  7301  		a := v_0
  7302  		x := v_1
  7303  		if v_2.Op != OpARM64MOVDconst {
  7304  			break
  7305  		}
  7306  		c := auxIntToInt64(v_2.AuxInt)
  7307  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
  7308  			break
  7309  		}
  7310  		v.reset(OpARM64MOVWUreg)
  7311  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7312  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
  7313  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7314  		v1.AuxInt = int64ToAuxInt(2)
  7315  		v1.AddArg2(x, x)
  7316  		v0.AddArg2(a, v1)
  7317  		v.AddArg(v0)
  7318  		return true
  7319  	}
  7320  	// match: (MADDW a x (MOVDconst [c]))
  7321  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
  7322  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
  7323  	for {
  7324  		a := v_0
  7325  		x := v_1
  7326  		if v_2.Op != OpARM64MOVDconst {
  7327  			break
  7328  		}
  7329  		c := auxIntToInt64(v_2.AuxInt)
  7330  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
  7331  			break
  7332  		}
  7333  		v.reset(OpARM64MOVWUreg)
  7334  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7335  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
  7336  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7337  		v1.AuxInt = int64ToAuxInt(2)
  7338  		v1.AddArg2(x, x)
  7339  		v0.AddArg2(a, v1)
  7340  		v.AddArg(v0)
  7341  		return true
  7342  	}
  7343  	// match: (MADDW a x (MOVDconst [c]))
  7344  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
  7345  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
  7346  	for {
  7347  		a := v_0
  7348  		x := v_1
  7349  		if v_2.Op != OpARM64MOVDconst {
  7350  			break
  7351  		}
  7352  		c := auxIntToInt64(v_2.AuxInt)
  7353  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
  7354  			break
  7355  		}
  7356  		v.reset(OpARM64MOVWUreg)
  7357  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7358  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
  7359  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7360  		v1.AuxInt = int64ToAuxInt(3)
  7361  		v1.AddArg2(x, x)
  7362  		v0.AddArg2(a, v1)
  7363  		v.AddArg(v0)
  7364  		return true
  7365  	}
  7366  	// match: (MADDW a x (MOVDconst [c]))
  7367  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
  7368  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
  7369  	for {
  7370  		a := v_0
  7371  		x := v_1
  7372  		if v_2.Op != OpARM64MOVDconst {
  7373  			break
  7374  		}
  7375  		c := auxIntToInt64(v_2.AuxInt)
  7376  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
  7377  			break
  7378  		}
  7379  		v.reset(OpARM64MOVWUreg)
  7380  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7381  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
  7382  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7383  		v1.AuxInt = int64ToAuxInt(3)
  7384  		v1.AddArg2(x, x)
  7385  		v0.AddArg2(a, v1)
  7386  		v.AddArg(v0)
  7387  		return true
  7388  	}
  7389  	// match: (MADDW a (MOVDconst [c]) x)
  7390  	// cond: int32(c)==-1
  7391  	// result: (MOVWUreg (SUB <a.Type> a x))
  7392  	for {
  7393  		a := v_0
  7394  		if v_1.Op != OpARM64MOVDconst {
  7395  			break
  7396  		}
  7397  		c := auxIntToInt64(v_1.AuxInt)
  7398  		x := v_2
  7399  		if !(int32(c) == -1) {
  7400  			break
  7401  		}
  7402  		v.reset(OpARM64MOVWUreg)
  7403  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7404  		v0.AddArg2(a, x)
  7405  		v.AddArg(v0)
  7406  		return true
  7407  	}
  7408  	// match: (MADDW a (MOVDconst [c]) _)
  7409  	// cond: int32(c)==0
  7410  	// result: (MOVWUreg a)
  7411  	for {
  7412  		a := v_0
  7413  		if v_1.Op != OpARM64MOVDconst {
  7414  			break
  7415  		}
  7416  		c := auxIntToInt64(v_1.AuxInt)
  7417  		if !(int32(c) == 0) {
  7418  			break
  7419  		}
  7420  		v.reset(OpARM64MOVWUreg)
  7421  		v.AddArg(a)
  7422  		return true
  7423  	}
  7424  	// match: (MADDW a (MOVDconst [c]) x)
  7425  	// cond: int32(c)==1
  7426  	// result: (MOVWUreg (ADD <a.Type> a x))
  7427  	for {
  7428  		a := v_0
  7429  		if v_1.Op != OpARM64MOVDconst {
  7430  			break
  7431  		}
  7432  		c := auxIntToInt64(v_1.AuxInt)
  7433  		x := v_2
  7434  		if !(int32(c) == 1) {
  7435  			break
  7436  		}
  7437  		v.reset(OpARM64MOVWUreg)
  7438  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7439  		v0.AddArg2(a, x)
  7440  		v.AddArg(v0)
  7441  		return true
  7442  	}
  7443  	// match: (MADDW a (MOVDconst [c]) x)
  7444  	// cond: isPowerOfTwo(c)
  7445  	// result: (MOVWUreg (ADDshiftLL <a.Type> a x [log64(c)]))
  7446  	for {
  7447  		a := v_0
  7448  		if v_1.Op != OpARM64MOVDconst {
  7449  			break
  7450  		}
  7451  		c := auxIntToInt64(v_1.AuxInt)
  7452  		x := v_2
  7453  		if !(isPowerOfTwo(c)) {
  7454  			break
  7455  		}
  7456  		v.reset(OpARM64MOVWUreg)
  7457  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7458  		v0.AuxInt = int64ToAuxInt(log64(c))
  7459  		v0.AddArg2(a, x)
  7460  		v.AddArg(v0)
  7461  		return true
  7462  	}
  7463  	// match: (MADDW a (MOVDconst [c]) x)
  7464  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
  7465  	// result: (MOVWUreg (ADD <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
  7466  	for {
  7467  		a := v_0
  7468  		if v_1.Op != OpARM64MOVDconst {
  7469  			break
  7470  		}
  7471  		c := auxIntToInt64(v_1.AuxInt)
  7472  		x := v_2
  7473  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
  7474  			break
  7475  		}
  7476  		v.reset(OpARM64MOVWUreg)
  7477  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
  7478  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7479  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
  7480  		v1.AddArg2(x, x)
  7481  		v0.AddArg2(a, v1)
  7482  		v.AddArg(v0)
  7483  		return true
  7484  	}
  7485  	// match: (MADDW a (MOVDconst [c]) x)
  7486  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
  7487  	// result: (MOVWUreg (SUB <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
  7488  	for {
  7489  		a := v_0
  7490  		if v_1.Op != OpARM64MOVDconst {
  7491  			break
  7492  		}
  7493  		c := auxIntToInt64(v_1.AuxInt)
  7494  		x := v_2
  7495  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
  7496  			break
  7497  		}
  7498  		v.reset(OpARM64MOVWUreg)
  7499  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
  7500  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7501  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
  7502  		v1.AddArg2(x, x)
  7503  		v0.AddArg2(a, v1)
  7504  		v.AddArg(v0)
  7505  		return true
  7506  	}
  7507  	// match: (MADDW a (MOVDconst [c]) x)
  7508  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
  7509  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
  7510  	for {
  7511  		a := v_0
  7512  		if v_1.Op != OpARM64MOVDconst {
  7513  			break
  7514  		}
  7515  		c := auxIntToInt64(v_1.AuxInt)
  7516  		x := v_2
  7517  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
  7518  			break
  7519  		}
  7520  		v.reset(OpARM64MOVWUreg)
  7521  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7522  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
  7523  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7524  		v1.AuxInt = int64ToAuxInt(2)
  7525  		v1.AddArg2(x, x)
  7526  		v0.AddArg2(a, v1)
  7527  		v.AddArg(v0)
  7528  		return true
  7529  	}
  7530  	// match: (MADDW a (MOVDconst [c]) x)
  7531  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
  7532  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
  7533  	for {
  7534  		a := v_0
  7535  		if v_1.Op != OpARM64MOVDconst {
  7536  			break
  7537  		}
  7538  		c := auxIntToInt64(v_1.AuxInt)
  7539  		x := v_2
  7540  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
  7541  			break
  7542  		}
  7543  		v.reset(OpARM64MOVWUreg)
  7544  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7545  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
  7546  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7547  		v1.AuxInt = int64ToAuxInt(2)
  7548  		v1.AddArg2(x, x)
  7549  		v0.AddArg2(a, v1)
  7550  		v.AddArg(v0)
  7551  		return true
  7552  	}
  7553  	// match: (MADDW a (MOVDconst [c]) x)
  7554  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
  7555  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
  7556  	for {
  7557  		a := v_0
  7558  		if v_1.Op != OpARM64MOVDconst {
  7559  			break
  7560  		}
  7561  		c := auxIntToInt64(v_1.AuxInt)
  7562  		x := v_2
  7563  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
  7564  			break
  7565  		}
  7566  		v.reset(OpARM64MOVWUreg)
  7567  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
  7568  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
  7569  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7570  		v1.AuxInt = int64ToAuxInt(3)
  7571  		v1.AddArg2(x, x)
  7572  		v0.AddArg2(a, v1)
  7573  		v.AddArg(v0)
  7574  		return true
  7575  	}
  7576  	// match: (MADDW a (MOVDconst [c]) x)
  7577  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
  7578  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
  7579  	for {
  7580  		a := v_0
  7581  		if v_1.Op != OpARM64MOVDconst {
  7582  			break
  7583  		}
  7584  		c := auxIntToInt64(v_1.AuxInt)
  7585  		x := v_2
  7586  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
  7587  			break
  7588  		}
  7589  		v.reset(OpARM64MOVWUreg)
  7590  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
  7591  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
  7592  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7593  		v1.AuxInt = int64ToAuxInt(3)
  7594  		v1.AddArg2(x, x)
  7595  		v0.AddArg2(a, v1)
  7596  		v.AddArg(v0)
  7597  		return true
  7598  	}
  7599  	// match: (MADDW (MOVDconst [c]) x y)
  7600  	// result: (MOVWUreg (ADDconst <x.Type> [c] (MULW <x.Type> x y)))
  7601  	for {
  7602  		if v_0.Op != OpARM64MOVDconst {
  7603  			break
  7604  		}
  7605  		c := auxIntToInt64(v_0.AuxInt)
  7606  		x := v_1
  7607  		y := v_2
  7608  		v.reset(OpARM64MOVWUreg)
  7609  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, x.Type)
  7610  		v0.AuxInt = int64ToAuxInt(c)
  7611  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
  7612  		v1.AddArg2(x, y)
  7613  		v0.AddArg(v1)
  7614  		v.AddArg(v0)
  7615  		return true
  7616  	}
  7617  	// match: (MADDW a (MOVDconst [c]) (MOVDconst [d]))
  7618  	// result: (MOVWUreg (ADDconst <a.Type> [c*d] a))
  7619  	for {
  7620  		a := v_0
  7621  		if v_1.Op != OpARM64MOVDconst {
  7622  			break
  7623  		}
  7624  		c := auxIntToInt64(v_1.AuxInt)
  7625  		if v_2.Op != OpARM64MOVDconst {
  7626  			break
  7627  		}
  7628  		d := auxIntToInt64(v_2.AuxInt)
  7629  		v.reset(OpARM64MOVWUreg)
  7630  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, a.Type)
  7631  		v0.AuxInt = int64ToAuxInt(c * d)
  7632  		v0.AddArg(a)
  7633  		v.AddArg(v0)
  7634  		return true
  7635  	}
  7636  	return false
  7637  }
  7638  func rewriteValueARM64_OpARM64MNEG(v *Value) bool {
  7639  	v_1 := v.Args[1]
  7640  	v_0 := v.Args[0]
  7641  	b := v.Block
  7642  	// match: (MNEG x (MOVDconst [-1]))
  7643  	// result: x
  7644  	for {
  7645  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7646  			x := v_0
  7647  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  7648  				continue
  7649  			}
  7650  			v.copyOf(x)
  7651  			return true
  7652  		}
  7653  		break
  7654  	}
  7655  	// match: (MNEG _ (MOVDconst [0]))
  7656  	// result: (MOVDconst [0])
  7657  	for {
  7658  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7659  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7660  				continue
  7661  			}
  7662  			v.reset(OpARM64MOVDconst)
  7663  			v.AuxInt = int64ToAuxInt(0)
  7664  			return true
  7665  		}
  7666  		break
  7667  	}
  7668  	// match: (MNEG x (MOVDconst [1]))
  7669  	// result: (NEG x)
  7670  	for {
  7671  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7672  			x := v_0
  7673  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
  7674  				continue
  7675  			}
  7676  			v.reset(OpARM64NEG)
  7677  			v.AddArg(x)
  7678  			return true
  7679  		}
  7680  		break
  7681  	}
  7682  	// match: (MNEG x (MOVDconst [c]))
  7683  	// cond: isPowerOfTwo(c)
  7684  	// result: (NEG (SLLconst <x.Type> [log64(c)] x))
  7685  	for {
  7686  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7687  			x := v_0
  7688  			if v_1.Op != OpARM64MOVDconst {
  7689  				continue
  7690  			}
  7691  			c := auxIntToInt64(v_1.AuxInt)
  7692  			if !(isPowerOfTwo(c)) {
  7693  				continue
  7694  			}
  7695  			v.reset(OpARM64NEG)
  7696  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  7697  			v0.AuxInt = int64ToAuxInt(log64(c))
  7698  			v0.AddArg(x)
  7699  			v.AddArg(v0)
  7700  			return true
  7701  		}
  7702  		break
  7703  	}
  7704  	// match: (MNEG x (MOVDconst [c]))
  7705  	// cond: isPowerOfTwo(c-1) && c >= 3
  7706  	// result: (NEG (ADDshiftLL <x.Type> x x [log64(c-1)]))
  7707  	for {
  7708  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7709  			x := v_0
  7710  			if v_1.Op != OpARM64MOVDconst {
  7711  				continue
  7712  			}
  7713  			c := auxIntToInt64(v_1.AuxInt)
  7714  			if !(isPowerOfTwo(c-1) && c >= 3) {
  7715  				continue
  7716  			}
  7717  			v.reset(OpARM64NEG)
  7718  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7719  			v0.AuxInt = int64ToAuxInt(log64(c - 1))
  7720  			v0.AddArg2(x, x)
  7721  			v.AddArg(v0)
  7722  			return true
  7723  		}
  7724  		break
  7725  	}
  7726  	// match: (MNEG x (MOVDconst [c]))
  7727  	// cond: isPowerOfTwo(c+1) && c >= 7
  7728  	// result: (NEG (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)]))
  7729  	for {
  7730  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7731  			x := v_0
  7732  			if v_1.Op != OpARM64MOVDconst {
  7733  				continue
  7734  			}
  7735  			c := auxIntToInt64(v_1.AuxInt)
  7736  			if !(isPowerOfTwo(c+1) && c >= 7) {
  7737  				continue
  7738  			}
  7739  			v.reset(OpARM64NEG)
  7740  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7741  			v0.AuxInt = int64ToAuxInt(log64(c + 1))
  7742  			v1 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  7743  			v1.AddArg(x)
  7744  			v0.AddArg2(v1, x)
  7745  			v.AddArg(v0)
  7746  			return true
  7747  		}
  7748  		break
  7749  	}
  7750  	// match: (MNEG x (MOVDconst [c]))
  7751  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
  7752  	// result: (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2]))
  7753  	for {
  7754  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7755  			x := v_0
  7756  			if v_1.Op != OpARM64MOVDconst {
  7757  				continue
  7758  			}
  7759  			c := auxIntToInt64(v_1.AuxInt)
  7760  			if !(c%3 == 0 && isPowerOfTwo(c/3)) {
  7761  				continue
  7762  			}
  7763  			v.reset(OpARM64SLLconst)
  7764  			v.Type = x.Type
  7765  			v.AuxInt = int64ToAuxInt(log64(c / 3))
  7766  			v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7767  			v0.AuxInt = int64ToAuxInt(2)
  7768  			v0.AddArg2(x, x)
  7769  			v.AddArg(v0)
  7770  			return true
  7771  		}
  7772  		break
  7773  	}
  7774  	// match: (MNEG x (MOVDconst [c]))
  7775  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
  7776  	// result: (NEG (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2])))
  7777  	for {
  7778  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7779  			x := v_0
  7780  			if v_1.Op != OpARM64MOVDconst {
  7781  				continue
  7782  			}
  7783  			c := auxIntToInt64(v_1.AuxInt)
  7784  			if !(c%5 == 0 && isPowerOfTwo(c/5)) {
  7785  				continue
  7786  			}
  7787  			v.reset(OpARM64NEG)
  7788  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  7789  			v0.AuxInt = int64ToAuxInt(log64(c / 5))
  7790  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7791  			v1.AuxInt = int64ToAuxInt(2)
  7792  			v1.AddArg2(x, x)
  7793  			v0.AddArg(v1)
  7794  			v.AddArg(v0)
  7795  			return true
  7796  		}
  7797  		break
  7798  	}
  7799  	// match: (MNEG x (MOVDconst [c]))
  7800  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
  7801  	// result: (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3]))
  7802  	for {
  7803  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7804  			x := v_0
  7805  			if v_1.Op != OpARM64MOVDconst {
  7806  				continue
  7807  			}
  7808  			c := auxIntToInt64(v_1.AuxInt)
  7809  			if !(c%7 == 0 && isPowerOfTwo(c/7)) {
  7810  				continue
  7811  			}
  7812  			v.reset(OpARM64SLLconst)
  7813  			v.Type = x.Type
  7814  			v.AuxInt = int64ToAuxInt(log64(c / 7))
  7815  			v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  7816  			v0.AuxInt = int64ToAuxInt(3)
  7817  			v0.AddArg2(x, x)
  7818  			v.AddArg(v0)
  7819  			return true
  7820  		}
  7821  		break
  7822  	}
  7823  	// match: (MNEG x (MOVDconst [c]))
  7824  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
  7825  	// result: (NEG (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3])))
  7826  	for {
  7827  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7828  			x := v_0
  7829  			if v_1.Op != OpARM64MOVDconst {
  7830  				continue
  7831  			}
  7832  			c := auxIntToInt64(v_1.AuxInt)
  7833  			if !(c%9 == 0 && isPowerOfTwo(c/9)) {
  7834  				continue
  7835  			}
  7836  			v.reset(OpARM64NEG)
  7837  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  7838  			v0.AuxInt = int64ToAuxInt(log64(c / 9))
  7839  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7840  			v1.AuxInt = int64ToAuxInt(3)
  7841  			v1.AddArg2(x, x)
  7842  			v0.AddArg(v1)
  7843  			v.AddArg(v0)
  7844  			return true
  7845  		}
  7846  		break
  7847  	}
  7848  	// match: (MNEG (MOVDconst [c]) (MOVDconst [d]))
  7849  	// result: (MOVDconst [-c*d])
  7850  	for {
  7851  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7852  			if v_0.Op != OpARM64MOVDconst {
  7853  				continue
  7854  			}
  7855  			c := auxIntToInt64(v_0.AuxInt)
  7856  			if v_1.Op != OpARM64MOVDconst {
  7857  				continue
  7858  			}
  7859  			d := auxIntToInt64(v_1.AuxInt)
  7860  			v.reset(OpARM64MOVDconst)
  7861  			v.AuxInt = int64ToAuxInt(-c * d)
  7862  			return true
  7863  		}
  7864  		break
  7865  	}
  7866  	return false
  7867  }
  7868  func rewriteValueARM64_OpARM64MNEGW(v *Value) bool {
  7869  	v_1 := v.Args[1]
  7870  	v_0 := v.Args[0]
  7871  	b := v.Block
  7872  	// match: (MNEGW x (MOVDconst [c]))
  7873  	// cond: int32(c)==-1
  7874  	// result: (MOVWUreg x)
  7875  	for {
  7876  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7877  			x := v_0
  7878  			if v_1.Op != OpARM64MOVDconst {
  7879  				continue
  7880  			}
  7881  			c := auxIntToInt64(v_1.AuxInt)
  7882  			if !(int32(c) == -1) {
  7883  				continue
  7884  			}
  7885  			v.reset(OpARM64MOVWUreg)
  7886  			v.AddArg(x)
  7887  			return true
  7888  		}
  7889  		break
  7890  	}
  7891  	// match: (MNEGW _ (MOVDconst [c]))
  7892  	// cond: int32(c)==0
  7893  	// result: (MOVDconst [0])
  7894  	for {
  7895  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7896  			if v_1.Op != OpARM64MOVDconst {
  7897  				continue
  7898  			}
  7899  			c := auxIntToInt64(v_1.AuxInt)
  7900  			if !(int32(c) == 0) {
  7901  				continue
  7902  			}
  7903  			v.reset(OpARM64MOVDconst)
  7904  			v.AuxInt = int64ToAuxInt(0)
  7905  			return true
  7906  		}
  7907  		break
  7908  	}
  7909  	// match: (MNEGW x (MOVDconst [c]))
  7910  	// cond: int32(c)==1
  7911  	// result: (MOVWUreg (NEG <x.Type> x))
  7912  	for {
  7913  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7914  			x := v_0
  7915  			if v_1.Op != OpARM64MOVDconst {
  7916  				continue
  7917  			}
  7918  			c := auxIntToInt64(v_1.AuxInt)
  7919  			if !(int32(c) == 1) {
  7920  				continue
  7921  			}
  7922  			v.reset(OpARM64MOVWUreg)
  7923  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  7924  			v0.AddArg(x)
  7925  			v.AddArg(v0)
  7926  			return true
  7927  		}
  7928  		break
  7929  	}
  7930  	// match: (MNEGW x (MOVDconst [c]))
  7931  	// cond: isPowerOfTwo(c)
  7932  	// result: (NEG (SLLconst <x.Type> [log64(c)] x))
  7933  	for {
  7934  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7935  			x := v_0
  7936  			if v_1.Op != OpARM64MOVDconst {
  7937  				continue
  7938  			}
  7939  			c := auxIntToInt64(v_1.AuxInt)
  7940  			if !(isPowerOfTwo(c)) {
  7941  				continue
  7942  			}
  7943  			v.reset(OpARM64NEG)
  7944  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  7945  			v0.AuxInt = int64ToAuxInt(log64(c))
  7946  			v0.AddArg(x)
  7947  			v.AddArg(v0)
  7948  			return true
  7949  		}
  7950  		break
  7951  	}
  7952  	// match: (MNEGW x (MOVDconst [c]))
  7953  	// cond: isPowerOfTwo(c-1) && int32(c) >= 3
  7954  	// result: (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> x x [log64(c-1)])))
  7955  	for {
  7956  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7957  			x := v_0
  7958  			if v_1.Op != OpARM64MOVDconst {
  7959  				continue
  7960  			}
  7961  			c := auxIntToInt64(v_1.AuxInt)
  7962  			if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
  7963  				continue
  7964  			}
  7965  			v.reset(OpARM64MOVWUreg)
  7966  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  7967  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7968  			v1.AuxInt = int64ToAuxInt(log64(c - 1))
  7969  			v1.AddArg2(x, x)
  7970  			v0.AddArg(v1)
  7971  			v.AddArg(v0)
  7972  			return true
  7973  		}
  7974  		break
  7975  	}
  7976  	// match: (MNEGW x (MOVDconst [c]))
  7977  	// cond: isPowerOfTwo(c+1) && int32(c) >= 7
  7978  	// result: (MOVWUreg (NEG <x.Type> (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)])))
  7979  	for {
  7980  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  7981  			x := v_0
  7982  			if v_1.Op != OpARM64MOVDconst {
  7983  				continue
  7984  			}
  7985  			c := auxIntToInt64(v_1.AuxInt)
  7986  			if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
  7987  				continue
  7988  			}
  7989  			v.reset(OpARM64MOVWUreg)
  7990  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  7991  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  7992  			v1.AuxInt = int64ToAuxInt(log64(c + 1))
  7993  			v2 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  7994  			v2.AddArg(x)
  7995  			v1.AddArg2(v2, x)
  7996  			v0.AddArg(v1)
  7997  			v.AddArg(v0)
  7998  			return true
  7999  		}
  8000  		break
  8001  	}
  8002  	// match: (MNEGW x (MOVDconst [c]))
  8003  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
  8004  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c/3)] (SUBshiftLL <x.Type> x x [2])))
  8005  	for {
  8006  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8007  			x := v_0
  8008  			if v_1.Op != OpARM64MOVDconst {
  8009  				continue
  8010  			}
  8011  			c := auxIntToInt64(v_1.AuxInt)
  8012  			if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
  8013  				continue
  8014  			}
  8015  			v.reset(OpARM64MOVWUreg)
  8016  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8017  			v0.AuxInt = int64ToAuxInt(log64(c / 3))
  8018  			v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  8019  			v1.AuxInt = int64ToAuxInt(2)
  8020  			v1.AddArg2(x, x)
  8021  			v0.AddArg(v1)
  8022  			v.AddArg(v0)
  8023  			return true
  8024  		}
  8025  		break
  8026  	}
  8027  	// match: (MNEGW x (MOVDconst [c]))
  8028  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
  8029  	// result: (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2]))))
  8030  	for {
  8031  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8032  			x := v_0
  8033  			if v_1.Op != OpARM64MOVDconst {
  8034  				continue
  8035  			}
  8036  			c := auxIntToInt64(v_1.AuxInt)
  8037  			if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
  8038  				continue
  8039  			}
  8040  			v.reset(OpARM64MOVWUreg)
  8041  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8042  			v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8043  			v1.AuxInt = int64ToAuxInt(log64(c / 5))
  8044  			v2 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8045  			v2.AuxInt = int64ToAuxInt(2)
  8046  			v2.AddArg2(x, x)
  8047  			v1.AddArg(v2)
  8048  			v0.AddArg(v1)
  8049  			v.AddArg(v0)
  8050  			return true
  8051  		}
  8052  		break
  8053  	}
  8054  	// match: (MNEGW x (MOVDconst [c]))
  8055  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
  8056  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c/7)] (SUBshiftLL <x.Type> x x [3])))
  8057  	for {
  8058  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8059  			x := v_0
  8060  			if v_1.Op != OpARM64MOVDconst {
  8061  				continue
  8062  			}
  8063  			c := auxIntToInt64(v_1.AuxInt)
  8064  			if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
  8065  				continue
  8066  			}
  8067  			v.reset(OpARM64MOVWUreg)
  8068  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8069  			v0.AuxInt = int64ToAuxInt(log64(c / 7))
  8070  			v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
  8071  			v1.AuxInt = int64ToAuxInt(3)
  8072  			v1.AddArg2(x, x)
  8073  			v0.AddArg(v1)
  8074  			v.AddArg(v0)
  8075  			return true
  8076  		}
  8077  		break
  8078  	}
  8079  	// match: (MNEGW x (MOVDconst [c]))
  8080  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
  8081  	// result: (MOVWUreg (NEG <x.Type> (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3]))))
  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 !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
  8090  				continue
  8091  			}
  8092  			v.reset(OpARM64MOVWUreg)
  8093  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
  8094  			v1 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
  8095  			v1.AuxInt = int64ToAuxInt(log64(c / 9))
  8096  			v2 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
  8097  			v2.AuxInt = int64ToAuxInt(3)
  8098  			v2.AddArg2(x, x)
  8099  			v1.AddArg(v2)
  8100  			v0.AddArg(v1)
  8101  			v.AddArg(v0)
  8102  			return true
  8103  		}
  8104  		break
  8105  	}
  8106  	// match: (MNEGW (MOVDconst [c]) (MOVDconst [d]))
  8107  	// result: (MOVDconst [int64(uint32(-c*d))])
  8108  	for {
  8109  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  8110  			if v_0.Op != OpARM64MOVDconst {
  8111  				continue
  8112  			}
  8113  			c := auxIntToInt64(v_0.AuxInt)
  8114  			if v_1.Op != OpARM64MOVDconst {
  8115  				continue
  8116  			}
  8117  			d := auxIntToInt64(v_1.AuxInt)
  8118  			v.reset(OpARM64MOVDconst)
  8119  			v.AuxInt = int64ToAuxInt(int64(uint32(-c * d)))
  8120  			return true
  8121  		}
  8122  		break
  8123  	}
  8124  	return false
  8125  }
  8126  func rewriteValueARM64_OpARM64MOD(v *Value) bool {
  8127  	v_1 := v.Args[1]
  8128  	v_0 := v.Args[0]
  8129  	// match: (MOD (MOVDconst [c]) (MOVDconst [d]))
  8130  	// cond: d != 0
  8131  	// result: (MOVDconst [c%d])
  8132  	for {
  8133  		if v_0.Op != OpARM64MOVDconst {
  8134  			break
  8135  		}
  8136  		c := auxIntToInt64(v_0.AuxInt)
  8137  		if v_1.Op != OpARM64MOVDconst {
  8138  			break
  8139  		}
  8140  		d := auxIntToInt64(v_1.AuxInt)
  8141  		if !(d != 0) {
  8142  			break
  8143  		}
  8144  		v.reset(OpARM64MOVDconst)
  8145  		v.AuxInt = int64ToAuxInt(c % d)
  8146  		return true
  8147  	}
  8148  	return false
  8149  }
  8150  func rewriteValueARM64_OpARM64MODW(v *Value) bool {
  8151  	v_1 := v.Args[1]
  8152  	v_0 := v.Args[0]
  8153  	// match: (MODW (MOVDconst [c]) (MOVDconst [d]))
  8154  	// cond: d != 0
  8155  	// result: (MOVDconst [int64(uint32(int32(c)%int32(d)))])
  8156  	for {
  8157  		if v_0.Op != OpARM64MOVDconst {
  8158  			break
  8159  		}
  8160  		c := auxIntToInt64(v_0.AuxInt)
  8161  		if v_1.Op != OpARM64MOVDconst {
  8162  			break
  8163  		}
  8164  		d := auxIntToInt64(v_1.AuxInt)
  8165  		if !(d != 0) {
  8166  			break
  8167  		}
  8168  		v.reset(OpARM64MOVDconst)
  8169  		v.AuxInt = int64ToAuxInt(int64(uint32(int32(c) % int32(d))))
  8170  		return true
  8171  	}
  8172  	return false
  8173  }
  8174  func rewriteValueARM64_OpARM64MOVBUload(v *Value) bool {
  8175  	v_1 := v.Args[1]
  8176  	v_0 := v.Args[0]
  8177  	b := v.Block
  8178  	config := b.Func.Config
  8179  	// match: (MOVBUload [off1] {sym} (ADDconst [off2] ptr) mem)
  8180  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8181  	// result: (MOVBUload [off1+int32(off2)] {sym} ptr mem)
  8182  	for {
  8183  		off1 := auxIntToInt32(v.AuxInt)
  8184  		sym := auxToSym(v.Aux)
  8185  		if v_0.Op != OpARM64ADDconst {
  8186  			break
  8187  		}
  8188  		off2 := auxIntToInt64(v_0.AuxInt)
  8189  		ptr := v_0.Args[0]
  8190  		mem := v_1
  8191  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8192  			break
  8193  		}
  8194  		v.reset(OpARM64MOVBUload)
  8195  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8196  		v.Aux = symToAux(sym)
  8197  		v.AddArg2(ptr, mem)
  8198  		return true
  8199  	}
  8200  	// match: (MOVBUload [off] {sym} (ADD ptr idx) mem)
  8201  	// cond: off == 0 && sym == nil
  8202  	// result: (MOVBUloadidx ptr idx mem)
  8203  	for {
  8204  		off := auxIntToInt32(v.AuxInt)
  8205  		sym := auxToSym(v.Aux)
  8206  		if v_0.Op != OpARM64ADD {
  8207  			break
  8208  		}
  8209  		idx := v_0.Args[1]
  8210  		ptr := v_0.Args[0]
  8211  		mem := v_1
  8212  		if !(off == 0 && sym == nil) {
  8213  			break
  8214  		}
  8215  		v.reset(OpARM64MOVBUloadidx)
  8216  		v.AddArg3(ptr, idx, mem)
  8217  		return true
  8218  	}
  8219  	// match: (MOVBUload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  8220  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8221  	// result: (MOVBUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8222  	for {
  8223  		off1 := auxIntToInt32(v.AuxInt)
  8224  		sym1 := auxToSym(v.Aux)
  8225  		if v_0.Op != OpARM64MOVDaddr {
  8226  			break
  8227  		}
  8228  		off2 := auxIntToInt32(v_0.AuxInt)
  8229  		sym2 := auxToSym(v_0.Aux)
  8230  		ptr := v_0.Args[0]
  8231  		mem := v_1
  8232  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8233  			break
  8234  		}
  8235  		v.reset(OpARM64MOVBUload)
  8236  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8237  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8238  		v.AddArg2(ptr, mem)
  8239  		return true
  8240  	}
  8241  	// match: (MOVBUload [off] {sym} ptr (MOVBstorezero [off2] {sym2} ptr2 _))
  8242  	// cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
  8243  	// result: (MOVDconst [0])
  8244  	for {
  8245  		off := auxIntToInt32(v.AuxInt)
  8246  		sym := auxToSym(v.Aux)
  8247  		ptr := v_0
  8248  		if v_1.Op != OpARM64MOVBstorezero {
  8249  			break
  8250  		}
  8251  		off2 := auxIntToInt32(v_1.AuxInt)
  8252  		sym2 := auxToSym(v_1.Aux)
  8253  		ptr2 := v_1.Args[0]
  8254  		if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
  8255  			break
  8256  		}
  8257  		v.reset(OpARM64MOVDconst)
  8258  		v.AuxInt = int64ToAuxInt(0)
  8259  		return true
  8260  	}
  8261  	// match: (MOVBUload [off] {sym} (SB) _)
  8262  	// cond: symIsRO(sym)
  8263  	// result: (MOVDconst [int64(read8(sym, int64(off)))])
  8264  	for {
  8265  		off := auxIntToInt32(v.AuxInt)
  8266  		sym := auxToSym(v.Aux)
  8267  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  8268  			break
  8269  		}
  8270  		v.reset(OpARM64MOVDconst)
  8271  		v.AuxInt = int64ToAuxInt(int64(read8(sym, int64(off))))
  8272  		return true
  8273  	}
  8274  	return false
  8275  }
  8276  func rewriteValueARM64_OpARM64MOVBUloadidx(v *Value) bool {
  8277  	v_2 := v.Args[2]
  8278  	v_1 := v.Args[1]
  8279  	v_0 := v.Args[0]
  8280  	// match: (MOVBUloadidx ptr (MOVDconst [c]) mem)
  8281  	// cond: is32Bit(c)
  8282  	// result: (MOVBUload [int32(c)] ptr mem)
  8283  	for {
  8284  		ptr := v_0
  8285  		if v_1.Op != OpARM64MOVDconst {
  8286  			break
  8287  		}
  8288  		c := auxIntToInt64(v_1.AuxInt)
  8289  		mem := v_2
  8290  		if !(is32Bit(c)) {
  8291  			break
  8292  		}
  8293  		v.reset(OpARM64MOVBUload)
  8294  		v.AuxInt = int32ToAuxInt(int32(c))
  8295  		v.AddArg2(ptr, mem)
  8296  		return true
  8297  	}
  8298  	// match: (MOVBUloadidx (MOVDconst [c]) ptr mem)
  8299  	// cond: is32Bit(c)
  8300  	// result: (MOVBUload [int32(c)] ptr mem)
  8301  	for {
  8302  		if v_0.Op != OpARM64MOVDconst {
  8303  			break
  8304  		}
  8305  		c := auxIntToInt64(v_0.AuxInt)
  8306  		ptr := v_1
  8307  		mem := v_2
  8308  		if !(is32Bit(c)) {
  8309  			break
  8310  		}
  8311  		v.reset(OpARM64MOVBUload)
  8312  		v.AuxInt = int32ToAuxInt(int32(c))
  8313  		v.AddArg2(ptr, mem)
  8314  		return true
  8315  	}
  8316  	// match: (MOVBUloadidx ptr idx (MOVBstorezeroidx ptr2 idx2 _))
  8317  	// cond: (isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2))
  8318  	// result: (MOVDconst [0])
  8319  	for {
  8320  		ptr := v_0
  8321  		idx := v_1
  8322  		if v_2.Op != OpARM64MOVBstorezeroidx {
  8323  			break
  8324  		}
  8325  		idx2 := v_2.Args[1]
  8326  		ptr2 := v_2.Args[0]
  8327  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
  8328  			break
  8329  		}
  8330  		v.reset(OpARM64MOVDconst)
  8331  		v.AuxInt = int64ToAuxInt(0)
  8332  		return true
  8333  	}
  8334  	return false
  8335  }
  8336  func rewriteValueARM64_OpARM64MOVBUreg(v *Value) bool {
  8337  	v_0 := v.Args[0]
  8338  	// match: (MOVBUreg (ANDconst [c] x))
  8339  	// result: (ANDconst [c&(1<<8-1)] x)
  8340  	for {
  8341  		if v_0.Op != OpARM64ANDconst {
  8342  			break
  8343  		}
  8344  		c := auxIntToInt64(v_0.AuxInt)
  8345  		x := v_0.Args[0]
  8346  		v.reset(OpARM64ANDconst)
  8347  		v.AuxInt = int64ToAuxInt(c & (1<<8 - 1))
  8348  		v.AddArg(x)
  8349  		return true
  8350  	}
  8351  	// match: (MOVBUreg (MOVDconst [c]))
  8352  	// result: (MOVDconst [int64(uint8(c))])
  8353  	for {
  8354  		if v_0.Op != OpARM64MOVDconst {
  8355  			break
  8356  		}
  8357  		c := auxIntToInt64(v_0.AuxInt)
  8358  		v.reset(OpARM64MOVDconst)
  8359  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  8360  		return true
  8361  	}
  8362  	// match: (MOVBUreg x)
  8363  	// cond: v.Type.Size() <= 1
  8364  	// result: x
  8365  	for {
  8366  		x := v_0
  8367  		if !(v.Type.Size() <= 1) {
  8368  			break
  8369  		}
  8370  		v.copyOf(x)
  8371  		return true
  8372  	}
  8373  	// match: (MOVBUreg (SLLconst [lc] x))
  8374  	// cond: lc >= 8
  8375  	// result: (MOVDconst [0])
  8376  	for {
  8377  		if v_0.Op != OpARM64SLLconst {
  8378  			break
  8379  		}
  8380  		lc := auxIntToInt64(v_0.AuxInt)
  8381  		if !(lc >= 8) {
  8382  			break
  8383  		}
  8384  		v.reset(OpARM64MOVDconst)
  8385  		v.AuxInt = int64ToAuxInt(0)
  8386  		return true
  8387  	}
  8388  	// match: (MOVBUreg (SLLconst [lc] x))
  8389  	// cond: lc < 8
  8390  	// result: (UBFIZ [armBFAuxInt(lc, 8-lc)] x)
  8391  	for {
  8392  		if v_0.Op != OpARM64SLLconst {
  8393  			break
  8394  		}
  8395  		lc := auxIntToInt64(v_0.AuxInt)
  8396  		x := v_0.Args[0]
  8397  		if !(lc < 8) {
  8398  			break
  8399  		}
  8400  		v.reset(OpARM64UBFIZ)
  8401  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 8-lc))
  8402  		v.AddArg(x)
  8403  		return true
  8404  	}
  8405  	// match: (MOVBUreg (SRLconst [rc] x))
  8406  	// cond: rc < 8
  8407  	// result: (UBFX [armBFAuxInt(rc, 8)] x)
  8408  	for {
  8409  		if v_0.Op != OpARM64SRLconst {
  8410  			break
  8411  		}
  8412  		rc := auxIntToInt64(v_0.AuxInt)
  8413  		x := v_0.Args[0]
  8414  		if !(rc < 8) {
  8415  			break
  8416  		}
  8417  		v.reset(OpARM64UBFX)
  8418  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8))
  8419  		v.AddArg(x)
  8420  		return true
  8421  	}
  8422  	// match: (MOVBUreg (UBFX [bfc] x))
  8423  	// cond: bfc.width() <= 8
  8424  	// result: (UBFX [bfc] x)
  8425  	for {
  8426  		if v_0.Op != OpARM64UBFX {
  8427  			break
  8428  		}
  8429  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  8430  		x := v_0.Args[0]
  8431  		if !(bfc.width() <= 8) {
  8432  			break
  8433  		}
  8434  		v.reset(OpARM64UBFX)
  8435  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
  8436  		v.AddArg(x)
  8437  		return true
  8438  	}
  8439  	return false
  8440  }
  8441  func rewriteValueARM64_OpARM64MOVBload(v *Value) bool {
  8442  	v_1 := v.Args[1]
  8443  	v_0 := v.Args[0]
  8444  	b := v.Block
  8445  	config := b.Func.Config
  8446  	// match: (MOVBload [off1] {sym} (ADDconst [off2] ptr) mem)
  8447  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8448  	// result: (MOVBload [off1+int32(off2)] {sym} ptr mem)
  8449  	for {
  8450  		off1 := auxIntToInt32(v.AuxInt)
  8451  		sym := auxToSym(v.Aux)
  8452  		if v_0.Op != OpARM64ADDconst {
  8453  			break
  8454  		}
  8455  		off2 := auxIntToInt64(v_0.AuxInt)
  8456  		ptr := v_0.Args[0]
  8457  		mem := v_1
  8458  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8459  			break
  8460  		}
  8461  		v.reset(OpARM64MOVBload)
  8462  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8463  		v.Aux = symToAux(sym)
  8464  		v.AddArg2(ptr, mem)
  8465  		return true
  8466  	}
  8467  	// match: (MOVBload [off] {sym} (ADD ptr idx) mem)
  8468  	// cond: off == 0 && sym == nil
  8469  	// result: (MOVBloadidx ptr idx mem)
  8470  	for {
  8471  		off := auxIntToInt32(v.AuxInt)
  8472  		sym := auxToSym(v.Aux)
  8473  		if v_0.Op != OpARM64ADD {
  8474  			break
  8475  		}
  8476  		idx := v_0.Args[1]
  8477  		ptr := v_0.Args[0]
  8478  		mem := v_1
  8479  		if !(off == 0 && sym == nil) {
  8480  			break
  8481  		}
  8482  		v.reset(OpARM64MOVBloadidx)
  8483  		v.AddArg3(ptr, idx, mem)
  8484  		return true
  8485  	}
  8486  	// match: (MOVBload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  8487  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8488  	// result: (MOVBload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8489  	for {
  8490  		off1 := auxIntToInt32(v.AuxInt)
  8491  		sym1 := auxToSym(v.Aux)
  8492  		if v_0.Op != OpARM64MOVDaddr {
  8493  			break
  8494  		}
  8495  		off2 := auxIntToInt32(v_0.AuxInt)
  8496  		sym2 := auxToSym(v_0.Aux)
  8497  		ptr := v_0.Args[0]
  8498  		mem := v_1
  8499  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8500  			break
  8501  		}
  8502  		v.reset(OpARM64MOVBload)
  8503  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8504  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8505  		v.AddArg2(ptr, mem)
  8506  		return true
  8507  	}
  8508  	// match: (MOVBload [off] {sym} ptr (MOVBstorezero [off2] {sym2} ptr2 _))
  8509  	// cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
  8510  	// result: (MOVDconst [0])
  8511  	for {
  8512  		off := auxIntToInt32(v.AuxInt)
  8513  		sym := auxToSym(v.Aux)
  8514  		ptr := v_0
  8515  		if v_1.Op != OpARM64MOVBstorezero {
  8516  			break
  8517  		}
  8518  		off2 := auxIntToInt32(v_1.AuxInt)
  8519  		sym2 := auxToSym(v_1.Aux)
  8520  		ptr2 := v_1.Args[0]
  8521  		if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
  8522  			break
  8523  		}
  8524  		v.reset(OpARM64MOVDconst)
  8525  		v.AuxInt = int64ToAuxInt(0)
  8526  		return true
  8527  	}
  8528  	return false
  8529  }
  8530  func rewriteValueARM64_OpARM64MOVBloadidx(v *Value) bool {
  8531  	v_2 := v.Args[2]
  8532  	v_1 := v.Args[1]
  8533  	v_0 := v.Args[0]
  8534  	// match: (MOVBloadidx ptr (MOVDconst [c]) mem)
  8535  	// cond: is32Bit(c)
  8536  	// result: (MOVBload [int32(c)] ptr mem)
  8537  	for {
  8538  		ptr := v_0
  8539  		if v_1.Op != OpARM64MOVDconst {
  8540  			break
  8541  		}
  8542  		c := auxIntToInt64(v_1.AuxInt)
  8543  		mem := v_2
  8544  		if !(is32Bit(c)) {
  8545  			break
  8546  		}
  8547  		v.reset(OpARM64MOVBload)
  8548  		v.AuxInt = int32ToAuxInt(int32(c))
  8549  		v.AddArg2(ptr, mem)
  8550  		return true
  8551  	}
  8552  	// match: (MOVBloadidx (MOVDconst [c]) ptr mem)
  8553  	// cond: is32Bit(c)
  8554  	// result: (MOVBload [int32(c)] ptr mem)
  8555  	for {
  8556  		if v_0.Op != OpARM64MOVDconst {
  8557  			break
  8558  		}
  8559  		c := auxIntToInt64(v_0.AuxInt)
  8560  		ptr := v_1
  8561  		mem := v_2
  8562  		if !(is32Bit(c)) {
  8563  			break
  8564  		}
  8565  		v.reset(OpARM64MOVBload)
  8566  		v.AuxInt = int32ToAuxInt(int32(c))
  8567  		v.AddArg2(ptr, mem)
  8568  		return true
  8569  	}
  8570  	// match: (MOVBloadidx ptr idx (MOVBstorezeroidx ptr2 idx2 _))
  8571  	// cond: (isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2))
  8572  	// result: (MOVDconst [0])
  8573  	for {
  8574  		ptr := v_0
  8575  		idx := v_1
  8576  		if v_2.Op != OpARM64MOVBstorezeroidx {
  8577  			break
  8578  		}
  8579  		idx2 := v_2.Args[1]
  8580  		ptr2 := v_2.Args[0]
  8581  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
  8582  			break
  8583  		}
  8584  		v.reset(OpARM64MOVDconst)
  8585  		v.AuxInt = int64ToAuxInt(0)
  8586  		return true
  8587  	}
  8588  	return false
  8589  }
  8590  func rewriteValueARM64_OpARM64MOVBreg(v *Value) bool {
  8591  	v_0 := v.Args[0]
  8592  	// match: (MOVBreg (MOVDconst [c]))
  8593  	// result: (MOVDconst [int64(int8(c))])
  8594  	for {
  8595  		if v_0.Op != OpARM64MOVDconst {
  8596  			break
  8597  		}
  8598  		c := auxIntToInt64(v_0.AuxInt)
  8599  		v.reset(OpARM64MOVDconst)
  8600  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  8601  		return true
  8602  	}
  8603  	// match: (MOVBreg x)
  8604  	// cond: v.Type.Size() <= 1
  8605  	// result: x
  8606  	for {
  8607  		x := v_0
  8608  		if !(v.Type.Size() <= 1) {
  8609  			break
  8610  		}
  8611  		v.copyOf(x)
  8612  		return true
  8613  	}
  8614  	// match: (MOVBreg <t> (ANDconst x [c]))
  8615  	// cond: uint64(c) & uint64(0xffffffffffffff80) == 0
  8616  	// result: (ANDconst <t> x [c])
  8617  	for {
  8618  		t := v.Type
  8619  		if v_0.Op != OpARM64ANDconst {
  8620  			break
  8621  		}
  8622  		c := auxIntToInt64(v_0.AuxInt)
  8623  		x := v_0.Args[0]
  8624  		if !(uint64(c)&uint64(0xffffffffffffff80) == 0) {
  8625  			break
  8626  		}
  8627  		v.reset(OpARM64ANDconst)
  8628  		v.Type = t
  8629  		v.AuxInt = int64ToAuxInt(c)
  8630  		v.AddArg(x)
  8631  		return true
  8632  	}
  8633  	// match: (MOVBreg (SLLconst [lc] x))
  8634  	// cond: lc < 8
  8635  	// result: (SBFIZ [armBFAuxInt(lc, 8-lc)] x)
  8636  	for {
  8637  		if v_0.Op != OpARM64SLLconst {
  8638  			break
  8639  		}
  8640  		lc := auxIntToInt64(v_0.AuxInt)
  8641  		x := v_0.Args[0]
  8642  		if !(lc < 8) {
  8643  			break
  8644  		}
  8645  		v.reset(OpARM64SBFIZ)
  8646  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 8-lc))
  8647  		v.AddArg(x)
  8648  		return true
  8649  	}
  8650  	// match: (MOVBreg (SBFX [bfc] x))
  8651  	// cond: bfc.width() <= 8
  8652  	// result: (SBFX [bfc] x)
  8653  	for {
  8654  		if v_0.Op != OpARM64SBFX {
  8655  			break
  8656  		}
  8657  		bfc := auxIntToArm64BitField(v_0.AuxInt)
  8658  		x := v_0.Args[0]
  8659  		if !(bfc.width() <= 8) {
  8660  			break
  8661  		}
  8662  		v.reset(OpARM64SBFX)
  8663  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
  8664  		v.AddArg(x)
  8665  		return true
  8666  	}
  8667  	return false
  8668  }
  8669  func rewriteValueARM64_OpARM64MOVBstore(v *Value) bool {
  8670  	v_2 := v.Args[2]
  8671  	v_1 := v.Args[1]
  8672  	v_0 := v.Args[0]
  8673  	b := v.Block
  8674  	config := b.Func.Config
  8675  	// match: (MOVBstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  8676  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8677  	// result: (MOVBstore [off1+int32(off2)] {sym} ptr val mem)
  8678  	for {
  8679  		off1 := auxIntToInt32(v.AuxInt)
  8680  		sym := auxToSym(v.Aux)
  8681  		if v_0.Op != OpARM64ADDconst {
  8682  			break
  8683  		}
  8684  		off2 := auxIntToInt64(v_0.AuxInt)
  8685  		ptr := v_0.Args[0]
  8686  		val := v_1
  8687  		mem := v_2
  8688  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8689  			break
  8690  		}
  8691  		v.reset(OpARM64MOVBstore)
  8692  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8693  		v.Aux = symToAux(sym)
  8694  		v.AddArg3(ptr, val, mem)
  8695  		return true
  8696  	}
  8697  	// match: (MOVBstore [off] {sym} (ADD ptr idx) val mem)
  8698  	// cond: off == 0 && sym == nil
  8699  	// result: (MOVBstoreidx ptr idx val mem)
  8700  	for {
  8701  		off := auxIntToInt32(v.AuxInt)
  8702  		sym := auxToSym(v.Aux)
  8703  		if v_0.Op != OpARM64ADD {
  8704  			break
  8705  		}
  8706  		idx := v_0.Args[1]
  8707  		ptr := v_0.Args[0]
  8708  		val := v_1
  8709  		mem := v_2
  8710  		if !(off == 0 && sym == nil) {
  8711  			break
  8712  		}
  8713  		v.reset(OpARM64MOVBstoreidx)
  8714  		v.AddArg4(ptr, idx, val, mem)
  8715  		return true
  8716  	}
  8717  	// match: (MOVBstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  8718  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  8719  	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  8720  	for {
  8721  		off1 := auxIntToInt32(v.AuxInt)
  8722  		sym1 := auxToSym(v.Aux)
  8723  		if v_0.Op != OpARM64MOVDaddr {
  8724  			break
  8725  		}
  8726  		off2 := auxIntToInt32(v_0.AuxInt)
  8727  		sym2 := auxToSym(v_0.Aux)
  8728  		ptr := v_0.Args[0]
  8729  		val := v_1
  8730  		mem := v_2
  8731  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  8732  			break
  8733  		}
  8734  		v.reset(OpARM64MOVBstore)
  8735  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8736  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8737  		v.AddArg3(ptr, val, mem)
  8738  		return true
  8739  	}
  8740  	// match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
  8741  	// result: (MOVBstorezero [off] {sym} ptr mem)
  8742  	for {
  8743  		off := auxIntToInt32(v.AuxInt)
  8744  		sym := auxToSym(v.Aux)
  8745  		ptr := v_0
  8746  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  8747  			break
  8748  		}
  8749  		mem := v_2
  8750  		v.reset(OpARM64MOVBstorezero)
  8751  		v.AuxInt = int32ToAuxInt(off)
  8752  		v.Aux = symToAux(sym)
  8753  		v.AddArg2(ptr, mem)
  8754  		return true
  8755  	}
  8756  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  8757  	// result: (MOVBstore [off] {sym} ptr x mem)
  8758  	for {
  8759  		off := auxIntToInt32(v.AuxInt)
  8760  		sym := auxToSym(v.Aux)
  8761  		ptr := v_0
  8762  		if v_1.Op != OpARM64MOVBreg {
  8763  			break
  8764  		}
  8765  		x := v_1.Args[0]
  8766  		mem := v_2
  8767  		v.reset(OpARM64MOVBstore)
  8768  		v.AuxInt = int32ToAuxInt(off)
  8769  		v.Aux = symToAux(sym)
  8770  		v.AddArg3(ptr, x, mem)
  8771  		return true
  8772  	}
  8773  	// match: (MOVBstore [off] {sym} ptr (MOVBUreg x) mem)
  8774  	// result: (MOVBstore [off] {sym} ptr x mem)
  8775  	for {
  8776  		off := auxIntToInt32(v.AuxInt)
  8777  		sym := auxToSym(v.Aux)
  8778  		ptr := v_0
  8779  		if v_1.Op != OpARM64MOVBUreg {
  8780  			break
  8781  		}
  8782  		x := v_1.Args[0]
  8783  		mem := v_2
  8784  		v.reset(OpARM64MOVBstore)
  8785  		v.AuxInt = int32ToAuxInt(off)
  8786  		v.Aux = symToAux(sym)
  8787  		v.AddArg3(ptr, x, mem)
  8788  		return true
  8789  	}
  8790  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  8791  	// result: (MOVBstore [off] {sym} ptr x mem)
  8792  	for {
  8793  		off := auxIntToInt32(v.AuxInt)
  8794  		sym := auxToSym(v.Aux)
  8795  		ptr := v_0
  8796  		if v_1.Op != OpARM64MOVHreg {
  8797  			break
  8798  		}
  8799  		x := v_1.Args[0]
  8800  		mem := v_2
  8801  		v.reset(OpARM64MOVBstore)
  8802  		v.AuxInt = int32ToAuxInt(off)
  8803  		v.Aux = symToAux(sym)
  8804  		v.AddArg3(ptr, x, mem)
  8805  		return true
  8806  	}
  8807  	// match: (MOVBstore [off] {sym} ptr (MOVHUreg x) mem)
  8808  	// result: (MOVBstore [off] {sym} ptr x mem)
  8809  	for {
  8810  		off := auxIntToInt32(v.AuxInt)
  8811  		sym := auxToSym(v.Aux)
  8812  		ptr := v_0
  8813  		if v_1.Op != OpARM64MOVHUreg {
  8814  			break
  8815  		}
  8816  		x := v_1.Args[0]
  8817  		mem := v_2
  8818  		v.reset(OpARM64MOVBstore)
  8819  		v.AuxInt = int32ToAuxInt(off)
  8820  		v.Aux = symToAux(sym)
  8821  		v.AddArg3(ptr, x, mem)
  8822  		return true
  8823  	}
  8824  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  8825  	// result: (MOVBstore [off] {sym} ptr x mem)
  8826  	for {
  8827  		off := auxIntToInt32(v.AuxInt)
  8828  		sym := auxToSym(v.Aux)
  8829  		ptr := v_0
  8830  		if v_1.Op != OpARM64MOVWreg {
  8831  			break
  8832  		}
  8833  		x := v_1.Args[0]
  8834  		mem := v_2
  8835  		v.reset(OpARM64MOVBstore)
  8836  		v.AuxInt = int32ToAuxInt(off)
  8837  		v.Aux = symToAux(sym)
  8838  		v.AddArg3(ptr, x, mem)
  8839  		return true
  8840  	}
  8841  	// match: (MOVBstore [off] {sym} ptr (MOVWUreg x) mem)
  8842  	// result: (MOVBstore [off] {sym} ptr x mem)
  8843  	for {
  8844  		off := auxIntToInt32(v.AuxInt)
  8845  		sym := auxToSym(v.Aux)
  8846  		ptr := v_0
  8847  		if v_1.Op != OpARM64MOVWUreg {
  8848  			break
  8849  		}
  8850  		x := v_1.Args[0]
  8851  		mem := v_2
  8852  		v.reset(OpARM64MOVBstore)
  8853  		v.AuxInt = int32ToAuxInt(off)
  8854  		v.Aux = symToAux(sym)
  8855  		v.AddArg3(ptr, x, mem)
  8856  		return true
  8857  	}
  8858  	return false
  8859  }
  8860  func rewriteValueARM64_OpARM64MOVBstoreidx(v *Value) bool {
  8861  	v_3 := v.Args[3]
  8862  	v_2 := v.Args[2]
  8863  	v_1 := v.Args[1]
  8864  	v_0 := v.Args[0]
  8865  	// match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
  8866  	// cond: is32Bit(c)
  8867  	// result: (MOVBstore [int32(c)] ptr val mem)
  8868  	for {
  8869  		ptr := v_0
  8870  		if v_1.Op != OpARM64MOVDconst {
  8871  			break
  8872  		}
  8873  		c := auxIntToInt64(v_1.AuxInt)
  8874  		val := v_2
  8875  		mem := v_3
  8876  		if !(is32Bit(c)) {
  8877  			break
  8878  		}
  8879  		v.reset(OpARM64MOVBstore)
  8880  		v.AuxInt = int32ToAuxInt(int32(c))
  8881  		v.AddArg3(ptr, val, mem)
  8882  		return true
  8883  	}
  8884  	// match: (MOVBstoreidx (MOVDconst [c]) idx val mem)
  8885  	// cond: is32Bit(c)
  8886  	// result: (MOVBstore [int32(c)] idx val mem)
  8887  	for {
  8888  		if v_0.Op != OpARM64MOVDconst {
  8889  			break
  8890  		}
  8891  		c := auxIntToInt64(v_0.AuxInt)
  8892  		idx := v_1
  8893  		val := v_2
  8894  		mem := v_3
  8895  		if !(is32Bit(c)) {
  8896  			break
  8897  		}
  8898  		v.reset(OpARM64MOVBstore)
  8899  		v.AuxInt = int32ToAuxInt(int32(c))
  8900  		v.AddArg3(idx, val, mem)
  8901  		return true
  8902  	}
  8903  	// match: (MOVBstoreidx ptr idx (MOVDconst [0]) mem)
  8904  	// result: (MOVBstorezeroidx ptr idx mem)
  8905  	for {
  8906  		ptr := v_0
  8907  		idx := v_1
  8908  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
  8909  			break
  8910  		}
  8911  		mem := v_3
  8912  		v.reset(OpARM64MOVBstorezeroidx)
  8913  		v.AddArg3(ptr, idx, mem)
  8914  		return true
  8915  	}
  8916  	// match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
  8917  	// result: (MOVBstoreidx ptr idx x mem)
  8918  	for {
  8919  		ptr := v_0
  8920  		idx := v_1
  8921  		if v_2.Op != OpARM64MOVBreg {
  8922  			break
  8923  		}
  8924  		x := v_2.Args[0]
  8925  		mem := v_3
  8926  		v.reset(OpARM64MOVBstoreidx)
  8927  		v.AddArg4(ptr, idx, x, mem)
  8928  		return true
  8929  	}
  8930  	// match: (MOVBstoreidx ptr idx (MOVBUreg x) mem)
  8931  	// result: (MOVBstoreidx ptr idx x mem)
  8932  	for {
  8933  		ptr := v_0
  8934  		idx := v_1
  8935  		if v_2.Op != OpARM64MOVBUreg {
  8936  			break
  8937  		}
  8938  		x := v_2.Args[0]
  8939  		mem := v_3
  8940  		v.reset(OpARM64MOVBstoreidx)
  8941  		v.AddArg4(ptr, idx, x, mem)
  8942  		return true
  8943  	}
  8944  	// match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
  8945  	// result: (MOVBstoreidx ptr idx x mem)
  8946  	for {
  8947  		ptr := v_0
  8948  		idx := v_1
  8949  		if v_2.Op != OpARM64MOVHreg {
  8950  			break
  8951  		}
  8952  		x := v_2.Args[0]
  8953  		mem := v_3
  8954  		v.reset(OpARM64MOVBstoreidx)
  8955  		v.AddArg4(ptr, idx, x, mem)
  8956  		return true
  8957  	}
  8958  	// match: (MOVBstoreidx ptr idx (MOVHUreg x) mem)
  8959  	// result: (MOVBstoreidx ptr idx x mem)
  8960  	for {
  8961  		ptr := v_0
  8962  		idx := v_1
  8963  		if v_2.Op != OpARM64MOVHUreg {
  8964  			break
  8965  		}
  8966  		x := v_2.Args[0]
  8967  		mem := v_3
  8968  		v.reset(OpARM64MOVBstoreidx)
  8969  		v.AddArg4(ptr, idx, x, mem)
  8970  		return true
  8971  	}
  8972  	// match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
  8973  	// result: (MOVBstoreidx ptr idx x mem)
  8974  	for {
  8975  		ptr := v_0
  8976  		idx := v_1
  8977  		if v_2.Op != OpARM64MOVWreg {
  8978  			break
  8979  		}
  8980  		x := v_2.Args[0]
  8981  		mem := v_3
  8982  		v.reset(OpARM64MOVBstoreidx)
  8983  		v.AddArg4(ptr, idx, x, mem)
  8984  		return true
  8985  	}
  8986  	// match: (MOVBstoreidx ptr idx (MOVWUreg x) mem)
  8987  	// result: (MOVBstoreidx ptr idx x mem)
  8988  	for {
  8989  		ptr := v_0
  8990  		idx := v_1
  8991  		if v_2.Op != OpARM64MOVWUreg {
  8992  			break
  8993  		}
  8994  		x := v_2.Args[0]
  8995  		mem := v_3
  8996  		v.reset(OpARM64MOVBstoreidx)
  8997  		v.AddArg4(ptr, idx, x, mem)
  8998  		return true
  8999  	}
  9000  	return false
  9001  }
  9002  func rewriteValueARM64_OpARM64MOVBstorezero(v *Value) bool {
  9003  	v_1 := v.Args[1]
  9004  	v_0 := v.Args[0]
  9005  	b := v.Block
  9006  	config := b.Func.Config
  9007  	// match: (MOVBstorezero [off1] {sym} (ADDconst [off2] ptr) mem)
  9008  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9009  	// result: (MOVBstorezero [off1+int32(off2)] {sym} ptr mem)
  9010  	for {
  9011  		off1 := auxIntToInt32(v.AuxInt)
  9012  		sym := auxToSym(v.Aux)
  9013  		if v_0.Op != OpARM64ADDconst {
  9014  			break
  9015  		}
  9016  		off2 := auxIntToInt64(v_0.AuxInt)
  9017  		ptr := v_0.Args[0]
  9018  		mem := v_1
  9019  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9020  			break
  9021  		}
  9022  		v.reset(OpARM64MOVBstorezero)
  9023  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9024  		v.Aux = symToAux(sym)
  9025  		v.AddArg2(ptr, mem)
  9026  		return true
  9027  	}
  9028  	// match: (MOVBstorezero [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  9029  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9030  	// result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9031  	for {
  9032  		off1 := auxIntToInt32(v.AuxInt)
  9033  		sym1 := auxToSym(v.Aux)
  9034  		if v_0.Op != OpARM64MOVDaddr {
  9035  			break
  9036  		}
  9037  		off2 := auxIntToInt32(v_0.AuxInt)
  9038  		sym2 := auxToSym(v_0.Aux)
  9039  		ptr := v_0.Args[0]
  9040  		mem := v_1
  9041  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9042  			break
  9043  		}
  9044  		v.reset(OpARM64MOVBstorezero)
  9045  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9046  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9047  		v.AddArg2(ptr, mem)
  9048  		return true
  9049  	}
  9050  	// match: (MOVBstorezero [off] {sym} (ADD ptr idx) mem)
  9051  	// cond: off == 0 && sym == nil
  9052  	// result: (MOVBstorezeroidx ptr idx mem)
  9053  	for {
  9054  		off := auxIntToInt32(v.AuxInt)
  9055  		sym := auxToSym(v.Aux)
  9056  		if v_0.Op != OpARM64ADD {
  9057  			break
  9058  		}
  9059  		idx := v_0.Args[1]
  9060  		ptr := v_0.Args[0]
  9061  		mem := v_1
  9062  		if !(off == 0 && sym == nil) {
  9063  			break
  9064  		}
  9065  		v.reset(OpARM64MOVBstorezeroidx)
  9066  		v.AddArg3(ptr, idx, mem)
  9067  		return true
  9068  	}
  9069  	return false
  9070  }
  9071  func rewriteValueARM64_OpARM64MOVBstorezeroidx(v *Value) bool {
  9072  	v_2 := v.Args[2]
  9073  	v_1 := v.Args[1]
  9074  	v_0 := v.Args[0]
  9075  	// match: (MOVBstorezeroidx ptr (MOVDconst [c]) mem)
  9076  	// cond: is32Bit(c)
  9077  	// result: (MOVBstorezero [int32(c)] ptr mem)
  9078  	for {
  9079  		ptr := v_0
  9080  		if v_1.Op != OpARM64MOVDconst {
  9081  			break
  9082  		}
  9083  		c := auxIntToInt64(v_1.AuxInt)
  9084  		mem := v_2
  9085  		if !(is32Bit(c)) {
  9086  			break
  9087  		}
  9088  		v.reset(OpARM64MOVBstorezero)
  9089  		v.AuxInt = int32ToAuxInt(int32(c))
  9090  		v.AddArg2(ptr, mem)
  9091  		return true
  9092  	}
  9093  	// match: (MOVBstorezeroidx (MOVDconst [c]) idx mem)
  9094  	// cond: is32Bit(c)
  9095  	// result: (MOVBstorezero [int32(c)] idx mem)
  9096  	for {
  9097  		if v_0.Op != OpARM64MOVDconst {
  9098  			break
  9099  		}
  9100  		c := auxIntToInt64(v_0.AuxInt)
  9101  		idx := v_1
  9102  		mem := v_2
  9103  		if !(is32Bit(c)) {
  9104  			break
  9105  		}
  9106  		v.reset(OpARM64MOVBstorezero)
  9107  		v.AuxInt = int32ToAuxInt(int32(c))
  9108  		v.AddArg2(idx, mem)
  9109  		return true
  9110  	}
  9111  	return false
  9112  }
  9113  func rewriteValueARM64_OpARM64MOVDload(v *Value) bool {
  9114  	v_1 := v.Args[1]
  9115  	v_0 := v.Args[0]
  9116  	b := v.Block
  9117  	config := b.Func.Config
  9118  	// match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr val _))
  9119  	// result: (FMOVDfpgp val)
  9120  	for {
  9121  		off := auxIntToInt32(v.AuxInt)
  9122  		sym := auxToSym(v.Aux)
  9123  		ptr := v_0
  9124  		if v_1.Op != OpARM64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  9125  			break
  9126  		}
  9127  		val := v_1.Args[1]
  9128  		if ptr != v_1.Args[0] {
  9129  			break
  9130  		}
  9131  		v.reset(OpARM64FMOVDfpgp)
  9132  		v.AddArg(val)
  9133  		return true
  9134  	}
  9135  	// match: (MOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  9136  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9137  	// result: (MOVDload [off1+int32(off2)] {sym} ptr mem)
  9138  	for {
  9139  		off1 := auxIntToInt32(v.AuxInt)
  9140  		sym := auxToSym(v.Aux)
  9141  		if v_0.Op != OpARM64ADDconst {
  9142  			break
  9143  		}
  9144  		off2 := auxIntToInt64(v_0.AuxInt)
  9145  		ptr := v_0.Args[0]
  9146  		mem := v_1
  9147  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9148  			break
  9149  		}
  9150  		v.reset(OpARM64MOVDload)
  9151  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9152  		v.Aux = symToAux(sym)
  9153  		v.AddArg2(ptr, mem)
  9154  		return true
  9155  	}
  9156  	// match: (MOVDload [off] {sym} (ADD ptr idx) mem)
  9157  	// cond: off == 0 && sym == nil
  9158  	// result: (MOVDloadidx ptr idx mem)
  9159  	for {
  9160  		off := auxIntToInt32(v.AuxInt)
  9161  		sym := auxToSym(v.Aux)
  9162  		if v_0.Op != OpARM64ADD {
  9163  			break
  9164  		}
  9165  		idx := v_0.Args[1]
  9166  		ptr := v_0.Args[0]
  9167  		mem := v_1
  9168  		if !(off == 0 && sym == nil) {
  9169  			break
  9170  		}
  9171  		v.reset(OpARM64MOVDloadidx)
  9172  		v.AddArg3(ptr, idx, mem)
  9173  		return true
  9174  	}
  9175  	// match: (MOVDload [off] {sym} (ADDshiftLL [3] ptr idx) mem)
  9176  	// cond: off == 0 && sym == nil
  9177  	// result: (MOVDloadidx8 ptr idx mem)
  9178  	for {
  9179  		off := auxIntToInt32(v.AuxInt)
  9180  		sym := auxToSym(v.Aux)
  9181  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  9182  			break
  9183  		}
  9184  		idx := v_0.Args[1]
  9185  		ptr := v_0.Args[0]
  9186  		mem := v_1
  9187  		if !(off == 0 && sym == nil) {
  9188  			break
  9189  		}
  9190  		v.reset(OpARM64MOVDloadidx8)
  9191  		v.AddArg3(ptr, idx, mem)
  9192  		return true
  9193  	}
  9194  	// match: (MOVDload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  9195  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9196  	// result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9197  	for {
  9198  		off1 := auxIntToInt32(v.AuxInt)
  9199  		sym1 := auxToSym(v.Aux)
  9200  		if v_0.Op != OpARM64MOVDaddr {
  9201  			break
  9202  		}
  9203  		off2 := auxIntToInt32(v_0.AuxInt)
  9204  		sym2 := auxToSym(v_0.Aux)
  9205  		ptr := v_0.Args[0]
  9206  		mem := v_1
  9207  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9208  			break
  9209  		}
  9210  		v.reset(OpARM64MOVDload)
  9211  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9212  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9213  		v.AddArg2(ptr, mem)
  9214  		return true
  9215  	}
  9216  	// match: (MOVDload [off] {sym} ptr (MOVDstorezero [off2] {sym2} ptr2 _))
  9217  	// cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
  9218  	// result: (MOVDconst [0])
  9219  	for {
  9220  		off := auxIntToInt32(v.AuxInt)
  9221  		sym := auxToSym(v.Aux)
  9222  		ptr := v_0
  9223  		if v_1.Op != OpARM64MOVDstorezero {
  9224  			break
  9225  		}
  9226  		off2 := auxIntToInt32(v_1.AuxInt)
  9227  		sym2 := auxToSym(v_1.Aux)
  9228  		ptr2 := v_1.Args[0]
  9229  		if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
  9230  			break
  9231  		}
  9232  		v.reset(OpARM64MOVDconst)
  9233  		v.AuxInt = int64ToAuxInt(0)
  9234  		return true
  9235  	}
  9236  	// match: (MOVDload [off] {sym} (SB) _)
  9237  	// cond: symIsRO(sym)
  9238  	// result: (MOVDconst [int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder))])
  9239  	for {
  9240  		off := auxIntToInt32(v.AuxInt)
  9241  		sym := auxToSym(v.Aux)
  9242  		if v_0.Op != OpSB || !(symIsRO(sym)) {
  9243  			break
  9244  		}
  9245  		v.reset(OpARM64MOVDconst)
  9246  		v.AuxInt = int64ToAuxInt(int64(read64(sym, int64(off), config.ctxt.Arch.ByteOrder)))
  9247  		return true
  9248  	}
  9249  	return false
  9250  }
  9251  func rewriteValueARM64_OpARM64MOVDloadidx(v *Value) bool {
  9252  	v_2 := v.Args[2]
  9253  	v_1 := v.Args[1]
  9254  	v_0 := v.Args[0]
  9255  	// match: (MOVDloadidx ptr (MOVDconst [c]) mem)
  9256  	// cond: is32Bit(c)
  9257  	// result: (MOVDload [int32(c)] ptr mem)
  9258  	for {
  9259  		ptr := v_0
  9260  		if v_1.Op != OpARM64MOVDconst {
  9261  			break
  9262  		}
  9263  		c := auxIntToInt64(v_1.AuxInt)
  9264  		mem := v_2
  9265  		if !(is32Bit(c)) {
  9266  			break
  9267  		}
  9268  		v.reset(OpARM64MOVDload)
  9269  		v.AuxInt = int32ToAuxInt(int32(c))
  9270  		v.AddArg2(ptr, mem)
  9271  		return true
  9272  	}
  9273  	// match: (MOVDloadidx (MOVDconst [c]) ptr mem)
  9274  	// cond: is32Bit(c)
  9275  	// result: (MOVDload [int32(c)] ptr mem)
  9276  	for {
  9277  		if v_0.Op != OpARM64MOVDconst {
  9278  			break
  9279  		}
  9280  		c := auxIntToInt64(v_0.AuxInt)
  9281  		ptr := v_1
  9282  		mem := v_2
  9283  		if !(is32Bit(c)) {
  9284  			break
  9285  		}
  9286  		v.reset(OpARM64MOVDload)
  9287  		v.AuxInt = int32ToAuxInt(int32(c))
  9288  		v.AddArg2(ptr, mem)
  9289  		return true
  9290  	}
  9291  	// match: (MOVDloadidx ptr (SLLconst [3] idx) mem)
  9292  	// result: (MOVDloadidx8 ptr idx mem)
  9293  	for {
  9294  		ptr := v_0
  9295  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  9296  			break
  9297  		}
  9298  		idx := v_1.Args[0]
  9299  		mem := v_2
  9300  		v.reset(OpARM64MOVDloadidx8)
  9301  		v.AddArg3(ptr, idx, mem)
  9302  		return true
  9303  	}
  9304  	// match: (MOVDloadidx (SLLconst [3] idx) ptr mem)
  9305  	// result: (MOVDloadidx8 ptr idx mem)
  9306  	for {
  9307  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  9308  			break
  9309  		}
  9310  		idx := v_0.Args[0]
  9311  		ptr := v_1
  9312  		mem := v_2
  9313  		v.reset(OpARM64MOVDloadidx8)
  9314  		v.AddArg3(ptr, idx, mem)
  9315  		return true
  9316  	}
  9317  	// match: (MOVDloadidx ptr idx (MOVDstorezeroidx ptr2 idx2 _))
  9318  	// cond: (isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2))
  9319  	// result: (MOVDconst [0])
  9320  	for {
  9321  		ptr := v_0
  9322  		idx := v_1
  9323  		if v_2.Op != OpARM64MOVDstorezeroidx {
  9324  			break
  9325  		}
  9326  		idx2 := v_2.Args[1]
  9327  		ptr2 := v_2.Args[0]
  9328  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
  9329  			break
  9330  		}
  9331  		v.reset(OpARM64MOVDconst)
  9332  		v.AuxInt = int64ToAuxInt(0)
  9333  		return true
  9334  	}
  9335  	return false
  9336  }
  9337  func rewriteValueARM64_OpARM64MOVDloadidx8(v *Value) bool {
  9338  	v_2 := v.Args[2]
  9339  	v_1 := v.Args[1]
  9340  	v_0 := v.Args[0]
  9341  	// match: (MOVDloadidx8 ptr (MOVDconst [c]) mem)
  9342  	// cond: is32Bit(c<<3)
  9343  	// result: (MOVDload [int32(c)<<3] ptr mem)
  9344  	for {
  9345  		ptr := v_0
  9346  		if v_1.Op != OpARM64MOVDconst {
  9347  			break
  9348  		}
  9349  		c := auxIntToInt64(v_1.AuxInt)
  9350  		mem := v_2
  9351  		if !(is32Bit(c << 3)) {
  9352  			break
  9353  		}
  9354  		v.reset(OpARM64MOVDload)
  9355  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  9356  		v.AddArg2(ptr, mem)
  9357  		return true
  9358  	}
  9359  	// match: (MOVDloadidx8 ptr idx (MOVDstorezeroidx8 ptr2 idx2 _))
  9360  	// cond: isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)
  9361  	// result: (MOVDconst [0])
  9362  	for {
  9363  		ptr := v_0
  9364  		idx := v_1
  9365  		if v_2.Op != OpARM64MOVDstorezeroidx8 {
  9366  			break
  9367  		}
  9368  		idx2 := v_2.Args[1]
  9369  		ptr2 := v_2.Args[0]
  9370  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)) {
  9371  			break
  9372  		}
  9373  		v.reset(OpARM64MOVDconst)
  9374  		v.AuxInt = int64ToAuxInt(0)
  9375  		return true
  9376  	}
  9377  	return false
  9378  }
  9379  func rewriteValueARM64_OpARM64MOVDnop(v *Value) bool {
  9380  	v_0 := v.Args[0]
  9381  	// match: (MOVDnop (MOVDconst [c]))
  9382  	// result: (MOVDconst [c])
  9383  	for {
  9384  		if v_0.Op != OpARM64MOVDconst {
  9385  			break
  9386  		}
  9387  		c := auxIntToInt64(v_0.AuxInt)
  9388  		v.reset(OpARM64MOVDconst)
  9389  		v.AuxInt = int64ToAuxInt(c)
  9390  		return true
  9391  	}
  9392  	return false
  9393  }
  9394  func rewriteValueARM64_OpARM64MOVDreg(v *Value) bool {
  9395  	v_0 := v.Args[0]
  9396  	// match: (MOVDreg x)
  9397  	// cond: x.Uses == 1
  9398  	// result: (MOVDnop x)
  9399  	for {
  9400  		x := v_0
  9401  		if !(x.Uses == 1) {
  9402  			break
  9403  		}
  9404  		v.reset(OpARM64MOVDnop)
  9405  		v.AddArg(x)
  9406  		return true
  9407  	}
  9408  	// match: (MOVDreg (MOVDconst [c]))
  9409  	// result: (MOVDconst [c])
  9410  	for {
  9411  		if v_0.Op != OpARM64MOVDconst {
  9412  			break
  9413  		}
  9414  		c := auxIntToInt64(v_0.AuxInt)
  9415  		v.reset(OpARM64MOVDconst)
  9416  		v.AuxInt = int64ToAuxInt(c)
  9417  		return true
  9418  	}
  9419  	return false
  9420  }
  9421  func rewriteValueARM64_OpARM64MOVDstore(v *Value) bool {
  9422  	v_2 := v.Args[2]
  9423  	v_1 := v.Args[1]
  9424  	v_0 := v.Args[0]
  9425  	b := v.Block
  9426  	config := b.Func.Config
  9427  	// match: (MOVDstore [off] {sym} ptr (FMOVDfpgp val) mem)
  9428  	// result: (FMOVDstore [off] {sym} ptr val mem)
  9429  	for {
  9430  		off := auxIntToInt32(v.AuxInt)
  9431  		sym := auxToSym(v.Aux)
  9432  		ptr := v_0
  9433  		if v_1.Op != OpARM64FMOVDfpgp {
  9434  			break
  9435  		}
  9436  		val := v_1.Args[0]
  9437  		mem := v_2
  9438  		v.reset(OpARM64FMOVDstore)
  9439  		v.AuxInt = int32ToAuxInt(off)
  9440  		v.Aux = symToAux(sym)
  9441  		v.AddArg3(ptr, val, mem)
  9442  		return true
  9443  	}
  9444  	// match: (MOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  9445  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9446  	// result: (MOVDstore [off1+int32(off2)] {sym} ptr val mem)
  9447  	for {
  9448  		off1 := auxIntToInt32(v.AuxInt)
  9449  		sym := auxToSym(v.Aux)
  9450  		if v_0.Op != OpARM64ADDconst {
  9451  			break
  9452  		}
  9453  		off2 := auxIntToInt64(v_0.AuxInt)
  9454  		ptr := v_0.Args[0]
  9455  		val := v_1
  9456  		mem := v_2
  9457  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9458  			break
  9459  		}
  9460  		v.reset(OpARM64MOVDstore)
  9461  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9462  		v.Aux = symToAux(sym)
  9463  		v.AddArg3(ptr, val, mem)
  9464  		return true
  9465  	}
  9466  	// match: (MOVDstore [off] {sym} (ADD ptr idx) val mem)
  9467  	// cond: off == 0 && sym == nil
  9468  	// result: (MOVDstoreidx ptr idx val mem)
  9469  	for {
  9470  		off := auxIntToInt32(v.AuxInt)
  9471  		sym := auxToSym(v.Aux)
  9472  		if v_0.Op != OpARM64ADD {
  9473  			break
  9474  		}
  9475  		idx := v_0.Args[1]
  9476  		ptr := v_0.Args[0]
  9477  		val := v_1
  9478  		mem := v_2
  9479  		if !(off == 0 && sym == nil) {
  9480  			break
  9481  		}
  9482  		v.reset(OpARM64MOVDstoreidx)
  9483  		v.AddArg4(ptr, idx, val, mem)
  9484  		return true
  9485  	}
  9486  	// match: (MOVDstore [off] {sym} (ADDshiftLL [3] ptr idx) val mem)
  9487  	// cond: off == 0 && sym == nil
  9488  	// result: (MOVDstoreidx8 ptr idx val mem)
  9489  	for {
  9490  		off := auxIntToInt32(v.AuxInt)
  9491  		sym := auxToSym(v.Aux)
  9492  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  9493  			break
  9494  		}
  9495  		idx := v_0.Args[1]
  9496  		ptr := v_0.Args[0]
  9497  		val := v_1
  9498  		mem := v_2
  9499  		if !(off == 0 && sym == nil) {
  9500  			break
  9501  		}
  9502  		v.reset(OpARM64MOVDstoreidx8)
  9503  		v.AddArg4(ptr, idx, val, mem)
  9504  		return true
  9505  	}
  9506  	// match: (MOVDstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
  9507  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9508  	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9509  	for {
  9510  		off1 := auxIntToInt32(v.AuxInt)
  9511  		sym1 := auxToSym(v.Aux)
  9512  		if v_0.Op != OpARM64MOVDaddr {
  9513  			break
  9514  		}
  9515  		off2 := auxIntToInt32(v_0.AuxInt)
  9516  		sym2 := auxToSym(v_0.Aux)
  9517  		ptr := v_0.Args[0]
  9518  		val := v_1
  9519  		mem := v_2
  9520  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9521  			break
  9522  		}
  9523  		v.reset(OpARM64MOVDstore)
  9524  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9525  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9526  		v.AddArg3(ptr, val, mem)
  9527  		return true
  9528  	}
  9529  	// match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
  9530  	// result: (MOVDstorezero [off] {sym} ptr mem)
  9531  	for {
  9532  		off := auxIntToInt32(v.AuxInt)
  9533  		sym := auxToSym(v.Aux)
  9534  		ptr := v_0
  9535  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  9536  			break
  9537  		}
  9538  		mem := v_2
  9539  		v.reset(OpARM64MOVDstorezero)
  9540  		v.AuxInt = int32ToAuxInt(off)
  9541  		v.Aux = symToAux(sym)
  9542  		v.AddArg2(ptr, mem)
  9543  		return true
  9544  	}
  9545  	return false
  9546  }
  9547  func rewriteValueARM64_OpARM64MOVDstoreidx(v *Value) bool {
  9548  	v_3 := v.Args[3]
  9549  	v_2 := v.Args[2]
  9550  	v_1 := v.Args[1]
  9551  	v_0 := v.Args[0]
  9552  	// match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
  9553  	// cond: is32Bit(c)
  9554  	// result: (MOVDstore [int32(c)] ptr val mem)
  9555  	for {
  9556  		ptr := v_0
  9557  		if v_1.Op != OpARM64MOVDconst {
  9558  			break
  9559  		}
  9560  		c := auxIntToInt64(v_1.AuxInt)
  9561  		val := v_2
  9562  		mem := v_3
  9563  		if !(is32Bit(c)) {
  9564  			break
  9565  		}
  9566  		v.reset(OpARM64MOVDstore)
  9567  		v.AuxInt = int32ToAuxInt(int32(c))
  9568  		v.AddArg3(ptr, val, mem)
  9569  		return true
  9570  	}
  9571  	// match: (MOVDstoreidx (MOVDconst [c]) idx val mem)
  9572  	// cond: is32Bit(c)
  9573  	// result: (MOVDstore [int32(c)] idx val mem)
  9574  	for {
  9575  		if v_0.Op != OpARM64MOVDconst {
  9576  			break
  9577  		}
  9578  		c := auxIntToInt64(v_0.AuxInt)
  9579  		idx := v_1
  9580  		val := v_2
  9581  		mem := v_3
  9582  		if !(is32Bit(c)) {
  9583  			break
  9584  		}
  9585  		v.reset(OpARM64MOVDstore)
  9586  		v.AuxInt = int32ToAuxInt(int32(c))
  9587  		v.AddArg3(idx, val, mem)
  9588  		return true
  9589  	}
  9590  	// match: (MOVDstoreidx ptr (SLLconst [3] idx) val mem)
  9591  	// result: (MOVDstoreidx8 ptr idx val mem)
  9592  	for {
  9593  		ptr := v_0
  9594  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  9595  			break
  9596  		}
  9597  		idx := v_1.Args[0]
  9598  		val := v_2
  9599  		mem := v_3
  9600  		v.reset(OpARM64MOVDstoreidx8)
  9601  		v.AddArg4(ptr, idx, val, mem)
  9602  		return true
  9603  	}
  9604  	// match: (MOVDstoreidx (SLLconst [3] idx) ptr val mem)
  9605  	// result: (MOVDstoreidx8 ptr idx val mem)
  9606  	for {
  9607  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  9608  			break
  9609  		}
  9610  		idx := v_0.Args[0]
  9611  		ptr := v_1
  9612  		val := v_2
  9613  		mem := v_3
  9614  		v.reset(OpARM64MOVDstoreidx8)
  9615  		v.AddArg4(ptr, idx, val, mem)
  9616  		return true
  9617  	}
  9618  	// match: (MOVDstoreidx ptr idx (MOVDconst [0]) mem)
  9619  	// result: (MOVDstorezeroidx ptr idx mem)
  9620  	for {
  9621  		ptr := v_0
  9622  		idx := v_1
  9623  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
  9624  			break
  9625  		}
  9626  		mem := v_3
  9627  		v.reset(OpARM64MOVDstorezeroidx)
  9628  		v.AddArg3(ptr, idx, mem)
  9629  		return true
  9630  	}
  9631  	return false
  9632  }
  9633  func rewriteValueARM64_OpARM64MOVDstoreidx8(v *Value) bool {
  9634  	v_3 := v.Args[3]
  9635  	v_2 := v.Args[2]
  9636  	v_1 := v.Args[1]
  9637  	v_0 := v.Args[0]
  9638  	// match: (MOVDstoreidx8 ptr (MOVDconst [c]) val mem)
  9639  	// cond: is32Bit(c<<3)
  9640  	// result: (MOVDstore [int32(c)<<3] ptr val mem)
  9641  	for {
  9642  		ptr := v_0
  9643  		if v_1.Op != OpARM64MOVDconst {
  9644  			break
  9645  		}
  9646  		c := auxIntToInt64(v_1.AuxInt)
  9647  		val := v_2
  9648  		mem := v_3
  9649  		if !(is32Bit(c << 3)) {
  9650  			break
  9651  		}
  9652  		v.reset(OpARM64MOVDstore)
  9653  		v.AuxInt = int32ToAuxInt(int32(c) << 3)
  9654  		v.AddArg3(ptr, val, mem)
  9655  		return true
  9656  	}
  9657  	// match: (MOVDstoreidx8 ptr idx (MOVDconst [0]) mem)
  9658  	// result: (MOVDstorezeroidx8 ptr idx mem)
  9659  	for {
  9660  		ptr := v_0
  9661  		idx := v_1
  9662  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
  9663  			break
  9664  		}
  9665  		mem := v_3
  9666  		v.reset(OpARM64MOVDstorezeroidx8)
  9667  		v.AddArg3(ptr, idx, mem)
  9668  		return true
  9669  	}
  9670  	return false
  9671  }
  9672  func rewriteValueARM64_OpARM64MOVDstorezero(v *Value) bool {
  9673  	v_1 := v.Args[1]
  9674  	v_0 := v.Args[0]
  9675  	b := v.Block
  9676  	config := b.Func.Config
  9677  	// match: (MOVDstorezero {s} [i] ptr x:(MOVDstorezero {s} [i+8] ptr mem))
  9678  	// cond: x.Uses == 1 && setPos(v, x.Pos) && clobber(x)
  9679  	// result: (MOVQstorezero {s} [i] ptr mem)
  9680  	for {
  9681  		i := auxIntToInt32(v.AuxInt)
  9682  		s := auxToSym(v.Aux)
  9683  		ptr := v_0
  9684  		x := v_1
  9685  		if x.Op != OpARM64MOVDstorezero || auxIntToInt32(x.AuxInt) != i+8 || auxToSym(x.Aux) != s {
  9686  			break
  9687  		}
  9688  		mem := x.Args[1]
  9689  		if ptr != x.Args[0] || !(x.Uses == 1 && setPos(v, x.Pos) && clobber(x)) {
  9690  			break
  9691  		}
  9692  		v.reset(OpARM64MOVQstorezero)
  9693  		v.AuxInt = int32ToAuxInt(i)
  9694  		v.Aux = symToAux(s)
  9695  		v.AddArg2(ptr, mem)
  9696  		return true
  9697  	}
  9698  	// match: (MOVDstorezero {s} [i] ptr x:(MOVDstorezero {s} [i-8] ptr mem))
  9699  	// cond: x.Uses == 1 && setPos(v, x.Pos) && clobber(x)
  9700  	// result: (MOVQstorezero {s} [i-8] ptr mem)
  9701  	for {
  9702  		i := auxIntToInt32(v.AuxInt)
  9703  		s := auxToSym(v.Aux)
  9704  		ptr := v_0
  9705  		x := v_1
  9706  		if x.Op != OpARM64MOVDstorezero || auxIntToInt32(x.AuxInt) != i-8 || auxToSym(x.Aux) != s {
  9707  			break
  9708  		}
  9709  		mem := x.Args[1]
  9710  		if ptr != x.Args[0] || !(x.Uses == 1 && setPos(v, x.Pos) && clobber(x)) {
  9711  			break
  9712  		}
  9713  		v.reset(OpARM64MOVQstorezero)
  9714  		v.AuxInt = int32ToAuxInt(i - 8)
  9715  		v.Aux = symToAux(s)
  9716  		v.AddArg2(ptr, mem)
  9717  		return true
  9718  	}
  9719  	// match: (MOVDstorezero [off1] {sym} (ADDconst [off2] ptr) mem)
  9720  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9721  	// result: (MOVDstorezero [off1+int32(off2)] {sym} ptr mem)
  9722  	for {
  9723  		off1 := auxIntToInt32(v.AuxInt)
  9724  		sym := auxToSym(v.Aux)
  9725  		if v_0.Op != OpARM64ADDconst {
  9726  			break
  9727  		}
  9728  		off2 := auxIntToInt64(v_0.AuxInt)
  9729  		ptr := v_0.Args[0]
  9730  		mem := v_1
  9731  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9732  			break
  9733  		}
  9734  		v.reset(OpARM64MOVDstorezero)
  9735  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9736  		v.Aux = symToAux(sym)
  9737  		v.AddArg2(ptr, mem)
  9738  		return true
  9739  	}
  9740  	// match: (MOVDstorezero [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  9741  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9742  	// result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9743  	for {
  9744  		off1 := auxIntToInt32(v.AuxInt)
  9745  		sym1 := auxToSym(v.Aux)
  9746  		if v_0.Op != OpARM64MOVDaddr {
  9747  			break
  9748  		}
  9749  		off2 := auxIntToInt32(v_0.AuxInt)
  9750  		sym2 := auxToSym(v_0.Aux)
  9751  		ptr := v_0.Args[0]
  9752  		mem := v_1
  9753  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9754  			break
  9755  		}
  9756  		v.reset(OpARM64MOVDstorezero)
  9757  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9758  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9759  		v.AddArg2(ptr, mem)
  9760  		return true
  9761  	}
  9762  	// match: (MOVDstorezero [off] {sym} (ADD ptr idx) mem)
  9763  	// cond: off == 0 && sym == nil
  9764  	// result: (MOVDstorezeroidx ptr idx mem)
  9765  	for {
  9766  		off := auxIntToInt32(v.AuxInt)
  9767  		sym := auxToSym(v.Aux)
  9768  		if v_0.Op != OpARM64ADD {
  9769  			break
  9770  		}
  9771  		idx := v_0.Args[1]
  9772  		ptr := v_0.Args[0]
  9773  		mem := v_1
  9774  		if !(off == 0 && sym == nil) {
  9775  			break
  9776  		}
  9777  		v.reset(OpARM64MOVDstorezeroidx)
  9778  		v.AddArg3(ptr, idx, mem)
  9779  		return true
  9780  	}
  9781  	// match: (MOVDstorezero [off] {sym} (ADDshiftLL [3] ptr idx) mem)
  9782  	// cond: off == 0 && sym == nil
  9783  	// result: (MOVDstorezeroidx8 ptr idx mem)
  9784  	for {
  9785  		off := auxIntToInt32(v.AuxInt)
  9786  		sym := auxToSym(v.Aux)
  9787  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 3 {
  9788  			break
  9789  		}
  9790  		idx := v_0.Args[1]
  9791  		ptr := v_0.Args[0]
  9792  		mem := v_1
  9793  		if !(off == 0 && sym == nil) {
  9794  			break
  9795  		}
  9796  		v.reset(OpARM64MOVDstorezeroidx8)
  9797  		v.AddArg3(ptr, idx, mem)
  9798  		return true
  9799  	}
  9800  	return false
  9801  }
  9802  func rewriteValueARM64_OpARM64MOVDstorezeroidx(v *Value) bool {
  9803  	v_2 := v.Args[2]
  9804  	v_1 := v.Args[1]
  9805  	v_0 := v.Args[0]
  9806  	// match: (MOVDstorezeroidx ptr (MOVDconst [c]) mem)
  9807  	// cond: is32Bit(c)
  9808  	// result: (MOVDstorezero [int32(c)] ptr mem)
  9809  	for {
  9810  		ptr := v_0
  9811  		if v_1.Op != OpARM64MOVDconst {
  9812  			break
  9813  		}
  9814  		c := auxIntToInt64(v_1.AuxInt)
  9815  		mem := v_2
  9816  		if !(is32Bit(c)) {
  9817  			break
  9818  		}
  9819  		v.reset(OpARM64MOVDstorezero)
  9820  		v.AuxInt = int32ToAuxInt(int32(c))
  9821  		v.AddArg2(ptr, mem)
  9822  		return true
  9823  	}
  9824  	// match: (MOVDstorezeroidx (MOVDconst [c]) idx mem)
  9825  	// cond: is32Bit(c)
  9826  	// result: (MOVDstorezero [int32(c)] idx mem)
  9827  	for {
  9828  		if v_0.Op != OpARM64MOVDconst {
  9829  			break
  9830  		}
  9831  		c := auxIntToInt64(v_0.AuxInt)
  9832  		idx := v_1
  9833  		mem := v_2
  9834  		if !(is32Bit(c)) {
  9835  			break
  9836  		}
  9837  		v.reset(OpARM64MOVDstorezero)
  9838  		v.AuxInt = int32ToAuxInt(int32(c))
  9839  		v.AddArg2(idx, mem)
  9840  		return true
  9841  	}
  9842  	// match: (MOVDstorezeroidx ptr (SLLconst [3] idx) mem)
  9843  	// result: (MOVDstorezeroidx8 ptr idx mem)
  9844  	for {
  9845  		ptr := v_0
  9846  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 3 {
  9847  			break
  9848  		}
  9849  		idx := v_1.Args[0]
  9850  		mem := v_2
  9851  		v.reset(OpARM64MOVDstorezeroidx8)
  9852  		v.AddArg3(ptr, idx, mem)
  9853  		return true
  9854  	}
  9855  	// match: (MOVDstorezeroidx (SLLconst [3] idx) ptr mem)
  9856  	// result: (MOVDstorezeroidx8 ptr idx mem)
  9857  	for {
  9858  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 3 {
  9859  			break
  9860  		}
  9861  		idx := v_0.Args[0]
  9862  		ptr := v_1
  9863  		mem := v_2
  9864  		v.reset(OpARM64MOVDstorezeroidx8)
  9865  		v.AddArg3(ptr, idx, mem)
  9866  		return true
  9867  	}
  9868  	return false
  9869  }
  9870  func rewriteValueARM64_OpARM64MOVDstorezeroidx8(v *Value) bool {
  9871  	v_2 := v.Args[2]
  9872  	v_1 := v.Args[1]
  9873  	v_0 := v.Args[0]
  9874  	// match: (MOVDstorezeroidx8 ptr (MOVDconst [c]) mem)
  9875  	// cond: is32Bit(c<<3)
  9876  	// result: (MOVDstorezero [int32(c<<3)] ptr mem)
  9877  	for {
  9878  		ptr := v_0
  9879  		if v_1.Op != OpARM64MOVDconst {
  9880  			break
  9881  		}
  9882  		c := auxIntToInt64(v_1.AuxInt)
  9883  		mem := v_2
  9884  		if !(is32Bit(c << 3)) {
  9885  			break
  9886  		}
  9887  		v.reset(OpARM64MOVDstorezero)
  9888  		v.AuxInt = int32ToAuxInt(int32(c << 3))
  9889  		v.AddArg2(ptr, mem)
  9890  		return true
  9891  	}
  9892  	return false
  9893  }
  9894  func rewriteValueARM64_OpARM64MOVHUload(v *Value) bool {
  9895  	v_1 := v.Args[1]
  9896  	v_0 := v.Args[0]
  9897  	b := v.Block
  9898  	config := b.Func.Config
  9899  	// match: (MOVHUload [off1] {sym} (ADDconst [off2] ptr) mem)
  9900  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9901  	// result: (MOVHUload [off1+int32(off2)] {sym} ptr mem)
  9902  	for {
  9903  		off1 := auxIntToInt32(v.AuxInt)
  9904  		sym := auxToSym(v.Aux)
  9905  		if v_0.Op != OpARM64ADDconst {
  9906  			break
  9907  		}
  9908  		off2 := auxIntToInt64(v_0.AuxInt)
  9909  		ptr := v_0.Args[0]
  9910  		mem := v_1
  9911  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9912  			break
  9913  		}
  9914  		v.reset(OpARM64MOVHUload)
  9915  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9916  		v.Aux = symToAux(sym)
  9917  		v.AddArg2(ptr, mem)
  9918  		return true
  9919  	}
  9920  	// match: (MOVHUload [off] {sym} (ADD ptr idx) mem)
  9921  	// cond: off == 0 && sym == nil
  9922  	// result: (MOVHUloadidx ptr idx mem)
  9923  	for {
  9924  		off := auxIntToInt32(v.AuxInt)
  9925  		sym := auxToSym(v.Aux)
  9926  		if v_0.Op != OpARM64ADD {
  9927  			break
  9928  		}
  9929  		idx := v_0.Args[1]
  9930  		ptr := v_0.Args[0]
  9931  		mem := v_1
  9932  		if !(off == 0 && sym == nil) {
  9933  			break
  9934  		}
  9935  		v.reset(OpARM64MOVHUloadidx)
  9936  		v.AddArg3(ptr, idx, mem)
  9937  		return true
  9938  	}
  9939  	// match: (MOVHUload [off] {sym} (ADDshiftLL [1] ptr idx) mem)
  9940  	// cond: off == 0 && sym == nil
  9941  	// result: (MOVHUloadidx2 ptr idx mem)
  9942  	for {
  9943  		off := auxIntToInt32(v.AuxInt)
  9944  		sym := auxToSym(v.Aux)
  9945  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
  9946  			break
  9947  		}
  9948  		idx := v_0.Args[1]
  9949  		ptr := v_0.Args[0]
  9950  		mem := v_1
  9951  		if !(off == 0 && sym == nil) {
  9952  			break
  9953  		}
  9954  		v.reset(OpARM64MOVHUloadidx2)
  9955  		v.AddArg3(ptr, idx, mem)
  9956  		return true
  9957  	}
  9958  	// match: (MOVHUload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
  9959  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
  9960  	// result: (MOVHUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9961  	for {
  9962  		off1 := auxIntToInt32(v.AuxInt)
  9963  		sym1 := auxToSym(v.Aux)
  9964  		if v_0.Op != OpARM64MOVDaddr {
  9965  			break
  9966  		}
  9967  		off2 := auxIntToInt32(v_0.AuxInt)
  9968  		sym2 := auxToSym(v_0.Aux)
  9969  		ptr := v_0.Args[0]
  9970  		mem := v_1
  9971  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
  9972  			break
  9973  		}
  9974  		v.reset(OpARM64MOVHUload)
  9975  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9976  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9977  		v.AddArg2(ptr, mem)
  9978  		return true
  9979  	}
  9980  	// match: (MOVHUload [off] {sym} ptr (MOVHstorezero [off2] {sym2} ptr2 _))
  9981  	// cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
  9982  	// result: (MOVDconst [0])
  9983  	for {
  9984  		off := auxIntToInt32(v.AuxInt)
  9985  		sym := auxToSym(v.Aux)
  9986  		ptr := v_0
  9987  		if v_1.Op != OpARM64MOVHstorezero {
  9988  			break
  9989  		}
  9990  		off2 := auxIntToInt32(v_1.AuxInt)
  9991  		sym2 := auxToSym(v_1.Aux)
  9992  		ptr2 := v_1.Args[0]
  9993  		if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
  9994  			break
  9995  		}
  9996  		v.reset(OpARM64MOVDconst)
  9997  		v.AuxInt = int64ToAuxInt(0)
  9998  		return true
  9999  	}
 10000  	// match: (MOVHUload [off] {sym} (SB) _)
 10001  	// cond: symIsRO(sym)
 10002  	// result: (MOVDconst [int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder))])
 10003  	for {
 10004  		off := auxIntToInt32(v.AuxInt)
 10005  		sym := auxToSym(v.Aux)
 10006  		if v_0.Op != OpSB || !(symIsRO(sym)) {
 10007  			break
 10008  		}
 10009  		v.reset(OpARM64MOVDconst)
 10010  		v.AuxInt = int64ToAuxInt(int64(read16(sym, int64(off), config.ctxt.Arch.ByteOrder)))
 10011  		return true
 10012  	}
 10013  	return false
 10014  }
 10015  func rewriteValueARM64_OpARM64MOVHUloadidx(v *Value) bool {
 10016  	v_2 := v.Args[2]
 10017  	v_1 := v.Args[1]
 10018  	v_0 := v.Args[0]
 10019  	// match: (MOVHUloadidx ptr (MOVDconst [c]) mem)
 10020  	// cond: is32Bit(c)
 10021  	// result: (MOVHUload [int32(c)] ptr mem)
 10022  	for {
 10023  		ptr := v_0
 10024  		if v_1.Op != OpARM64MOVDconst {
 10025  			break
 10026  		}
 10027  		c := auxIntToInt64(v_1.AuxInt)
 10028  		mem := v_2
 10029  		if !(is32Bit(c)) {
 10030  			break
 10031  		}
 10032  		v.reset(OpARM64MOVHUload)
 10033  		v.AuxInt = int32ToAuxInt(int32(c))
 10034  		v.AddArg2(ptr, mem)
 10035  		return true
 10036  	}
 10037  	// match: (MOVHUloadidx (MOVDconst [c]) ptr mem)
 10038  	// cond: is32Bit(c)
 10039  	// result: (MOVHUload [int32(c)] ptr mem)
 10040  	for {
 10041  		if v_0.Op != OpARM64MOVDconst {
 10042  			break
 10043  		}
 10044  		c := auxIntToInt64(v_0.AuxInt)
 10045  		ptr := v_1
 10046  		mem := v_2
 10047  		if !(is32Bit(c)) {
 10048  			break
 10049  		}
 10050  		v.reset(OpARM64MOVHUload)
 10051  		v.AuxInt = int32ToAuxInt(int32(c))
 10052  		v.AddArg2(ptr, mem)
 10053  		return true
 10054  	}
 10055  	// match: (MOVHUloadidx ptr (SLLconst [1] idx) mem)
 10056  	// result: (MOVHUloadidx2 ptr idx mem)
 10057  	for {
 10058  		ptr := v_0
 10059  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
 10060  			break
 10061  		}
 10062  		idx := v_1.Args[0]
 10063  		mem := v_2
 10064  		v.reset(OpARM64MOVHUloadidx2)
 10065  		v.AddArg3(ptr, idx, mem)
 10066  		return true
 10067  	}
 10068  	// match: (MOVHUloadidx ptr (ADD idx idx) mem)
 10069  	// result: (MOVHUloadidx2 ptr idx mem)
 10070  	for {
 10071  		ptr := v_0
 10072  		if v_1.Op != OpARM64ADD {
 10073  			break
 10074  		}
 10075  		idx := v_1.Args[1]
 10076  		if idx != v_1.Args[0] {
 10077  			break
 10078  		}
 10079  		mem := v_2
 10080  		v.reset(OpARM64MOVHUloadidx2)
 10081  		v.AddArg3(ptr, idx, mem)
 10082  		return true
 10083  	}
 10084  	// match: (MOVHUloadidx (ADD idx idx) ptr mem)
 10085  	// result: (MOVHUloadidx2 ptr idx mem)
 10086  	for {
 10087  		if v_0.Op != OpARM64ADD {
 10088  			break
 10089  		}
 10090  		idx := v_0.Args[1]
 10091  		if idx != v_0.Args[0] {
 10092  			break
 10093  		}
 10094  		ptr := v_1
 10095  		mem := v_2
 10096  		v.reset(OpARM64MOVHUloadidx2)
 10097  		v.AddArg3(ptr, idx, mem)
 10098  		return true
 10099  	}
 10100  	// match: (MOVHUloadidx ptr idx (MOVHstorezeroidx ptr2 idx2 _))
 10101  	// cond: (isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2))
 10102  	// result: (MOVDconst [0])
 10103  	for {
 10104  		ptr := v_0
 10105  		idx := v_1
 10106  		if v_2.Op != OpARM64MOVHstorezeroidx {
 10107  			break
 10108  		}
 10109  		idx2 := v_2.Args[1]
 10110  		ptr2 := v_2.Args[0]
 10111  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
 10112  			break
 10113  		}
 10114  		v.reset(OpARM64MOVDconst)
 10115  		v.AuxInt = int64ToAuxInt(0)
 10116  		return true
 10117  	}
 10118  	return false
 10119  }
 10120  func rewriteValueARM64_OpARM64MOVHUloadidx2(v *Value) bool {
 10121  	v_2 := v.Args[2]
 10122  	v_1 := v.Args[1]
 10123  	v_0 := v.Args[0]
 10124  	// match: (MOVHUloadidx2 ptr (MOVDconst [c]) mem)
 10125  	// cond: is32Bit(c<<1)
 10126  	// result: (MOVHUload [int32(c)<<1] ptr mem)
 10127  	for {
 10128  		ptr := v_0
 10129  		if v_1.Op != OpARM64MOVDconst {
 10130  			break
 10131  		}
 10132  		c := auxIntToInt64(v_1.AuxInt)
 10133  		mem := v_2
 10134  		if !(is32Bit(c << 1)) {
 10135  			break
 10136  		}
 10137  		v.reset(OpARM64MOVHUload)
 10138  		v.AuxInt = int32ToAuxInt(int32(c) << 1)
 10139  		v.AddArg2(ptr, mem)
 10140  		return true
 10141  	}
 10142  	// match: (MOVHUloadidx2 ptr idx (MOVHstorezeroidx2 ptr2 idx2 _))
 10143  	// cond: isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)
 10144  	// result: (MOVDconst [0])
 10145  	for {
 10146  		ptr := v_0
 10147  		idx := v_1
 10148  		if v_2.Op != OpARM64MOVHstorezeroidx2 {
 10149  			break
 10150  		}
 10151  		idx2 := v_2.Args[1]
 10152  		ptr2 := v_2.Args[0]
 10153  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)) {
 10154  			break
 10155  		}
 10156  		v.reset(OpARM64MOVDconst)
 10157  		v.AuxInt = int64ToAuxInt(0)
 10158  		return true
 10159  	}
 10160  	return false
 10161  }
 10162  func rewriteValueARM64_OpARM64MOVHUreg(v *Value) bool {
 10163  	v_0 := v.Args[0]
 10164  	// match: (MOVHUreg (ANDconst [c] x))
 10165  	// result: (ANDconst [c&(1<<16-1)] x)
 10166  	for {
 10167  		if v_0.Op != OpARM64ANDconst {
 10168  			break
 10169  		}
 10170  		c := auxIntToInt64(v_0.AuxInt)
 10171  		x := v_0.Args[0]
 10172  		v.reset(OpARM64ANDconst)
 10173  		v.AuxInt = int64ToAuxInt(c & (1<<16 - 1))
 10174  		v.AddArg(x)
 10175  		return true
 10176  	}
 10177  	// match: (MOVHUreg (MOVDconst [c]))
 10178  	// result: (MOVDconst [int64(uint16(c))])
 10179  	for {
 10180  		if v_0.Op != OpARM64MOVDconst {
 10181  			break
 10182  		}
 10183  		c := auxIntToInt64(v_0.AuxInt)
 10184  		v.reset(OpARM64MOVDconst)
 10185  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
 10186  		return true
 10187  	}
 10188  	// match: (MOVHUreg x)
 10189  	// cond: v.Type.Size() <= 2
 10190  	// result: x
 10191  	for {
 10192  		x := v_0
 10193  		if !(v.Type.Size() <= 2) {
 10194  			break
 10195  		}
 10196  		v.copyOf(x)
 10197  		return true
 10198  	}
 10199  	// match: (MOVHUreg (SLLconst [lc] x))
 10200  	// cond: lc >= 16
 10201  	// result: (MOVDconst [0])
 10202  	for {
 10203  		if v_0.Op != OpARM64SLLconst {
 10204  			break
 10205  		}
 10206  		lc := auxIntToInt64(v_0.AuxInt)
 10207  		if !(lc >= 16) {
 10208  			break
 10209  		}
 10210  		v.reset(OpARM64MOVDconst)
 10211  		v.AuxInt = int64ToAuxInt(0)
 10212  		return true
 10213  	}
 10214  	// match: (MOVHUreg (SLLconst [lc] x))
 10215  	// cond: lc < 16
 10216  	// result: (UBFIZ [armBFAuxInt(lc, 16-lc)] x)
 10217  	for {
 10218  		if v_0.Op != OpARM64SLLconst {
 10219  			break
 10220  		}
 10221  		lc := auxIntToInt64(v_0.AuxInt)
 10222  		x := v_0.Args[0]
 10223  		if !(lc < 16) {
 10224  			break
 10225  		}
 10226  		v.reset(OpARM64UBFIZ)
 10227  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 16-lc))
 10228  		v.AddArg(x)
 10229  		return true
 10230  	}
 10231  	// match: (MOVHUreg (SRLconst [rc] x))
 10232  	// cond: rc < 16
 10233  	// result: (UBFX [armBFAuxInt(rc, 16)] x)
 10234  	for {
 10235  		if v_0.Op != OpARM64SRLconst {
 10236  			break
 10237  		}
 10238  		rc := auxIntToInt64(v_0.AuxInt)
 10239  		x := v_0.Args[0]
 10240  		if !(rc < 16) {
 10241  			break
 10242  		}
 10243  		v.reset(OpARM64UBFX)
 10244  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16))
 10245  		v.AddArg(x)
 10246  		return true
 10247  	}
 10248  	// match: (MOVHUreg (UBFX [bfc] x))
 10249  	// cond: bfc.width() <= 16
 10250  	// result: (UBFX [bfc] x)
 10251  	for {
 10252  		if v_0.Op != OpARM64UBFX {
 10253  			break
 10254  		}
 10255  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 10256  		x := v_0.Args[0]
 10257  		if !(bfc.width() <= 16) {
 10258  			break
 10259  		}
 10260  		v.reset(OpARM64UBFX)
 10261  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 10262  		v.AddArg(x)
 10263  		return true
 10264  	}
 10265  	return false
 10266  }
 10267  func rewriteValueARM64_OpARM64MOVHload(v *Value) bool {
 10268  	v_1 := v.Args[1]
 10269  	v_0 := v.Args[0]
 10270  	b := v.Block
 10271  	config := b.Func.Config
 10272  	// match: (MOVHload [off1] {sym} (ADDconst [off2] ptr) mem)
 10273  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10274  	// result: (MOVHload [off1+int32(off2)] {sym} ptr mem)
 10275  	for {
 10276  		off1 := auxIntToInt32(v.AuxInt)
 10277  		sym := auxToSym(v.Aux)
 10278  		if v_0.Op != OpARM64ADDconst {
 10279  			break
 10280  		}
 10281  		off2 := auxIntToInt64(v_0.AuxInt)
 10282  		ptr := v_0.Args[0]
 10283  		mem := v_1
 10284  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10285  			break
 10286  		}
 10287  		v.reset(OpARM64MOVHload)
 10288  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10289  		v.Aux = symToAux(sym)
 10290  		v.AddArg2(ptr, mem)
 10291  		return true
 10292  	}
 10293  	// match: (MOVHload [off] {sym} (ADD ptr idx) mem)
 10294  	// cond: off == 0 && sym == nil
 10295  	// result: (MOVHloadidx ptr idx mem)
 10296  	for {
 10297  		off := auxIntToInt32(v.AuxInt)
 10298  		sym := auxToSym(v.Aux)
 10299  		if v_0.Op != OpARM64ADD {
 10300  			break
 10301  		}
 10302  		idx := v_0.Args[1]
 10303  		ptr := v_0.Args[0]
 10304  		mem := v_1
 10305  		if !(off == 0 && sym == nil) {
 10306  			break
 10307  		}
 10308  		v.reset(OpARM64MOVHloadidx)
 10309  		v.AddArg3(ptr, idx, mem)
 10310  		return true
 10311  	}
 10312  	// match: (MOVHload [off] {sym} (ADDshiftLL [1] ptr idx) mem)
 10313  	// cond: off == 0 && sym == nil
 10314  	// result: (MOVHloadidx2 ptr idx mem)
 10315  	for {
 10316  		off := auxIntToInt32(v.AuxInt)
 10317  		sym := auxToSym(v.Aux)
 10318  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
 10319  			break
 10320  		}
 10321  		idx := v_0.Args[1]
 10322  		ptr := v_0.Args[0]
 10323  		mem := v_1
 10324  		if !(off == 0 && sym == nil) {
 10325  			break
 10326  		}
 10327  		v.reset(OpARM64MOVHloadidx2)
 10328  		v.AddArg3(ptr, idx, mem)
 10329  		return true
 10330  	}
 10331  	// match: (MOVHload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 10332  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10333  	// result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10334  	for {
 10335  		off1 := auxIntToInt32(v.AuxInt)
 10336  		sym1 := auxToSym(v.Aux)
 10337  		if v_0.Op != OpARM64MOVDaddr {
 10338  			break
 10339  		}
 10340  		off2 := auxIntToInt32(v_0.AuxInt)
 10341  		sym2 := auxToSym(v_0.Aux)
 10342  		ptr := v_0.Args[0]
 10343  		mem := v_1
 10344  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10345  			break
 10346  		}
 10347  		v.reset(OpARM64MOVHload)
 10348  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10349  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10350  		v.AddArg2(ptr, mem)
 10351  		return true
 10352  	}
 10353  	// match: (MOVHload [off] {sym} ptr (MOVHstorezero [off2] {sym2} ptr2 _))
 10354  	// cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
 10355  	// result: (MOVDconst [0])
 10356  	for {
 10357  		off := auxIntToInt32(v.AuxInt)
 10358  		sym := auxToSym(v.Aux)
 10359  		ptr := v_0
 10360  		if v_1.Op != OpARM64MOVHstorezero {
 10361  			break
 10362  		}
 10363  		off2 := auxIntToInt32(v_1.AuxInt)
 10364  		sym2 := auxToSym(v_1.Aux)
 10365  		ptr2 := v_1.Args[0]
 10366  		if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
 10367  			break
 10368  		}
 10369  		v.reset(OpARM64MOVDconst)
 10370  		v.AuxInt = int64ToAuxInt(0)
 10371  		return true
 10372  	}
 10373  	return false
 10374  }
 10375  func rewriteValueARM64_OpARM64MOVHloadidx(v *Value) bool {
 10376  	v_2 := v.Args[2]
 10377  	v_1 := v.Args[1]
 10378  	v_0 := v.Args[0]
 10379  	// match: (MOVHloadidx ptr (MOVDconst [c]) mem)
 10380  	// cond: is32Bit(c)
 10381  	// result: (MOVHload [int32(c)] ptr mem)
 10382  	for {
 10383  		ptr := v_0
 10384  		if v_1.Op != OpARM64MOVDconst {
 10385  			break
 10386  		}
 10387  		c := auxIntToInt64(v_1.AuxInt)
 10388  		mem := v_2
 10389  		if !(is32Bit(c)) {
 10390  			break
 10391  		}
 10392  		v.reset(OpARM64MOVHload)
 10393  		v.AuxInt = int32ToAuxInt(int32(c))
 10394  		v.AddArg2(ptr, mem)
 10395  		return true
 10396  	}
 10397  	// match: (MOVHloadidx (MOVDconst [c]) ptr mem)
 10398  	// cond: is32Bit(c)
 10399  	// result: (MOVHload [int32(c)] ptr mem)
 10400  	for {
 10401  		if v_0.Op != OpARM64MOVDconst {
 10402  			break
 10403  		}
 10404  		c := auxIntToInt64(v_0.AuxInt)
 10405  		ptr := v_1
 10406  		mem := v_2
 10407  		if !(is32Bit(c)) {
 10408  			break
 10409  		}
 10410  		v.reset(OpARM64MOVHload)
 10411  		v.AuxInt = int32ToAuxInt(int32(c))
 10412  		v.AddArg2(ptr, mem)
 10413  		return true
 10414  	}
 10415  	// match: (MOVHloadidx ptr (SLLconst [1] idx) mem)
 10416  	// result: (MOVHloadidx2 ptr idx mem)
 10417  	for {
 10418  		ptr := v_0
 10419  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
 10420  			break
 10421  		}
 10422  		idx := v_1.Args[0]
 10423  		mem := v_2
 10424  		v.reset(OpARM64MOVHloadidx2)
 10425  		v.AddArg3(ptr, idx, mem)
 10426  		return true
 10427  	}
 10428  	// match: (MOVHloadidx ptr (ADD idx idx) mem)
 10429  	// result: (MOVHloadidx2 ptr idx mem)
 10430  	for {
 10431  		ptr := v_0
 10432  		if v_1.Op != OpARM64ADD {
 10433  			break
 10434  		}
 10435  		idx := v_1.Args[1]
 10436  		if idx != v_1.Args[0] {
 10437  			break
 10438  		}
 10439  		mem := v_2
 10440  		v.reset(OpARM64MOVHloadidx2)
 10441  		v.AddArg3(ptr, idx, mem)
 10442  		return true
 10443  	}
 10444  	// match: (MOVHloadidx (ADD idx idx) ptr mem)
 10445  	// result: (MOVHloadidx2 ptr idx mem)
 10446  	for {
 10447  		if v_0.Op != OpARM64ADD {
 10448  			break
 10449  		}
 10450  		idx := v_0.Args[1]
 10451  		if idx != v_0.Args[0] {
 10452  			break
 10453  		}
 10454  		ptr := v_1
 10455  		mem := v_2
 10456  		v.reset(OpARM64MOVHloadidx2)
 10457  		v.AddArg3(ptr, idx, mem)
 10458  		return true
 10459  	}
 10460  	// match: (MOVHloadidx ptr idx (MOVHstorezeroidx ptr2 idx2 _))
 10461  	// cond: (isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2))
 10462  	// result: (MOVDconst [0])
 10463  	for {
 10464  		ptr := v_0
 10465  		idx := v_1
 10466  		if v_2.Op != OpARM64MOVHstorezeroidx {
 10467  			break
 10468  		}
 10469  		idx2 := v_2.Args[1]
 10470  		ptr2 := v_2.Args[0]
 10471  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
 10472  			break
 10473  		}
 10474  		v.reset(OpARM64MOVDconst)
 10475  		v.AuxInt = int64ToAuxInt(0)
 10476  		return true
 10477  	}
 10478  	return false
 10479  }
 10480  func rewriteValueARM64_OpARM64MOVHloadidx2(v *Value) bool {
 10481  	v_2 := v.Args[2]
 10482  	v_1 := v.Args[1]
 10483  	v_0 := v.Args[0]
 10484  	// match: (MOVHloadidx2 ptr (MOVDconst [c]) mem)
 10485  	// cond: is32Bit(c<<1)
 10486  	// result: (MOVHload [int32(c)<<1] ptr mem)
 10487  	for {
 10488  		ptr := v_0
 10489  		if v_1.Op != OpARM64MOVDconst {
 10490  			break
 10491  		}
 10492  		c := auxIntToInt64(v_1.AuxInt)
 10493  		mem := v_2
 10494  		if !(is32Bit(c << 1)) {
 10495  			break
 10496  		}
 10497  		v.reset(OpARM64MOVHload)
 10498  		v.AuxInt = int32ToAuxInt(int32(c) << 1)
 10499  		v.AddArg2(ptr, mem)
 10500  		return true
 10501  	}
 10502  	// match: (MOVHloadidx2 ptr idx (MOVHstorezeroidx2 ptr2 idx2 _))
 10503  	// cond: isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)
 10504  	// result: (MOVDconst [0])
 10505  	for {
 10506  		ptr := v_0
 10507  		idx := v_1
 10508  		if v_2.Op != OpARM64MOVHstorezeroidx2 {
 10509  			break
 10510  		}
 10511  		idx2 := v_2.Args[1]
 10512  		ptr2 := v_2.Args[0]
 10513  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)) {
 10514  			break
 10515  		}
 10516  		v.reset(OpARM64MOVDconst)
 10517  		v.AuxInt = int64ToAuxInt(0)
 10518  		return true
 10519  	}
 10520  	return false
 10521  }
 10522  func rewriteValueARM64_OpARM64MOVHreg(v *Value) bool {
 10523  	v_0 := v.Args[0]
 10524  	// match: (MOVHreg (MOVDconst [c]))
 10525  	// result: (MOVDconst [int64(int16(c))])
 10526  	for {
 10527  		if v_0.Op != OpARM64MOVDconst {
 10528  			break
 10529  		}
 10530  		c := auxIntToInt64(v_0.AuxInt)
 10531  		v.reset(OpARM64MOVDconst)
 10532  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
 10533  		return true
 10534  	}
 10535  	// match: (MOVHreg x)
 10536  	// cond: v.Type.Size() <= 2
 10537  	// result: x
 10538  	for {
 10539  		x := v_0
 10540  		if !(v.Type.Size() <= 2) {
 10541  			break
 10542  		}
 10543  		v.copyOf(x)
 10544  		return true
 10545  	}
 10546  	// match: (MOVHreg <t> (ANDconst x [c]))
 10547  	// cond: uint64(c) & uint64(0xffffffffffff8000) == 0
 10548  	// result: (ANDconst <t> x [c])
 10549  	for {
 10550  		t := v.Type
 10551  		if v_0.Op != OpARM64ANDconst {
 10552  			break
 10553  		}
 10554  		c := auxIntToInt64(v_0.AuxInt)
 10555  		x := v_0.Args[0]
 10556  		if !(uint64(c)&uint64(0xffffffffffff8000) == 0) {
 10557  			break
 10558  		}
 10559  		v.reset(OpARM64ANDconst)
 10560  		v.Type = t
 10561  		v.AuxInt = int64ToAuxInt(c)
 10562  		v.AddArg(x)
 10563  		return true
 10564  	}
 10565  	// match: (MOVHreg (SLLconst [lc] x))
 10566  	// cond: lc < 16
 10567  	// result: (SBFIZ [armBFAuxInt(lc, 16-lc)] x)
 10568  	for {
 10569  		if v_0.Op != OpARM64SLLconst {
 10570  			break
 10571  		}
 10572  		lc := auxIntToInt64(v_0.AuxInt)
 10573  		x := v_0.Args[0]
 10574  		if !(lc < 16) {
 10575  			break
 10576  		}
 10577  		v.reset(OpARM64SBFIZ)
 10578  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 16-lc))
 10579  		v.AddArg(x)
 10580  		return true
 10581  	}
 10582  	// match: (MOVHreg (SBFX [bfc] x))
 10583  	// cond: bfc.width() <= 16
 10584  	// result: (SBFX [bfc] x)
 10585  	for {
 10586  		if v_0.Op != OpARM64SBFX {
 10587  			break
 10588  		}
 10589  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 10590  		x := v_0.Args[0]
 10591  		if !(bfc.width() <= 16) {
 10592  			break
 10593  		}
 10594  		v.reset(OpARM64SBFX)
 10595  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 10596  		v.AddArg(x)
 10597  		return true
 10598  	}
 10599  	return false
 10600  }
 10601  func rewriteValueARM64_OpARM64MOVHstore(v *Value) bool {
 10602  	v_2 := v.Args[2]
 10603  	v_1 := v.Args[1]
 10604  	v_0 := v.Args[0]
 10605  	b := v.Block
 10606  	config := b.Func.Config
 10607  	// match: (MOVHstore [off1] {sym} (ADDconst [off2] ptr) val mem)
 10608  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10609  	// result: (MOVHstore [off1+int32(off2)] {sym} ptr val mem)
 10610  	for {
 10611  		off1 := auxIntToInt32(v.AuxInt)
 10612  		sym := auxToSym(v.Aux)
 10613  		if v_0.Op != OpARM64ADDconst {
 10614  			break
 10615  		}
 10616  		off2 := auxIntToInt64(v_0.AuxInt)
 10617  		ptr := v_0.Args[0]
 10618  		val := v_1
 10619  		mem := v_2
 10620  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10621  			break
 10622  		}
 10623  		v.reset(OpARM64MOVHstore)
 10624  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10625  		v.Aux = symToAux(sym)
 10626  		v.AddArg3(ptr, val, mem)
 10627  		return true
 10628  	}
 10629  	// match: (MOVHstore [off] {sym} (ADD ptr idx) val mem)
 10630  	// cond: off == 0 && sym == nil
 10631  	// result: (MOVHstoreidx ptr idx val mem)
 10632  	for {
 10633  		off := auxIntToInt32(v.AuxInt)
 10634  		sym := auxToSym(v.Aux)
 10635  		if v_0.Op != OpARM64ADD {
 10636  			break
 10637  		}
 10638  		idx := v_0.Args[1]
 10639  		ptr := v_0.Args[0]
 10640  		val := v_1
 10641  		mem := v_2
 10642  		if !(off == 0 && sym == nil) {
 10643  			break
 10644  		}
 10645  		v.reset(OpARM64MOVHstoreidx)
 10646  		v.AddArg4(ptr, idx, val, mem)
 10647  		return true
 10648  	}
 10649  	// match: (MOVHstore [off] {sym} (ADDshiftLL [1] ptr idx) val mem)
 10650  	// cond: off == 0 && sym == nil
 10651  	// result: (MOVHstoreidx2 ptr idx val mem)
 10652  	for {
 10653  		off := auxIntToInt32(v.AuxInt)
 10654  		sym := auxToSym(v.Aux)
 10655  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
 10656  			break
 10657  		}
 10658  		idx := v_0.Args[1]
 10659  		ptr := v_0.Args[0]
 10660  		val := v_1
 10661  		mem := v_2
 10662  		if !(off == 0 && sym == nil) {
 10663  			break
 10664  		}
 10665  		v.reset(OpARM64MOVHstoreidx2)
 10666  		v.AddArg4(ptr, idx, val, mem)
 10667  		return true
 10668  	}
 10669  	// match: (MOVHstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
 10670  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 10671  	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 10672  	for {
 10673  		off1 := auxIntToInt32(v.AuxInt)
 10674  		sym1 := auxToSym(v.Aux)
 10675  		if v_0.Op != OpARM64MOVDaddr {
 10676  			break
 10677  		}
 10678  		off2 := auxIntToInt32(v_0.AuxInt)
 10679  		sym2 := auxToSym(v_0.Aux)
 10680  		ptr := v_0.Args[0]
 10681  		val := v_1
 10682  		mem := v_2
 10683  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 10684  			break
 10685  		}
 10686  		v.reset(OpARM64MOVHstore)
 10687  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10688  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10689  		v.AddArg3(ptr, val, mem)
 10690  		return true
 10691  	}
 10692  	// match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
 10693  	// result: (MOVHstorezero [off] {sym} ptr mem)
 10694  	for {
 10695  		off := auxIntToInt32(v.AuxInt)
 10696  		sym := auxToSym(v.Aux)
 10697  		ptr := v_0
 10698  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 10699  			break
 10700  		}
 10701  		mem := v_2
 10702  		v.reset(OpARM64MOVHstorezero)
 10703  		v.AuxInt = int32ToAuxInt(off)
 10704  		v.Aux = symToAux(sym)
 10705  		v.AddArg2(ptr, mem)
 10706  		return true
 10707  	}
 10708  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
 10709  	// result: (MOVHstore [off] {sym} ptr x mem)
 10710  	for {
 10711  		off := auxIntToInt32(v.AuxInt)
 10712  		sym := auxToSym(v.Aux)
 10713  		ptr := v_0
 10714  		if v_1.Op != OpARM64MOVHreg {
 10715  			break
 10716  		}
 10717  		x := v_1.Args[0]
 10718  		mem := v_2
 10719  		v.reset(OpARM64MOVHstore)
 10720  		v.AuxInt = int32ToAuxInt(off)
 10721  		v.Aux = symToAux(sym)
 10722  		v.AddArg3(ptr, x, mem)
 10723  		return true
 10724  	}
 10725  	// match: (MOVHstore [off] {sym} ptr (MOVHUreg x) mem)
 10726  	// result: (MOVHstore [off] {sym} ptr x mem)
 10727  	for {
 10728  		off := auxIntToInt32(v.AuxInt)
 10729  		sym := auxToSym(v.Aux)
 10730  		ptr := v_0
 10731  		if v_1.Op != OpARM64MOVHUreg {
 10732  			break
 10733  		}
 10734  		x := v_1.Args[0]
 10735  		mem := v_2
 10736  		v.reset(OpARM64MOVHstore)
 10737  		v.AuxInt = int32ToAuxInt(off)
 10738  		v.Aux = symToAux(sym)
 10739  		v.AddArg3(ptr, x, mem)
 10740  		return true
 10741  	}
 10742  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
 10743  	// result: (MOVHstore [off] {sym} ptr x mem)
 10744  	for {
 10745  		off := auxIntToInt32(v.AuxInt)
 10746  		sym := auxToSym(v.Aux)
 10747  		ptr := v_0
 10748  		if v_1.Op != OpARM64MOVWreg {
 10749  			break
 10750  		}
 10751  		x := v_1.Args[0]
 10752  		mem := v_2
 10753  		v.reset(OpARM64MOVHstore)
 10754  		v.AuxInt = int32ToAuxInt(off)
 10755  		v.Aux = symToAux(sym)
 10756  		v.AddArg3(ptr, x, mem)
 10757  		return true
 10758  	}
 10759  	// match: (MOVHstore [off] {sym} ptr (MOVWUreg x) mem)
 10760  	// result: (MOVHstore [off] {sym} ptr x mem)
 10761  	for {
 10762  		off := auxIntToInt32(v.AuxInt)
 10763  		sym := auxToSym(v.Aux)
 10764  		ptr := v_0
 10765  		if v_1.Op != OpARM64MOVWUreg {
 10766  			break
 10767  		}
 10768  		x := v_1.Args[0]
 10769  		mem := v_2
 10770  		v.reset(OpARM64MOVHstore)
 10771  		v.AuxInt = int32ToAuxInt(off)
 10772  		v.Aux = symToAux(sym)
 10773  		v.AddArg3(ptr, x, mem)
 10774  		return true
 10775  	}
 10776  	return false
 10777  }
 10778  func rewriteValueARM64_OpARM64MOVHstoreidx(v *Value) bool {
 10779  	v_3 := v.Args[3]
 10780  	v_2 := v.Args[2]
 10781  	v_1 := v.Args[1]
 10782  	v_0 := v.Args[0]
 10783  	// match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
 10784  	// cond: is32Bit(c)
 10785  	// result: (MOVHstore [int32(c)] ptr val mem)
 10786  	for {
 10787  		ptr := v_0
 10788  		if v_1.Op != OpARM64MOVDconst {
 10789  			break
 10790  		}
 10791  		c := auxIntToInt64(v_1.AuxInt)
 10792  		val := v_2
 10793  		mem := v_3
 10794  		if !(is32Bit(c)) {
 10795  			break
 10796  		}
 10797  		v.reset(OpARM64MOVHstore)
 10798  		v.AuxInt = int32ToAuxInt(int32(c))
 10799  		v.AddArg3(ptr, val, mem)
 10800  		return true
 10801  	}
 10802  	// match: (MOVHstoreidx (MOVDconst [c]) idx val mem)
 10803  	// cond: is32Bit(c)
 10804  	// result: (MOVHstore [int32(c)] idx val mem)
 10805  	for {
 10806  		if v_0.Op != OpARM64MOVDconst {
 10807  			break
 10808  		}
 10809  		c := auxIntToInt64(v_0.AuxInt)
 10810  		idx := v_1
 10811  		val := v_2
 10812  		mem := v_3
 10813  		if !(is32Bit(c)) {
 10814  			break
 10815  		}
 10816  		v.reset(OpARM64MOVHstore)
 10817  		v.AuxInt = int32ToAuxInt(int32(c))
 10818  		v.AddArg3(idx, val, mem)
 10819  		return true
 10820  	}
 10821  	// match: (MOVHstoreidx ptr (SLLconst [1] idx) val mem)
 10822  	// result: (MOVHstoreidx2 ptr idx val mem)
 10823  	for {
 10824  		ptr := v_0
 10825  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
 10826  			break
 10827  		}
 10828  		idx := v_1.Args[0]
 10829  		val := v_2
 10830  		mem := v_3
 10831  		v.reset(OpARM64MOVHstoreidx2)
 10832  		v.AddArg4(ptr, idx, val, mem)
 10833  		return true
 10834  	}
 10835  	// match: (MOVHstoreidx ptr (ADD idx idx) val mem)
 10836  	// result: (MOVHstoreidx2 ptr idx val mem)
 10837  	for {
 10838  		ptr := v_0
 10839  		if v_1.Op != OpARM64ADD {
 10840  			break
 10841  		}
 10842  		idx := v_1.Args[1]
 10843  		if idx != v_1.Args[0] {
 10844  			break
 10845  		}
 10846  		val := v_2
 10847  		mem := v_3
 10848  		v.reset(OpARM64MOVHstoreidx2)
 10849  		v.AddArg4(ptr, idx, val, mem)
 10850  		return true
 10851  	}
 10852  	// match: (MOVHstoreidx (SLLconst [1] idx) ptr val mem)
 10853  	// result: (MOVHstoreidx2 ptr idx val mem)
 10854  	for {
 10855  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 1 {
 10856  			break
 10857  		}
 10858  		idx := v_0.Args[0]
 10859  		ptr := v_1
 10860  		val := v_2
 10861  		mem := v_3
 10862  		v.reset(OpARM64MOVHstoreidx2)
 10863  		v.AddArg4(ptr, idx, val, mem)
 10864  		return true
 10865  	}
 10866  	// match: (MOVHstoreidx (ADD idx idx) ptr val mem)
 10867  	// result: (MOVHstoreidx2 ptr idx val mem)
 10868  	for {
 10869  		if v_0.Op != OpARM64ADD {
 10870  			break
 10871  		}
 10872  		idx := v_0.Args[1]
 10873  		if idx != v_0.Args[0] {
 10874  			break
 10875  		}
 10876  		ptr := v_1
 10877  		val := v_2
 10878  		mem := v_3
 10879  		v.reset(OpARM64MOVHstoreidx2)
 10880  		v.AddArg4(ptr, idx, val, mem)
 10881  		return true
 10882  	}
 10883  	// match: (MOVHstoreidx ptr idx (MOVDconst [0]) mem)
 10884  	// result: (MOVHstorezeroidx ptr idx mem)
 10885  	for {
 10886  		ptr := v_0
 10887  		idx := v_1
 10888  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
 10889  			break
 10890  		}
 10891  		mem := v_3
 10892  		v.reset(OpARM64MOVHstorezeroidx)
 10893  		v.AddArg3(ptr, idx, mem)
 10894  		return true
 10895  	}
 10896  	// match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
 10897  	// result: (MOVHstoreidx ptr idx x mem)
 10898  	for {
 10899  		ptr := v_0
 10900  		idx := v_1
 10901  		if v_2.Op != OpARM64MOVHreg {
 10902  			break
 10903  		}
 10904  		x := v_2.Args[0]
 10905  		mem := v_3
 10906  		v.reset(OpARM64MOVHstoreidx)
 10907  		v.AddArg4(ptr, idx, x, mem)
 10908  		return true
 10909  	}
 10910  	// match: (MOVHstoreidx ptr idx (MOVHUreg x) mem)
 10911  	// result: (MOVHstoreidx ptr idx x mem)
 10912  	for {
 10913  		ptr := v_0
 10914  		idx := v_1
 10915  		if v_2.Op != OpARM64MOVHUreg {
 10916  			break
 10917  		}
 10918  		x := v_2.Args[0]
 10919  		mem := v_3
 10920  		v.reset(OpARM64MOVHstoreidx)
 10921  		v.AddArg4(ptr, idx, x, mem)
 10922  		return true
 10923  	}
 10924  	// match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
 10925  	// result: (MOVHstoreidx ptr idx x mem)
 10926  	for {
 10927  		ptr := v_0
 10928  		idx := v_1
 10929  		if v_2.Op != OpARM64MOVWreg {
 10930  			break
 10931  		}
 10932  		x := v_2.Args[0]
 10933  		mem := v_3
 10934  		v.reset(OpARM64MOVHstoreidx)
 10935  		v.AddArg4(ptr, idx, x, mem)
 10936  		return true
 10937  	}
 10938  	// match: (MOVHstoreidx ptr idx (MOVWUreg x) mem)
 10939  	// result: (MOVHstoreidx ptr idx x mem)
 10940  	for {
 10941  		ptr := v_0
 10942  		idx := v_1
 10943  		if v_2.Op != OpARM64MOVWUreg {
 10944  			break
 10945  		}
 10946  		x := v_2.Args[0]
 10947  		mem := v_3
 10948  		v.reset(OpARM64MOVHstoreidx)
 10949  		v.AddArg4(ptr, idx, x, mem)
 10950  		return true
 10951  	}
 10952  	return false
 10953  }
 10954  func rewriteValueARM64_OpARM64MOVHstoreidx2(v *Value) bool {
 10955  	v_3 := v.Args[3]
 10956  	v_2 := v.Args[2]
 10957  	v_1 := v.Args[1]
 10958  	v_0 := v.Args[0]
 10959  	// match: (MOVHstoreidx2 ptr (MOVDconst [c]) val mem)
 10960  	// cond: is32Bit(c<<1)
 10961  	// result: (MOVHstore [int32(c)<<1] ptr val mem)
 10962  	for {
 10963  		ptr := v_0
 10964  		if v_1.Op != OpARM64MOVDconst {
 10965  			break
 10966  		}
 10967  		c := auxIntToInt64(v_1.AuxInt)
 10968  		val := v_2
 10969  		mem := v_3
 10970  		if !(is32Bit(c << 1)) {
 10971  			break
 10972  		}
 10973  		v.reset(OpARM64MOVHstore)
 10974  		v.AuxInt = int32ToAuxInt(int32(c) << 1)
 10975  		v.AddArg3(ptr, val, mem)
 10976  		return true
 10977  	}
 10978  	// match: (MOVHstoreidx2 ptr idx (MOVDconst [0]) mem)
 10979  	// result: (MOVHstorezeroidx2 ptr idx mem)
 10980  	for {
 10981  		ptr := v_0
 10982  		idx := v_1
 10983  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
 10984  			break
 10985  		}
 10986  		mem := v_3
 10987  		v.reset(OpARM64MOVHstorezeroidx2)
 10988  		v.AddArg3(ptr, idx, mem)
 10989  		return true
 10990  	}
 10991  	// match: (MOVHstoreidx2 ptr idx (MOVHreg x) mem)
 10992  	// result: (MOVHstoreidx2 ptr idx x mem)
 10993  	for {
 10994  		ptr := v_0
 10995  		idx := v_1
 10996  		if v_2.Op != OpARM64MOVHreg {
 10997  			break
 10998  		}
 10999  		x := v_2.Args[0]
 11000  		mem := v_3
 11001  		v.reset(OpARM64MOVHstoreidx2)
 11002  		v.AddArg4(ptr, idx, x, mem)
 11003  		return true
 11004  	}
 11005  	// match: (MOVHstoreidx2 ptr idx (MOVHUreg x) mem)
 11006  	// result: (MOVHstoreidx2 ptr idx x mem)
 11007  	for {
 11008  		ptr := v_0
 11009  		idx := v_1
 11010  		if v_2.Op != OpARM64MOVHUreg {
 11011  			break
 11012  		}
 11013  		x := v_2.Args[0]
 11014  		mem := v_3
 11015  		v.reset(OpARM64MOVHstoreidx2)
 11016  		v.AddArg4(ptr, idx, x, mem)
 11017  		return true
 11018  	}
 11019  	// match: (MOVHstoreidx2 ptr idx (MOVWreg x) mem)
 11020  	// result: (MOVHstoreidx2 ptr idx x mem)
 11021  	for {
 11022  		ptr := v_0
 11023  		idx := v_1
 11024  		if v_2.Op != OpARM64MOVWreg {
 11025  			break
 11026  		}
 11027  		x := v_2.Args[0]
 11028  		mem := v_3
 11029  		v.reset(OpARM64MOVHstoreidx2)
 11030  		v.AddArg4(ptr, idx, x, mem)
 11031  		return true
 11032  	}
 11033  	// match: (MOVHstoreidx2 ptr idx (MOVWUreg x) mem)
 11034  	// result: (MOVHstoreidx2 ptr idx x mem)
 11035  	for {
 11036  		ptr := v_0
 11037  		idx := v_1
 11038  		if v_2.Op != OpARM64MOVWUreg {
 11039  			break
 11040  		}
 11041  		x := v_2.Args[0]
 11042  		mem := v_3
 11043  		v.reset(OpARM64MOVHstoreidx2)
 11044  		v.AddArg4(ptr, idx, x, mem)
 11045  		return true
 11046  	}
 11047  	return false
 11048  }
 11049  func rewriteValueARM64_OpARM64MOVHstorezero(v *Value) bool {
 11050  	v_1 := v.Args[1]
 11051  	v_0 := v.Args[0]
 11052  	b := v.Block
 11053  	config := b.Func.Config
 11054  	// match: (MOVHstorezero [off1] {sym} (ADDconst [off2] ptr) mem)
 11055  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11056  	// result: (MOVHstorezero [off1+int32(off2)] {sym} ptr mem)
 11057  	for {
 11058  		off1 := auxIntToInt32(v.AuxInt)
 11059  		sym := auxToSym(v.Aux)
 11060  		if v_0.Op != OpARM64ADDconst {
 11061  			break
 11062  		}
 11063  		off2 := auxIntToInt64(v_0.AuxInt)
 11064  		ptr := v_0.Args[0]
 11065  		mem := v_1
 11066  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11067  			break
 11068  		}
 11069  		v.reset(OpARM64MOVHstorezero)
 11070  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11071  		v.Aux = symToAux(sym)
 11072  		v.AddArg2(ptr, mem)
 11073  		return true
 11074  	}
 11075  	// match: (MOVHstorezero [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 11076  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11077  	// result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 11078  	for {
 11079  		off1 := auxIntToInt32(v.AuxInt)
 11080  		sym1 := auxToSym(v.Aux)
 11081  		if v_0.Op != OpARM64MOVDaddr {
 11082  			break
 11083  		}
 11084  		off2 := auxIntToInt32(v_0.AuxInt)
 11085  		sym2 := auxToSym(v_0.Aux)
 11086  		ptr := v_0.Args[0]
 11087  		mem := v_1
 11088  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11089  			break
 11090  		}
 11091  		v.reset(OpARM64MOVHstorezero)
 11092  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11093  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11094  		v.AddArg2(ptr, mem)
 11095  		return true
 11096  	}
 11097  	// match: (MOVHstorezero [off] {sym} (ADD ptr idx) mem)
 11098  	// cond: off == 0 && sym == nil
 11099  	// result: (MOVHstorezeroidx ptr idx mem)
 11100  	for {
 11101  		off := auxIntToInt32(v.AuxInt)
 11102  		sym := auxToSym(v.Aux)
 11103  		if v_0.Op != OpARM64ADD {
 11104  			break
 11105  		}
 11106  		idx := v_0.Args[1]
 11107  		ptr := v_0.Args[0]
 11108  		mem := v_1
 11109  		if !(off == 0 && sym == nil) {
 11110  			break
 11111  		}
 11112  		v.reset(OpARM64MOVHstorezeroidx)
 11113  		v.AddArg3(ptr, idx, mem)
 11114  		return true
 11115  	}
 11116  	// match: (MOVHstorezero [off] {sym} (ADDshiftLL [1] ptr idx) mem)
 11117  	// cond: off == 0 && sym == nil
 11118  	// result: (MOVHstorezeroidx2 ptr idx mem)
 11119  	for {
 11120  		off := auxIntToInt32(v.AuxInt)
 11121  		sym := auxToSym(v.Aux)
 11122  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 1 {
 11123  			break
 11124  		}
 11125  		idx := v_0.Args[1]
 11126  		ptr := v_0.Args[0]
 11127  		mem := v_1
 11128  		if !(off == 0 && sym == nil) {
 11129  			break
 11130  		}
 11131  		v.reset(OpARM64MOVHstorezeroidx2)
 11132  		v.AddArg3(ptr, idx, mem)
 11133  		return true
 11134  	}
 11135  	return false
 11136  }
 11137  func rewriteValueARM64_OpARM64MOVHstorezeroidx(v *Value) bool {
 11138  	v_2 := v.Args[2]
 11139  	v_1 := v.Args[1]
 11140  	v_0 := v.Args[0]
 11141  	// match: (MOVHstorezeroidx ptr (MOVDconst [c]) mem)
 11142  	// cond: is32Bit(c)
 11143  	// result: (MOVHstorezero [int32(c)] ptr mem)
 11144  	for {
 11145  		ptr := v_0
 11146  		if v_1.Op != OpARM64MOVDconst {
 11147  			break
 11148  		}
 11149  		c := auxIntToInt64(v_1.AuxInt)
 11150  		mem := v_2
 11151  		if !(is32Bit(c)) {
 11152  			break
 11153  		}
 11154  		v.reset(OpARM64MOVHstorezero)
 11155  		v.AuxInt = int32ToAuxInt(int32(c))
 11156  		v.AddArg2(ptr, mem)
 11157  		return true
 11158  	}
 11159  	// match: (MOVHstorezeroidx (MOVDconst [c]) idx mem)
 11160  	// cond: is32Bit(c)
 11161  	// result: (MOVHstorezero [int32(c)] idx mem)
 11162  	for {
 11163  		if v_0.Op != OpARM64MOVDconst {
 11164  			break
 11165  		}
 11166  		c := auxIntToInt64(v_0.AuxInt)
 11167  		idx := v_1
 11168  		mem := v_2
 11169  		if !(is32Bit(c)) {
 11170  			break
 11171  		}
 11172  		v.reset(OpARM64MOVHstorezero)
 11173  		v.AuxInt = int32ToAuxInt(int32(c))
 11174  		v.AddArg2(idx, mem)
 11175  		return true
 11176  	}
 11177  	// match: (MOVHstorezeroidx ptr (SLLconst [1] idx) mem)
 11178  	// result: (MOVHstorezeroidx2 ptr idx mem)
 11179  	for {
 11180  		ptr := v_0
 11181  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 1 {
 11182  			break
 11183  		}
 11184  		idx := v_1.Args[0]
 11185  		mem := v_2
 11186  		v.reset(OpARM64MOVHstorezeroidx2)
 11187  		v.AddArg3(ptr, idx, mem)
 11188  		return true
 11189  	}
 11190  	// match: (MOVHstorezeroidx ptr (ADD idx idx) mem)
 11191  	// result: (MOVHstorezeroidx2 ptr idx mem)
 11192  	for {
 11193  		ptr := v_0
 11194  		if v_1.Op != OpARM64ADD {
 11195  			break
 11196  		}
 11197  		idx := v_1.Args[1]
 11198  		if idx != v_1.Args[0] {
 11199  			break
 11200  		}
 11201  		mem := v_2
 11202  		v.reset(OpARM64MOVHstorezeroidx2)
 11203  		v.AddArg3(ptr, idx, mem)
 11204  		return true
 11205  	}
 11206  	// match: (MOVHstorezeroidx (SLLconst [1] idx) ptr mem)
 11207  	// result: (MOVHstorezeroidx2 ptr idx mem)
 11208  	for {
 11209  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 1 {
 11210  			break
 11211  		}
 11212  		idx := v_0.Args[0]
 11213  		ptr := v_1
 11214  		mem := v_2
 11215  		v.reset(OpARM64MOVHstorezeroidx2)
 11216  		v.AddArg3(ptr, idx, mem)
 11217  		return true
 11218  	}
 11219  	// match: (MOVHstorezeroidx (ADD idx idx) ptr mem)
 11220  	// result: (MOVHstorezeroidx2 ptr idx mem)
 11221  	for {
 11222  		if v_0.Op != OpARM64ADD {
 11223  			break
 11224  		}
 11225  		idx := v_0.Args[1]
 11226  		if idx != v_0.Args[0] {
 11227  			break
 11228  		}
 11229  		ptr := v_1
 11230  		mem := v_2
 11231  		v.reset(OpARM64MOVHstorezeroidx2)
 11232  		v.AddArg3(ptr, idx, mem)
 11233  		return true
 11234  	}
 11235  	return false
 11236  }
 11237  func rewriteValueARM64_OpARM64MOVHstorezeroidx2(v *Value) bool {
 11238  	v_2 := v.Args[2]
 11239  	v_1 := v.Args[1]
 11240  	v_0 := v.Args[0]
 11241  	// match: (MOVHstorezeroidx2 ptr (MOVDconst [c]) mem)
 11242  	// cond: is32Bit(c<<1)
 11243  	// result: (MOVHstorezero [int32(c<<1)] ptr mem)
 11244  	for {
 11245  		ptr := v_0
 11246  		if v_1.Op != OpARM64MOVDconst {
 11247  			break
 11248  		}
 11249  		c := auxIntToInt64(v_1.AuxInt)
 11250  		mem := v_2
 11251  		if !(is32Bit(c << 1)) {
 11252  			break
 11253  		}
 11254  		v.reset(OpARM64MOVHstorezero)
 11255  		v.AuxInt = int32ToAuxInt(int32(c << 1))
 11256  		v.AddArg2(ptr, mem)
 11257  		return true
 11258  	}
 11259  	return false
 11260  }
 11261  func rewriteValueARM64_OpARM64MOVQstorezero(v *Value) bool {
 11262  	v_1 := v.Args[1]
 11263  	v_0 := v.Args[0]
 11264  	b := v.Block
 11265  	config := b.Func.Config
 11266  	// match: (MOVQstorezero [off1] {sym} (ADDconst [off2] ptr) mem)
 11267  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11268  	// result: (MOVQstorezero [off1+int32(off2)] {sym} ptr mem)
 11269  	for {
 11270  		off1 := auxIntToInt32(v.AuxInt)
 11271  		sym := auxToSym(v.Aux)
 11272  		if v_0.Op != OpARM64ADDconst {
 11273  			break
 11274  		}
 11275  		off2 := auxIntToInt64(v_0.AuxInt)
 11276  		ptr := v_0.Args[0]
 11277  		mem := v_1
 11278  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11279  			break
 11280  		}
 11281  		v.reset(OpARM64MOVQstorezero)
 11282  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11283  		v.Aux = symToAux(sym)
 11284  		v.AddArg2(ptr, mem)
 11285  		return true
 11286  	}
 11287  	// match: (MOVQstorezero [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 11288  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11289  	// result: (MOVQstorezero [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 11290  	for {
 11291  		off1 := auxIntToInt32(v.AuxInt)
 11292  		sym1 := auxToSym(v.Aux)
 11293  		if v_0.Op != OpARM64MOVDaddr {
 11294  			break
 11295  		}
 11296  		off2 := auxIntToInt32(v_0.AuxInt)
 11297  		sym2 := auxToSym(v_0.Aux)
 11298  		ptr := v_0.Args[0]
 11299  		mem := v_1
 11300  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11301  			break
 11302  		}
 11303  		v.reset(OpARM64MOVQstorezero)
 11304  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11305  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11306  		v.AddArg2(ptr, mem)
 11307  		return true
 11308  	}
 11309  	return false
 11310  }
 11311  func rewriteValueARM64_OpARM64MOVWUload(v *Value) bool {
 11312  	v_1 := v.Args[1]
 11313  	v_0 := v.Args[0]
 11314  	b := v.Block
 11315  	config := b.Func.Config
 11316  	// match: (MOVWUload [off] {sym} ptr (FMOVSstore [off] {sym} ptr val _))
 11317  	// result: (FMOVSfpgp val)
 11318  	for {
 11319  		off := auxIntToInt32(v.AuxInt)
 11320  		sym := auxToSym(v.Aux)
 11321  		ptr := v_0
 11322  		if v_1.Op != OpARM64FMOVSstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
 11323  			break
 11324  		}
 11325  		val := v_1.Args[1]
 11326  		if ptr != v_1.Args[0] {
 11327  			break
 11328  		}
 11329  		v.reset(OpARM64FMOVSfpgp)
 11330  		v.AddArg(val)
 11331  		return true
 11332  	}
 11333  	// match: (MOVWUload [off1] {sym} (ADDconst [off2] ptr) mem)
 11334  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11335  	// result: (MOVWUload [off1+int32(off2)] {sym} ptr mem)
 11336  	for {
 11337  		off1 := auxIntToInt32(v.AuxInt)
 11338  		sym := auxToSym(v.Aux)
 11339  		if v_0.Op != OpARM64ADDconst {
 11340  			break
 11341  		}
 11342  		off2 := auxIntToInt64(v_0.AuxInt)
 11343  		ptr := v_0.Args[0]
 11344  		mem := v_1
 11345  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11346  			break
 11347  		}
 11348  		v.reset(OpARM64MOVWUload)
 11349  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11350  		v.Aux = symToAux(sym)
 11351  		v.AddArg2(ptr, mem)
 11352  		return true
 11353  	}
 11354  	// match: (MOVWUload [off] {sym} (ADD ptr idx) mem)
 11355  	// cond: off == 0 && sym == nil
 11356  	// result: (MOVWUloadidx ptr idx mem)
 11357  	for {
 11358  		off := auxIntToInt32(v.AuxInt)
 11359  		sym := auxToSym(v.Aux)
 11360  		if v_0.Op != OpARM64ADD {
 11361  			break
 11362  		}
 11363  		idx := v_0.Args[1]
 11364  		ptr := v_0.Args[0]
 11365  		mem := v_1
 11366  		if !(off == 0 && sym == nil) {
 11367  			break
 11368  		}
 11369  		v.reset(OpARM64MOVWUloadidx)
 11370  		v.AddArg3(ptr, idx, mem)
 11371  		return true
 11372  	}
 11373  	// match: (MOVWUload [off] {sym} (ADDshiftLL [2] ptr idx) mem)
 11374  	// cond: off == 0 && sym == nil
 11375  	// result: (MOVWUloadidx4 ptr idx mem)
 11376  	for {
 11377  		off := auxIntToInt32(v.AuxInt)
 11378  		sym := auxToSym(v.Aux)
 11379  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
 11380  			break
 11381  		}
 11382  		idx := v_0.Args[1]
 11383  		ptr := v_0.Args[0]
 11384  		mem := v_1
 11385  		if !(off == 0 && sym == nil) {
 11386  			break
 11387  		}
 11388  		v.reset(OpARM64MOVWUloadidx4)
 11389  		v.AddArg3(ptr, idx, mem)
 11390  		return true
 11391  	}
 11392  	// match: (MOVWUload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 11393  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11394  	// result: (MOVWUload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 11395  	for {
 11396  		off1 := auxIntToInt32(v.AuxInt)
 11397  		sym1 := auxToSym(v.Aux)
 11398  		if v_0.Op != OpARM64MOVDaddr {
 11399  			break
 11400  		}
 11401  		off2 := auxIntToInt32(v_0.AuxInt)
 11402  		sym2 := auxToSym(v_0.Aux)
 11403  		ptr := v_0.Args[0]
 11404  		mem := v_1
 11405  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11406  			break
 11407  		}
 11408  		v.reset(OpARM64MOVWUload)
 11409  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11410  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11411  		v.AddArg2(ptr, mem)
 11412  		return true
 11413  	}
 11414  	// match: (MOVWUload [off] {sym} ptr (MOVWstorezero [off2] {sym2} ptr2 _))
 11415  	// cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
 11416  	// result: (MOVDconst [0])
 11417  	for {
 11418  		off := auxIntToInt32(v.AuxInt)
 11419  		sym := auxToSym(v.Aux)
 11420  		ptr := v_0
 11421  		if v_1.Op != OpARM64MOVWstorezero {
 11422  			break
 11423  		}
 11424  		off2 := auxIntToInt32(v_1.AuxInt)
 11425  		sym2 := auxToSym(v_1.Aux)
 11426  		ptr2 := v_1.Args[0]
 11427  		if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
 11428  			break
 11429  		}
 11430  		v.reset(OpARM64MOVDconst)
 11431  		v.AuxInt = int64ToAuxInt(0)
 11432  		return true
 11433  	}
 11434  	// match: (MOVWUload [off] {sym} (SB) _)
 11435  	// cond: symIsRO(sym)
 11436  	// result: (MOVDconst [int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder))])
 11437  	for {
 11438  		off := auxIntToInt32(v.AuxInt)
 11439  		sym := auxToSym(v.Aux)
 11440  		if v_0.Op != OpSB || !(symIsRO(sym)) {
 11441  			break
 11442  		}
 11443  		v.reset(OpARM64MOVDconst)
 11444  		v.AuxInt = int64ToAuxInt(int64(read32(sym, int64(off), config.ctxt.Arch.ByteOrder)))
 11445  		return true
 11446  	}
 11447  	return false
 11448  }
 11449  func rewriteValueARM64_OpARM64MOVWUloadidx(v *Value) bool {
 11450  	v_2 := v.Args[2]
 11451  	v_1 := v.Args[1]
 11452  	v_0 := v.Args[0]
 11453  	// match: (MOVWUloadidx ptr (MOVDconst [c]) mem)
 11454  	// cond: is32Bit(c)
 11455  	// result: (MOVWUload [int32(c)] ptr mem)
 11456  	for {
 11457  		ptr := v_0
 11458  		if v_1.Op != OpARM64MOVDconst {
 11459  			break
 11460  		}
 11461  		c := auxIntToInt64(v_1.AuxInt)
 11462  		mem := v_2
 11463  		if !(is32Bit(c)) {
 11464  			break
 11465  		}
 11466  		v.reset(OpARM64MOVWUload)
 11467  		v.AuxInt = int32ToAuxInt(int32(c))
 11468  		v.AddArg2(ptr, mem)
 11469  		return true
 11470  	}
 11471  	// match: (MOVWUloadidx (MOVDconst [c]) ptr mem)
 11472  	// cond: is32Bit(c)
 11473  	// result: (MOVWUload [int32(c)] ptr mem)
 11474  	for {
 11475  		if v_0.Op != OpARM64MOVDconst {
 11476  			break
 11477  		}
 11478  		c := auxIntToInt64(v_0.AuxInt)
 11479  		ptr := v_1
 11480  		mem := v_2
 11481  		if !(is32Bit(c)) {
 11482  			break
 11483  		}
 11484  		v.reset(OpARM64MOVWUload)
 11485  		v.AuxInt = int32ToAuxInt(int32(c))
 11486  		v.AddArg2(ptr, mem)
 11487  		return true
 11488  	}
 11489  	// match: (MOVWUloadidx ptr (SLLconst [2] idx) mem)
 11490  	// result: (MOVWUloadidx4 ptr idx mem)
 11491  	for {
 11492  		ptr := v_0
 11493  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
 11494  			break
 11495  		}
 11496  		idx := v_1.Args[0]
 11497  		mem := v_2
 11498  		v.reset(OpARM64MOVWUloadidx4)
 11499  		v.AddArg3(ptr, idx, mem)
 11500  		return true
 11501  	}
 11502  	// match: (MOVWUloadidx (SLLconst [2] idx) ptr mem)
 11503  	// result: (MOVWUloadidx4 ptr idx mem)
 11504  	for {
 11505  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
 11506  			break
 11507  		}
 11508  		idx := v_0.Args[0]
 11509  		ptr := v_1
 11510  		mem := v_2
 11511  		v.reset(OpARM64MOVWUloadidx4)
 11512  		v.AddArg3(ptr, idx, mem)
 11513  		return true
 11514  	}
 11515  	// match: (MOVWUloadidx ptr idx (MOVWstorezeroidx ptr2 idx2 _))
 11516  	// cond: (isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2))
 11517  	// result: (MOVDconst [0])
 11518  	for {
 11519  		ptr := v_0
 11520  		idx := v_1
 11521  		if v_2.Op != OpARM64MOVWstorezeroidx {
 11522  			break
 11523  		}
 11524  		idx2 := v_2.Args[1]
 11525  		ptr2 := v_2.Args[0]
 11526  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
 11527  			break
 11528  		}
 11529  		v.reset(OpARM64MOVDconst)
 11530  		v.AuxInt = int64ToAuxInt(0)
 11531  		return true
 11532  	}
 11533  	return false
 11534  }
 11535  func rewriteValueARM64_OpARM64MOVWUloadidx4(v *Value) bool {
 11536  	v_2 := v.Args[2]
 11537  	v_1 := v.Args[1]
 11538  	v_0 := v.Args[0]
 11539  	// match: (MOVWUloadidx4 ptr (MOVDconst [c]) mem)
 11540  	// cond: is32Bit(c<<2)
 11541  	// result: (MOVWUload [int32(c)<<2] ptr mem)
 11542  	for {
 11543  		ptr := v_0
 11544  		if v_1.Op != OpARM64MOVDconst {
 11545  			break
 11546  		}
 11547  		c := auxIntToInt64(v_1.AuxInt)
 11548  		mem := v_2
 11549  		if !(is32Bit(c << 2)) {
 11550  			break
 11551  		}
 11552  		v.reset(OpARM64MOVWUload)
 11553  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
 11554  		v.AddArg2(ptr, mem)
 11555  		return true
 11556  	}
 11557  	// match: (MOVWUloadidx4 ptr idx (MOVWstorezeroidx4 ptr2 idx2 _))
 11558  	// cond: isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)
 11559  	// result: (MOVDconst [0])
 11560  	for {
 11561  		ptr := v_0
 11562  		idx := v_1
 11563  		if v_2.Op != OpARM64MOVWstorezeroidx4 {
 11564  			break
 11565  		}
 11566  		idx2 := v_2.Args[1]
 11567  		ptr2 := v_2.Args[0]
 11568  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)) {
 11569  			break
 11570  		}
 11571  		v.reset(OpARM64MOVDconst)
 11572  		v.AuxInt = int64ToAuxInt(0)
 11573  		return true
 11574  	}
 11575  	return false
 11576  }
 11577  func rewriteValueARM64_OpARM64MOVWUreg(v *Value) bool {
 11578  	v_0 := v.Args[0]
 11579  	// match: (MOVWUreg (ANDconst [c] x))
 11580  	// result: (ANDconst [c&(1<<32-1)] x)
 11581  	for {
 11582  		if v_0.Op != OpARM64ANDconst {
 11583  			break
 11584  		}
 11585  		c := auxIntToInt64(v_0.AuxInt)
 11586  		x := v_0.Args[0]
 11587  		v.reset(OpARM64ANDconst)
 11588  		v.AuxInt = int64ToAuxInt(c & (1<<32 - 1))
 11589  		v.AddArg(x)
 11590  		return true
 11591  	}
 11592  	// match: (MOVWUreg (MOVDconst [c]))
 11593  	// result: (MOVDconst [int64(uint32(c))])
 11594  	for {
 11595  		if v_0.Op != OpARM64MOVDconst {
 11596  			break
 11597  		}
 11598  		c := auxIntToInt64(v_0.AuxInt)
 11599  		v.reset(OpARM64MOVDconst)
 11600  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
 11601  		return true
 11602  	}
 11603  	// match: (MOVWUreg x)
 11604  	// cond: v.Type.Size() <= 4
 11605  	// result: x
 11606  	for {
 11607  		x := v_0
 11608  		if !(v.Type.Size() <= 4) {
 11609  			break
 11610  		}
 11611  		v.copyOf(x)
 11612  		return true
 11613  	}
 11614  	// match: (MOVWUreg (SLLconst [lc] x))
 11615  	// cond: lc >= 32
 11616  	// result: (MOVDconst [0])
 11617  	for {
 11618  		if v_0.Op != OpARM64SLLconst {
 11619  			break
 11620  		}
 11621  		lc := auxIntToInt64(v_0.AuxInt)
 11622  		if !(lc >= 32) {
 11623  			break
 11624  		}
 11625  		v.reset(OpARM64MOVDconst)
 11626  		v.AuxInt = int64ToAuxInt(0)
 11627  		return true
 11628  	}
 11629  	// match: (MOVWUreg (SLLconst [lc] x))
 11630  	// cond: lc < 32
 11631  	// result: (UBFIZ [armBFAuxInt(lc, 32-lc)] x)
 11632  	for {
 11633  		if v_0.Op != OpARM64SLLconst {
 11634  			break
 11635  		}
 11636  		lc := auxIntToInt64(v_0.AuxInt)
 11637  		x := v_0.Args[0]
 11638  		if !(lc < 32) {
 11639  			break
 11640  		}
 11641  		v.reset(OpARM64UBFIZ)
 11642  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 32-lc))
 11643  		v.AddArg(x)
 11644  		return true
 11645  	}
 11646  	// match: (MOVWUreg (SRLconst [rc] x))
 11647  	// cond: rc < 32
 11648  	// result: (UBFX [armBFAuxInt(rc, 32)] x)
 11649  	for {
 11650  		if v_0.Op != OpARM64SRLconst {
 11651  			break
 11652  		}
 11653  		rc := auxIntToInt64(v_0.AuxInt)
 11654  		x := v_0.Args[0]
 11655  		if !(rc < 32) {
 11656  			break
 11657  		}
 11658  		v.reset(OpARM64UBFX)
 11659  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32))
 11660  		v.AddArg(x)
 11661  		return true
 11662  	}
 11663  	// match: (MOVWUreg (UBFX [bfc] x))
 11664  	// cond: bfc.width() <= 32
 11665  	// result: (UBFX [bfc] x)
 11666  	for {
 11667  		if v_0.Op != OpARM64UBFX {
 11668  			break
 11669  		}
 11670  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 11671  		x := v_0.Args[0]
 11672  		if !(bfc.width() <= 32) {
 11673  			break
 11674  		}
 11675  		v.reset(OpARM64UBFX)
 11676  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 11677  		v.AddArg(x)
 11678  		return true
 11679  	}
 11680  	return false
 11681  }
 11682  func rewriteValueARM64_OpARM64MOVWload(v *Value) bool {
 11683  	v_1 := v.Args[1]
 11684  	v_0 := v.Args[0]
 11685  	b := v.Block
 11686  	config := b.Func.Config
 11687  	// match: (MOVWload [off1] {sym} (ADDconst [off2] ptr) mem)
 11688  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11689  	// result: (MOVWload [off1+int32(off2)] {sym} ptr mem)
 11690  	for {
 11691  		off1 := auxIntToInt32(v.AuxInt)
 11692  		sym := auxToSym(v.Aux)
 11693  		if v_0.Op != OpARM64ADDconst {
 11694  			break
 11695  		}
 11696  		off2 := auxIntToInt64(v_0.AuxInt)
 11697  		ptr := v_0.Args[0]
 11698  		mem := v_1
 11699  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11700  			break
 11701  		}
 11702  		v.reset(OpARM64MOVWload)
 11703  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11704  		v.Aux = symToAux(sym)
 11705  		v.AddArg2(ptr, mem)
 11706  		return true
 11707  	}
 11708  	// match: (MOVWload [off] {sym} (ADD ptr idx) mem)
 11709  	// cond: off == 0 && sym == nil
 11710  	// result: (MOVWloadidx ptr idx mem)
 11711  	for {
 11712  		off := auxIntToInt32(v.AuxInt)
 11713  		sym := auxToSym(v.Aux)
 11714  		if v_0.Op != OpARM64ADD {
 11715  			break
 11716  		}
 11717  		idx := v_0.Args[1]
 11718  		ptr := v_0.Args[0]
 11719  		mem := v_1
 11720  		if !(off == 0 && sym == nil) {
 11721  			break
 11722  		}
 11723  		v.reset(OpARM64MOVWloadidx)
 11724  		v.AddArg3(ptr, idx, mem)
 11725  		return true
 11726  	}
 11727  	// match: (MOVWload [off] {sym} (ADDshiftLL [2] ptr idx) mem)
 11728  	// cond: off == 0 && sym == nil
 11729  	// result: (MOVWloadidx4 ptr idx mem)
 11730  	for {
 11731  		off := auxIntToInt32(v.AuxInt)
 11732  		sym := auxToSym(v.Aux)
 11733  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
 11734  			break
 11735  		}
 11736  		idx := v_0.Args[1]
 11737  		ptr := v_0.Args[0]
 11738  		mem := v_1
 11739  		if !(off == 0 && sym == nil) {
 11740  			break
 11741  		}
 11742  		v.reset(OpARM64MOVWloadidx4)
 11743  		v.AddArg3(ptr, idx, mem)
 11744  		return true
 11745  	}
 11746  	// match: (MOVWload [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 11747  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 11748  	// result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 11749  	for {
 11750  		off1 := auxIntToInt32(v.AuxInt)
 11751  		sym1 := auxToSym(v.Aux)
 11752  		if v_0.Op != OpARM64MOVDaddr {
 11753  			break
 11754  		}
 11755  		off2 := auxIntToInt32(v_0.AuxInt)
 11756  		sym2 := auxToSym(v_0.Aux)
 11757  		ptr := v_0.Args[0]
 11758  		mem := v_1
 11759  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 11760  			break
 11761  		}
 11762  		v.reset(OpARM64MOVWload)
 11763  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11764  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11765  		v.AddArg2(ptr, mem)
 11766  		return true
 11767  	}
 11768  	// match: (MOVWload [off] {sym} ptr (MOVWstorezero [off2] {sym2} ptr2 _))
 11769  	// cond: sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)
 11770  	// result: (MOVDconst [0])
 11771  	for {
 11772  		off := auxIntToInt32(v.AuxInt)
 11773  		sym := auxToSym(v.Aux)
 11774  		ptr := v_0
 11775  		if v_1.Op != OpARM64MOVWstorezero {
 11776  			break
 11777  		}
 11778  		off2 := auxIntToInt32(v_1.AuxInt)
 11779  		sym2 := auxToSym(v_1.Aux)
 11780  		ptr2 := v_1.Args[0]
 11781  		if !(sym == sym2 && off == off2 && isSamePtr(ptr, ptr2)) {
 11782  			break
 11783  		}
 11784  		v.reset(OpARM64MOVDconst)
 11785  		v.AuxInt = int64ToAuxInt(0)
 11786  		return true
 11787  	}
 11788  	return false
 11789  }
 11790  func rewriteValueARM64_OpARM64MOVWloadidx(v *Value) bool {
 11791  	v_2 := v.Args[2]
 11792  	v_1 := v.Args[1]
 11793  	v_0 := v.Args[0]
 11794  	// match: (MOVWloadidx ptr (MOVDconst [c]) mem)
 11795  	// cond: is32Bit(c)
 11796  	// result: (MOVWload [int32(c)] ptr mem)
 11797  	for {
 11798  		ptr := v_0
 11799  		if v_1.Op != OpARM64MOVDconst {
 11800  			break
 11801  		}
 11802  		c := auxIntToInt64(v_1.AuxInt)
 11803  		mem := v_2
 11804  		if !(is32Bit(c)) {
 11805  			break
 11806  		}
 11807  		v.reset(OpARM64MOVWload)
 11808  		v.AuxInt = int32ToAuxInt(int32(c))
 11809  		v.AddArg2(ptr, mem)
 11810  		return true
 11811  	}
 11812  	// match: (MOVWloadidx (MOVDconst [c]) ptr mem)
 11813  	// cond: is32Bit(c)
 11814  	// result: (MOVWload [int32(c)] ptr mem)
 11815  	for {
 11816  		if v_0.Op != OpARM64MOVDconst {
 11817  			break
 11818  		}
 11819  		c := auxIntToInt64(v_0.AuxInt)
 11820  		ptr := v_1
 11821  		mem := v_2
 11822  		if !(is32Bit(c)) {
 11823  			break
 11824  		}
 11825  		v.reset(OpARM64MOVWload)
 11826  		v.AuxInt = int32ToAuxInt(int32(c))
 11827  		v.AddArg2(ptr, mem)
 11828  		return true
 11829  	}
 11830  	// match: (MOVWloadidx ptr (SLLconst [2] idx) mem)
 11831  	// result: (MOVWloadidx4 ptr idx mem)
 11832  	for {
 11833  		ptr := v_0
 11834  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
 11835  			break
 11836  		}
 11837  		idx := v_1.Args[0]
 11838  		mem := v_2
 11839  		v.reset(OpARM64MOVWloadidx4)
 11840  		v.AddArg3(ptr, idx, mem)
 11841  		return true
 11842  	}
 11843  	// match: (MOVWloadidx (SLLconst [2] idx) ptr mem)
 11844  	// result: (MOVWloadidx4 ptr idx mem)
 11845  	for {
 11846  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
 11847  			break
 11848  		}
 11849  		idx := v_0.Args[0]
 11850  		ptr := v_1
 11851  		mem := v_2
 11852  		v.reset(OpARM64MOVWloadidx4)
 11853  		v.AddArg3(ptr, idx, mem)
 11854  		return true
 11855  	}
 11856  	// match: (MOVWloadidx ptr idx (MOVWstorezeroidx ptr2 idx2 _))
 11857  	// cond: (isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2))
 11858  	// result: (MOVDconst [0])
 11859  	for {
 11860  		ptr := v_0
 11861  		idx := v_1
 11862  		if v_2.Op != OpARM64MOVWstorezeroidx {
 11863  			break
 11864  		}
 11865  		idx2 := v_2.Args[1]
 11866  		ptr2 := v_2.Args[0]
 11867  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2) || isSamePtr(ptr, idx2) && isSamePtr(idx, ptr2)) {
 11868  			break
 11869  		}
 11870  		v.reset(OpARM64MOVDconst)
 11871  		v.AuxInt = int64ToAuxInt(0)
 11872  		return true
 11873  	}
 11874  	return false
 11875  }
 11876  func rewriteValueARM64_OpARM64MOVWloadidx4(v *Value) bool {
 11877  	v_2 := v.Args[2]
 11878  	v_1 := v.Args[1]
 11879  	v_0 := v.Args[0]
 11880  	// match: (MOVWloadidx4 ptr (MOVDconst [c]) mem)
 11881  	// cond: is32Bit(c<<2)
 11882  	// result: (MOVWload [int32(c)<<2] ptr mem)
 11883  	for {
 11884  		ptr := v_0
 11885  		if v_1.Op != OpARM64MOVDconst {
 11886  			break
 11887  		}
 11888  		c := auxIntToInt64(v_1.AuxInt)
 11889  		mem := v_2
 11890  		if !(is32Bit(c << 2)) {
 11891  			break
 11892  		}
 11893  		v.reset(OpARM64MOVWload)
 11894  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
 11895  		v.AddArg2(ptr, mem)
 11896  		return true
 11897  	}
 11898  	// match: (MOVWloadidx4 ptr idx (MOVWstorezeroidx4 ptr2 idx2 _))
 11899  	// cond: isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)
 11900  	// result: (MOVDconst [0])
 11901  	for {
 11902  		ptr := v_0
 11903  		idx := v_1
 11904  		if v_2.Op != OpARM64MOVWstorezeroidx4 {
 11905  			break
 11906  		}
 11907  		idx2 := v_2.Args[1]
 11908  		ptr2 := v_2.Args[0]
 11909  		if !(isSamePtr(ptr, ptr2) && isSamePtr(idx, idx2)) {
 11910  			break
 11911  		}
 11912  		v.reset(OpARM64MOVDconst)
 11913  		v.AuxInt = int64ToAuxInt(0)
 11914  		return true
 11915  	}
 11916  	return false
 11917  }
 11918  func rewriteValueARM64_OpARM64MOVWreg(v *Value) bool {
 11919  	v_0 := v.Args[0]
 11920  	// match: (MOVWreg (MOVDconst [c]))
 11921  	// result: (MOVDconst [int64(int32(c))])
 11922  	for {
 11923  		if v_0.Op != OpARM64MOVDconst {
 11924  			break
 11925  		}
 11926  		c := auxIntToInt64(v_0.AuxInt)
 11927  		v.reset(OpARM64MOVDconst)
 11928  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
 11929  		return true
 11930  	}
 11931  	// match: (MOVWreg x)
 11932  	// cond: v.Type.Size() <= 4
 11933  	// result: x
 11934  	for {
 11935  		x := v_0
 11936  		if !(v.Type.Size() <= 4) {
 11937  			break
 11938  		}
 11939  		v.copyOf(x)
 11940  		return true
 11941  	}
 11942  	// match: (MOVWreg <t> (ANDconst x [c]))
 11943  	// cond: uint64(c) & uint64(0xffffffff80000000) == 0
 11944  	// result: (ANDconst <t> x [c])
 11945  	for {
 11946  		t := v.Type
 11947  		if v_0.Op != OpARM64ANDconst {
 11948  			break
 11949  		}
 11950  		c := auxIntToInt64(v_0.AuxInt)
 11951  		x := v_0.Args[0]
 11952  		if !(uint64(c)&uint64(0xffffffff80000000) == 0) {
 11953  			break
 11954  		}
 11955  		v.reset(OpARM64ANDconst)
 11956  		v.Type = t
 11957  		v.AuxInt = int64ToAuxInt(c)
 11958  		v.AddArg(x)
 11959  		return true
 11960  	}
 11961  	// match: (MOVWreg (SLLconst [lc] x))
 11962  	// cond: lc < 32
 11963  	// result: (SBFIZ [armBFAuxInt(lc, 32-lc)] x)
 11964  	for {
 11965  		if v_0.Op != OpARM64SLLconst {
 11966  			break
 11967  		}
 11968  		lc := auxIntToInt64(v_0.AuxInt)
 11969  		x := v_0.Args[0]
 11970  		if !(lc < 32) {
 11971  			break
 11972  		}
 11973  		v.reset(OpARM64SBFIZ)
 11974  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, 32-lc))
 11975  		v.AddArg(x)
 11976  		return true
 11977  	}
 11978  	// match: (MOVWreg (SBFX [bfc] x))
 11979  	// cond: bfc.width() <= 32
 11980  	// result: (SBFX [bfc] x)
 11981  	for {
 11982  		if v_0.Op != OpARM64SBFX {
 11983  			break
 11984  		}
 11985  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 11986  		x := v_0.Args[0]
 11987  		if !(bfc.width() <= 32) {
 11988  			break
 11989  		}
 11990  		v.reset(OpARM64SBFX)
 11991  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 11992  		v.AddArg(x)
 11993  		return true
 11994  	}
 11995  	return false
 11996  }
 11997  func rewriteValueARM64_OpARM64MOVWstore(v *Value) bool {
 11998  	v_2 := v.Args[2]
 11999  	v_1 := v.Args[1]
 12000  	v_0 := v.Args[0]
 12001  	b := v.Block
 12002  	config := b.Func.Config
 12003  	// match: (MOVWstore [off] {sym} ptr (FMOVSfpgp val) mem)
 12004  	// result: (FMOVSstore [off] {sym} ptr val mem)
 12005  	for {
 12006  		off := auxIntToInt32(v.AuxInt)
 12007  		sym := auxToSym(v.Aux)
 12008  		ptr := v_0
 12009  		if v_1.Op != OpARM64FMOVSfpgp {
 12010  			break
 12011  		}
 12012  		val := v_1.Args[0]
 12013  		mem := v_2
 12014  		v.reset(OpARM64FMOVSstore)
 12015  		v.AuxInt = int32ToAuxInt(off)
 12016  		v.Aux = symToAux(sym)
 12017  		v.AddArg3(ptr, val, mem)
 12018  		return true
 12019  	}
 12020  	// match: (MOVWstore [off1] {sym} (ADDconst [off2] ptr) val mem)
 12021  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 12022  	// result: (MOVWstore [off1+int32(off2)] {sym} ptr val mem)
 12023  	for {
 12024  		off1 := auxIntToInt32(v.AuxInt)
 12025  		sym := auxToSym(v.Aux)
 12026  		if v_0.Op != OpARM64ADDconst {
 12027  			break
 12028  		}
 12029  		off2 := auxIntToInt64(v_0.AuxInt)
 12030  		ptr := v_0.Args[0]
 12031  		val := v_1
 12032  		mem := v_2
 12033  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 12034  			break
 12035  		}
 12036  		v.reset(OpARM64MOVWstore)
 12037  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 12038  		v.Aux = symToAux(sym)
 12039  		v.AddArg3(ptr, val, mem)
 12040  		return true
 12041  	}
 12042  	// match: (MOVWstore [off] {sym} (ADD ptr idx) val mem)
 12043  	// cond: off == 0 && sym == nil
 12044  	// result: (MOVWstoreidx ptr idx val mem)
 12045  	for {
 12046  		off := auxIntToInt32(v.AuxInt)
 12047  		sym := auxToSym(v.Aux)
 12048  		if v_0.Op != OpARM64ADD {
 12049  			break
 12050  		}
 12051  		idx := v_0.Args[1]
 12052  		ptr := v_0.Args[0]
 12053  		val := v_1
 12054  		mem := v_2
 12055  		if !(off == 0 && sym == nil) {
 12056  			break
 12057  		}
 12058  		v.reset(OpARM64MOVWstoreidx)
 12059  		v.AddArg4(ptr, idx, val, mem)
 12060  		return true
 12061  	}
 12062  	// match: (MOVWstore [off] {sym} (ADDshiftLL [2] ptr idx) val mem)
 12063  	// cond: off == 0 && sym == nil
 12064  	// result: (MOVWstoreidx4 ptr idx val mem)
 12065  	for {
 12066  		off := auxIntToInt32(v.AuxInt)
 12067  		sym := auxToSym(v.Aux)
 12068  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
 12069  			break
 12070  		}
 12071  		idx := v_0.Args[1]
 12072  		ptr := v_0.Args[0]
 12073  		val := v_1
 12074  		mem := v_2
 12075  		if !(off == 0 && sym == nil) {
 12076  			break
 12077  		}
 12078  		v.reset(OpARM64MOVWstoreidx4)
 12079  		v.AddArg4(ptr, idx, val, mem)
 12080  		return true
 12081  	}
 12082  	// match: (MOVWstore [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val mem)
 12083  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 12084  	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 12085  	for {
 12086  		off1 := auxIntToInt32(v.AuxInt)
 12087  		sym1 := auxToSym(v.Aux)
 12088  		if v_0.Op != OpARM64MOVDaddr {
 12089  			break
 12090  		}
 12091  		off2 := auxIntToInt32(v_0.AuxInt)
 12092  		sym2 := auxToSym(v_0.Aux)
 12093  		ptr := v_0.Args[0]
 12094  		val := v_1
 12095  		mem := v_2
 12096  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 12097  			break
 12098  		}
 12099  		v.reset(OpARM64MOVWstore)
 12100  		v.AuxInt = int32ToAuxInt(off1 + off2)
 12101  		v.Aux = symToAux(mergeSym(sym1, sym2))
 12102  		v.AddArg3(ptr, val, mem)
 12103  		return true
 12104  	}
 12105  	// match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
 12106  	// result: (MOVWstorezero [off] {sym} ptr mem)
 12107  	for {
 12108  		off := auxIntToInt32(v.AuxInt)
 12109  		sym := auxToSym(v.Aux)
 12110  		ptr := v_0
 12111  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 12112  			break
 12113  		}
 12114  		mem := v_2
 12115  		v.reset(OpARM64MOVWstorezero)
 12116  		v.AuxInt = int32ToAuxInt(off)
 12117  		v.Aux = symToAux(sym)
 12118  		v.AddArg2(ptr, mem)
 12119  		return true
 12120  	}
 12121  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
 12122  	// result: (MOVWstore [off] {sym} ptr x mem)
 12123  	for {
 12124  		off := auxIntToInt32(v.AuxInt)
 12125  		sym := auxToSym(v.Aux)
 12126  		ptr := v_0
 12127  		if v_1.Op != OpARM64MOVWreg {
 12128  			break
 12129  		}
 12130  		x := v_1.Args[0]
 12131  		mem := v_2
 12132  		v.reset(OpARM64MOVWstore)
 12133  		v.AuxInt = int32ToAuxInt(off)
 12134  		v.Aux = symToAux(sym)
 12135  		v.AddArg3(ptr, x, mem)
 12136  		return true
 12137  	}
 12138  	// match: (MOVWstore [off] {sym} ptr (MOVWUreg x) mem)
 12139  	// result: (MOVWstore [off] {sym} ptr x mem)
 12140  	for {
 12141  		off := auxIntToInt32(v.AuxInt)
 12142  		sym := auxToSym(v.Aux)
 12143  		ptr := v_0
 12144  		if v_1.Op != OpARM64MOVWUreg {
 12145  			break
 12146  		}
 12147  		x := v_1.Args[0]
 12148  		mem := v_2
 12149  		v.reset(OpARM64MOVWstore)
 12150  		v.AuxInt = int32ToAuxInt(off)
 12151  		v.Aux = symToAux(sym)
 12152  		v.AddArg3(ptr, x, mem)
 12153  		return true
 12154  	}
 12155  	return false
 12156  }
 12157  func rewriteValueARM64_OpARM64MOVWstoreidx(v *Value) bool {
 12158  	v_3 := v.Args[3]
 12159  	v_2 := v.Args[2]
 12160  	v_1 := v.Args[1]
 12161  	v_0 := v.Args[0]
 12162  	// match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
 12163  	// cond: is32Bit(c)
 12164  	// result: (MOVWstore [int32(c)] ptr val mem)
 12165  	for {
 12166  		ptr := v_0
 12167  		if v_1.Op != OpARM64MOVDconst {
 12168  			break
 12169  		}
 12170  		c := auxIntToInt64(v_1.AuxInt)
 12171  		val := v_2
 12172  		mem := v_3
 12173  		if !(is32Bit(c)) {
 12174  			break
 12175  		}
 12176  		v.reset(OpARM64MOVWstore)
 12177  		v.AuxInt = int32ToAuxInt(int32(c))
 12178  		v.AddArg3(ptr, val, mem)
 12179  		return true
 12180  	}
 12181  	// match: (MOVWstoreidx (MOVDconst [c]) idx val mem)
 12182  	// cond: is32Bit(c)
 12183  	// result: (MOVWstore [int32(c)] idx val mem)
 12184  	for {
 12185  		if v_0.Op != OpARM64MOVDconst {
 12186  			break
 12187  		}
 12188  		c := auxIntToInt64(v_0.AuxInt)
 12189  		idx := v_1
 12190  		val := v_2
 12191  		mem := v_3
 12192  		if !(is32Bit(c)) {
 12193  			break
 12194  		}
 12195  		v.reset(OpARM64MOVWstore)
 12196  		v.AuxInt = int32ToAuxInt(int32(c))
 12197  		v.AddArg3(idx, val, mem)
 12198  		return true
 12199  	}
 12200  	// match: (MOVWstoreidx ptr (SLLconst [2] idx) val mem)
 12201  	// result: (MOVWstoreidx4 ptr idx val mem)
 12202  	for {
 12203  		ptr := v_0
 12204  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
 12205  			break
 12206  		}
 12207  		idx := v_1.Args[0]
 12208  		val := v_2
 12209  		mem := v_3
 12210  		v.reset(OpARM64MOVWstoreidx4)
 12211  		v.AddArg4(ptr, idx, val, mem)
 12212  		return true
 12213  	}
 12214  	// match: (MOVWstoreidx (SLLconst [2] idx) ptr val mem)
 12215  	// result: (MOVWstoreidx4 ptr idx val mem)
 12216  	for {
 12217  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
 12218  			break
 12219  		}
 12220  		idx := v_0.Args[0]
 12221  		ptr := v_1
 12222  		val := v_2
 12223  		mem := v_3
 12224  		v.reset(OpARM64MOVWstoreidx4)
 12225  		v.AddArg4(ptr, idx, val, mem)
 12226  		return true
 12227  	}
 12228  	// match: (MOVWstoreidx ptr idx (MOVDconst [0]) mem)
 12229  	// result: (MOVWstorezeroidx ptr idx mem)
 12230  	for {
 12231  		ptr := v_0
 12232  		idx := v_1
 12233  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
 12234  			break
 12235  		}
 12236  		mem := v_3
 12237  		v.reset(OpARM64MOVWstorezeroidx)
 12238  		v.AddArg3(ptr, idx, mem)
 12239  		return true
 12240  	}
 12241  	// match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
 12242  	// result: (MOVWstoreidx ptr idx x mem)
 12243  	for {
 12244  		ptr := v_0
 12245  		idx := v_1
 12246  		if v_2.Op != OpARM64MOVWreg {
 12247  			break
 12248  		}
 12249  		x := v_2.Args[0]
 12250  		mem := v_3
 12251  		v.reset(OpARM64MOVWstoreidx)
 12252  		v.AddArg4(ptr, idx, x, mem)
 12253  		return true
 12254  	}
 12255  	// match: (MOVWstoreidx ptr idx (MOVWUreg x) mem)
 12256  	// result: (MOVWstoreidx ptr idx x mem)
 12257  	for {
 12258  		ptr := v_0
 12259  		idx := v_1
 12260  		if v_2.Op != OpARM64MOVWUreg {
 12261  			break
 12262  		}
 12263  		x := v_2.Args[0]
 12264  		mem := v_3
 12265  		v.reset(OpARM64MOVWstoreidx)
 12266  		v.AddArg4(ptr, idx, x, mem)
 12267  		return true
 12268  	}
 12269  	return false
 12270  }
 12271  func rewriteValueARM64_OpARM64MOVWstoreidx4(v *Value) bool {
 12272  	v_3 := v.Args[3]
 12273  	v_2 := v.Args[2]
 12274  	v_1 := v.Args[1]
 12275  	v_0 := v.Args[0]
 12276  	// match: (MOVWstoreidx4 ptr (MOVDconst [c]) val mem)
 12277  	// cond: is32Bit(c<<2)
 12278  	// result: (MOVWstore [int32(c)<<2] ptr val mem)
 12279  	for {
 12280  		ptr := v_0
 12281  		if v_1.Op != OpARM64MOVDconst {
 12282  			break
 12283  		}
 12284  		c := auxIntToInt64(v_1.AuxInt)
 12285  		val := v_2
 12286  		mem := v_3
 12287  		if !(is32Bit(c << 2)) {
 12288  			break
 12289  		}
 12290  		v.reset(OpARM64MOVWstore)
 12291  		v.AuxInt = int32ToAuxInt(int32(c) << 2)
 12292  		v.AddArg3(ptr, val, mem)
 12293  		return true
 12294  	}
 12295  	// match: (MOVWstoreidx4 ptr idx (MOVDconst [0]) mem)
 12296  	// result: (MOVWstorezeroidx4 ptr idx mem)
 12297  	for {
 12298  		ptr := v_0
 12299  		idx := v_1
 12300  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
 12301  			break
 12302  		}
 12303  		mem := v_3
 12304  		v.reset(OpARM64MOVWstorezeroidx4)
 12305  		v.AddArg3(ptr, idx, mem)
 12306  		return true
 12307  	}
 12308  	// match: (MOVWstoreidx4 ptr idx (MOVWreg x) mem)
 12309  	// result: (MOVWstoreidx4 ptr idx x mem)
 12310  	for {
 12311  		ptr := v_0
 12312  		idx := v_1
 12313  		if v_2.Op != OpARM64MOVWreg {
 12314  			break
 12315  		}
 12316  		x := v_2.Args[0]
 12317  		mem := v_3
 12318  		v.reset(OpARM64MOVWstoreidx4)
 12319  		v.AddArg4(ptr, idx, x, mem)
 12320  		return true
 12321  	}
 12322  	// match: (MOVWstoreidx4 ptr idx (MOVWUreg x) mem)
 12323  	// result: (MOVWstoreidx4 ptr idx x mem)
 12324  	for {
 12325  		ptr := v_0
 12326  		idx := v_1
 12327  		if v_2.Op != OpARM64MOVWUreg {
 12328  			break
 12329  		}
 12330  		x := v_2.Args[0]
 12331  		mem := v_3
 12332  		v.reset(OpARM64MOVWstoreidx4)
 12333  		v.AddArg4(ptr, idx, x, mem)
 12334  		return true
 12335  	}
 12336  	return false
 12337  }
 12338  func rewriteValueARM64_OpARM64MOVWstorezero(v *Value) bool {
 12339  	v_1 := v.Args[1]
 12340  	v_0 := v.Args[0]
 12341  	b := v.Block
 12342  	config := b.Func.Config
 12343  	// match: (MOVWstorezero [off1] {sym} (ADDconst [off2] ptr) mem)
 12344  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 12345  	// result: (MOVWstorezero [off1+int32(off2)] {sym} ptr mem)
 12346  	for {
 12347  		off1 := auxIntToInt32(v.AuxInt)
 12348  		sym := auxToSym(v.Aux)
 12349  		if v_0.Op != OpARM64ADDconst {
 12350  			break
 12351  		}
 12352  		off2 := auxIntToInt64(v_0.AuxInt)
 12353  		ptr := v_0.Args[0]
 12354  		mem := v_1
 12355  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 12356  			break
 12357  		}
 12358  		v.reset(OpARM64MOVWstorezero)
 12359  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 12360  		v.Aux = symToAux(sym)
 12361  		v.AddArg2(ptr, mem)
 12362  		return true
 12363  	}
 12364  	// match: (MOVWstorezero [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) mem)
 12365  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 12366  	// result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 12367  	for {
 12368  		off1 := auxIntToInt32(v.AuxInt)
 12369  		sym1 := auxToSym(v.Aux)
 12370  		if v_0.Op != OpARM64MOVDaddr {
 12371  			break
 12372  		}
 12373  		off2 := auxIntToInt32(v_0.AuxInt)
 12374  		sym2 := auxToSym(v_0.Aux)
 12375  		ptr := v_0.Args[0]
 12376  		mem := v_1
 12377  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 12378  			break
 12379  		}
 12380  		v.reset(OpARM64MOVWstorezero)
 12381  		v.AuxInt = int32ToAuxInt(off1 + off2)
 12382  		v.Aux = symToAux(mergeSym(sym1, sym2))
 12383  		v.AddArg2(ptr, mem)
 12384  		return true
 12385  	}
 12386  	// match: (MOVWstorezero [off] {sym} (ADD ptr idx) mem)
 12387  	// cond: off == 0 && sym == nil
 12388  	// result: (MOVWstorezeroidx ptr idx mem)
 12389  	for {
 12390  		off := auxIntToInt32(v.AuxInt)
 12391  		sym := auxToSym(v.Aux)
 12392  		if v_0.Op != OpARM64ADD {
 12393  			break
 12394  		}
 12395  		idx := v_0.Args[1]
 12396  		ptr := v_0.Args[0]
 12397  		mem := v_1
 12398  		if !(off == 0 && sym == nil) {
 12399  			break
 12400  		}
 12401  		v.reset(OpARM64MOVWstorezeroidx)
 12402  		v.AddArg3(ptr, idx, mem)
 12403  		return true
 12404  	}
 12405  	// match: (MOVWstorezero [off] {sym} (ADDshiftLL [2] ptr idx) mem)
 12406  	// cond: off == 0 && sym == nil
 12407  	// result: (MOVWstorezeroidx4 ptr idx mem)
 12408  	for {
 12409  		off := auxIntToInt32(v.AuxInt)
 12410  		sym := auxToSym(v.Aux)
 12411  		if v_0.Op != OpARM64ADDshiftLL || auxIntToInt64(v_0.AuxInt) != 2 {
 12412  			break
 12413  		}
 12414  		idx := v_0.Args[1]
 12415  		ptr := v_0.Args[0]
 12416  		mem := v_1
 12417  		if !(off == 0 && sym == nil) {
 12418  			break
 12419  		}
 12420  		v.reset(OpARM64MOVWstorezeroidx4)
 12421  		v.AddArg3(ptr, idx, mem)
 12422  		return true
 12423  	}
 12424  	return false
 12425  }
 12426  func rewriteValueARM64_OpARM64MOVWstorezeroidx(v *Value) bool {
 12427  	v_2 := v.Args[2]
 12428  	v_1 := v.Args[1]
 12429  	v_0 := v.Args[0]
 12430  	// match: (MOVWstorezeroidx ptr (MOVDconst [c]) mem)
 12431  	// cond: is32Bit(c)
 12432  	// result: (MOVWstorezero [int32(c)] ptr mem)
 12433  	for {
 12434  		ptr := v_0
 12435  		if v_1.Op != OpARM64MOVDconst {
 12436  			break
 12437  		}
 12438  		c := auxIntToInt64(v_1.AuxInt)
 12439  		mem := v_2
 12440  		if !(is32Bit(c)) {
 12441  			break
 12442  		}
 12443  		v.reset(OpARM64MOVWstorezero)
 12444  		v.AuxInt = int32ToAuxInt(int32(c))
 12445  		v.AddArg2(ptr, mem)
 12446  		return true
 12447  	}
 12448  	// match: (MOVWstorezeroidx (MOVDconst [c]) idx mem)
 12449  	// cond: is32Bit(c)
 12450  	// result: (MOVWstorezero [int32(c)] idx mem)
 12451  	for {
 12452  		if v_0.Op != OpARM64MOVDconst {
 12453  			break
 12454  		}
 12455  		c := auxIntToInt64(v_0.AuxInt)
 12456  		idx := v_1
 12457  		mem := v_2
 12458  		if !(is32Bit(c)) {
 12459  			break
 12460  		}
 12461  		v.reset(OpARM64MOVWstorezero)
 12462  		v.AuxInt = int32ToAuxInt(int32(c))
 12463  		v.AddArg2(idx, mem)
 12464  		return true
 12465  	}
 12466  	// match: (MOVWstorezeroidx ptr (SLLconst [2] idx) mem)
 12467  	// result: (MOVWstorezeroidx4 ptr idx mem)
 12468  	for {
 12469  		ptr := v_0
 12470  		if v_1.Op != OpARM64SLLconst || auxIntToInt64(v_1.AuxInt) != 2 {
 12471  			break
 12472  		}
 12473  		idx := v_1.Args[0]
 12474  		mem := v_2
 12475  		v.reset(OpARM64MOVWstorezeroidx4)
 12476  		v.AddArg3(ptr, idx, mem)
 12477  		return true
 12478  	}
 12479  	// match: (MOVWstorezeroidx (SLLconst [2] idx) ptr mem)
 12480  	// result: (MOVWstorezeroidx4 ptr idx mem)
 12481  	for {
 12482  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != 2 {
 12483  			break
 12484  		}
 12485  		idx := v_0.Args[0]
 12486  		ptr := v_1
 12487  		mem := v_2
 12488  		v.reset(OpARM64MOVWstorezeroidx4)
 12489  		v.AddArg3(ptr, idx, mem)
 12490  		return true
 12491  	}
 12492  	return false
 12493  }
 12494  func rewriteValueARM64_OpARM64MOVWstorezeroidx4(v *Value) bool {
 12495  	v_2 := v.Args[2]
 12496  	v_1 := v.Args[1]
 12497  	v_0 := v.Args[0]
 12498  	// match: (MOVWstorezeroidx4 ptr (MOVDconst [c]) mem)
 12499  	// cond: is32Bit(c<<2)
 12500  	// result: (MOVWstorezero [int32(c<<2)] ptr mem)
 12501  	for {
 12502  		ptr := v_0
 12503  		if v_1.Op != OpARM64MOVDconst {
 12504  			break
 12505  		}
 12506  		c := auxIntToInt64(v_1.AuxInt)
 12507  		mem := v_2
 12508  		if !(is32Bit(c << 2)) {
 12509  			break
 12510  		}
 12511  		v.reset(OpARM64MOVWstorezero)
 12512  		v.AuxInt = int32ToAuxInt(int32(c << 2))
 12513  		v.AddArg2(ptr, mem)
 12514  		return true
 12515  	}
 12516  	return false
 12517  }
 12518  func rewriteValueARM64_OpARM64MSUB(v *Value) bool {
 12519  	v_2 := v.Args[2]
 12520  	v_1 := v.Args[1]
 12521  	v_0 := v.Args[0]
 12522  	b := v.Block
 12523  	// match: (MSUB a x (MOVDconst [-1]))
 12524  	// result: (ADD a x)
 12525  	for {
 12526  		a := v_0
 12527  		x := v_1
 12528  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != -1 {
 12529  			break
 12530  		}
 12531  		v.reset(OpARM64ADD)
 12532  		v.AddArg2(a, x)
 12533  		return true
 12534  	}
 12535  	// match: (MSUB a _ (MOVDconst [0]))
 12536  	// result: a
 12537  	for {
 12538  		a := v_0
 12539  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
 12540  			break
 12541  		}
 12542  		v.copyOf(a)
 12543  		return true
 12544  	}
 12545  	// match: (MSUB a x (MOVDconst [1]))
 12546  	// result: (SUB a x)
 12547  	for {
 12548  		a := v_0
 12549  		x := v_1
 12550  		if v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 1 {
 12551  			break
 12552  		}
 12553  		v.reset(OpARM64SUB)
 12554  		v.AddArg2(a, x)
 12555  		return true
 12556  	}
 12557  	// match: (MSUB a x (MOVDconst [c]))
 12558  	// cond: isPowerOfTwo(c)
 12559  	// result: (SUBshiftLL a x [log64(c)])
 12560  	for {
 12561  		a := v_0
 12562  		x := v_1
 12563  		if v_2.Op != OpARM64MOVDconst {
 12564  			break
 12565  		}
 12566  		c := auxIntToInt64(v_2.AuxInt)
 12567  		if !(isPowerOfTwo(c)) {
 12568  			break
 12569  		}
 12570  		v.reset(OpARM64SUBshiftLL)
 12571  		v.AuxInt = int64ToAuxInt(log64(c))
 12572  		v.AddArg2(a, x)
 12573  		return true
 12574  	}
 12575  	// match: (MSUB a x (MOVDconst [c]))
 12576  	// cond: isPowerOfTwo(c-1) && c>=3
 12577  	// result: (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
 12578  	for {
 12579  		a := v_0
 12580  		x := v_1
 12581  		if v_2.Op != OpARM64MOVDconst {
 12582  			break
 12583  		}
 12584  		c := auxIntToInt64(v_2.AuxInt)
 12585  		if !(isPowerOfTwo(c-1) && c >= 3) {
 12586  			break
 12587  		}
 12588  		v.reset(OpARM64SUB)
 12589  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12590  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
 12591  		v0.AddArg2(x, x)
 12592  		v.AddArg2(a, v0)
 12593  		return true
 12594  	}
 12595  	// match: (MSUB a x (MOVDconst [c]))
 12596  	// cond: isPowerOfTwo(c+1) && c>=7
 12597  	// result: (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
 12598  	for {
 12599  		a := v_0
 12600  		x := v_1
 12601  		if v_2.Op != OpARM64MOVDconst {
 12602  			break
 12603  		}
 12604  		c := auxIntToInt64(v_2.AuxInt)
 12605  		if !(isPowerOfTwo(c+1) && c >= 7) {
 12606  			break
 12607  		}
 12608  		v.reset(OpARM64ADD)
 12609  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12610  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
 12611  		v0.AddArg2(x, x)
 12612  		v.AddArg2(a, v0)
 12613  		return true
 12614  	}
 12615  	// match: (MSUB a x (MOVDconst [c]))
 12616  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
 12617  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
 12618  	for {
 12619  		a := v_0
 12620  		x := v_1
 12621  		if v_2.Op != OpARM64MOVDconst {
 12622  			break
 12623  		}
 12624  		c := auxIntToInt64(v_2.AuxInt)
 12625  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
 12626  			break
 12627  		}
 12628  		v.reset(OpARM64ADDshiftLL)
 12629  		v.AuxInt = int64ToAuxInt(log64(c / 3))
 12630  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12631  		v0.AuxInt = int64ToAuxInt(2)
 12632  		v0.AddArg2(x, x)
 12633  		v.AddArg2(a, v0)
 12634  		return true
 12635  	}
 12636  	// match: (MSUB a x (MOVDconst [c]))
 12637  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
 12638  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
 12639  	for {
 12640  		a := v_0
 12641  		x := v_1
 12642  		if v_2.Op != OpARM64MOVDconst {
 12643  			break
 12644  		}
 12645  		c := auxIntToInt64(v_2.AuxInt)
 12646  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
 12647  			break
 12648  		}
 12649  		v.reset(OpARM64SUBshiftLL)
 12650  		v.AuxInt = int64ToAuxInt(log64(c / 5))
 12651  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12652  		v0.AuxInt = int64ToAuxInt(2)
 12653  		v0.AddArg2(x, x)
 12654  		v.AddArg2(a, v0)
 12655  		return true
 12656  	}
 12657  	// match: (MSUB a x (MOVDconst [c]))
 12658  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
 12659  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
 12660  	for {
 12661  		a := v_0
 12662  		x := v_1
 12663  		if v_2.Op != OpARM64MOVDconst {
 12664  			break
 12665  		}
 12666  		c := auxIntToInt64(v_2.AuxInt)
 12667  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
 12668  			break
 12669  		}
 12670  		v.reset(OpARM64ADDshiftLL)
 12671  		v.AuxInt = int64ToAuxInt(log64(c / 7))
 12672  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12673  		v0.AuxInt = int64ToAuxInt(3)
 12674  		v0.AddArg2(x, x)
 12675  		v.AddArg2(a, v0)
 12676  		return true
 12677  	}
 12678  	// match: (MSUB a x (MOVDconst [c]))
 12679  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
 12680  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
 12681  	for {
 12682  		a := v_0
 12683  		x := v_1
 12684  		if v_2.Op != OpARM64MOVDconst {
 12685  			break
 12686  		}
 12687  		c := auxIntToInt64(v_2.AuxInt)
 12688  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
 12689  			break
 12690  		}
 12691  		v.reset(OpARM64SUBshiftLL)
 12692  		v.AuxInt = int64ToAuxInt(log64(c / 9))
 12693  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12694  		v0.AuxInt = int64ToAuxInt(3)
 12695  		v0.AddArg2(x, x)
 12696  		v.AddArg2(a, v0)
 12697  		return true
 12698  	}
 12699  	// match: (MSUB a (MOVDconst [-1]) x)
 12700  	// result: (ADD a x)
 12701  	for {
 12702  		a := v_0
 12703  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
 12704  			break
 12705  		}
 12706  		x := v_2
 12707  		v.reset(OpARM64ADD)
 12708  		v.AddArg2(a, x)
 12709  		return true
 12710  	}
 12711  	// match: (MSUB a (MOVDconst [0]) _)
 12712  	// result: a
 12713  	for {
 12714  		a := v_0
 12715  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 12716  			break
 12717  		}
 12718  		v.copyOf(a)
 12719  		return true
 12720  	}
 12721  	// match: (MSUB a (MOVDconst [1]) x)
 12722  	// result: (SUB a x)
 12723  	for {
 12724  		a := v_0
 12725  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 12726  			break
 12727  		}
 12728  		x := v_2
 12729  		v.reset(OpARM64SUB)
 12730  		v.AddArg2(a, x)
 12731  		return true
 12732  	}
 12733  	// match: (MSUB a (MOVDconst [c]) x)
 12734  	// cond: isPowerOfTwo(c)
 12735  	// result: (SUBshiftLL a x [log64(c)])
 12736  	for {
 12737  		a := v_0
 12738  		if v_1.Op != OpARM64MOVDconst {
 12739  			break
 12740  		}
 12741  		c := auxIntToInt64(v_1.AuxInt)
 12742  		x := v_2
 12743  		if !(isPowerOfTwo(c)) {
 12744  			break
 12745  		}
 12746  		v.reset(OpARM64SUBshiftLL)
 12747  		v.AuxInt = int64ToAuxInt(log64(c))
 12748  		v.AddArg2(a, x)
 12749  		return true
 12750  	}
 12751  	// match: (MSUB a (MOVDconst [c]) x)
 12752  	// cond: isPowerOfTwo(c-1) && c>=3
 12753  	// result: (SUB a (ADDshiftLL <x.Type> x x [log64(c-1)]))
 12754  	for {
 12755  		a := v_0
 12756  		if v_1.Op != OpARM64MOVDconst {
 12757  			break
 12758  		}
 12759  		c := auxIntToInt64(v_1.AuxInt)
 12760  		x := v_2
 12761  		if !(isPowerOfTwo(c-1) && c >= 3) {
 12762  			break
 12763  		}
 12764  		v.reset(OpARM64SUB)
 12765  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12766  		v0.AuxInt = int64ToAuxInt(log64(c - 1))
 12767  		v0.AddArg2(x, x)
 12768  		v.AddArg2(a, v0)
 12769  		return true
 12770  	}
 12771  	// match: (MSUB a (MOVDconst [c]) x)
 12772  	// cond: isPowerOfTwo(c+1) && c>=7
 12773  	// result: (ADD a (SUBshiftLL <x.Type> x x [log64(c+1)]))
 12774  	for {
 12775  		a := v_0
 12776  		if v_1.Op != OpARM64MOVDconst {
 12777  			break
 12778  		}
 12779  		c := auxIntToInt64(v_1.AuxInt)
 12780  		x := v_2
 12781  		if !(isPowerOfTwo(c+1) && c >= 7) {
 12782  			break
 12783  		}
 12784  		v.reset(OpARM64ADD)
 12785  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12786  		v0.AuxInt = int64ToAuxInt(log64(c + 1))
 12787  		v0.AddArg2(x, x)
 12788  		v.AddArg2(a, v0)
 12789  		return true
 12790  	}
 12791  	// match: (MSUB a (MOVDconst [c]) x)
 12792  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
 12793  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)])
 12794  	for {
 12795  		a := v_0
 12796  		if v_1.Op != OpARM64MOVDconst {
 12797  			break
 12798  		}
 12799  		c := auxIntToInt64(v_1.AuxInt)
 12800  		x := v_2
 12801  		if !(c%3 == 0 && isPowerOfTwo(c/3)) {
 12802  			break
 12803  		}
 12804  		v.reset(OpARM64ADDshiftLL)
 12805  		v.AuxInt = int64ToAuxInt(log64(c / 3))
 12806  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12807  		v0.AuxInt = int64ToAuxInt(2)
 12808  		v0.AddArg2(x, x)
 12809  		v.AddArg2(a, v0)
 12810  		return true
 12811  	}
 12812  	// match: (MSUB a (MOVDconst [c]) x)
 12813  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
 12814  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)])
 12815  	for {
 12816  		a := v_0
 12817  		if v_1.Op != OpARM64MOVDconst {
 12818  			break
 12819  		}
 12820  		c := auxIntToInt64(v_1.AuxInt)
 12821  		x := v_2
 12822  		if !(c%5 == 0 && isPowerOfTwo(c/5)) {
 12823  			break
 12824  		}
 12825  		v.reset(OpARM64SUBshiftLL)
 12826  		v.AuxInt = int64ToAuxInt(log64(c / 5))
 12827  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12828  		v0.AuxInt = int64ToAuxInt(2)
 12829  		v0.AddArg2(x, x)
 12830  		v.AddArg2(a, v0)
 12831  		return true
 12832  	}
 12833  	// match: (MSUB a (MOVDconst [c]) x)
 12834  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
 12835  	// result: (ADDshiftLL a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)])
 12836  	for {
 12837  		a := v_0
 12838  		if v_1.Op != OpARM64MOVDconst {
 12839  			break
 12840  		}
 12841  		c := auxIntToInt64(v_1.AuxInt)
 12842  		x := v_2
 12843  		if !(c%7 == 0 && isPowerOfTwo(c/7)) {
 12844  			break
 12845  		}
 12846  		v.reset(OpARM64ADDshiftLL)
 12847  		v.AuxInt = int64ToAuxInt(log64(c / 7))
 12848  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 12849  		v0.AuxInt = int64ToAuxInt(3)
 12850  		v0.AddArg2(x, x)
 12851  		v.AddArg2(a, v0)
 12852  		return true
 12853  	}
 12854  	// match: (MSUB a (MOVDconst [c]) x)
 12855  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
 12856  	// result: (SUBshiftLL a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)])
 12857  	for {
 12858  		a := v_0
 12859  		if v_1.Op != OpARM64MOVDconst {
 12860  			break
 12861  		}
 12862  		c := auxIntToInt64(v_1.AuxInt)
 12863  		x := v_2
 12864  		if !(c%9 == 0 && isPowerOfTwo(c/9)) {
 12865  			break
 12866  		}
 12867  		v.reset(OpARM64SUBshiftLL)
 12868  		v.AuxInt = int64ToAuxInt(log64(c / 9))
 12869  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 12870  		v0.AuxInt = int64ToAuxInt(3)
 12871  		v0.AddArg2(x, x)
 12872  		v.AddArg2(a, v0)
 12873  		return true
 12874  	}
 12875  	// match: (MSUB (MOVDconst [c]) x y)
 12876  	// result: (ADDconst [c] (MNEG <x.Type> x y))
 12877  	for {
 12878  		if v_0.Op != OpARM64MOVDconst {
 12879  			break
 12880  		}
 12881  		c := auxIntToInt64(v_0.AuxInt)
 12882  		x := v_1
 12883  		y := v_2
 12884  		v.reset(OpARM64ADDconst)
 12885  		v.AuxInt = int64ToAuxInt(c)
 12886  		v0 := b.NewValue0(v.Pos, OpARM64MNEG, x.Type)
 12887  		v0.AddArg2(x, y)
 12888  		v.AddArg(v0)
 12889  		return true
 12890  	}
 12891  	// match: (MSUB a (MOVDconst [c]) (MOVDconst [d]))
 12892  	// result: (SUBconst [c*d] a)
 12893  	for {
 12894  		a := v_0
 12895  		if v_1.Op != OpARM64MOVDconst {
 12896  			break
 12897  		}
 12898  		c := auxIntToInt64(v_1.AuxInt)
 12899  		if v_2.Op != OpARM64MOVDconst {
 12900  			break
 12901  		}
 12902  		d := auxIntToInt64(v_2.AuxInt)
 12903  		v.reset(OpARM64SUBconst)
 12904  		v.AuxInt = int64ToAuxInt(c * d)
 12905  		v.AddArg(a)
 12906  		return true
 12907  	}
 12908  	return false
 12909  }
 12910  func rewriteValueARM64_OpARM64MSUBW(v *Value) bool {
 12911  	v_2 := v.Args[2]
 12912  	v_1 := v.Args[1]
 12913  	v_0 := v.Args[0]
 12914  	b := v.Block
 12915  	// match: (MSUBW a x (MOVDconst [c]))
 12916  	// cond: int32(c)==-1
 12917  	// result: (MOVWUreg (ADD <a.Type> a x))
 12918  	for {
 12919  		a := v_0
 12920  		x := v_1
 12921  		if v_2.Op != OpARM64MOVDconst {
 12922  			break
 12923  		}
 12924  		c := auxIntToInt64(v_2.AuxInt)
 12925  		if !(int32(c) == -1) {
 12926  			break
 12927  		}
 12928  		v.reset(OpARM64MOVWUreg)
 12929  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 12930  		v0.AddArg2(a, x)
 12931  		v.AddArg(v0)
 12932  		return true
 12933  	}
 12934  	// match: (MSUBW a _ (MOVDconst [c]))
 12935  	// cond: int32(c)==0
 12936  	// result: (MOVWUreg a)
 12937  	for {
 12938  		a := v_0
 12939  		if v_2.Op != OpARM64MOVDconst {
 12940  			break
 12941  		}
 12942  		c := auxIntToInt64(v_2.AuxInt)
 12943  		if !(int32(c) == 0) {
 12944  			break
 12945  		}
 12946  		v.reset(OpARM64MOVWUreg)
 12947  		v.AddArg(a)
 12948  		return true
 12949  	}
 12950  	// match: (MSUBW a x (MOVDconst [c]))
 12951  	// cond: int32(c)==1
 12952  	// result: (MOVWUreg (SUB <a.Type> a x))
 12953  	for {
 12954  		a := v_0
 12955  		x := v_1
 12956  		if v_2.Op != OpARM64MOVDconst {
 12957  			break
 12958  		}
 12959  		c := auxIntToInt64(v_2.AuxInt)
 12960  		if !(int32(c) == 1) {
 12961  			break
 12962  		}
 12963  		v.reset(OpARM64MOVWUreg)
 12964  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 12965  		v0.AddArg2(a, x)
 12966  		v.AddArg(v0)
 12967  		return true
 12968  	}
 12969  	// match: (MSUBW a x (MOVDconst [c]))
 12970  	// cond: isPowerOfTwo(c)
 12971  	// result: (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
 12972  	for {
 12973  		a := v_0
 12974  		x := v_1
 12975  		if v_2.Op != OpARM64MOVDconst {
 12976  			break
 12977  		}
 12978  		c := auxIntToInt64(v_2.AuxInt)
 12979  		if !(isPowerOfTwo(c)) {
 12980  			break
 12981  		}
 12982  		v.reset(OpARM64MOVWUreg)
 12983  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 12984  		v0.AuxInt = int64ToAuxInt(log64(c))
 12985  		v0.AddArg2(a, x)
 12986  		v.AddArg(v0)
 12987  		return true
 12988  	}
 12989  	// match: (MSUBW a x (MOVDconst [c]))
 12990  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
 12991  	// result: (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
 12992  	for {
 12993  		a := v_0
 12994  		x := v_1
 12995  		if v_2.Op != OpARM64MOVDconst {
 12996  			break
 12997  		}
 12998  		c := auxIntToInt64(v_2.AuxInt)
 12999  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
 13000  			break
 13001  		}
 13002  		v.reset(OpARM64MOVWUreg)
 13003  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 13004  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13005  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
 13006  		v1.AddArg2(x, x)
 13007  		v0.AddArg2(a, v1)
 13008  		v.AddArg(v0)
 13009  		return true
 13010  	}
 13011  	// match: (MSUBW a x (MOVDconst [c]))
 13012  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
 13013  	// result: (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
 13014  	for {
 13015  		a := v_0
 13016  		x := v_1
 13017  		if v_2.Op != OpARM64MOVDconst {
 13018  			break
 13019  		}
 13020  		c := auxIntToInt64(v_2.AuxInt)
 13021  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
 13022  			break
 13023  		}
 13024  		v.reset(OpARM64MOVWUreg)
 13025  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 13026  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 13027  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
 13028  		v1.AddArg2(x, x)
 13029  		v0.AddArg2(a, v1)
 13030  		v.AddArg(v0)
 13031  		return true
 13032  	}
 13033  	// match: (MSUBW a x (MOVDconst [c]))
 13034  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
 13035  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
 13036  	for {
 13037  		a := v_0
 13038  		x := v_1
 13039  		if v_2.Op != OpARM64MOVDconst {
 13040  			break
 13041  		}
 13042  		c := auxIntToInt64(v_2.AuxInt)
 13043  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
 13044  			break
 13045  		}
 13046  		v.reset(OpARM64MOVWUreg)
 13047  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 13048  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
 13049  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 13050  		v1.AuxInt = int64ToAuxInt(2)
 13051  		v1.AddArg2(x, x)
 13052  		v0.AddArg2(a, v1)
 13053  		v.AddArg(v0)
 13054  		return true
 13055  	}
 13056  	// match: (MSUBW a x (MOVDconst [c]))
 13057  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
 13058  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
 13059  	for {
 13060  		a := v_0
 13061  		x := v_1
 13062  		if v_2.Op != OpARM64MOVDconst {
 13063  			break
 13064  		}
 13065  		c := auxIntToInt64(v_2.AuxInt)
 13066  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
 13067  			break
 13068  		}
 13069  		v.reset(OpARM64MOVWUreg)
 13070  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 13071  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
 13072  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13073  		v1.AuxInt = int64ToAuxInt(2)
 13074  		v1.AddArg2(x, x)
 13075  		v0.AddArg2(a, v1)
 13076  		v.AddArg(v0)
 13077  		return true
 13078  	}
 13079  	// match: (MSUBW a x (MOVDconst [c]))
 13080  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
 13081  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
 13082  	for {
 13083  		a := v_0
 13084  		x := v_1
 13085  		if v_2.Op != OpARM64MOVDconst {
 13086  			break
 13087  		}
 13088  		c := auxIntToInt64(v_2.AuxInt)
 13089  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
 13090  			break
 13091  		}
 13092  		v.reset(OpARM64MOVWUreg)
 13093  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 13094  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
 13095  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 13096  		v1.AuxInt = int64ToAuxInt(3)
 13097  		v1.AddArg2(x, x)
 13098  		v0.AddArg2(a, v1)
 13099  		v.AddArg(v0)
 13100  		return true
 13101  	}
 13102  	// match: (MSUBW a x (MOVDconst [c]))
 13103  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
 13104  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
 13105  	for {
 13106  		a := v_0
 13107  		x := v_1
 13108  		if v_2.Op != OpARM64MOVDconst {
 13109  			break
 13110  		}
 13111  		c := auxIntToInt64(v_2.AuxInt)
 13112  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
 13113  			break
 13114  		}
 13115  		v.reset(OpARM64MOVWUreg)
 13116  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 13117  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
 13118  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13119  		v1.AuxInt = int64ToAuxInt(3)
 13120  		v1.AddArg2(x, x)
 13121  		v0.AddArg2(a, v1)
 13122  		v.AddArg(v0)
 13123  		return true
 13124  	}
 13125  	// match: (MSUBW a (MOVDconst [c]) x)
 13126  	// cond: int32(c)==-1
 13127  	// result: (MOVWUreg (ADD <a.Type> a x))
 13128  	for {
 13129  		a := v_0
 13130  		if v_1.Op != OpARM64MOVDconst {
 13131  			break
 13132  		}
 13133  		c := auxIntToInt64(v_1.AuxInt)
 13134  		x := v_2
 13135  		if !(int32(c) == -1) {
 13136  			break
 13137  		}
 13138  		v.reset(OpARM64MOVWUreg)
 13139  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 13140  		v0.AddArg2(a, x)
 13141  		v.AddArg(v0)
 13142  		return true
 13143  	}
 13144  	// match: (MSUBW a (MOVDconst [c]) _)
 13145  	// cond: int32(c)==0
 13146  	// result: (MOVWUreg a)
 13147  	for {
 13148  		a := v_0
 13149  		if v_1.Op != OpARM64MOVDconst {
 13150  			break
 13151  		}
 13152  		c := auxIntToInt64(v_1.AuxInt)
 13153  		if !(int32(c) == 0) {
 13154  			break
 13155  		}
 13156  		v.reset(OpARM64MOVWUreg)
 13157  		v.AddArg(a)
 13158  		return true
 13159  	}
 13160  	// match: (MSUBW a (MOVDconst [c]) x)
 13161  	// cond: int32(c)==1
 13162  	// result: (MOVWUreg (SUB <a.Type> a x))
 13163  	for {
 13164  		a := v_0
 13165  		if v_1.Op != OpARM64MOVDconst {
 13166  			break
 13167  		}
 13168  		c := auxIntToInt64(v_1.AuxInt)
 13169  		x := v_2
 13170  		if !(int32(c) == 1) {
 13171  			break
 13172  		}
 13173  		v.reset(OpARM64MOVWUreg)
 13174  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 13175  		v0.AddArg2(a, x)
 13176  		v.AddArg(v0)
 13177  		return true
 13178  	}
 13179  	// match: (MSUBW a (MOVDconst [c]) x)
 13180  	// cond: isPowerOfTwo(c)
 13181  	// result: (MOVWUreg (SUBshiftLL <a.Type> a x [log64(c)]))
 13182  	for {
 13183  		a := v_0
 13184  		if v_1.Op != OpARM64MOVDconst {
 13185  			break
 13186  		}
 13187  		c := auxIntToInt64(v_1.AuxInt)
 13188  		x := v_2
 13189  		if !(isPowerOfTwo(c)) {
 13190  			break
 13191  		}
 13192  		v.reset(OpARM64MOVWUreg)
 13193  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 13194  		v0.AuxInt = int64ToAuxInt(log64(c))
 13195  		v0.AddArg2(a, x)
 13196  		v.AddArg(v0)
 13197  		return true
 13198  	}
 13199  	// match: (MSUBW a (MOVDconst [c]) x)
 13200  	// cond: isPowerOfTwo(c-1) && int32(c)>=3
 13201  	// result: (MOVWUreg (SUB <a.Type> a (ADDshiftLL <x.Type> x x [log64(c-1)])))
 13202  	for {
 13203  		a := v_0
 13204  		if v_1.Op != OpARM64MOVDconst {
 13205  			break
 13206  		}
 13207  		c := auxIntToInt64(v_1.AuxInt)
 13208  		x := v_2
 13209  		if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
 13210  			break
 13211  		}
 13212  		v.reset(OpARM64MOVWUreg)
 13213  		v0 := b.NewValue0(v.Pos, OpARM64SUB, a.Type)
 13214  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13215  		v1.AuxInt = int64ToAuxInt(log64(c - 1))
 13216  		v1.AddArg2(x, x)
 13217  		v0.AddArg2(a, v1)
 13218  		v.AddArg(v0)
 13219  		return true
 13220  	}
 13221  	// match: (MSUBW a (MOVDconst [c]) x)
 13222  	// cond: isPowerOfTwo(c+1) && int32(c)>=7
 13223  	// result: (MOVWUreg (ADD <a.Type> a (SUBshiftLL <x.Type> x x [log64(c+1)])))
 13224  	for {
 13225  		a := v_0
 13226  		if v_1.Op != OpARM64MOVDconst {
 13227  			break
 13228  		}
 13229  		c := auxIntToInt64(v_1.AuxInt)
 13230  		x := v_2
 13231  		if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
 13232  			break
 13233  		}
 13234  		v.reset(OpARM64MOVWUreg)
 13235  		v0 := b.NewValue0(v.Pos, OpARM64ADD, a.Type)
 13236  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 13237  		v1.AuxInt = int64ToAuxInt(log64(c + 1))
 13238  		v1.AddArg2(x, x)
 13239  		v0.AddArg2(a, v1)
 13240  		v.AddArg(v0)
 13241  		return true
 13242  	}
 13243  	// match: (MSUBW a (MOVDconst [c]) x)
 13244  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
 13245  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [2]) [log64(c/3)]))
 13246  	for {
 13247  		a := v_0
 13248  		if v_1.Op != OpARM64MOVDconst {
 13249  			break
 13250  		}
 13251  		c := auxIntToInt64(v_1.AuxInt)
 13252  		x := v_2
 13253  		if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
 13254  			break
 13255  		}
 13256  		v.reset(OpARM64MOVWUreg)
 13257  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 13258  		v0.AuxInt = int64ToAuxInt(log64(c / 3))
 13259  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 13260  		v1.AuxInt = int64ToAuxInt(2)
 13261  		v1.AddArg2(x, x)
 13262  		v0.AddArg2(a, v1)
 13263  		v.AddArg(v0)
 13264  		return true
 13265  	}
 13266  	// match: (MSUBW a (MOVDconst [c]) x)
 13267  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
 13268  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [2]) [log64(c/5)]))
 13269  	for {
 13270  		a := v_0
 13271  		if v_1.Op != OpARM64MOVDconst {
 13272  			break
 13273  		}
 13274  		c := auxIntToInt64(v_1.AuxInt)
 13275  		x := v_2
 13276  		if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
 13277  			break
 13278  		}
 13279  		v.reset(OpARM64MOVWUreg)
 13280  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 13281  		v0.AuxInt = int64ToAuxInt(log64(c / 5))
 13282  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13283  		v1.AuxInt = int64ToAuxInt(2)
 13284  		v1.AddArg2(x, x)
 13285  		v0.AddArg2(a, v1)
 13286  		v.AddArg(v0)
 13287  		return true
 13288  	}
 13289  	// match: (MSUBW a (MOVDconst [c]) x)
 13290  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
 13291  	// result: (MOVWUreg (ADDshiftLL <a.Type> a (SUBshiftLL <x.Type> x x [3]) [log64(c/7)]))
 13292  	for {
 13293  		a := v_0
 13294  		if v_1.Op != OpARM64MOVDconst {
 13295  			break
 13296  		}
 13297  		c := auxIntToInt64(v_1.AuxInt)
 13298  		x := v_2
 13299  		if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
 13300  			break
 13301  		}
 13302  		v.reset(OpARM64MOVWUreg)
 13303  		v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, a.Type)
 13304  		v0.AuxInt = int64ToAuxInt(log64(c / 7))
 13305  		v1 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, x.Type)
 13306  		v1.AuxInt = int64ToAuxInt(3)
 13307  		v1.AddArg2(x, x)
 13308  		v0.AddArg2(a, v1)
 13309  		v.AddArg(v0)
 13310  		return true
 13311  	}
 13312  	// match: (MSUBW a (MOVDconst [c]) x)
 13313  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
 13314  	// result: (MOVWUreg (SUBshiftLL <a.Type> a (ADDshiftLL <x.Type> x x [3]) [log64(c/9)]))
 13315  	for {
 13316  		a := v_0
 13317  		if v_1.Op != OpARM64MOVDconst {
 13318  			break
 13319  		}
 13320  		c := auxIntToInt64(v_1.AuxInt)
 13321  		x := v_2
 13322  		if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
 13323  			break
 13324  		}
 13325  		v.reset(OpARM64MOVWUreg)
 13326  		v0 := b.NewValue0(v.Pos, OpARM64SUBshiftLL, a.Type)
 13327  		v0.AuxInt = int64ToAuxInt(log64(c / 9))
 13328  		v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13329  		v1.AuxInt = int64ToAuxInt(3)
 13330  		v1.AddArg2(x, x)
 13331  		v0.AddArg2(a, v1)
 13332  		v.AddArg(v0)
 13333  		return true
 13334  	}
 13335  	// match: (MSUBW (MOVDconst [c]) x y)
 13336  	// result: (MOVWUreg (ADDconst <x.Type> [c] (MNEGW <x.Type> x y)))
 13337  	for {
 13338  		if v_0.Op != OpARM64MOVDconst {
 13339  			break
 13340  		}
 13341  		c := auxIntToInt64(v_0.AuxInt)
 13342  		x := v_1
 13343  		y := v_2
 13344  		v.reset(OpARM64MOVWUreg)
 13345  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, x.Type)
 13346  		v0.AuxInt = int64ToAuxInt(c)
 13347  		v1 := b.NewValue0(v.Pos, OpARM64MNEGW, x.Type)
 13348  		v1.AddArg2(x, y)
 13349  		v0.AddArg(v1)
 13350  		v.AddArg(v0)
 13351  		return true
 13352  	}
 13353  	// match: (MSUBW a (MOVDconst [c]) (MOVDconst [d]))
 13354  	// result: (MOVWUreg (SUBconst <a.Type> [c*d] a))
 13355  	for {
 13356  		a := v_0
 13357  		if v_1.Op != OpARM64MOVDconst {
 13358  			break
 13359  		}
 13360  		c := auxIntToInt64(v_1.AuxInt)
 13361  		if v_2.Op != OpARM64MOVDconst {
 13362  			break
 13363  		}
 13364  		d := auxIntToInt64(v_2.AuxInt)
 13365  		v.reset(OpARM64MOVWUreg)
 13366  		v0 := b.NewValue0(v.Pos, OpARM64SUBconst, a.Type)
 13367  		v0.AuxInt = int64ToAuxInt(c * d)
 13368  		v0.AddArg(a)
 13369  		v.AddArg(v0)
 13370  		return true
 13371  	}
 13372  	return false
 13373  }
 13374  func rewriteValueARM64_OpARM64MUL(v *Value) bool {
 13375  	v_1 := v.Args[1]
 13376  	v_0 := v.Args[0]
 13377  	b := v.Block
 13378  	// match: (MUL (NEG x) y)
 13379  	// result: (MNEG x y)
 13380  	for {
 13381  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13382  			if v_0.Op != OpARM64NEG {
 13383  				continue
 13384  			}
 13385  			x := v_0.Args[0]
 13386  			y := v_1
 13387  			v.reset(OpARM64MNEG)
 13388  			v.AddArg2(x, y)
 13389  			return true
 13390  		}
 13391  		break
 13392  	}
 13393  	// match: (MUL x (MOVDconst [-1]))
 13394  	// result: (NEG 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 || auxIntToInt64(v_1.AuxInt) != -1 {
 13399  				continue
 13400  			}
 13401  			v.reset(OpARM64NEG)
 13402  			v.AddArg(x)
 13403  			return true
 13404  		}
 13405  		break
 13406  	}
 13407  	// match: (MUL _ (MOVDconst [0]))
 13408  	// result: (MOVDconst [0])
 13409  	for {
 13410  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13411  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 13412  				continue
 13413  			}
 13414  			v.reset(OpARM64MOVDconst)
 13415  			v.AuxInt = int64ToAuxInt(0)
 13416  			return true
 13417  		}
 13418  		break
 13419  	}
 13420  	// match: (MUL x (MOVDconst [1]))
 13421  	// result: x
 13422  	for {
 13423  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13424  			x := v_0
 13425  			if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 13426  				continue
 13427  			}
 13428  			v.copyOf(x)
 13429  			return true
 13430  		}
 13431  		break
 13432  	}
 13433  	// match: (MUL x (MOVDconst [c]))
 13434  	// cond: isPowerOfTwo(c)
 13435  	// result: (SLLconst [log64(c)] x)
 13436  	for {
 13437  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13438  			x := v_0
 13439  			if v_1.Op != OpARM64MOVDconst {
 13440  				continue
 13441  			}
 13442  			c := auxIntToInt64(v_1.AuxInt)
 13443  			if !(isPowerOfTwo(c)) {
 13444  				continue
 13445  			}
 13446  			v.reset(OpARM64SLLconst)
 13447  			v.AuxInt = int64ToAuxInt(log64(c))
 13448  			v.AddArg(x)
 13449  			return true
 13450  		}
 13451  		break
 13452  	}
 13453  	// match: (MUL x (MOVDconst [c]))
 13454  	// cond: isPowerOfTwo(c-1) && c >= 3
 13455  	// result: (ADDshiftLL x x [log64(c-1)])
 13456  	for {
 13457  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13458  			x := v_0
 13459  			if v_1.Op != OpARM64MOVDconst {
 13460  				continue
 13461  			}
 13462  			c := auxIntToInt64(v_1.AuxInt)
 13463  			if !(isPowerOfTwo(c-1) && c >= 3) {
 13464  				continue
 13465  			}
 13466  			v.reset(OpARM64ADDshiftLL)
 13467  			v.AuxInt = int64ToAuxInt(log64(c - 1))
 13468  			v.AddArg2(x, x)
 13469  			return true
 13470  		}
 13471  		break
 13472  	}
 13473  	// match: (MUL x (MOVDconst [c]))
 13474  	// cond: isPowerOfTwo(c+1) && c >= 7
 13475  	// result: (ADDshiftLL (NEG <x.Type> x) x [log64(c+1)])
 13476  	for {
 13477  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13478  			x := v_0
 13479  			if v_1.Op != OpARM64MOVDconst {
 13480  				continue
 13481  			}
 13482  			c := auxIntToInt64(v_1.AuxInt)
 13483  			if !(isPowerOfTwo(c+1) && c >= 7) {
 13484  				continue
 13485  			}
 13486  			v.reset(OpARM64ADDshiftLL)
 13487  			v.AuxInt = int64ToAuxInt(log64(c + 1))
 13488  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
 13489  			v0.AddArg(x)
 13490  			v.AddArg2(v0, x)
 13491  			return true
 13492  		}
 13493  		break
 13494  	}
 13495  	// match: (MUL x (MOVDconst [c]))
 13496  	// cond: c%3 == 0 && isPowerOfTwo(c/3)
 13497  	// result: (SLLconst [log64(c/3)] (ADDshiftLL <x.Type> x x [1]))
 13498  	for {
 13499  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13500  			x := v_0
 13501  			if v_1.Op != OpARM64MOVDconst {
 13502  				continue
 13503  			}
 13504  			c := auxIntToInt64(v_1.AuxInt)
 13505  			if !(c%3 == 0 && isPowerOfTwo(c/3)) {
 13506  				continue
 13507  			}
 13508  			v.reset(OpARM64SLLconst)
 13509  			v.AuxInt = int64ToAuxInt(log64(c / 3))
 13510  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13511  			v0.AuxInt = int64ToAuxInt(1)
 13512  			v0.AddArg2(x, x)
 13513  			v.AddArg(v0)
 13514  			return true
 13515  		}
 13516  		break
 13517  	}
 13518  	// match: (MUL x (MOVDconst [c]))
 13519  	// cond: c%5 == 0 && isPowerOfTwo(c/5)
 13520  	// result: (SLLconst [log64(c/5)] (ADDshiftLL <x.Type> x x [2]))
 13521  	for {
 13522  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13523  			x := v_0
 13524  			if v_1.Op != OpARM64MOVDconst {
 13525  				continue
 13526  			}
 13527  			c := auxIntToInt64(v_1.AuxInt)
 13528  			if !(c%5 == 0 && isPowerOfTwo(c/5)) {
 13529  				continue
 13530  			}
 13531  			v.reset(OpARM64SLLconst)
 13532  			v.AuxInt = int64ToAuxInt(log64(c / 5))
 13533  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13534  			v0.AuxInt = int64ToAuxInt(2)
 13535  			v0.AddArg2(x, x)
 13536  			v.AddArg(v0)
 13537  			return true
 13538  		}
 13539  		break
 13540  	}
 13541  	// match: (MUL x (MOVDconst [c]))
 13542  	// cond: c%7 == 0 && isPowerOfTwo(c/7)
 13543  	// result: (SLLconst [log64(c/7)] (ADDshiftLL <x.Type> (NEG <x.Type> x) x [3]))
 13544  	for {
 13545  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13546  			x := v_0
 13547  			if v_1.Op != OpARM64MOVDconst {
 13548  				continue
 13549  			}
 13550  			c := auxIntToInt64(v_1.AuxInt)
 13551  			if !(c%7 == 0 && isPowerOfTwo(c/7)) {
 13552  				continue
 13553  			}
 13554  			v.reset(OpARM64SLLconst)
 13555  			v.AuxInt = int64ToAuxInt(log64(c / 7))
 13556  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13557  			v0.AuxInt = int64ToAuxInt(3)
 13558  			v1 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
 13559  			v1.AddArg(x)
 13560  			v0.AddArg2(v1, x)
 13561  			v.AddArg(v0)
 13562  			return true
 13563  		}
 13564  		break
 13565  	}
 13566  	// match: (MUL x (MOVDconst [c]))
 13567  	// cond: c%9 == 0 && isPowerOfTwo(c/9)
 13568  	// result: (SLLconst [log64(c/9)] (ADDshiftLL <x.Type> x x [3]))
 13569  	for {
 13570  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13571  			x := v_0
 13572  			if v_1.Op != OpARM64MOVDconst {
 13573  				continue
 13574  			}
 13575  			c := auxIntToInt64(v_1.AuxInt)
 13576  			if !(c%9 == 0 && isPowerOfTwo(c/9)) {
 13577  				continue
 13578  			}
 13579  			v.reset(OpARM64SLLconst)
 13580  			v.AuxInt = int64ToAuxInt(log64(c / 9))
 13581  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13582  			v0.AuxInt = int64ToAuxInt(3)
 13583  			v0.AddArg2(x, x)
 13584  			v.AddArg(v0)
 13585  			return true
 13586  		}
 13587  		break
 13588  	}
 13589  	// match: (MUL (MOVDconst [c]) (MOVDconst [d]))
 13590  	// result: (MOVDconst [c*d])
 13591  	for {
 13592  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13593  			if v_0.Op != OpARM64MOVDconst {
 13594  				continue
 13595  			}
 13596  			c := auxIntToInt64(v_0.AuxInt)
 13597  			if v_1.Op != OpARM64MOVDconst {
 13598  				continue
 13599  			}
 13600  			d := auxIntToInt64(v_1.AuxInt)
 13601  			v.reset(OpARM64MOVDconst)
 13602  			v.AuxInt = int64ToAuxInt(c * d)
 13603  			return true
 13604  		}
 13605  		break
 13606  	}
 13607  	return false
 13608  }
 13609  func rewriteValueARM64_OpARM64MULW(v *Value) bool {
 13610  	v_1 := v.Args[1]
 13611  	v_0 := v.Args[0]
 13612  	b := v.Block
 13613  	// match: (MULW (NEG x) y)
 13614  	// result: (MNEGW x y)
 13615  	for {
 13616  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13617  			if v_0.Op != OpARM64NEG {
 13618  				continue
 13619  			}
 13620  			x := v_0.Args[0]
 13621  			y := v_1
 13622  			v.reset(OpARM64MNEGW)
 13623  			v.AddArg2(x, y)
 13624  			return true
 13625  		}
 13626  		break
 13627  	}
 13628  	// match: (MULW x (MOVDconst [c]))
 13629  	// cond: int32(c)==-1
 13630  	// result: (MOVWUreg (NEG <x.Type> x))
 13631  	for {
 13632  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13633  			x := v_0
 13634  			if v_1.Op != OpARM64MOVDconst {
 13635  				continue
 13636  			}
 13637  			c := auxIntToInt64(v_1.AuxInt)
 13638  			if !(int32(c) == -1) {
 13639  				continue
 13640  			}
 13641  			v.reset(OpARM64MOVWUreg)
 13642  			v0 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
 13643  			v0.AddArg(x)
 13644  			v.AddArg(v0)
 13645  			return true
 13646  		}
 13647  		break
 13648  	}
 13649  	// match: (MULW _ (MOVDconst [c]))
 13650  	// cond: int32(c)==0
 13651  	// result: (MOVDconst [0])
 13652  	for {
 13653  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13654  			if v_1.Op != OpARM64MOVDconst {
 13655  				continue
 13656  			}
 13657  			c := auxIntToInt64(v_1.AuxInt)
 13658  			if !(int32(c) == 0) {
 13659  				continue
 13660  			}
 13661  			v.reset(OpARM64MOVDconst)
 13662  			v.AuxInt = int64ToAuxInt(0)
 13663  			return true
 13664  		}
 13665  		break
 13666  	}
 13667  	// match: (MULW x (MOVDconst [c]))
 13668  	// cond: int32(c)==1
 13669  	// result: (MOVWUreg x)
 13670  	for {
 13671  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13672  			x := v_0
 13673  			if v_1.Op != OpARM64MOVDconst {
 13674  				continue
 13675  			}
 13676  			c := auxIntToInt64(v_1.AuxInt)
 13677  			if !(int32(c) == 1) {
 13678  				continue
 13679  			}
 13680  			v.reset(OpARM64MOVWUreg)
 13681  			v.AddArg(x)
 13682  			return true
 13683  		}
 13684  		break
 13685  	}
 13686  	// match: (MULW x (MOVDconst [c]))
 13687  	// cond: isPowerOfTwo(c)
 13688  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c)] x))
 13689  	for {
 13690  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13691  			x := v_0
 13692  			if v_1.Op != OpARM64MOVDconst {
 13693  				continue
 13694  			}
 13695  			c := auxIntToInt64(v_1.AuxInt)
 13696  			if !(isPowerOfTwo(c)) {
 13697  				continue
 13698  			}
 13699  			v.reset(OpARM64MOVWUreg)
 13700  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 13701  			v0.AuxInt = int64ToAuxInt(log64(c))
 13702  			v0.AddArg(x)
 13703  			v.AddArg(v0)
 13704  			return true
 13705  		}
 13706  		break
 13707  	}
 13708  	// match: (MULW x (MOVDconst [c]))
 13709  	// cond: isPowerOfTwo(c-1) && int32(c) >= 3
 13710  	// result: (MOVWUreg (ADDshiftLL <x.Type> x x [log64(c-1)]))
 13711  	for {
 13712  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13713  			x := v_0
 13714  			if v_1.Op != OpARM64MOVDconst {
 13715  				continue
 13716  			}
 13717  			c := auxIntToInt64(v_1.AuxInt)
 13718  			if !(isPowerOfTwo(c-1) && int32(c) >= 3) {
 13719  				continue
 13720  			}
 13721  			v.reset(OpARM64MOVWUreg)
 13722  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13723  			v0.AuxInt = int64ToAuxInt(log64(c - 1))
 13724  			v0.AddArg2(x, x)
 13725  			v.AddArg(v0)
 13726  			return true
 13727  		}
 13728  		break
 13729  	}
 13730  	// match: (MULW x (MOVDconst [c]))
 13731  	// cond: isPowerOfTwo(c+1) && int32(c) >= 7
 13732  	// result: (MOVWUreg (ADDshiftLL <x.Type> (NEG <x.Type> x) x [log64(c+1)]))
 13733  	for {
 13734  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13735  			x := v_0
 13736  			if v_1.Op != OpARM64MOVDconst {
 13737  				continue
 13738  			}
 13739  			c := auxIntToInt64(v_1.AuxInt)
 13740  			if !(isPowerOfTwo(c+1) && int32(c) >= 7) {
 13741  				continue
 13742  			}
 13743  			v.reset(OpARM64MOVWUreg)
 13744  			v0 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13745  			v0.AuxInt = int64ToAuxInt(log64(c + 1))
 13746  			v1 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
 13747  			v1.AddArg(x)
 13748  			v0.AddArg2(v1, x)
 13749  			v.AddArg(v0)
 13750  			return true
 13751  		}
 13752  		break
 13753  	}
 13754  	// match: (MULW x (MOVDconst [c]))
 13755  	// cond: c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)
 13756  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c/3)] (ADDshiftLL <x.Type> x x [1])))
 13757  	for {
 13758  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13759  			x := v_0
 13760  			if v_1.Op != OpARM64MOVDconst {
 13761  				continue
 13762  			}
 13763  			c := auxIntToInt64(v_1.AuxInt)
 13764  			if !(c%3 == 0 && isPowerOfTwo(c/3) && is32Bit(c)) {
 13765  				continue
 13766  			}
 13767  			v.reset(OpARM64MOVWUreg)
 13768  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 13769  			v0.AuxInt = int64ToAuxInt(log64(c / 3))
 13770  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13771  			v1.AuxInt = int64ToAuxInt(1)
 13772  			v1.AddArg2(x, x)
 13773  			v0.AddArg(v1)
 13774  			v.AddArg(v0)
 13775  			return true
 13776  		}
 13777  		break
 13778  	}
 13779  	// match: (MULW x (MOVDconst [c]))
 13780  	// cond: c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)
 13781  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c/5)] (ADDshiftLL <x.Type> x x [2])))
 13782  	for {
 13783  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13784  			x := v_0
 13785  			if v_1.Op != OpARM64MOVDconst {
 13786  				continue
 13787  			}
 13788  			c := auxIntToInt64(v_1.AuxInt)
 13789  			if !(c%5 == 0 && isPowerOfTwo(c/5) && is32Bit(c)) {
 13790  				continue
 13791  			}
 13792  			v.reset(OpARM64MOVWUreg)
 13793  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 13794  			v0.AuxInt = int64ToAuxInt(log64(c / 5))
 13795  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13796  			v1.AuxInt = int64ToAuxInt(2)
 13797  			v1.AddArg2(x, x)
 13798  			v0.AddArg(v1)
 13799  			v.AddArg(v0)
 13800  			return true
 13801  		}
 13802  		break
 13803  	}
 13804  	// match: (MULW x (MOVDconst [c]))
 13805  	// cond: c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)
 13806  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c/7)] (ADDshiftLL <x.Type> (NEG <x.Type> x) x [3])))
 13807  	for {
 13808  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13809  			x := v_0
 13810  			if v_1.Op != OpARM64MOVDconst {
 13811  				continue
 13812  			}
 13813  			c := auxIntToInt64(v_1.AuxInt)
 13814  			if !(c%7 == 0 && isPowerOfTwo(c/7) && is32Bit(c)) {
 13815  				continue
 13816  			}
 13817  			v.reset(OpARM64MOVWUreg)
 13818  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 13819  			v0.AuxInt = int64ToAuxInt(log64(c / 7))
 13820  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13821  			v1.AuxInt = int64ToAuxInt(3)
 13822  			v2 := b.NewValue0(v.Pos, OpARM64NEG, x.Type)
 13823  			v2.AddArg(x)
 13824  			v1.AddArg2(v2, x)
 13825  			v0.AddArg(v1)
 13826  			v.AddArg(v0)
 13827  			return true
 13828  		}
 13829  		break
 13830  	}
 13831  	// match: (MULW x (MOVDconst [c]))
 13832  	// cond: c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)
 13833  	// result: (MOVWUreg (SLLconst <x.Type> [log64(c/9)] (ADDshiftLL <x.Type> x x [3])))
 13834  	for {
 13835  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13836  			x := v_0
 13837  			if v_1.Op != OpARM64MOVDconst {
 13838  				continue
 13839  			}
 13840  			c := auxIntToInt64(v_1.AuxInt)
 13841  			if !(c%9 == 0 && isPowerOfTwo(c/9) && is32Bit(c)) {
 13842  				continue
 13843  			}
 13844  			v.reset(OpARM64MOVWUreg)
 13845  			v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 13846  			v0.AuxInt = int64ToAuxInt(log64(c / 9))
 13847  			v1 := b.NewValue0(v.Pos, OpARM64ADDshiftLL, x.Type)
 13848  			v1.AuxInt = int64ToAuxInt(3)
 13849  			v1.AddArg2(x, x)
 13850  			v0.AddArg(v1)
 13851  			v.AddArg(v0)
 13852  			return true
 13853  		}
 13854  		break
 13855  	}
 13856  	// match: (MULW (MOVDconst [c]) (MOVDconst [d]))
 13857  	// result: (MOVDconst [int64(uint32(c*d))])
 13858  	for {
 13859  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13860  			if v_0.Op != OpARM64MOVDconst {
 13861  				continue
 13862  			}
 13863  			c := auxIntToInt64(v_0.AuxInt)
 13864  			if v_1.Op != OpARM64MOVDconst {
 13865  				continue
 13866  			}
 13867  			d := auxIntToInt64(v_1.AuxInt)
 13868  			v.reset(OpARM64MOVDconst)
 13869  			v.AuxInt = int64ToAuxInt(int64(uint32(c * d)))
 13870  			return true
 13871  		}
 13872  		break
 13873  	}
 13874  	return false
 13875  }
 13876  func rewriteValueARM64_OpARM64MVN(v *Value) bool {
 13877  	v_0 := v.Args[0]
 13878  	// match: (MVN (XOR x y))
 13879  	// result: (EON x y)
 13880  	for {
 13881  		if v_0.Op != OpARM64XOR {
 13882  			break
 13883  		}
 13884  		y := v_0.Args[1]
 13885  		x := v_0.Args[0]
 13886  		v.reset(OpARM64EON)
 13887  		v.AddArg2(x, y)
 13888  		return true
 13889  	}
 13890  	// match: (MVN (MOVDconst [c]))
 13891  	// result: (MOVDconst [^c])
 13892  	for {
 13893  		if v_0.Op != OpARM64MOVDconst {
 13894  			break
 13895  		}
 13896  		c := auxIntToInt64(v_0.AuxInt)
 13897  		v.reset(OpARM64MOVDconst)
 13898  		v.AuxInt = int64ToAuxInt(^c)
 13899  		return true
 13900  	}
 13901  	// match: (MVN x:(SLLconst [c] y))
 13902  	// cond: clobberIfDead(x)
 13903  	// result: (MVNshiftLL [c] y)
 13904  	for {
 13905  		x := v_0
 13906  		if x.Op != OpARM64SLLconst {
 13907  			break
 13908  		}
 13909  		c := auxIntToInt64(x.AuxInt)
 13910  		y := x.Args[0]
 13911  		if !(clobberIfDead(x)) {
 13912  			break
 13913  		}
 13914  		v.reset(OpARM64MVNshiftLL)
 13915  		v.AuxInt = int64ToAuxInt(c)
 13916  		v.AddArg(y)
 13917  		return true
 13918  	}
 13919  	// match: (MVN x:(SRLconst [c] y))
 13920  	// cond: clobberIfDead(x)
 13921  	// result: (MVNshiftRL [c] y)
 13922  	for {
 13923  		x := v_0
 13924  		if x.Op != OpARM64SRLconst {
 13925  			break
 13926  		}
 13927  		c := auxIntToInt64(x.AuxInt)
 13928  		y := x.Args[0]
 13929  		if !(clobberIfDead(x)) {
 13930  			break
 13931  		}
 13932  		v.reset(OpARM64MVNshiftRL)
 13933  		v.AuxInt = int64ToAuxInt(c)
 13934  		v.AddArg(y)
 13935  		return true
 13936  	}
 13937  	// match: (MVN x:(SRAconst [c] y))
 13938  	// cond: clobberIfDead(x)
 13939  	// result: (MVNshiftRA [c] y)
 13940  	for {
 13941  		x := v_0
 13942  		if x.Op != OpARM64SRAconst {
 13943  			break
 13944  		}
 13945  		c := auxIntToInt64(x.AuxInt)
 13946  		y := x.Args[0]
 13947  		if !(clobberIfDead(x)) {
 13948  			break
 13949  		}
 13950  		v.reset(OpARM64MVNshiftRA)
 13951  		v.AuxInt = int64ToAuxInt(c)
 13952  		v.AddArg(y)
 13953  		return true
 13954  	}
 13955  	// match: (MVN x:(RORconst [c] y))
 13956  	// cond: clobberIfDead(x)
 13957  	// result: (MVNshiftRO [c] y)
 13958  	for {
 13959  		x := v_0
 13960  		if x.Op != OpARM64RORconst {
 13961  			break
 13962  		}
 13963  		c := auxIntToInt64(x.AuxInt)
 13964  		y := x.Args[0]
 13965  		if !(clobberIfDead(x)) {
 13966  			break
 13967  		}
 13968  		v.reset(OpARM64MVNshiftRO)
 13969  		v.AuxInt = int64ToAuxInt(c)
 13970  		v.AddArg(y)
 13971  		return true
 13972  	}
 13973  	return false
 13974  }
 13975  func rewriteValueARM64_OpARM64MVNshiftLL(v *Value) bool {
 13976  	v_0 := v.Args[0]
 13977  	// match: (MVNshiftLL (MOVDconst [c]) [d])
 13978  	// result: (MOVDconst [^int64(uint64(c)<<uint64(d))])
 13979  	for {
 13980  		d := auxIntToInt64(v.AuxInt)
 13981  		if v_0.Op != OpARM64MOVDconst {
 13982  			break
 13983  		}
 13984  		c := auxIntToInt64(v_0.AuxInt)
 13985  		v.reset(OpARM64MOVDconst)
 13986  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
 13987  		return true
 13988  	}
 13989  	return false
 13990  }
 13991  func rewriteValueARM64_OpARM64MVNshiftRA(v *Value) bool {
 13992  	v_0 := v.Args[0]
 13993  	// match: (MVNshiftRA (MOVDconst [c]) [d])
 13994  	// result: (MOVDconst [^(c>>uint64(d))])
 13995  	for {
 13996  		d := auxIntToInt64(v.AuxInt)
 13997  		if v_0.Op != OpARM64MOVDconst {
 13998  			break
 13999  		}
 14000  		c := auxIntToInt64(v_0.AuxInt)
 14001  		v.reset(OpARM64MOVDconst)
 14002  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
 14003  		return true
 14004  	}
 14005  	return false
 14006  }
 14007  func rewriteValueARM64_OpARM64MVNshiftRL(v *Value) bool {
 14008  	v_0 := v.Args[0]
 14009  	// match: (MVNshiftRL (MOVDconst [c]) [d])
 14010  	// result: (MOVDconst [^int64(uint64(c)>>uint64(d))])
 14011  	for {
 14012  		d := auxIntToInt64(v.AuxInt)
 14013  		if v_0.Op != OpARM64MOVDconst {
 14014  			break
 14015  		}
 14016  		c := auxIntToInt64(v_0.AuxInt)
 14017  		v.reset(OpARM64MOVDconst)
 14018  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
 14019  		return true
 14020  	}
 14021  	return false
 14022  }
 14023  func rewriteValueARM64_OpARM64MVNshiftRO(v *Value) bool {
 14024  	v_0 := v.Args[0]
 14025  	// match: (MVNshiftRO (MOVDconst [c]) [d])
 14026  	// result: (MOVDconst [^rotateRight64(c, d)])
 14027  	for {
 14028  		d := auxIntToInt64(v.AuxInt)
 14029  		if v_0.Op != OpARM64MOVDconst {
 14030  			break
 14031  		}
 14032  		c := auxIntToInt64(v_0.AuxInt)
 14033  		v.reset(OpARM64MOVDconst)
 14034  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
 14035  		return true
 14036  	}
 14037  	return false
 14038  }
 14039  func rewriteValueARM64_OpARM64NEG(v *Value) bool {
 14040  	v_0 := v.Args[0]
 14041  	// match: (NEG (MUL x y))
 14042  	// result: (MNEG x y)
 14043  	for {
 14044  		if v_0.Op != OpARM64MUL {
 14045  			break
 14046  		}
 14047  		y := v_0.Args[1]
 14048  		x := v_0.Args[0]
 14049  		v.reset(OpARM64MNEG)
 14050  		v.AddArg2(x, y)
 14051  		return true
 14052  	}
 14053  	// match: (NEG (MULW x y))
 14054  	// cond: v.Type.Size() <= 4
 14055  	// result: (MNEGW x y)
 14056  	for {
 14057  		if v_0.Op != OpARM64MULW {
 14058  			break
 14059  		}
 14060  		y := v_0.Args[1]
 14061  		x := v_0.Args[0]
 14062  		if !(v.Type.Size() <= 4) {
 14063  			break
 14064  		}
 14065  		v.reset(OpARM64MNEGW)
 14066  		v.AddArg2(x, y)
 14067  		return true
 14068  	}
 14069  	// match: (NEG (NEG x))
 14070  	// result: x
 14071  	for {
 14072  		if v_0.Op != OpARM64NEG {
 14073  			break
 14074  		}
 14075  		x := v_0.Args[0]
 14076  		v.copyOf(x)
 14077  		return true
 14078  	}
 14079  	// match: (NEG (MOVDconst [c]))
 14080  	// result: (MOVDconst [-c])
 14081  	for {
 14082  		if v_0.Op != OpARM64MOVDconst {
 14083  			break
 14084  		}
 14085  		c := auxIntToInt64(v_0.AuxInt)
 14086  		v.reset(OpARM64MOVDconst)
 14087  		v.AuxInt = int64ToAuxInt(-c)
 14088  		return true
 14089  	}
 14090  	// match: (NEG x:(SLLconst [c] y))
 14091  	// cond: clobberIfDead(x)
 14092  	// result: (NEGshiftLL [c] y)
 14093  	for {
 14094  		x := v_0
 14095  		if x.Op != OpARM64SLLconst {
 14096  			break
 14097  		}
 14098  		c := auxIntToInt64(x.AuxInt)
 14099  		y := x.Args[0]
 14100  		if !(clobberIfDead(x)) {
 14101  			break
 14102  		}
 14103  		v.reset(OpARM64NEGshiftLL)
 14104  		v.AuxInt = int64ToAuxInt(c)
 14105  		v.AddArg(y)
 14106  		return true
 14107  	}
 14108  	// match: (NEG x:(SRLconst [c] y))
 14109  	// cond: clobberIfDead(x)
 14110  	// result: (NEGshiftRL [c] y)
 14111  	for {
 14112  		x := v_0
 14113  		if x.Op != OpARM64SRLconst {
 14114  			break
 14115  		}
 14116  		c := auxIntToInt64(x.AuxInt)
 14117  		y := x.Args[0]
 14118  		if !(clobberIfDead(x)) {
 14119  			break
 14120  		}
 14121  		v.reset(OpARM64NEGshiftRL)
 14122  		v.AuxInt = int64ToAuxInt(c)
 14123  		v.AddArg(y)
 14124  		return true
 14125  	}
 14126  	// match: (NEG x:(SRAconst [c] y))
 14127  	// cond: clobberIfDead(x)
 14128  	// result: (NEGshiftRA [c] y)
 14129  	for {
 14130  		x := v_0
 14131  		if x.Op != OpARM64SRAconst {
 14132  			break
 14133  		}
 14134  		c := auxIntToInt64(x.AuxInt)
 14135  		y := x.Args[0]
 14136  		if !(clobberIfDead(x)) {
 14137  			break
 14138  		}
 14139  		v.reset(OpARM64NEGshiftRA)
 14140  		v.AuxInt = int64ToAuxInt(c)
 14141  		v.AddArg(y)
 14142  		return true
 14143  	}
 14144  	return false
 14145  }
 14146  func rewriteValueARM64_OpARM64NEGshiftLL(v *Value) bool {
 14147  	v_0 := v.Args[0]
 14148  	// match: (NEGshiftLL (MOVDconst [c]) [d])
 14149  	// result: (MOVDconst [-int64(uint64(c)<<uint64(d))])
 14150  	for {
 14151  		d := auxIntToInt64(v.AuxInt)
 14152  		if v_0.Op != OpARM64MOVDconst {
 14153  			break
 14154  		}
 14155  		c := auxIntToInt64(v_0.AuxInt)
 14156  		v.reset(OpARM64MOVDconst)
 14157  		v.AuxInt = int64ToAuxInt(-int64(uint64(c) << uint64(d)))
 14158  		return true
 14159  	}
 14160  	return false
 14161  }
 14162  func rewriteValueARM64_OpARM64NEGshiftRA(v *Value) bool {
 14163  	v_0 := v.Args[0]
 14164  	// match: (NEGshiftRA (MOVDconst [c]) [d])
 14165  	// result: (MOVDconst [-(c>>uint64(d))])
 14166  	for {
 14167  		d := auxIntToInt64(v.AuxInt)
 14168  		if v_0.Op != OpARM64MOVDconst {
 14169  			break
 14170  		}
 14171  		c := auxIntToInt64(v_0.AuxInt)
 14172  		v.reset(OpARM64MOVDconst)
 14173  		v.AuxInt = int64ToAuxInt(-(c >> uint64(d)))
 14174  		return true
 14175  	}
 14176  	return false
 14177  }
 14178  func rewriteValueARM64_OpARM64NEGshiftRL(v *Value) bool {
 14179  	v_0 := v.Args[0]
 14180  	// match: (NEGshiftRL (MOVDconst [c]) [d])
 14181  	// result: (MOVDconst [-int64(uint64(c)>>uint64(d))])
 14182  	for {
 14183  		d := auxIntToInt64(v.AuxInt)
 14184  		if v_0.Op != OpARM64MOVDconst {
 14185  			break
 14186  		}
 14187  		c := auxIntToInt64(v_0.AuxInt)
 14188  		v.reset(OpARM64MOVDconst)
 14189  		v.AuxInt = int64ToAuxInt(-int64(uint64(c) >> uint64(d)))
 14190  		return true
 14191  	}
 14192  	return false
 14193  }
 14194  func rewriteValueARM64_OpARM64NotEqual(v *Value) bool {
 14195  	v_0 := v.Args[0]
 14196  	b := v.Block
 14197  	// match: (NotEqual (CMPconst [0] z:(AND x y)))
 14198  	// cond: z.Uses == 1
 14199  	// result: (NotEqual (TST x y))
 14200  	for {
 14201  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14202  			break
 14203  		}
 14204  		z := v_0.Args[0]
 14205  		if z.Op != OpARM64AND {
 14206  			break
 14207  		}
 14208  		y := z.Args[1]
 14209  		x := z.Args[0]
 14210  		if !(z.Uses == 1) {
 14211  			break
 14212  		}
 14213  		v.reset(OpARM64NotEqual)
 14214  		v0 := b.NewValue0(v.Pos, OpARM64TST, types.TypeFlags)
 14215  		v0.AddArg2(x, y)
 14216  		v.AddArg(v0)
 14217  		return true
 14218  	}
 14219  	// match: (NotEqual (CMPWconst [0] x:(ANDconst [c] y)))
 14220  	// cond: x.Uses == 1
 14221  	// result: (NotEqual (TSTWconst [int32(c)] y))
 14222  	for {
 14223  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 14224  			break
 14225  		}
 14226  		x := v_0.Args[0]
 14227  		if x.Op != OpARM64ANDconst {
 14228  			break
 14229  		}
 14230  		c := auxIntToInt64(x.AuxInt)
 14231  		y := x.Args[0]
 14232  		if !(x.Uses == 1) {
 14233  			break
 14234  		}
 14235  		v.reset(OpARM64NotEqual)
 14236  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
 14237  		v0.AuxInt = int32ToAuxInt(int32(c))
 14238  		v0.AddArg(y)
 14239  		v.AddArg(v0)
 14240  		return true
 14241  	}
 14242  	// match: (NotEqual (CMPWconst [0] z:(AND x y)))
 14243  	// cond: z.Uses == 1
 14244  	// result: (NotEqual (TSTW x y))
 14245  	for {
 14246  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 14247  			break
 14248  		}
 14249  		z := v_0.Args[0]
 14250  		if z.Op != OpARM64AND {
 14251  			break
 14252  		}
 14253  		y := z.Args[1]
 14254  		x := z.Args[0]
 14255  		if !(z.Uses == 1) {
 14256  			break
 14257  		}
 14258  		v.reset(OpARM64NotEqual)
 14259  		v0 := b.NewValue0(v.Pos, OpARM64TSTW, types.TypeFlags)
 14260  		v0.AddArg2(x, y)
 14261  		v.AddArg(v0)
 14262  		return true
 14263  	}
 14264  	// match: (NotEqual (CMPconst [0] x:(ANDconst [c] y)))
 14265  	// cond: x.Uses == 1
 14266  	// result: (NotEqual (TSTconst [c] y))
 14267  	for {
 14268  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14269  			break
 14270  		}
 14271  		x := v_0.Args[0]
 14272  		if x.Op != OpARM64ANDconst {
 14273  			break
 14274  		}
 14275  		c := auxIntToInt64(x.AuxInt)
 14276  		y := x.Args[0]
 14277  		if !(x.Uses == 1) {
 14278  			break
 14279  		}
 14280  		v.reset(OpARM64NotEqual)
 14281  		v0 := b.NewValue0(v.Pos, OpARM64TSTconst, types.TypeFlags)
 14282  		v0.AuxInt = int64ToAuxInt(c)
 14283  		v0.AddArg(y)
 14284  		v.AddArg(v0)
 14285  		return true
 14286  	}
 14287  	// match: (NotEqual (CMP x z:(NEG y)))
 14288  	// cond: z.Uses == 1
 14289  	// result: (NotEqual (CMN x y))
 14290  	for {
 14291  		if v_0.Op != OpARM64CMP {
 14292  			break
 14293  		}
 14294  		_ = v_0.Args[1]
 14295  		x := v_0.Args[0]
 14296  		z := v_0.Args[1]
 14297  		if z.Op != OpARM64NEG {
 14298  			break
 14299  		}
 14300  		y := z.Args[0]
 14301  		if !(z.Uses == 1) {
 14302  			break
 14303  		}
 14304  		v.reset(OpARM64NotEqual)
 14305  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
 14306  		v0.AddArg2(x, y)
 14307  		v.AddArg(v0)
 14308  		return true
 14309  	}
 14310  	// match: (NotEqual (CMPW x z:(NEG y)))
 14311  	// cond: z.Uses == 1
 14312  	// result: (NotEqual (CMNW x y))
 14313  	for {
 14314  		if v_0.Op != OpARM64CMPW {
 14315  			break
 14316  		}
 14317  		_ = v_0.Args[1]
 14318  		x := v_0.Args[0]
 14319  		z := v_0.Args[1]
 14320  		if z.Op != OpARM64NEG {
 14321  			break
 14322  		}
 14323  		y := z.Args[0]
 14324  		if !(z.Uses == 1) {
 14325  			break
 14326  		}
 14327  		v.reset(OpARM64NotEqual)
 14328  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
 14329  		v0.AddArg2(x, y)
 14330  		v.AddArg(v0)
 14331  		return true
 14332  	}
 14333  	// match: (NotEqual (CMPconst [0] x:(ADDconst [c] y)))
 14334  	// cond: x.Uses == 1
 14335  	// result: (NotEqual (CMNconst [c] y))
 14336  	for {
 14337  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14338  			break
 14339  		}
 14340  		x := v_0.Args[0]
 14341  		if x.Op != OpARM64ADDconst {
 14342  			break
 14343  		}
 14344  		c := auxIntToInt64(x.AuxInt)
 14345  		y := x.Args[0]
 14346  		if !(x.Uses == 1) {
 14347  			break
 14348  		}
 14349  		v.reset(OpARM64NotEqual)
 14350  		v0 := b.NewValue0(v.Pos, OpARM64CMNconst, types.TypeFlags)
 14351  		v0.AuxInt = int64ToAuxInt(c)
 14352  		v0.AddArg(y)
 14353  		v.AddArg(v0)
 14354  		return true
 14355  	}
 14356  	// match: (NotEqual (CMPWconst [0] x:(ADDconst [c] y)))
 14357  	// cond: x.Uses == 1
 14358  	// result: (NotEqual (CMNWconst [int32(c)] y))
 14359  	for {
 14360  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 14361  			break
 14362  		}
 14363  		x := v_0.Args[0]
 14364  		if x.Op != OpARM64ADDconst {
 14365  			break
 14366  		}
 14367  		c := auxIntToInt64(x.AuxInt)
 14368  		y := x.Args[0]
 14369  		if !(x.Uses == 1) {
 14370  			break
 14371  		}
 14372  		v.reset(OpARM64NotEqual)
 14373  		v0 := b.NewValue0(v.Pos, OpARM64CMNWconst, types.TypeFlags)
 14374  		v0.AuxInt = int32ToAuxInt(int32(c))
 14375  		v0.AddArg(y)
 14376  		v.AddArg(v0)
 14377  		return true
 14378  	}
 14379  	// match: (NotEqual (CMPconst [0] z:(ADD x y)))
 14380  	// cond: z.Uses == 1
 14381  	// result: (NotEqual (CMN x y))
 14382  	for {
 14383  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14384  			break
 14385  		}
 14386  		z := v_0.Args[0]
 14387  		if z.Op != OpARM64ADD {
 14388  			break
 14389  		}
 14390  		y := z.Args[1]
 14391  		x := z.Args[0]
 14392  		if !(z.Uses == 1) {
 14393  			break
 14394  		}
 14395  		v.reset(OpARM64NotEqual)
 14396  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
 14397  		v0.AddArg2(x, y)
 14398  		v.AddArg(v0)
 14399  		return true
 14400  	}
 14401  	// match: (NotEqual (CMPWconst [0] z:(ADD x y)))
 14402  	// cond: z.Uses == 1
 14403  	// result: (NotEqual (CMNW x y))
 14404  	for {
 14405  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 14406  			break
 14407  		}
 14408  		z := v_0.Args[0]
 14409  		if z.Op != OpARM64ADD {
 14410  			break
 14411  		}
 14412  		y := z.Args[1]
 14413  		x := z.Args[0]
 14414  		if !(z.Uses == 1) {
 14415  			break
 14416  		}
 14417  		v.reset(OpARM64NotEqual)
 14418  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
 14419  		v0.AddArg2(x, y)
 14420  		v.AddArg(v0)
 14421  		return true
 14422  	}
 14423  	// match: (NotEqual (CMPconst [0] z:(MADD a x y)))
 14424  	// cond: z.Uses == 1
 14425  	// result: (NotEqual (CMN a (MUL <x.Type> x y)))
 14426  	for {
 14427  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14428  			break
 14429  		}
 14430  		z := v_0.Args[0]
 14431  		if z.Op != OpARM64MADD {
 14432  			break
 14433  		}
 14434  		y := z.Args[2]
 14435  		a := z.Args[0]
 14436  		x := z.Args[1]
 14437  		if !(z.Uses == 1) {
 14438  			break
 14439  		}
 14440  		v.reset(OpARM64NotEqual)
 14441  		v0 := b.NewValue0(v.Pos, OpARM64CMN, types.TypeFlags)
 14442  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
 14443  		v1.AddArg2(x, y)
 14444  		v0.AddArg2(a, v1)
 14445  		v.AddArg(v0)
 14446  		return true
 14447  	}
 14448  	// match: (NotEqual (CMPconst [0] z:(MSUB a x y)))
 14449  	// cond: z.Uses == 1
 14450  	// result: (NotEqual (CMP a (MUL <x.Type> x y)))
 14451  	for {
 14452  		if v_0.Op != OpARM64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14453  			break
 14454  		}
 14455  		z := v_0.Args[0]
 14456  		if z.Op != OpARM64MSUB {
 14457  			break
 14458  		}
 14459  		y := z.Args[2]
 14460  		a := z.Args[0]
 14461  		x := z.Args[1]
 14462  		if !(z.Uses == 1) {
 14463  			break
 14464  		}
 14465  		v.reset(OpARM64NotEqual)
 14466  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 14467  		v1 := b.NewValue0(v.Pos, OpARM64MUL, x.Type)
 14468  		v1.AddArg2(x, y)
 14469  		v0.AddArg2(a, v1)
 14470  		v.AddArg(v0)
 14471  		return true
 14472  	}
 14473  	// match: (NotEqual (CMPWconst [0] z:(MADDW a x y)))
 14474  	// cond: z.Uses == 1
 14475  	// result: (NotEqual (CMNW a (MULW <x.Type> x y)))
 14476  	for {
 14477  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 14478  			break
 14479  		}
 14480  		z := v_0.Args[0]
 14481  		if z.Op != OpARM64MADDW {
 14482  			break
 14483  		}
 14484  		y := z.Args[2]
 14485  		a := z.Args[0]
 14486  		x := z.Args[1]
 14487  		if !(z.Uses == 1) {
 14488  			break
 14489  		}
 14490  		v.reset(OpARM64NotEqual)
 14491  		v0 := b.NewValue0(v.Pos, OpARM64CMNW, types.TypeFlags)
 14492  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
 14493  		v1.AddArg2(x, y)
 14494  		v0.AddArg2(a, v1)
 14495  		v.AddArg(v0)
 14496  		return true
 14497  	}
 14498  	// match: (NotEqual (CMPWconst [0] z:(MSUBW a x y)))
 14499  	// cond: z.Uses == 1
 14500  	// result: (NotEqual (CMPW a (MULW <x.Type> x y)))
 14501  	for {
 14502  		if v_0.Op != OpARM64CMPWconst || auxIntToInt32(v_0.AuxInt) != 0 {
 14503  			break
 14504  		}
 14505  		z := v_0.Args[0]
 14506  		if z.Op != OpARM64MSUBW {
 14507  			break
 14508  		}
 14509  		y := z.Args[2]
 14510  		a := z.Args[0]
 14511  		x := z.Args[1]
 14512  		if !(z.Uses == 1) {
 14513  			break
 14514  		}
 14515  		v.reset(OpARM64NotEqual)
 14516  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 14517  		v1 := b.NewValue0(v.Pos, OpARM64MULW, x.Type)
 14518  		v1.AddArg2(x, y)
 14519  		v0.AddArg2(a, v1)
 14520  		v.AddArg(v0)
 14521  		return true
 14522  	}
 14523  	// match: (NotEqual (FlagConstant [fc]))
 14524  	// result: (MOVDconst [b2i(fc.ne())])
 14525  	for {
 14526  		if v_0.Op != OpARM64FlagConstant {
 14527  			break
 14528  		}
 14529  		fc := auxIntToFlagConstant(v_0.AuxInt)
 14530  		v.reset(OpARM64MOVDconst)
 14531  		v.AuxInt = int64ToAuxInt(b2i(fc.ne()))
 14532  		return true
 14533  	}
 14534  	// match: (NotEqual (InvertFlags x))
 14535  	// result: (NotEqual x)
 14536  	for {
 14537  		if v_0.Op != OpARM64InvertFlags {
 14538  			break
 14539  		}
 14540  		x := v_0.Args[0]
 14541  		v.reset(OpARM64NotEqual)
 14542  		v.AddArg(x)
 14543  		return true
 14544  	}
 14545  	return false
 14546  }
 14547  func rewriteValueARM64_OpARM64OR(v *Value) bool {
 14548  	v_1 := v.Args[1]
 14549  	v_0 := v.Args[0]
 14550  	// match: (OR x (MOVDconst [c]))
 14551  	// result: (ORconst [c] x)
 14552  	for {
 14553  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 14554  			x := v_0
 14555  			if v_1.Op != OpARM64MOVDconst {
 14556  				continue
 14557  			}
 14558  			c := auxIntToInt64(v_1.AuxInt)
 14559  			v.reset(OpARM64ORconst)
 14560  			v.AuxInt = int64ToAuxInt(c)
 14561  			v.AddArg(x)
 14562  			return true
 14563  		}
 14564  		break
 14565  	}
 14566  	// match: (OR x x)
 14567  	// result: x
 14568  	for {
 14569  		x := v_0
 14570  		if x != v_1 {
 14571  			break
 14572  		}
 14573  		v.copyOf(x)
 14574  		return true
 14575  	}
 14576  	// match: (OR x (MVN y))
 14577  	// result: (ORN x y)
 14578  	for {
 14579  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 14580  			x := v_0
 14581  			if v_1.Op != OpARM64MVN {
 14582  				continue
 14583  			}
 14584  			y := v_1.Args[0]
 14585  			v.reset(OpARM64ORN)
 14586  			v.AddArg2(x, y)
 14587  			return true
 14588  		}
 14589  		break
 14590  	}
 14591  	// match: (OR x0 x1:(SLLconst [c] y))
 14592  	// cond: clobberIfDead(x1)
 14593  	// result: (ORshiftLL x0 y [c])
 14594  	for {
 14595  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 14596  			x0 := v_0
 14597  			x1 := v_1
 14598  			if x1.Op != OpARM64SLLconst {
 14599  				continue
 14600  			}
 14601  			c := auxIntToInt64(x1.AuxInt)
 14602  			y := x1.Args[0]
 14603  			if !(clobberIfDead(x1)) {
 14604  				continue
 14605  			}
 14606  			v.reset(OpARM64ORshiftLL)
 14607  			v.AuxInt = int64ToAuxInt(c)
 14608  			v.AddArg2(x0, y)
 14609  			return true
 14610  		}
 14611  		break
 14612  	}
 14613  	// match: (OR x0 x1:(SRLconst [c] y))
 14614  	// cond: clobberIfDead(x1)
 14615  	// result: (ORshiftRL x0 y [c])
 14616  	for {
 14617  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 14618  			x0 := v_0
 14619  			x1 := v_1
 14620  			if x1.Op != OpARM64SRLconst {
 14621  				continue
 14622  			}
 14623  			c := auxIntToInt64(x1.AuxInt)
 14624  			y := x1.Args[0]
 14625  			if !(clobberIfDead(x1)) {
 14626  				continue
 14627  			}
 14628  			v.reset(OpARM64ORshiftRL)
 14629  			v.AuxInt = int64ToAuxInt(c)
 14630  			v.AddArg2(x0, y)
 14631  			return true
 14632  		}
 14633  		break
 14634  	}
 14635  	// match: (OR x0 x1:(SRAconst [c] y))
 14636  	// cond: clobberIfDead(x1)
 14637  	// result: (ORshiftRA x0 y [c])
 14638  	for {
 14639  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 14640  			x0 := v_0
 14641  			x1 := v_1
 14642  			if x1.Op != OpARM64SRAconst {
 14643  				continue
 14644  			}
 14645  			c := auxIntToInt64(x1.AuxInt)
 14646  			y := x1.Args[0]
 14647  			if !(clobberIfDead(x1)) {
 14648  				continue
 14649  			}
 14650  			v.reset(OpARM64ORshiftRA)
 14651  			v.AuxInt = int64ToAuxInt(c)
 14652  			v.AddArg2(x0, y)
 14653  			return true
 14654  		}
 14655  		break
 14656  	}
 14657  	// match: (OR x0 x1:(RORconst [c] y))
 14658  	// cond: clobberIfDead(x1)
 14659  	// result: (ORshiftRO x0 y [c])
 14660  	for {
 14661  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 14662  			x0 := v_0
 14663  			x1 := v_1
 14664  			if x1.Op != OpARM64RORconst {
 14665  				continue
 14666  			}
 14667  			c := auxIntToInt64(x1.AuxInt)
 14668  			y := x1.Args[0]
 14669  			if !(clobberIfDead(x1)) {
 14670  				continue
 14671  			}
 14672  			v.reset(OpARM64ORshiftRO)
 14673  			v.AuxInt = int64ToAuxInt(c)
 14674  			v.AddArg2(x0, y)
 14675  			return true
 14676  		}
 14677  		break
 14678  	}
 14679  	// match: (OR (UBFIZ [bfc] x) (ANDconst [ac] y))
 14680  	// cond: ac == ^((1<<uint(bfc.width())-1) << uint(bfc.lsb()))
 14681  	// result: (BFI [bfc] y x)
 14682  	for {
 14683  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 14684  			if v_0.Op != OpARM64UBFIZ {
 14685  				continue
 14686  			}
 14687  			bfc := auxIntToArm64BitField(v_0.AuxInt)
 14688  			x := v_0.Args[0]
 14689  			if v_1.Op != OpARM64ANDconst {
 14690  				continue
 14691  			}
 14692  			ac := auxIntToInt64(v_1.AuxInt)
 14693  			y := v_1.Args[0]
 14694  			if !(ac == ^((1<<uint(bfc.width()) - 1) << uint(bfc.lsb()))) {
 14695  				continue
 14696  			}
 14697  			v.reset(OpARM64BFI)
 14698  			v.AuxInt = arm64BitFieldToAuxInt(bfc)
 14699  			v.AddArg2(y, x)
 14700  			return true
 14701  		}
 14702  		break
 14703  	}
 14704  	// match: (OR (UBFX [bfc] x) (ANDconst [ac] y))
 14705  	// cond: ac == ^(1<<uint(bfc.width())-1)
 14706  	// result: (BFXIL [bfc] y x)
 14707  	for {
 14708  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 14709  			if v_0.Op != OpARM64UBFX {
 14710  				continue
 14711  			}
 14712  			bfc := auxIntToArm64BitField(v_0.AuxInt)
 14713  			x := v_0.Args[0]
 14714  			if v_1.Op != OpARM64ANDconst {
 14715  				continue
 14716  			}
 14717  			ac := auxIntToInt64(v_1.AuxInt)
 14718  			y := v_1.Args[0]
 14719  			if !(ac == ^(1<<uint(bfc.width()) - 1)) {
 14720  				continue
 14721  			}
 14722  			v.reset(OpARM64BFXIL)
 14723  			v.AuxInt = arm64BitFieldToAuxInt(bfc)
 14724  			v.AddArg2(y, x)
 14725  			return true
 14726  		}
 14727  		break
 14728  	}
 14729  	return false
 14730  }
 14731  func rewriteValueARM64_OpARM64ORN(v *Value) bool {
 14732  	v_1 := v.Args[1]
 14733  	v_0 := v.Args[0]
 14734  	// match: (ORN x (MOVDconst [c]))
 14735  	// result: (ORconst [^c] x)
 14736  	for {
 14737  		x := v_0
 14738  		if v_1.Op != OpARM64MOVDconst {
 14739  			break
 14740  		}
 14741  		c := auxIntToInt64(v_1.AuxInt)
 14742  		v.reset(OpARM64ORconst)
 14743  		v.AuxInt = int64ToAuxInt(^c)
 14744  		v.AddArg(x)
 14745  		return true
 14746  	}
 14747  	// match: (ORN x x)
 14748  	// result: (MOVDconst [-1])
 14749  	for {
 14750  		x := v_0
 14751  		if x != v_1 {
 14752  			break
 14753  		}
 14754  		v.reset(OpARM64MOVDconst)
 14755  		v.AuxInt = int64ToAuxInt(-1)
 14756  		return true
 14757  	}
 14758  	// match: (ORN x0 x1:(SLLconst [c] y))
 14759  	// cond: clobberIfDead(x1)
 14760  	// result: (ORNshiftLL x0 y [c])
 14761  	for {
 14762  		x0 := v_0
 14763  		x1 := v_1
 14764  		if x1.Op != OpARM64SLLconst {
 14765  			break
 14766  		}
 14767  		c := auxIntToInt64(x1.AuxInt)
 14768  		y := x1.Args[0]
 14769  		if !(clobberIfDead(x1)) {
 14770  			break
 14771  		}
 14772  		v.reset(OpARM64ORNshiftLL)
 14773  		v.AuxInt = int64ToAuxInt(c)
 14774  		v.AddArg2(x0, y)
 14775  		return true
 14776  	}
 14777  	// match: (ORN x0 x1:(SRLconst [c] y))
 14778  	// cond: clobberIfDead(x1)
 14779  	// result: (ORNshiftRL x0 y [c])
 14780  	for {
 14781  		x0 := v_0
 14782  		x1 := v_1
 14783  		if x1.Op != OpARM64SRLconst {
 14784  			break
 14785  		}
 14786  		c := auxIntToInt64(x1.AuxInt)
 14787  		y := x1.Args[0]
 14788  		if !(clobberIfDead(x1)) {
 14789  			break
 14790  		}
 14791  		v.reset(OpARM64ORNshiftRL)
 14792  		v.AuxInt = int64ToAuxInt(c)
 14793  		v.AddArg2(x0, y)
 14794  		return true
 14795  	}
 14796  	// match: (ORN x0 x1:(SRAconst [c] y))
 14797  	// cond: clobberIfDead(x1)
 14798  	// result: (ORNshiftRA x0 y [c])
 14799  	for {
 14800  		x0 := v_0
 14801  		x1 := v_1
 14802  		if x1.Op != OpARM64SRAconst {
 14803  			break
 14804  		}
 14805  		c := auxIntToInt64(x1.AuxInt)
 14806  		y := x1.Args[0]
 14807  		if !(clobberIfDead(x1)) {
 14808  			break
 14809  		}
 14810  		v.reset(OpARM64ORNshiftRA)
 14811  		v.AuxInt = int64ToAuxInt(c)
 14812  		v.AddArg2(x0, y)
 14813  		return true
 14814  	}
 14815  	// match: (ORN x0 x1:(RORconst [c] y))
 14816  	// cond: clobberIfDead(x1)
 14817  	// result: (ORNshiftRO x0 y [c])
 14818  	for {
 14819  		x0 := v_0
 14820  		x1 := v_1
 14821  		if x1.Op != OpARM64RORconst {
 14822  			break
 14823  		}
 14824  		c := auxIntToInt64(x1.AuxInt)
 14825  		y := x1.Args[0]
 14826  		if !(clobberIfDead(x1)) {
 14827  			break
 14828  		}
 14829  		v.reset(OpARM64ORNshiftRO)
 14830  		v.AuxInt = int64ToAuxInt(c)
 14831  		v.AddArg2(x0, y)
 14832  		return true
 14833  	}
 14834  	return false
 14835  }
 14836  func rewriteValueARM64_OpARM64ORNshiftLL(v *Value) bool {
 14837  	v_1 := v.Args[1]
 14838  	v_0 := v.Args[0]
 14839  	// match: (ORNshiftLL x (MOVDconst [c]) [d])
 14840  	// result: (ORconst x [^int64(uint64(c)<<uint64(d))])
 14841  	for {
 14842  		d := auxIntToInt64(v.AuxInt)
 14843  		x := v_0
 14844  		if v_1.Op != OpARM64MOVDconst {
 14845  			break
 14846  		}
 14847  		c := auxIntToInt64(v_1.AuxInt)
 14848  		v.reset(OpARM64ORconst)
 14849  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) << uint64(d)))
 14850  		v.AddArg(x)
 14851  		return true
 14852  	}
 14853  	// match: (ORNshiftLL (SLLconst x [c]) x [c])
 14854  	// result: (MOVDconst [-1])
 14855  	for {
 14856  		c := auxIntToInt64(v.AuxInt)
 14857  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 14858  			break
 14859  		}
 14860  		x := v_0.Args[0]
 14861  		if x != v_1 {
 14862  			break
 14863  		}
 14864  		v.reset(OpARM64MOVDconst)
 14865  		v.AuxInt = int64ToAuxInt(-1)
 14866  		return true
 14867  	}
 14868  	return false
 14869  }
 14870  func rewriteValueARM64_OpARM64ORNshiftRA(v *Value) bool {
 14871  	v_1 := v.Args[1]
 14872  	v_0 := v.Args[0]
 14873  	// match: (ORNshiftRA x (MOVDconst [c]) [d])
 14874  	// result: (ORconst x [^(c>>uint64(d))])
 14875  	for {
 14876  		d := auxIntToInt64(v.AuxInt)
 14877  		x := v_0
 14878  		if v_1.Op != OpARM64MOVDconst {
 14879  			break
 14880  		}
 14881  		c := auxIntToInt64(v_1.AuxInt)
 14882  		v.reset(OpARM64ORconst)
 14883  		v.AuxInt = int64ToAuxInt(^(c >> uint64(d)))
 14884  		v.AddArg(x)
 14885  		return true
 14886  	}
 14887  	// match: (ORNshiftRA (SRAconst x [c]) x [c])
 14888  	// result: (MOVDconst [-1])
 14889  	for {
 14890  		c := auxIntToInt64(v.AuxInt)
 14891  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
 14892  			break
 14893  		}
 14894  		x := v_0.Args[0]
 14895  		if x != v_1 {
 14896  			break
 14897  		}
 14898  		v.reset(OpARM64MOVDconst)
 14899  		v.AuxInt = int64ToAuxInt(-1)
 14900  		return true
 14901  	}
 14902  	return false
 14903  }
 14904  func rewriteValueARM64_OpARM64ORNshiftRL(v *Value) bool {
 14905  	v_1 := v.Args[1]
 14906  	v_0 := v.Args[0]
 14907  	// match: (ORNshiftRL x (MOVDconst [c]) [d])
 14908  	// result: (ORconst x [^int64(uint64(c)>>uint64(d))])
 14909  	for {
 14910  		d := auxIntToInt64(v.AuxInt)
 14911  		x := v_0
 14912  		if v_1.Op != OpARM64MOVDconst {
 14913  			break
 14914  		}
 14915  		c := auxIntToInt64(v_1.AuxInt)
 14916  		v.reset(OpARM64ORconst)
 14917  		v.AuxInt = int64ToAuxInt(^int64(uint64(c) >> uint64(d)))
 14918  		v.AddArg(x)
 14919  		return true
 14920  	}
 14921  	// match: (ORNshiftRL (SRLconst x [c]) x [c])
 14922  	// result: (MOVDconst [-1])
 14923  	for {
 14924  		c := auxIntToInt64(v.AuxInt)
 14925  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 14926  			break
 14927  		}
 14928  		x := v_0.Args[0]
 14929  		if x != v_1 {
 14930  			break
 14931  		}
 14932  		v.reset(OpARM64MOVDconst)
 14933  		v.AuxInt = int64ToAuxInt(-1)
 14934  		return true
 14935  	}
 14936  	return false
 14937  }
 14938  func rewriteValueARM64_OpARM64ORNshiftRO(v *Value) bool {
 14939  	v_1 := v.Args[1]
 14940  	v_0 := v.Args[0]
 14941  	// match: (ORNshiftRO x (MOVDconst [c]) [d])
 14942  	// result: (ORconst x [^rotateRight64(c, d)])
 14943  	for {
 14944  		d := auxIntToInt64(v.AuxInt)
 14945  		x := v_0
 14946  		if v_1.Op != OpARM64MOVDconst {
 14947  			break
 14948  		}
 14949  		c := auxIntToInt64(v_1.AuxInt)
 14950  		v.reset(OpARM64ORconst)
 14951  		v.AuxInt = int64ToAuxInt(^rotateRight64(c, d))
 14952  		v.AddArg(x)
 14953  		return true
 14954  	}
 14955  	// match: (ORNshiftRO (RORconst x [c]) x [c])
 14956  	// result: (MOVDconst [-1])
 14957  	for {
 14958  		c := auxIntToInt64(v.AuxInt)
 14959  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
 14960  			break
 14961  		}
 14962  		x := v_0.Args[0]
 14963  		if x != v_1 {
 14964  			break
 14965  		}
 14966  		v.reset(OpARM64MOVDconst)
 14967  		v.AuxInt = int64ToAuxInt(-1)
 14968  		return true
 14969  	}
 14970  	return false
 14971  }
 14972  func rewriteValueARM64_OpARM64ORconst(v *Value) bool {
 14973  	v_0 := v.Args[0]
 14974  	// match: (ORconst [0] x)
 14975  	// result: x
 14976  	for {
 14977  		if auxIntToInt64(v.AuxInt) != 0 {
 14978  			break
 14979  		}
 14980  		x := v_0
 14981  		v.copyOf(x)
 14982  		return true
 14983  	}
 14984  	// match: (ORconst [-1] _)
 14985  	// result: (MOVDconst [-1])
 14986  	for {
 14987  		if auxIntToInt64(v.AuxInt) != -1 {
 14988  			break
 14989  		}
 14990  		v.reset(OpARM64MOVDconst)
 14991  		v.AuxInt = int64ToAuxInt(-1)
 14992  		return true
 14993  	}
 14994  	// match: (ORconst [c] (MOVDconst [d]))
 14995  	// result: (MOVDconst [c|d])
 14996  	for {
 14997  		c := auxIntToInt64(v.AuxInt)
 14998  		if v_0.Op != OpARM64MOVDconst {
 14999  			break
 15000  		}
 15001  		d := auxIntToInt64(v_0.AuxInt)
 15002  		v.reset(OpARM64MOVDconst)
 15003  		v.AuxInt = int64ToAuxInt(c | d)
 15004  		return true
 15005  	}
 15006  	// match: (ORconst [c] (ORconst [d] x))
 15007  	// result: (ORconst [c|d] x)
 15008  	for {
 15009  		c := auxIntToInt64(v.AuxInt)
 15010  		if v_0.Op != OpARM64ORconst {
 15011  			break
 15012  		}
 15013  		d := auxIntToInt64(v_0.AuxInt)
 15014  		x := v_0.Args[0]
 15015  		v.reset(OpARM64ORconst)
 15016  		v.AuxInt = int64ToAuxInt(c | d)
 15017  		v.AddArg(x)
 15018  		return true
 15019  	}
 15020  	// match: (ORconst [c1] (ANDconst [c2] x))
 15021  	// cond: c2|c1 == ^0
 15022  	// result: (ORconst [c1] x)
 15023  	for {
 15024  		c1 := auxIntToInt64(v.AuxInt)
 15025  		if v_0.Op != OpARM64ANDconst {
 15026  			break
 15027  		}
 15028  		c2 := auxIntToInt64(v_0.AuxInt)
 15029  		x := v_0.Args[0]
 15030  		if !(c2|c1 == ^0) {
 15031  			break
 15032  		}
 15033  		v.reset(OpARM64ORconst)
 15034  		v.AuxInt = int64ToAuxInt(c1)
 15035  		v.AddArg(x)
 15036  		return true
 15037  	}
 15038  	return false
 15039  }
 15040  func rewriteValueARM64_OpARM64ORshiftLL(v *Value) bool {
 15041  	v_1 := v.Args[1]
 15042  	v_0 := v.Args[0]
 15043  	b := v.Block
 15044  	typ := &b.Func.Config.Types
 15045  	// match: (ORshiftLL (MOVDconst [c]) x [d])
 15046  	// result: (ORconst [c] (SLLconst <x.Type> x [d]))
 15047  	for {
 15048  		d := auxIntToInt64(v.AuxInt)
 15049  		if v_0.Op != OpARM64MOVDconst {
 15050  			break
 15051  		}
 15052  		c := auxIntToInt64(v_0.AuxInt)
 15053  		x := v_1
 15054  		v.reset(OpARM64ORconst)
 15055  		v.AuxInt = int64ToAuxInt(c)
 15056  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 15057  		v0.AuxInt = int64ToAuxInt(d)
 15058  		v0.AddArg(x)
 15059  		v.AddArg(v0)
 15060  		return true
 15061  	}
 15062  	// match: (ORshiftLL x (MOVDconst [c]) [d])
 15063  	// result: (ORconst x [int64(uint64(c)<<uint64(d))])
 15064  	for {
 15065  		d := auxIntToInt64(v.AuxInt)
 15066  		x := v_0
 15067  		if v_1.Op != OpARM64MOVDconst {
 15068  			break
 15069  		}
 15070  		c := auxIntToInt64(v_1.AuxInt)
 15071  		v.reset(OpARM64ORconst)
 15072  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 15073  		v.AddArg(x)
 15074  		return true
 15075  	}
 15076  	// match: (ORshiftLL y:(SLLconst x [c]) x [c])
 15077  	// result: y
 15078  	for {
 15079  		c := auxIntToInt64(v.AuxInt)
 15080  		y := v_0
 15081  		if y.Op != OpARM64SLLconst || auxIntToInt64(y.AuxInt) != c {
 15082  			break
 15083  		}
 15084  		x := y.Args[0]
 15085  		if x != v_1 {
 15086  			break
 15087  		}
 15088  		v.copyOf(y)
 15089  		return true
 15090  	}
 15091  	// match: (ORshiftLL <typ.UInt16> [8] (UBFX <typ.UInt16> [armBFAuxInt(8, 8)] x) x)
 15092  	// result: (REV16W x)
 15093  	for {
 15094  		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) {
 15095  			break
 15096  		}
 15097  		x := v_0.Args[0]
 15098  		if x != v_1 {
 15099  			break
 15100  		}
 15101  		v.reset(OpARM64REV16W)
 15102  		v.AddArg(x)
 15103  		return true
 15104  	}
 15105  	// match: (ORshiftLL [8] (UBFX [armBFAuxInt(8, 24)] (ANDconst [c1] x)) (ANDconst [c2] x))
 15106  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
 15107  	// result: (REV16W x)
 15108  	for {
 15109  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
 15110  			break
 15111  		}
 15112  		v_0_0 := v_0.Args[0]
 15113  		if v_0_0.Op != OpARM64ANDconst {
 15114  			break
 15115  		}
 15116  		c1 := auxIntToInt64(v_0_0.AuxInt)
 15117  		x := v_0_0.Args[0]
 15118  		if v_1.Op != OpARM64ANDconst {
 15119  			break
 15120  		}
 15121  		c2 := auxIntToInt64(v_1.AuxInt)
 15122  		if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
 15123  			break
 15124  		}
 15125  		v.reset(OpARM64REV16W)
 15126  		v.AddArg(x)
 15127  		return true
 15128  	}
 15129  	// match: (ORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 15130  	// cond: (uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff)
 15131  	// result: (REV16 x)
 15132  	for {
 15133  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 15134  			break
 15135  		}
 15136  		v_0_0 := v_0.Args[0]
 15137  		if v_0_0.Op != OpARM64ANDconst {
 15138  			break
 15139  		}
 15140  		c1 := auxIntToInt64(v_0_0.AuxInt)
 15141  		x := v_0_0.Args[0]
 15142  		if v_1.Op != OpARM64ANDconst {
 15143  			break
 15144  		}
 15145  		c2 := auxIntToInt64(v_1.AuxInt)
 15146  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
 15147  			break
 15148  		}
 15149  		v.reset(OpARM64REV16)
 15150  		v.AddArg(x)
 15151  		return true
 15152  	}
 15153  	// match: (ORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 15154  	// cond: (uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff)
 15155  	// result: (REV16 (ANDconst <x.Type> [0xffffffff] x))
 15156  	for {
 15157  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 15158  			break
 15159  		}
 15160  		v_0_0 := v_0.Args[0]
 15161  		if v_0_0.Op != OpARM64ANDconst {
 15162  			break
 15163  		}
 15164  		c1 := auxIntToInt64(v_0_0.AuxInt)
 15165  		x := v_0_0.Args[0]
 15166  		if v_1.Op != OpARM64ANDconst {
 15167  			break
 15168  		}
 15169  		c2 := auxIntToInt64(v_1.AuxInt)
 15170  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
 15171  			break
 15172  		}
 15173  		v.reset(OpARM64REV16)
 15174  		v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
 15175  		v0.AuxInt = int64ToAuxInt(0xffffffff)
 15176  		v0.AddArg(x)
 15177  		v.AddArg(v0)
 15178  		return true
 15179  	}
 15180  	// match: ( ORshiftLL [c] (SRLconst x [64-c]) x2)
 15181  	// result: (EXTRconst [64-c] x2 x)
 15182  	for {
 15183  		c := auxIntToInt64(v.AuxInt)
 15184  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
 15185  			break
 15186  		}
 15187  		x := v_0.Args[0]
 15188  		x2 := v_1
 15189  		v.reset(OpARM64EXTRconst)
 15190  		v.AuxInt = int64ToAuxInt(64 - c)
 15191  		v.AddArg2(x2, x)
 15192  		return true
 15193  	}
 15194  	// match: ( ORshiftLL <t> [c] (UBFX [bfc] x) x2)
 15195  	// cond: c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)
 15196  	// result: (EXTRWconst [32-c] x2 x)
 15197  	for {
 15198  		t := v.Type
 15199  		c := auxIntToInt64(v.AuxInt)
 15200  		if v_0.Op != OpARM64UBFX {
 15201  			break
 15202  		}
 15203  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 15204  		x := v_0.Args[0]
 15205  		x2 := v_1
 15206  		if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
 15207  			break
 15208  		}
 15209  		v.reset(OpARM64EXTRWconst)
 15210  		v.AuxInt = int64ToAuxInt(32 - c)
 15211  		v.AddArg2(x2, x)
 15212  		return true
 15213  	}
 15214  	// match: (ORshiftLL [s] (ANDconst [xc] x) (ANDconst [yc] y))
 15215  	// cond: xc == ^(yc << s) && yc & (yc+1) == 0 && yc > 0 && s+log64(yc+1) <= 64
 15216  	// result: (BFI [armBFAuxInt(s, log64(yc+1))] x y)
 15217  	for {
 15218  		s := auxIntToInt64(v.AuxInt)
 15219  		if v_0.Op != OpARM64ANDconst {
 15220  			break
 15221  		}
 15222  		xc := auxIntToInt64(v_0.AuxInt)
 15223  		x := v_0.Args[0]
 15224  		if v_1.Op != OpARM64ANDconst {
 15225  			break
 15226  		}
 15227  		yc := auxIntToInt64(v_1.AuxInt)
 15228  		y := v_1.Args[0]
 15229  		if !(xc == ^(yc<<s) && yc&(yc+1) == 0 && yc > 0 && s+log64(yc+1) <= 64) {
 15230  			break
 15231  		}
 15232  		v.reset(OpARM64BFI)
 15233  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(s, log64(yc+1)))
 15234  		v.AddArg2(x, y)
 15235  		return true
 15236  	}
 15237  	// match: (ORshiftLL [sc] (UBFX [bfc] x) (SRLconst [sc] y))
 15238  	// cond: sc == bfc.width()
 15239  	// result: (BFXIL [bfc] y x)
 15240  	for {
 15241  		sc := auxIntToInt64(v.AuxInt)
 15242  		if v_0.Op != OpARM64UBFX {
 15243  			break
 15244  		}
 15245  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 15246  		x := v_0.Args[0]
 15247  		if v_1.Op != OpARM64SRLconst || auxIntToInt64(v_1.AuxInt) != sc {
 15248  			break
 15249  		}
 15250  		y := v_1.Args[0]
 15251  		if !(sc == bfc.width()) {
 15252  			break
 15253  		}
 15254  		v.reset(OpARM64BFXIL)
 15255  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 15256  		v.AddArg2(y, x)
 15257  		return true
 15258  	}
 15259  	return false
 15260  }
 15261  func rewriteValueARM64_OpARM64ORshiftRA(v *Value) bool {
 15262  	v_1 := v.Args[1]
 15263  	v_0 := v.Args[0]
 15264  	b := v.Block
 15265  	// match: (ORshiftRA (MOVDconst [c]) x [d])
 15266  	// result: (ORconst [c] (SRAconst <x.Type> x [d]))
 15267  	for {
 15268  		d := auxIntToInt64(v.AuxInt)
 15269  		if v_0.Op != OpARM64MOVDconst {
 15270  			break
 15271  		}
 15272  		c := auxIntToInt64(v_0.AuxInt)
 15273  		x := v_1
 15274  		v.reset(OpARM64ORconst)
 15275  		v.AuxInt = int64ToAuxInt(c)
 15276  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
 15277  		v0.AuxInt = int64ToAuxInt(d)
 15278  		v0.AddArg(x)
 15279  		v.AddArg(v0)
 15280  		return true
 15281  	}
 15282  	// match: (ORshiftRA x (MOVDconst [c]) [d])
 15283  	// result: (ORconst x [c>>uint64(d)])
 15284  	for {
 15285  		d := auxIntToInt64(v.AuxInt)
 15286  		x := v_0
 15287  		if v_1.Op != OpARM64MOVDconst {
 15288  			break
 15289  		}
 15290  		c := auxIntToInt64(v_1.AuxInt)
 15291  		v.reset(OpARM64ORconst)
 15292  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 15293  		v.AddArg(x)
 15294  		return true
 15295  	}
 15296  	// match: (ORshiftRA y:(SRAconst x [c]) x [c])
 15297  	// result: y
 15298  	for {
 15299  		c := auxIntToInt64(v.AuxInt)
 15300  		y := v_0
 15301  		if y.Op != OpARM64SRAconst || auxIntToInt64(y.AuxInt) != c {
 15302  			break
 15303  		}
 15304  		x := y.Args[0]
 15305  		if x != v_1 {
 15306  			break
 15307  		}
 15308  		v.copyOf(y)
 15309  		return true
 15310  	}
 15311  	return false
 15312  }
 15313  func rewriteValueARM64_OpARM64ORshiftRL(v *Value) bool {
 15314  	v_1 := v.Args[1]
 15315  	v_0 := v.Args[0]
 15316  	b := v.Block
 15317  	// match: (ORshiftRL (MOVDconst [c]) x [d])
 15318  	// result: (ORconst [c] (SRLconst <x.Type> x [d]))
 15319  	for {
 15320  		d := auxIntToInt64(v.AuxInt)
 15321  		if v_0.Op != OpARM64MOVDconst {
 15322  			break
 15323  		}
 15324  		c := auxIntToInt64(v_0.AuxInt)
 15325  		x := v_1
 15326  		v.reset(OpARM64ORconst)
 15327  		v.AuxInt = int64ToAuxInt(c)
 15328  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
 15329  		v0.AuxInt = int64ToAuxInt(d)
 15330  		v0.AddArg(x)
 15331  		v.AddArg(v0)
 15332  		return true
 15333  	}
 15334  	// match: (ORshiftRL x (MOVDconst [c]) [d])
 15335  	// result: (ORconst x [int64(uint64(c)>>uint64(d))])
 15336  	for {
 15337  		d := auxIntToInt64(v.AuxInt)
 15338  		x := v_0
 15339  		if v_1.Op != OpARM64MOVDconst {
 15340  			break
 15341  		}
 15342  		c := auxIntToInt64(v_1.AuxInt)
 15343  		v.reset(OpARM64ORconst)
 15344  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 15345  		v.AddArg(x)
 15346  		return true
 15347  	}
 15348  	// match: (ORshiftRL y:(SRLconst x [c]) x [c])
 15349  	// result: y
 15350  	for {
 15351  		c := auxIntToInt64(v.AuxInt)
 15352  		y := v_0
 15353  		if y.Op != OpARM64SRLconst || auxIntToInt64(y.AuxInt) != c {
 15354  			break
 15355  		}
 15356  		x := y.Args[0]
 15357  		if x != v_1 {
 15358  			break
 15359  		}
 15360  		v.copyOf(y)
 15361  		return true
 15362  	}
 15363  	// match: (ORshiftRL [rc] (ANDconst [ac] x) (SLLconst [lc] y))
 15364  	// cond: lc > rc && ac == ^((1<<uint(64-lc)-1) << uint64(lc-rc))
 15365  	// result: (BFI [armBFAuxInt(lc-rc, 64-lc)] x y)
 15366  	for {
 15367  		rc := auxIntToInt64(v.AuxInt)
 15368  		if v_0.Op != OpARM64ANDconst {
 15369  			break
 15370  		}
 15371  		ac := auxIntToInt64(v_0.AuxInt)
 15372  		x := v_0.Args[0]
 15373  		if v_1.Op != OpARM64SLLconst {
 15374  			break
 15375  		}
 15376  		lc := auxIntToInt64(v_1.AuxInt)
 15377  		y := v_1.Args[0]
 15378  		if !(lc > rc && ac == ^((1<<uint(64-lc)-1)<<uint64(lc-rc))) {
 15379  			break
 15380  		}
 15381  		v.reset(OpARM64BFI)
 15382  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
 15383  		v.AddArg2(x, y)
 15384  		return true
 15385  	}
 15386  	// match: (ORshiftRL [rc] (ANDconst [ac] y) (SLLconst [lc] x))
 15387  	// cond: lc < rc && ac == ^((1<<uint(64-rc)-1))
 15388  	// result: (BFXIL [armBFAuxInt(rc-lc, 64-rc)] y x)
 15389  	for {
 15390  		rc := auxIntToInt64(v.AuxInt)
 15391  		if v_0.Op != OpARM64ANDconst {
 15392  			break
 15393  		}
 15394  		ac := auxIntToInt64(v_0.AuxInt)
 15395  		y := v_0.Args[0]
 15396  		if v_1.Op != OpARM64SLLconst {
 15397  			break
 15398  		}
 15399  		lc := auxIntToInt64(v_1.AuxInt)
 15400  		x := v_1.Args[0]
 15401  		if !(lc < rc && ac == ^(1<<uint(64-rc)-1)) {
 15402  			break
 15403  		}
 15404  		v.reset(OpARM64BFXIL)
 15405  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
 15406  		v.AddArg2(y, x)
 15407  		return true
 15408  	}
 15409  	return false
 15410  }
 15411  func rewriteValueARM64_OpARM64ORshiftRO(v *Value) bool {
 15412  	v_1 := v.Args[1]
 15413  	v_0 := v.Args[0]
 15414  	b := v.Block
 15415  	// match: (ORshiftRO (MOVDconst [c]) x [d])
 15416  	// result: (ORconst [c] (RORconst <x.Type> x [d]))
 15417  	for {
 15418  		d := auxIntToInt64(v.AuxInt)
 15419  		if v_0.Op != OpARM64MOVDconst {
 15420  			break
 15421  		}
 15422  		c := auxIntToInt64(v_0.AuxInt)
 15423  		x := v_1
 15424  		v.reset(OpARM64ORconst)
 15425  		v.AuxInt = int64ToAuxInt(c)
 15426  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
 15427  		v0.AuxInt = int64ToAuxInt(d)
 15428  		v0.AddArg(x)
 15429  		v.AddArg(v0)
 15430  		return true
 15431  	}
 15432  	// match: (ORshiftRO x (MOVDconst [c]) [d])
 15433  	// result: (ORconst x [rotateRight64(c, d)])
 15434  	for {
 15435  		d := auxIntToInt64(v.AuxInt)
 15436  		x := v_0
 15437  		if v_1.Op != OpARM64MOVDconst {
 15438  			break
 15439  		}
 15440  		c := auxIntToInt64(v_1.AuxInt)
 15441  		v.reset(OpARM64ORconst)
 15442  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
 15443  		v.AddArg(x)
 15444  		return true
 15445  	}
 15446  	// match: (ORshiftRO y:(RORconst x [c]) x [c])
 15447  	// result: y
 15448  	for {
 15449  		c := auxIntToInt64(v.AuxInt)
 15450  		y := v_0
 15451  		if y.Op != OpARM64RORconst || auxIntToInt64(y.AuxInt) != c {
 15452  			break
 15453  		}
 15454  		x := y.Args[0]
 15455  		if x != v_1 {
 15456  			break
 15457  		}
 15458  		v.copyOf(y)
 15459  		return true
 15460  	}
 15461  	return false
 15462  }
 15463  func rewriteValueARM64_OpARM64REV(v *Value) bool {
 15464  	v_0 := v.Args[0]
 15465  	// match: (REV (REV p))
 15466  	// result: p
 15467  	for {
 15468  		if v_0.Op != OpARM64REV {
 15469  			break
 15470  		}
 15471  		p := v_0.Args[0]
 15472  		v.copyOf(p)
 15473  		return true
 15474  	}
 15475  	return false
 15476  }
 15477  func rewriteValueARM64_OpARM64REVW(v *Value) bool {
 15478  	v_0 := v.Args[0]
 15479  	// match: (REVW (REVW p))
 15480  	// result: p
 15481  	for {
 15482  		if v_0.Op != OpARM64REVW {
 15483  			break
 15484  		}
 15485  		p := v_0.Args[0]
 15486  		v.copyOf(p)
 15487  		return true
 15488  	}
 15489  	return false
 15490  }
 15491  func rewriteValueARM64_OpARM64ROR(v *Value) bool {
 15492  	v_1 := v.Args[1]
 15493  	v_0 := v.Args[0]
 15494  	// match: (ROR x (MOVDconst [c]))
 15495  	// result: (RORconst x [c&63])
 15496  	for {
 15497  		x := v_0
 15498  		if v_1.Op != OpARM64MOVDconst {
 15499  			break
 15500  		}
 15501  		c := auxIntToInt64(v_1.AuxInt)
 15502  		v.reset(OpARM64RORconst)
 15503  		v.AuxInt = int64ToAuxInt(c & 63)
 15504  		v.AddArg(x)
 15505  		return true
 15506  	}
 15507  	return false
 15508  }
 15509  func rewriteValueARM64_OpARM64RORW(v *Value) bool {
 15510  	v_1 := v.Args[1]
 15511  	v_0 := v.Args[0]
 15512  	// match: (RORW x (MOVDconst [c]))
 15513  	// result: (RORWconst x [c&31])
 15514  	for {
 15515  		x := v_0
 15516  		if v_1.Op != OpARM64MOVDconst {
 15517  			break
 15518  		}
 15519  		c := auxIntToInt64(v_1.AuxInt)
 15520  		v.reset(OpARM64RORWconst)
 15521  		v.AuxInt = int64ToAuxInt(c & 31)
 15522  		v.AddArg(x)
 15523  		return true
 15524  	}
 15525  	return false
 15526  }
 15527  func rewriteValueARM64_OpARM64SBCSflags(v *Value) bool {
 15528  	v_2 := v.Args[2]
 15529  	v_1 := v.Args[1]
 15530  	v_0 := v.Args[0]
 15531  	b := v.Block
 15532  	typ := &b.Func.Config.Types
 15533  	// match: (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags (NEG <typ.UInt64> (NGCzerocarry <typ.UInt64> bo)))))
 15534  	// result: (SBCSflags x y bo)
 15535  	for {
 15536  		x := v_0
 15537  		y := v_1
 15538  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
 15539  			break
 15540  		}
 15541  		v_2_0 := v_2.Args[0]
 15542  		if v_2_0.Op != OpARM64NEGSflags {
 15543  			break
 15544  		}
 15545  		v_2_0_0 := v_2_0.Args[0]
 15546  		if v_2_0_0.Op != OpARM64NEG || v_2_0_0.Type != typ.UInt64 {
 15547  			break
 15548  		}
 15549  		v_2_0_0_0 := v_2_0_0.Args[0]
 15550  		if v_2_0_0_0.Op != OpARM64NGCzerocarry || v_2_0_0_0.Type != typ.UInt64 {
 15551  			break
 15552  		}
 15553  		bo := v_2_0_0_0.Args[0]
 15554  		v.reset(OpARM64SBCSflags)
 15555  		v.AddArg3(x, y, bo)
 15556  		return true
 15557  	}
 15558  	// match: (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags (MOVDconst [0]))))
 15559  	// result: (SUBSflags x y)
 15560  	for {
 15561  		x := v_0
 15562  		y := v_1
 15563  		if v_2.Op != OpSelect1 || v_2.Type != types.TypeFlags {
 15564  			break
 15565  		}
 15566  		v_2_0 := v_2.Args[0]
 15567  		if v_2_0.Op != OpARM64NEGSflags {
 15568  			break
 15569  		}
 15570  		v_2_0_0 := v_2_0.Args[0]
 15571  		if v_2_0_0.Op != OpARM64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
 15572  			break
 15573  		}
 15574  		v.reset(OpARM64SUBSflags)
 15575  		v.AddArg2(x, y)
 15576  		return true
 15577  	}
 15578  	return false
 15579  }
 15580  func rewriteValueARM64_OpARM64SBFX(v *Value) bool {
 15581  	v_0 := v.Args[0]
 15582  	// match: (SBFX [bfc] s:(SLLconst [sc] x))
 15583  	// cond: s.Uses == 1 && sc <= bfc.lsb()
 15584  	// result: (SBFX [armBFAuxInt(bfc.lsb() - sc, bfc.width())] x)
 15585  	for {
 15586  		bfc := auxIntToArm64BitField(v.AuxInt)
 15587  		s := v_0
 15588  		if s.Op != OpARM64SLLconst {
 15589  			break
 15590  		}
 15591  		sc := auxIntToInt64(s.AuxInt)
 15592  		x := s.Args[0]
 15593  		if !(s.Uses == 1 && sc <= bfc.lsb()) {
 15594  			break
 15595  		}
 15596  		v.reset(OpARM64SBFX)
 15597  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 15598  		v.AddArg(x)
 15599  		return true
 15600  	}
 15601  	// match: (SBFX [bfc] s:(SLLconst [sc] x))
 15602  	// cond: s.Uses == 1 && sc > bfc.lsb()
 15603  	// result: (SBFIZ [armBFAuxInt(sc - bfc.lsb(), bfc.width() - (sc-bfc.lsb()))] x)
 15604  	for {
 15605  		bfc := auxIntToArm64BitField(v.AuxInt)
 15606  		s := v_0
 15607  		if s.Op != OpARM64SLLconst {
 15608  			break
 15609  		}
 15610  		sc := auxIntToInt64(s.AuxInt)
 15611  		x := s.Args[0]
 15612  		if !(s.Uses == 1 && sc > bfc.lsb()) {
 15613  			break
 15614  		}
 15615  		v.reset(OpARM64SBFIZ)
 15616  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.width()-(sc-bfc.lsb())))
 15617  		v.AddArg(x)
 15618  		return true
 15619  	}
 15620  	return false
 15621  }
 15622  func rewriteValueARM64_OpARM64SLL(v *Value) bool {
 15623  	v_1 := v.Args[1]
 15624  	v_0 := v.Args[0]
 15625  	// match: (SLL x (MOVDconst [c]))
 15626  	// result: (SLLconst x [c&63])
 15627  	for {
 15628  		x := v_0
 15629  		if v_1.Op != OpARM64MOVDconst {
 15630  			break
 15631  		}
 15632  		c := auxIntToInt64(v_1.AuxInt)
 15633  		v.reset(OpARM64SLLconst)
 15634  		v.AuxInt = int64ToAuxInt(c & 63)
 15635  		v.AddArg(x)
 15636  		return true
 15637  	}
 15638  	// match: (SLL x (ANDconst [63] y))
 15639  	// result: (SLL x y)
 15640  	for {
 15641  		x := v_0
 15642  		if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
 15643  			break
 15644  		}
 15645  		y := v_1.Args[0]
 15646  		v.reset(OpARM64SLL)
 15647  		v.AddArg2(x, y)
 15648  		return true
 15649  	}
 15650  	return false
 15651  }
 15652  func rewriteValueARM64_OpARM64SLLconst(v *Value) bool {
 15653  	v_0 := v.Args[0]
 15654  	// match: (SLLconst [c] (MOVDconst [d]))
 15655  	// result: (MOVDconst [d<<uint64(c)])
 15656  	for {
 15657  		c := auxIntToInt64(v.AuxInt)
 15658  		if v_0.Op != OpARM64MOVDconst {
 15659  			break
 15660  		}
 15661  		d := auxIntToInt64(v_0.AuxInt)
 15662  		v.reset(OpARM64MOVDconst)
 15663  		v.AuxInt = int64ToAuxInt(d << uint64(c))
 15664  		return true
 15665  	}
 15666  	// match: (SLLconst [c] (SRLconst [c] x))
 15667  	// cond: 0 < c && c < 64
 15668  	// result: (ANDconst [^(1<<uint(c)-1)] x)
 15669  	for {
 15670  		c := auxIntToInt64(v.AuxInt)
 15671  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 15672  			break
 15673  		}
 15674  		x := v_0.Args[0]
 15675  		if !(0 < c && c < 64) {
 15676  			break
 15677  		}
 15678  		v.reset(OpARM64ANDconst)
 15679  		v.AuxInt = int64ToAuxInt(^(1<<uint(c) - 1))
 15680  		v.AddArg(x)
 15681  		return true
 15682  	}
 15683  	// match: (SLLconst [lc] (MOVWreg x))
 15684  	// result: (SBFIZ [armBFAuxInt(lc, min(32, 64-lc))] x)
 15685  	for {
 15686  		lc := auxIntToInt64(v.AuxInt)
 15687  		if v_0.Op != OpARM64MOVWreg {
 15688  			break
 15689  		}
 15690  		x := v_0.Args[0]
 15691  		v.reset(OpARM64SBFIZ)
 15692  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(32, 64-lc)))
 15693  		v.AddArg(x)
 15694  		return true
 15695  	}
 15696  	// match: (SLLconst [lc] (MOVHreg x))
 15697  	// result: (SBFIZ [armBFAuxInt(lc, min(16, 64-lc))] x)
 15698  	for {
 15699  		lc := auxIntToInt64(v.AuxInt)
 15700  		if v_0.Op != OpARM64MOVHreg {
 15701  			break
 15702  		}
 15703  		x := v_0.Args[0]
 15704  		v.reset(OpARM64SBFIZ)
 15705  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(16, 64-lc)))
 15706  		v.AddArg(x)
 15707  		return true
 15708  	}
 15709  	// match: (SLLconst [lc] (MOVBreg x))
 15710  	// result: (SBFIZ [armBFAuxInt(lc, min(8, 64-lc))] x)
 15711  	for {
 15712  		lc := auxIntToInt64(v.AuxInt)
 15713  		if v_0.Op != OpARM64MOVBreg {
 15714  			break
 15715  		}
 15716  		x := v_0.Args[0]
 15717  		v.reset(OpARM64SBFIZ)
 15718  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(8, 64-lc)))
 15719  		v.AddArg(x)
 15720  		return true
 15721  	}
 15722  	// match: (SLLconst [lc] (MOVWUreg x))
 15723  	// result: (UBFIZ [armBFAuxInt(lc, min(32, 64-lc))] x)
 15724  	for {
 15725  		lc := auxIntToInt64(v.AuxInt)
 15726  		if v_0.Op != OpARM64MOVWUreg {
 15727  			break
 15728  		}
 15729  		x := v_0.Args[0]
 15730  		v.reset(OpARM64UBFIZ)
 15731  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(32, 64-lc)))
 15732  		v.AddArg(x)
 15733  		return true
 15734  	}
 15735  	// match: (SLLconst [lc] (MOVHUreg x))
 15736  	// result: (UBFIZ [armBFAuxInt(lc, min(16, 64-lc))] x)
 15737  	for {
 15738  		lc := auxIntToInt64(v.AuxInt)
 15739  		if v_0.Op != OpARM64MOVHUreg {
 15740  			break
 15741  		}
 15742  		x := v_0.Args[0]
 15743  		v.reset(OpARM64UBFIZ)
 15744  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(16, 64-lc)))
 15745  		v.AddArg(x)
 15746  		return true
 15747  	}
 15748  	// match: (SLLconst [lc] (MOVBUreg x))
 15749  	// result: (UBFIZ [armBFAuxInt(lc, min(8, 64-lc))] x)
 15750  	for {
 15751  		lc := auxIntToInt64(v.AuxInt)
 15752  		if v_0.Op != OpARM64MOVBUreg {
 15753  			break
 15754  		}
 15755  		x := v_0.Args[0]
 15756  		v.reset(OpARM64UBFIZ)
 15757  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc, min(8, 64-lc)))
 15758  		v.AddArg(x)
 15759  		return true
 15760  	}
 15761  	// match: (SLLconst [sc] (ANDconst [ac] x))
 15762  	// cond: isARM64BFMask(sc, ac, 0)
 15763  	// result: (UBFIZ [armBFAuxInt(sc, arm64BFWidth(ac, 0))] x)
 15764  	for {
 15765  		sc := auxIntToInt64(v.AuxInt)
 15766  		if v_0.Op != OpARM64ANDconst {
 15767  			break
 15768  		}
 15769  		ac := auxIntToInt64(v_0.AuxInt)
 15770  		x := v_0.Args[0]
 15771  		if !(isARM64BFMask(sc, ac, 0)) {
 15772  			break
 15773  		}
 15774  		v.reset(OpARM64UBFIZ)
 15775  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, 0)))
 15776  		v.AddArg(x)
 15777  		return true
 15778  	}
 15779  	// match: (SLLconst [sc] (UBFIZ [bfc] x))
 15780  	// cond: sc+bfc.width()+bfc.lsb() < 64
 15781  	// result: (UBFIZ [armBFAuxInt(bfc.lsb()+sc, bfc.width())] x)
 15782  	for {
 15783  		sc := auxIntToInt64(v.AuxInt)
 15784  		if v_0.Op != OpARM64UBFIZ {
 15785  			break
 15786  		}
 15787  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 15788  		x := v_0.Args[0]
 15789  		if !(sc+bfc.width()+bfc.lsb() < 64) {
 15790  			break
 15791  		}
 15792  		v.reset(OpARM64UBFIZ)
 15793  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()))
 15794  		v.AddArg(x)
 15795  		return true
 15796  	}
 15797  	return false
 15798  }
 15799  func rewriteValueARM64_OpARM64SRA(v *Value) bool {
 15800  	v_1 := v.Args[1]
 15801  	v_0 := v.Args[0]
 15802  	// match: (SRA x (MOVDconst [c]))
 15803  	// result: (SRAconst x [c&63])
 15804  	for {
 15805  		x := v_0
 15806  		if v_1.Op != OpARM64MOVDconst {
 15807  			break
 15808  		}
 15809  		c := auxIntToInt64(v_1.AuxInt)
 15810  		v.reset(OpARM64SRAconst)
 15811  		v.AuxInt = int64ToAuxInt(c & 63)
 15812  		v.AddArg(x)
 15813  		return true
 15814  	}
 15815  	// match: (SRA x (ANDconst [63] y))
 15816  	// result: (SRA x y)
 15817  	for {
 15818  		x := v_0
 15819  		if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
 15820  			break
 15821  		}
 15822  		y := v_1.Args[0]
 15823  		v.reset(OpARM64SRA)
 15824  		v.AddArg2(x, y)
 15825  		return true
 15826  	}
 15827  	return false
 15828  }
 15829  func rewriteValueARM64_OpARM64SRAconst(v *Value) bool {
 15830  	v_0 := v.Args[0]
 15831  	// match: (SRAconst [c] (MOVDconst [d]))
 15832  	// result: (MOVDconst [d>>uint64(c)])
 15833  	for {
 15834  		c := auxIntToInt64(v.AuxInt)
 15835  		if v_0.Op != OpARM64MOVDconst {
 15836  			break
 15837  		}
 15838  		d := auxIntToInt64(v_0.AuxInt)
 15839  		v.reset(OpARM64MOVDconst)
 15840  		v.AuxInt = int64ToAuxInt(d >> uint64(c))
 15841  		return true
 15842  	}
 15843  	// match: (SRAconst [rc] (SLLconst [lc] x))
 15844  	// cond: lc > rc
 15845  	// result: (SBFIZ [armBFAuxInt(lc-rc, 64-lc)] x)
 15846  	for {
 15847  		rc := auxIntToInt64(v.AuxInt)
 15848  		if v_0.Op != OpARM64SLLconst {
 15849  			break
 15850  		}
 15851  		lc := auxIntToInt64(v_0.AuxInt)
 15852  		x := v_0.Args[0]
 15853  		if !(lc > rc) {
 15854  			break
 15855  		}
 15856  		v.reset(OpARM64SBFIZ)
 15857  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
 15858  		v.AddArg(x)
 15859  		return true
 15860  	}
 15861  	// match: (SRAconst [rc] (SLLconst [lc] x))
 15862  	// cond: lc <= rc
 15863  	// result: (SBFX [armBFAuxInt(rc-lc, 64-rc)] x)
 15864  	for {
 15865  		rc := auxIntToInt64(v.AuxInt)
 15866  		if v_0.Op != OpARM64SLLconst {
 15867  			break
 15868  		}
 15869  		lc := auxIntToInt64(v_0.AuxInt)
 15870  		x := v_0.Args[0]
 15871  		if !(lc <= rc) {
 15872  			break
 15873  		}
 15874  		v.reset(OpARM64SBFX)
 15875  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
 15876  		v.AddArg(x)
 15877  		return true
 15878  	}
 15879  	// match: (SRAconst [rc] (MOVWreg x))
 15880  	// cond: rc < 32
 15881  	// result: (SBFX [armBFAuxInt(rc, 32-rc)] x)
 15882  	for {
 15883  		rc := auxIntToInt64(v.AuxInt)
 15884  		if v_0.Op != OpARM64MOVWreg {
 15885  			break
 15886  		}
 15887  		x := v_0.Args[0]
 15888  		if !(rc < 32) {
 15889  			break
 15890  		}
 15891  		v.reset(OpARM64SBFX)
 15892  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32-rc))
 15893  		v.AddArg(x)
 15894  		return true
 15895  	}
 15896  	// match: (SRAconst [rc] (MOVHreg x))
 15897  	// cond: rc < 16
 15898  	// result: (SBFX [armBFAuxInt(rc, 16-rc)] x)
 15899  	for {
 15900  		rc := auxIntToInt64(v.AuxInt)
 15901  		if v_0.Op != OpARM64MOVHreg {
 15902  			break
 15903  		}
 15904  		x := v_0.Args[0]
 15905  		if !(rc < 16) {
 15906  			break
 15907  		}
 15908  		v.reset(OpARM64SBFX)
 15909  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16-rc))
 15910  		v.AddArg(x)
 15911  		return true
 15912  	}
 15913  	// match: (SRAconst [rc] (MOVBreg x))
 15914  	// cond: rc < 8
 15915  	// result: (SBFX [armBFAuxInt(rc, 8-rc)] x)
 15916  	for {
 15917  		rc := auxIntToInt64(v.AuxInt)
 15918  		if v_0.Op != OpARM64MOVBreg {
 15919  			break
 15920  		}
 15921  		x := v_0.Args[0]
 15922  		if !(rc < 8) {
 15923  			break
 15924  		}
 15925  		v.reset(OpARM64SBFX)
 15926  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8-rc))
 15927  		v.AddArg(x)
 15928  		return true
 15929  	}
 15930  	// match: (SRAconst [sc] (SBFIZ [bfc] x))
 15931  	// cond: sc < bfc.lsb()
 15932  	// result: (SBFIZ [armBFAuxInt(bfc.lsb()-sc, bfc.width())] x)
 15933  	for {
 15934  		sc := auxIntToInt64(v.AuxInt)
 15935  		if v_0.Op != OpARM64SBFIZ {
 15936  			break
 15937  		}
 15938  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 15939  		x := v_0.Args[0]
 15940  		if !(sc < bfc.lsb()) {
 15941  			break
 15942  		}
 15943  		v.reset(OpARM64SBFIZ)
 15944  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 15945  		v.AddArg(x)
 15946  		return true
 15947  	}
 15948  	// match: (SRAconst [sc] (SBFIZ [bfc] x))
 15949  	// cond: sc >= bfc.lsb() && sc < bfc.lsb()+bfc.width()
 15950  	// result: (SBFX [armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc)] x)
 15951  	for {
 15952  		sc := auxIntToInt64(v.AuxInt)
 15953  		if v_0.Op != OpARM64SBFIZ {
 15954  			break
 15955  		}
 15956  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 15957  		x := v_0.Args[0]
 15958  		if !(sc >= bfc.lsb() && sc < bfc.lsb()+bfc.width()) {
 15959  			break
 15960  		}
 15961  		v.reset(OpARM64SBFX)
 15962  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc))
 15963  		v.AddArg(x)
 15964  		return true
 15965  	}
 15966  	return false
 15967  }
 15968  func rewriteValueARM64_OpARM64SRL(v *Value) bool {
 15969  	v_1 := v.Args[1]
 15970  	v_0 := v.Args[0]
 15971  	// match: (SRL x (MOVDconst [c]))
 15972  	// result: (SRLconst x [c&63])
 15973  	for {
 15974  		x := v_0
 15975  		if v_1.Op != OpARM64MOVDconst {
 15976  			break
 15977  		}
 15978  		c := auxIntToInt64(v_1.AuxInt)
 15979  		v.reset(OpARM64SRLconst)
 15980  		v.AuxInt = int64ToAuxInt(c & 63)
 15981  		v.AddArg(x)
 15982  		return true
 15983  	}
 15984  	// match: (SRL x (ANDconst [63] y))
 15985  	// result: (SRL x y)
 15986  	for {
 15987  		x := v_0
 15988  		if v_1.Op != OpARM64ANDconst || auxIntToInt64(v_1.AuxInt) != 63 {
 15989  			break
 15990  		}
 15991  		y := v_1.Args[0]
 15992  		v.reset(OpARM64SRL)
 15993  		v.AddArg2(x, y)
 15994  		return true
 15995  	}
 15996  	return false
 15997  }
 15998  func rewriteValueARM64_OpARM64SRLconst(v *Value) bool {
 15999  	v_0 := v.Args[0]
 16000  	// match: (SRLconst [c] (MOVDconst [d]))
 16001  	// result: (MOVDconst [int64(uint64(d)>>uint64(c))])
 16002  	for {
 16003  		c := auxIntToInt64(v.AuxInt)
 16004  		if v_0.Op != OpARM64MOVDconst {
 16005  			break
 16006  		}
 16007  		d := auxIntToInt64(v_0.AuxInt)
 16008  		v.reset(OpARM64MOVDconst)
 16009  		v.AuxInt = int64ToAuxInt(int64(uint64(d) >> uint64(c)))
 16010  		return true
 16011  	}
 16012  	// match: (SRLconst [c] (SLLconst [c] x))
 16013  	// cond: 0 < c && c < 64
 16014  	// result: (ANDconst [1<<uint(64-c)-1] x)
 16015  	for {
 16016  		c := auxIntToInt64(v.AuxInt)
 16017  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 16018  			break
 16019  		}
 16020  		x := v_0.Args[0]
 16021  		if !(0 < c && c < 64) {
 16022  			break
 16023  		}
 16024  		v.reset(OpARM64ANDconst)
 16025  		v.AuxInt = int64ToAuxInt(1<<uint(64-c) - 1)
 16026  		v.AddArg(x)
 16027  		return true
 16028  	}
 16029  	// match: (SRLconst [rc] (MOVWUreg x))
 16030  	// cond: rc >= 32
 16031  	// result: (MOVDconst [0])
 16032  	for {
 16033  		rc := auxIntToInt64(v.AuxInt)
 16034  		if v_0.Op != OpARM64MOVWUreg {
 16035  			break
 16036  		}
 16037  		if !(rc >= 32) {
 16038  			break
 16039  		}
 16040  		v.reset(OpARM64MOVDconst)
 16041  		v.AuxInt = int64ToAuxInt(0)
 16042  		return true
 16043  	}
 16044  	// match: (SRLconst [rc] (MOVHUreg x))
 16045  	// cond: rc >= 16
 16046  	// result: (MOVDconst [0])
 16047  	for {
 16048  		rc := auxIntToInt64(v.AuxInt)
 16049  		if v_0.Op != OpARM64MOVHUreg {
 16050  			break
 16051  		}
 16052  		if !(rc >= 16) {
 16053  			break
 16054  		}
 16055  		v.reset(OpARM64MOVDconst)
 16056  		v.AuxInt = int64ToAuxInt(0)
 16057  		return true
 16058  	}
 16059  	// match: (SRLconst [rc] (MOVBUreg x))
 16060  	// cond: rc >= 8
 16061  	// result: (MOVDconst [0])
 16062  	for {
 16063  		rc := auxIntToInt64(v.AuxInt)
 16064  		if v_0.Op != OpARM64MOVBUreg {
 16065  			break
 16066  		}
 16067  		if !(rc >= 8) {
 16068  			break
 16069  		}
 16070  		v.reset(OpARM64MOVDconst)
 16071  		v.AuxInt = int64ToAuxInt(0)
 16072  		return true
 16073  	}
 16074  	// match: (SRLconst [rc] (SLLconst [lc] x))
 16075  	// cond: lc > rc
 16076  	// result: (UBFIZ [armBFAuxInt(lc-rc, 64-lc)] x)
 16077  	for {
 16078  		rc := auxIntToInt64(v.AuxInt)
 16079  		if v_0.Op != OpARM64SLLconst {
 16080  			break
 16081  		}
 16082  		lc := auxIntToInt64(v_0.AuxInt)
 16083  		x := v_0.Args[0]
 16084  		if !(lc > rc) {
 16085  			break
 16086  		}
 16087  		v.reset(OpARM64UBFIZ)
 16088  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(lc-rc, 64-lc))
 16089  		v.AddArg(x)
 16090  		return true
 16091  	}
 16092  	// match: (SRLconst [rc] (SLLconst [lc] x))
 16093  	// cond: lc < rc
 16094  	// result: (UBFX [armBFAuxInt(rc-lc, 64-rc)] x)
 16095  	for {
 16096  		rc := auxIntToInt64(v.AuxInt)
 16097  		if v_0.Op != OpARM64SLLconst {
 16098  			break
 16099  		}
 16100  		lc := auxIntToInt64(v_0.AuxInt)
 16101  		x := v_0.Args[0]
 16102  		if !(lc < rc) {
 16103  			break
 16104  		}
 16105  		v.reset(OpARM64UBFX)
 16106  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc-lc, 64-rc))
 16107  		v.AddArg(x)
 16108  		return true
 16109  	}
 16110  	// match: (SRLconst [rc] (MOVWUreg x))
 16111  	// cond: rc < 32
 16112  	// result: (UBFX [armBFAuxInt(rc, 32-rc)] x)
 16113  	for {
 16114  		rc := auxIntToInt64(v.AuxInt)
 16115  		if v_0.Op != OpARM64MOVWUreg {
 16116  			break
 16117  		}
 16118  		x := v_0.Args[0]
 16119  		if !(rc < 32) {
 16120  			break
 16121  		}
 16122  		v.reset(OpARM64UBFX)
 16123  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 32-rc))
 16124  		v.AddArg(x)
 16125  		return true
 16126  	}
 16127  	// match: (SRLconst [rc] (MOVHUreg x))
 16128  	// cond: rc < 16
 16129  	// result: (UBFX [armBFAuxInt(rc, 16-rc)] x)
 16130  	for {
 16131  		rc := auxIntToInt64(v.AuxInt)
 16132  		if v_0.Op != OpARM64MOVHUreg {
 16133  			break
 16134  		}
 16135  		x := v_0.Args[0]
 16136  		if !(rc < 16) {
 16137  			break
 16138  		}
 16139  		v.reset(OpARM64UBFX)
 16140  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 16-rc))
 16141  		v.AddArg(x)
 16142  		return true
 16143  	}
 16144  	// match: (SRLconst [rc] (MOVBUreg x))
 16145  	// cond: rc < 8
 16146  	// result: (UBFX [armBFAuxInt(rc, 8-rc)] x)
 16147  	for {
 16148  		rc := auxIntToInt64(v.AuxInt)
 16149  		if v_0.Op != OpARM64MOVBUreg {
 16150  			break
 16151  		}
 16152  		x := v_0.Args[0]
 16153  		if !(rc < 8) {
 16154  			break
 16155  		}
 16156  		v.reset(OpARM64UBFX)
 16157  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(rc, 8-rc))
 16158  		v.AddArg(x)
 16159  		return true
 16160  	}
 16161  	// match: (SRLconst [sc] (ANDconst [ac] x))
 16162  	// cond: isARM64BFMask(sc, ac, sc)
 16163  	// result: (UBFX [armBFAuxInt(sc, arm64BFWidth(ac, sc))] x)
 16164  	for {
 16165  		sc := auxIntToInt64(v.AuxInt)
 16166  		if v_0.Op != OpARM64ANDconst {
 16167  			break
 16168  		}
 16169  		ac := auxIntToInt64(v_0.AuxInt)
 16170  		x := v_0.Args[0]
 16171  		if !(isARM64BFMask(sc, ac, sc)) {
 16172  			break
 16173  		}
 16174  		v.reset(OpARM64UBFX)
 16175  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc, arm64BFWidth(ac, sc)))
 16176  		v.AddArg(x)
 16177  		return true
 16178  	}
 16179  	// match: (SRLconst [sc] (UBFX [bfc] x))
 16180  	// cond: sc < bfc.width()
 16181  	// result: (UBFX [armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc)] x)
 16182  	for {
 16183  		sc := auxIntToInt64(v.AuxInt)
 16184  		if v_0.Op != OpARM64UBFX {
 16185  			break
 16186  		}
 16187  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 16188  		x := v_0.Args[0]
 16189  		if !(sc < bfc.width()) {
 16190  			break
 16191  		}
 16192  		v.reset(OpARM64UBFX)
 16193  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc))
 16194  		v.AddArg(x)
 16195  		return true
 16196  	}
 16197  	// match: (SRLconst [sc] (UBFIZ [bfc] x))
 16198  	// cond: sc == bfc.lsb()
 16199  	// result: (ANDconst [1<<uint(bfc.width())-1] x)
 16200  	for {
 16201  		sc := auxIntToInt64(v.AuxInt)
 16202  		if v_0.Op != OpARM64UBFIZ {
 16203  			break
 16204  		}
 16205  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 16206  		x := v_0.Args[0]
 16207  		if !(sc == bfc.lsb()) {
 16208  			break
 16209  		}
 16210  		v.reset(OpARM64ANDconst)
 16211  		v.AuxInt = int64ToAuxInt(1<<uint(bfc.width()) - 1)
 16212  		v.AddArg(x)
 16213  		return true
 16214  	}
 16215  	// match: (SRLconst [sc] (UBFIZ [bfc] x))
 16216  	// cond: sc < bfc.lsb()
 16217  	// result: (UBFIZ [armBFAuxInt(bfc.lsb()-sc, bfc.width())] x)
 16218  	for {
 16219  		sc := auxIntToInt64(v.AuxInt)
 16220  		if v_0.Op != OpARM64UBFIZ {
 16221  			break
 16222  		}
 16223  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 16224  		x := v_0.Args[0]
 16225  		if !(sc < bfc.lsb()) {
 16226  			break
 16227  		}
 16228  		v.reset(OpARM64UBFIZ)
 16229  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 16230  		v.AddArg(x)
 16231  		return true
 16232  	}
 16233  	// match: (SRLconst [sc] (UBFIZ [bfc] x))
 16234  	// cond: sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()
 16235  	// result: (UBFX [armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc)] x)
 16236  	for {
 16237  		sc := auxIntToInt64(v.AuxInt)
 16238  		if v_0.Op != OpARM64UBFIZ {
 16239  			break
 16240  		}
 16241  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 16242  		x := v_0.Args[0]
 16243  		if !(sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()) {
 16244  			break
 16245  		}
 16246  		v.reset(OpARM64UBFX)
 16247  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc))
 16248  		v.AddArg(x)
 16249  		return true
 16250  	}
 16251  	return false
 16252  }
 16253  func rewriteValueARM64_OpARM64STP(v *Value) bool {
 16254  	v_3 := v.Args[3]
 16255  	v_2 := v.Args[2]
 16256  	v_1 := v.Args[1]
 16257  	v_0 := v.Args[0]
 16258  	b := v.Block
 16259  	config := b.Func.Config
 16260  	// match: (STP [off1] {sym} (ADDconst [off2] ptr) val1 val2 mem)
 16261  	// cond: is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 16262  	// result: (STP [off1+int32(off2)] {sym} ptr val1 val2 mem)
 16263  	for {
 16264  		off1 := auxIntToInt32(v.AuxInt)
 16265  		sym := auxToSym(v.Aux)
 16266  		if v_0.Op != OpARM64ADDconst {
 16267  			break
 16268  		}
 16269  		off2 := auxIntToInt64(v_0.AuxInt)
 16270  		ptr := v_0.Args[0]
 16271  		val1 := v_1
 16272  		val2 := v_2
 16273  		mem := v_3
 16274  		if !(is32Bit(int64(off1)+off2) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 16275  			break
 16276  		}
 16277  		v.reset(OpARM64STP)
 16278  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 16279  		v.Aux = symToAux(sym)
 16280  		v.AddArg4(ptr, val1, val2, mem)
 16281  		return true
 16282  	}
 16283  	// match: (STP [off1] {sym1} (MOVDaddr [off2] {sym2} ptr) val1 val2 mem)
 16284  	// cond: canMergeSym(sym1,sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)
 16285  	// result: (STP [off1+off2] {mergeSym(sym1,sym2)} ptr val1 val2 mem)
 16286  	for {
 16287  		off1 := auxIntToInt32(v.AuxInt)
 16288  		sym1 := auxToSym(v.Aux)
 16289  		if v_0.Op != OpARM64MOVDaddr {
 16290  			break
 16291  		}
 16292  		off2 := auxIntToInt32(v_0.AuxInt)
 16293  		sym2 := auxToSym(v_0.Aux)
 16294  		ptr := v_0.Args[0]
 16295  		val1 := v_1
 16296  		val2 := v_2
 16297  		mem := v_3
 16298  		if !(canMergeSym(sym1, sym2) && is32Bit(int64(off1)+int64(off2)) && (ptr.Op != OpSB || !config.ctxt.Flag_dynlink)) {
 16299  			break
 16300  		}
 16301  		v.reset(OpARM64STP)
 16302  		v.AuxInt = int32ToAuxInt(off1 + off2)
 16303  		v.Aux = symToAux(mergeSym(sym1, sym2))
 16304  		v.AddArg4(ptr, val1, val2, mem)
 16305  		return true
 16306  	}
 16307  	// match: (STP [off] {sym} ptr (MOVDconst [0]) (MOVDconst [0]) mem)
 16308  	// result: (MOVQstorezero [off] {sym} ptr mem)
 16309  	for {
 16310  		off := auxIntToInt32(v.AuxInt)
 16311  		sym := auxToSym(v.Aux)
 16312  		ptr := v_0
 16313  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 || v_2.Op != OpARM64MOVDconst || auxIntToInt64(v_2.AuxInt) != 0 {
 16314  			break
 16315  		}
 16316  		mem := v_3
 16317  		v.reset(OpARM64MOVQstorezero)
 16318  		v.AuxInt = int32ToAuxInt(off)
 16319  		v.Aux = symToAux(sym)
 16320  		v.AddArg2(ptr, mem)
 16321  		return true
 16322  	}
 16323  	return false
 16324  }
 16325  func rewriteValueARM64_OpARM64SUB(v *Value) bool {
 16326  	v_1 := v.Args[1]
 16327  	v_0 := v.Args[0]
 16328  	b := v.Block
 16329  	// match: (SUB x (MOVDconst [c]))
 16330  	// result: (SUBconst [c] x)
 16331  	for {
 16332  		x := v_0
 16333  		if v_1.Op != OpARM64MOVDconst {
 16334  			break
 16335  		}
 16336  		c := auxIntToInt64(v_1.AuxInt)
 16337  		v.reset(OpARM64SUBconst)
 16338  		v.AuxInt = int64ToAuxInt(c)
 16339  		v.AddArg(x)
 16340  		return true
 16341  	}
 16342  	// match: (SUB a l:(MUL x y))
 16343  	// cond: l.Uses==1 && clobber(l)
 16344  	// result: (MSUB a x y)
 16345  	for {
 16346  		a := v_0
 16347  		l := v_1
 16348  		if l.Op != OpARM64MUL {
 16349  			break
 16350  		}
 16351  		y := l.Args[1]
 16352  		x := l.Args[0]
 16353  		if !(l.Uses == 1 && clobber(l)) {
 16354  			break
 16355  		}
 16356  		v.reset(OpARM64MSUB)
 16357  		v.AddArg3(a, x, y)
 16358  		return true
 16359  	}
 16360  	// match: (SUB a l:(MNEG x y))
 16361  	// cond: l.Uses==1 && clobber(l)
 16362  	// result: (MADD a x y)
 16363  	for {
 16364  		a := v_0
 16365  		l := v_1
 16366  		if l.Op != OpARM64MNEG {
 16367  			break
 16368  		}
 16369  		y := l.Args[1]
 16370  		x := l.Args[0]
 16371  		if !(l.Uses == 1 && clobber(l)) {
 16372  			break
 16373  		}
 16374  		v.reset(OpARM64MADD)
 16375  		v.AddArg3(a, x, y)
 16376  		return true
 16377  	}
 16378  	// match: (SUB a l:(MULW x y))
 16379  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
 16380  	// result: (MSUBW a x y)
 16381  	for {
 16382  		a := v_0
 16383  		l := v_1
 16384  		if l.Op != OpARM64MULW {
 16385  			break
 16386  		}
 16387  		y := l.Args[1]
 16388  		x := l.Args[0]
 16389  		if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
 16390  			break
 16391  		}
 16392  		v.reset(OpARM64MSUBW)
 16393  		v.AddArg3(a, x, y)
 16394  		return true
 16395  	}
 16396  	// match: (SUB a l:(MNEGW x y))
 16397  	// cond: v.Type.Size() <= 4 && l.Uses==1 && clobber(l)
 16398  	// result: (MADDW a x y)
 16399  	for {
 16400  		a := v_0
 16401  		l := v_1
 16402  		if l.Op != OpARM64MNEGW {
 16403  			break
 16404  		}
 16405  		y := l.Args[1]
 16406  		x := l.Args[0]
 16407  		if !(v.Type.Size() <= 4 && l.Uses == 1 && clobber(l)) {
 16408  			break
 16409  		}
 16410  		v.reset(OpARM64MADDW)
 16411  		v.AddArg3(a, x, y)
 16412  		return true
 16413  	}
 16414  	// match: (SUB x x)
 16415  	// result: (MOVDconst [0])
 16416  	for {
 16417  		x := v_0
 16418  		if x != v_1 {
 16419  			break
 16420  		}
 16421  		v.reset(OpARM64MOVDconst)
 16422  		v.AuxInt = int64ToAuxInt(0)
 16423  		return true
 16424  	}
 16425  	// match: (SUB x (SUB y z))
 16426  	// result: (SUB (ADD <v.Type> x z) y)
 16427  	for {
 16428  		x := v_0
 16429  		if v_1.Op != OpARM64SUB {
 16430  			break
 16431  		}
 16432  		z := v_1.Args[1]
 16433  		y := v_1.Args[0]
 16434  		v.reset(OpARM64SUB)
 16435  		v0 := b.NewValue0(v.Pos, OpARM64ADD, v.Type)
 16436  		v0.AddArg2(x, z)
 16437  		v.AddArg2(v0, y)
 16438  		return true
 16439  	}
 16440  	// match: (SUB (SUB x y) z)
 16441  	// result: (SUB x (ADD <y.Type> y z))
 16442  	for {
 16443  		if v_0.Op != OpARM64SUB {
 16444  			break
 16445  		}
 16446  		y := v_0.Args[1]
 16447  		x := v_0.Args[0]
 16448  		z := v_1
 16449  		v.reset(OpARM64SUB)
 16450  		v0 := b.NewValue0(v.Pos, OpARM64ADD, y.Type)
 16451  		v0.AddArg2(y, z)
 16452  		v.AddArg2(x, v0)
 16453  		return true
 16454  	}
 16455  	// match: (SUB x0 x1:(SLLconst [c] y))
 16456  	// cond: clobberIfDead(x1)
 16457  	// result: (SUBshiftLL x0 y [c])
 16458  	for {
 16459  		x0 := v_0
 16460  		x1 := v_1
 16461  		if x1.Op != OpARM64SLLconst {
 16462  			break
 16463  		}
 16464  		c := auxIntToInt64(x1.AuxInt)
 16465  		y := x1.Args[0]
 16466  		if !(clobberIfDead(x1)) {
 16467  			break
 16468  		}
 16469  		v.reset(OpARM64SUBshiftLL)
 16470  		v.AuxInt = int64ToAuxInt(c)
 16471  		v.AddArg2(x0, y)
 16472  		return true
 16473  	}
 16474  	// match: (SUB x0 x1:(SRLconst [c] y))
 16475  	// cond: clobberIfDead(x1)
 16476  	// result: (SUBshiftRL x0 y [c])
 16477  	for {
 16478  		x0 := v_0
 16479  		x1 := v_1
 16480  		if x1.Op != OpARM64SRLconst {
 16481  			break
 16482  		}
 16483  		c := auxIntToInt64(x1.AuxInt)
 16484  		y := x1.Args[0]
 16485  		if !(clobberIfDead(x1)) {
 16486  			break
 16487  		}
 16488  		v.reset(OpARM64SUBshiftRL)
 16489  		v.AuxInt = int64ToAuxInt(c)
 16490  		v.AddArg2(x0, y)
 16491  		return true
 16492  	}
 16493  	// match: (SUB x0 x1:(SRAconst [c] y))
 16494  	// cond: clobberIfDead(x1)
 16495  	// result: (SUBshiftRA x0 y [c])
 16496  	for {
 16497  		x0 := v_0
 16498  		x1 := v_1
 16499  		if x1.Op != OpARM64SRAconst {
 16500  			break
 16501  		}
 16502  		c := auxIntToInt64(x1.AuxInt)
 16503  		y := x1.Args[0]
 16504  		if !(clobberIfDead(x1)) {
 16505  			break
 16506  		}
 16507  		v.reset(OpARM64SUBshiftRA)
 16508  		v.AuxInt = int64ToAuxInt(c)
 16509  		v.AddArg2(x0, y)
 16510  		return true
 16511  	}
 16512  	return false
 16513  }
 16514  func rewriteValueARM64_OpARM64SUBconst(v *Value) bool {
 16515  	v_0 := v.Args[0]
 16516  	// match: (SUBconst [0] x)
 16517  	// result: x
 16518  	for {
 16519  		if auxIntToInt64(v.AuxInt) != 0 {
 16520  			break
 16521  		}
 16522  		x := v_0
 16523  		v.copyOf(x)
 16524  		return true
 16525  	}
 16526  	// match: (SUBconst [c] (MOVDconst [d]))
 16527  	// result: (MOVDconst [d-c])
 16528  	for {
 16529  		c := auxIntToInt64(v.AuxInt)
 16530  		if v_0.Op != OpARM64MOVDconst {
 16531  			break
 16532  		}
 16533  		d := auxIntToInt64(v_0.AuxInt)
 16534  		v.reset(OpARM64MOVDconst)
 16535  		v.AuxInt = int64ToAuxInt(d - c)
 16536  		return true
 16537  	}
 16538  	// match: (SUBconst [c] (SUBconst [d] x))
 16539  	// result: (ADDconst [-c-d] x)
 16540  	for {
 16541  		c := auxIntToInt64(v.AuxInt)
 16542  		if v_0.Op != OpARM64SUBconst {
 16543  			break
 16544  		}
 16545  		d := auxIntToInt64(v_0.AuxInt)
 16546  		x := v_0.Args[0]
 16547  		v.reset(OpARM64ADDconst)
 16548  		v.AuxInt = int64ToAuxInt(-c - d)
 16549  		v.AddArg(x)
 16550  		return true
 16551  	}
 16552  	// match: (SUBconst [c] (ADDconst [d] x))
 16553  	// result: (ADDconst [-c+d] x)
 16554  	for {
 16555  		c := auxIntToInt64(v.AuxInt)
 16556  		if v_0.Op != OpARM64ADDconst {
 16557  			break
 16558  		}
 16559  		d := auxIntToInt64(v_0.AuxInt)
 16560  		x := v_0.Args[0]
 16561  		v.reset(OpARM64ADDconst)
 16562  		v.AuxInt = int64ToAuxInt(-c + d)
 16563  		v.AddArg(x)
 16564  		return true
 16565  	}
 16566  	return false
 16567  }
 16568  func rewriteValueARM64_OpARM64SUBshiftLL(v *Value) bool {
 16569  	v_1 := v.Args[1]
 16570  	v_0 := v.Args[0]
 16571  	// match: (SUBshiftLL x (MOVDconst [c]) [d])
 16572  	// result: (SUBconst x [int64(uint64(c)<<uint64(d))])
 16573  	for {
 16574  		d := auxIntToInt64(v.AuxInt)
 16575  		x := v_0
 16576  		if v_1.Op != OpARM64MOVDconst {
 16577  			break
 16578  		}
 16579  		c := auxIntToInt64(v_1.AuxInt)
 16580  		v.reset(OpARM64SUBconst)
 16581  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 16582  		v.AddArg(x)
 16583  		return true
 16584  	}
 16585  	// match: (SUBshiftLL (SLLconst x [c]) x [c])
 16586  	// result: (MOVDconst [0])
 16587  	for {
 16588  		c := auxIntToInt64(v.AuxInt)
 16589  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 16590  			break
 16591  		}
 16592  		x := v_0.Args[0]
 16593  		if x != v_1 {
 16594  			break
 16595  		}
 16596  		v.reset(OpARM64MOVDconst)
 16597  		v.AuxInt = int64ToAuxInt(0)
 16598  		return true
 16599  	}
 16600  	return false
 16601  }
 16602  func rewriteValueARM64_OpARM64SUBshiftRA(v *Value) bool {
 16603  	v_1 := v.Args[1]
 16604  	v_0 := v.Args[0]
 16605  	// match: (SUBshiftRA x (MOVDconst [c]) [d])
 16606  	// result: (SUBconst x [c>>uint64(d)])
 16607  	for {
 16608  		d := auxIntToInt64(v.AuxInt)
 16609  		x := v_0
 16610  		if v_1.Op != OpARM64MOVDconst {
 16611  			break
 16612  		}
 16613  		c := auxIntToInt64(v_1.AuxInt)
 16614  		v.reset(OpARM64SUBconst)
 16615  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 16616  		v.AddArg(x)
 16617  		return true
 16618  	}
 16619  	// match: (SUBshiftRA (SRAconst x [c]) x [c])
 16620  	// result: (MOVDconst [0])
 16621  	for {
 16622  		c := auxIntToInt64(v.AuxInt)
 16623  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
 16624  			break
 16625  		}
 16626  		x := v_0.Args[0]
 16627  		if x != v_1 {
 16628  			break
 16629  		}
 16630  		v.reset(OpARM64MOVDconst)
 16631  		v.AuxInt = int64ToAuxInt(0)
 16632  		return true
 16633  	}
 16634  	return false
 16635  }
 16636  func rewriteValueARM64_OpARM64SUBshiftRL(v *Value) bool {
 16637  	v_1 := v.Args[1]
 16638  	v_0 := v.Args[0]
 16639  	// match: (SUBshiftRL x (MOVDconst [c]) [d])
 16640  	// result: (SUBconst x [int64(uint64(c)>>uint64(d))])
 16641  	for {
 16642  		d := auxIntToInt64(v.AuxInt)
 16643  		x := v_0
 16644  		if v_1.Op != OpARM64MOVDconst {
 16645  			break
 16646  		}
 16647  		c := auxIntToInt64(v_1.AuxInt)
 16648  		v.reset(OpARM64SUBconst)
 16649  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 16650  		v.AddArg(x)
 16651  		return true
 16652  	}
 16653  	// match: (SUBshiftRL (SRLconst x [c]) x [c])
 16654  	// result: (MOVDconst [0])
 16655  	for {
 16656  		c := auxIntToInt64(v.AuxInt)
 16657  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 16658  			break
 16659  		}
 16660  		x := v_0.Args[0]
 16661  		if x != v_1 {
 16662  			break
 16663  		}
 16664  		v.reset(OpARM64MOVDconst)
 16665  		v.AuxInt = int64ToAuxInt(0)
 16666  		return true
 16667  	}
 16668  	return false
 16669  }
 16670  func rewriteValueARM64_OpARM64TST(v *Value) bool {
 16671  	v_1 := v.Args[1]
 16672  	v_0 := v.Args[0]
 16673  	// match: (TST x (MOVDconst [c]))
 16674  	// result: (TSTconst [c] x)
 16675  	for {
 16676  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16677  			x := v_0
 16678  			if v_1.Op != OpARM64MOVDconst {
 16679  				continue
 16680  			}
 16681  			c := auxIntToInt64(v_1.AuxInt)
 16682  			v.reset(OpARM64TSTconst)
 16683  			v.AuxInt = int64ToAuxInt(c)
 16684  			v.AddArg(x)
 16685  			return true
 16686  		}
 16687  		break
 16688  	}
 16689  	// match: (TST x0 x1:(SLLconst [c] y))
 16690  	// cond: clobberIfDead(x1)
 16691  	// result: (TSTshiftLL x0 y [c])
 16692  	for {
 16693  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16694  			x0 := v_0
 16695  			x1 := v_1
 16696  			if x1.Op != OpARM64SLLconst {
 16697  				continue
 16698  			}
 16699  			c := auxIntToInt64(x1.AuxInt)
 16700  			y := x1.Args[0]
 16701  			if !(clobberIfDead(x1)) {
 16702  				continue
 16703  			}
 16704  			v.reset(OpARM64TSTshiftLL)
 16705  			v.AuxInt = int64ToAuxInt(c)
 16706  			v.AddArg2(x0, y)
 16707  			return true
 16708  		}
 16709  		break
 16710  	}
 16711  	// match: (TST x0 x1:(SRLconst [c] y))
 16712  	// cond: clobberIfDead(x1)
 16713  	// result: (TSTshiftRL x0 y [c])
 16714  	for {
 16715  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16716  			x0 := v_0
 16717  			x1 := v_1
 16718  			if x1.Op != OpARM64SRLconst {
 16719  				continue
 16720  			}
 16721  			c := auxIntToInt64(x1.AuxInt)
 16722  			y := x1.Args[0]
 16723  			if !(clobberIfDead(x1)) {
 16724  				continue
 16725  			}
 16726  			v.reset(OpARM64TSTshiftRL)
 16727  			v.AuxInt = int64ToAuxInt(c)
 16728  			v.AddArg2(x0, y)
 16729  			return true
 16730  		}
 16731  		break
 16732  	}
 16733  	// match: (TST x0 x1:(SRAconst [c] y))
 16734  	// cond: clobberIfDead(x1)
 16735  	// result: (TSTshiftRA x0 y [c])
 16736  	for {
 16737  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16738  			x0 := v_0
 16739  			x1 := v_1
 16740  			if x1.Op != OpARM64SRAconst {
 16741  				continue
 16742  			}
 16743  			c := auxIntToInt64(x1.AuxInt)
 16744  			y := x1.Args[0]
 16745  			if !(clobberIfDead(x1)) {
 16746  				continue
 16747  			}
 16748  			v.reset(OpARM64TSTshiftRA)
 16749  			v.AuxInt = int64ToAuxInt(c)
 16750  			v.AddArg2(x0, y)
 16751  			return true
 16752  		}
 16753  		break
 16754  	}
 16755  	// match: (TST x0 x1:(RORconst [c] y))
 16756  	// cond: clobberIfDead(x1)
 16757  	// result: (TSTshiftRO x0 y [c])
 16758  	for {
 16759  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16760  			x0 := v_0
 16761  			x1 := v_1
 16762  			if x1.Op != OpARM64RORconst {
 16763  				continue
 16764  			}
 16765  			c := auxIntToInt64(x1.AuxInt)
 16766  			y := x1.Args[0]
 16767  			if !(clobberIfDead(x1)) {
 16768  				continue
 16769  			}
 16770  			v.reset(OpARM64TSTshiftRO)
 16771  			v.AuxInt = int64ToAuxInt(c)
 16772  			v.AddArg2(x0, y)
 16773  			return true
 16774  		}
 16775  		break
 16776  	}
 16777  	return false
 16778  }
 16779  func rewriteValueARM64_OpARM64TSTW(v *Value) bool {
 16780  	v_1 := v.Args[1]
 16781  	v_0 := v.Args[0]
 16782  	// match: (TSTW x (MOVDconst [c]))
 16783  	// result: (TSTWconst [int32(c)] x)
 16784  	for {
 16785  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 16786  			x := v_0
 16787  			if v_1.Op != OpARM64MOVDconst {
 16788  				continue
 16789  			}
 16790  			c := auxIntToInt64(v_1.AuxInt)
 16791  			v.reset(OpARM64TSTWconst)
 16792  			v.AuxInt = int32ToAuxInt(int32(c))
 16793  			v.AddArg(x)
 16794  			return true
 16795  		}
 16796  		break
 16797  	}
 16798  	return false
 16799  }
 16800  func rewriteValueARM64_OpARM64TSTWconst(v *Value) bool {
 16801  	v_0 := v.Args[0]
 16802  	// match: (TSTWconst (MOVDconst [x]) [y])
 16803  	// result: (FlagConstant [logicFlags32(int32(x)&y)])
 16804  	for {
 16805  		y := auxIntToInt32(v.AuxInt)
 16806  		if v_0.Op != OpARM64MOVDconst {
 16807  			break
 16808  		}
 16809  		x := auxIntToInt64(v_0.AuxInt)
 16810  		v.reset(OpARM64FlagConstant)
 16811  		v.AuxInt = flagConstantToAuxInt(logicFlags32(int32(x) & y))
 16812  		return true
 16813  	}
 16814  	return false
 16815  }
 16816  func rewriteValueARM64_OpARM64TSTconst(v *Value) bool {
 16817  	v_0 := v.Args[0]
 16818  	// match: (TSTconst (MOVDconst [x]) [y])
 16819  	// result: (FlagConstant [logicFlags64(x&y)])
 16820  	for {
 16821  		y := auxIntToInt64(v.AuxInt)
 16822  		if v_0.Op != OpARM64MOVDconst {
 16823  			break
 16824  		}
 16825  		x := auxIntToInt64(v_0.AuxInt)
 16826  		v.reset(OpARM64FlagConstant)
 16827  		v.AuxInt = flagConstantToAuxInt(logicFlags64(x & y))
 16828  		return true
 16829  	}
 16830  	return false
 16831  }
 16832  func rewriteValueARM64_OpARM64TSTshiftLL(v *Value) bool {
 16833  	v_1 := v.Args[1]
 16834  	v_0 := v.Args[0]
 16835  	b := v.Block
 16836  	// match: (TSTshiftLL (MOVDconst [c]) x [d])
 16837  	// result: (TSTconst [c] (SLLconst <x.Type> x [d]))
 16838  	for {
 16839  		d := auxIntToInt64(v.AuxInt)
 16840  		if v_0.Op != OpARM64MOVDconst {
 16841  			break
 16842  		}
 16843  		c := auxIntToInt64(v_0.AuxInt)
 16844  		x := v_1
 16845  		v.reset(OpARM64TSTconst)
 16846  		v.AuxInt = int64ToAuxInt(c)
 16847  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 16848  		v0.AuxInt = int64ToAuxInt(d)
 16849  		v0.AddArg(x)
 16850  		v.AddArg(v0)
 16851  		return true
 16852  	}
 16853  	// match: (TSTshiftLL x (MOVDconst [c]) [d])
 16854  	// result: (TSTconst x [int64(uint64(c)<<uint64(d))])
 16855  	for {
 16856  		d := auxIntToInt64(v.AuxInt)
 16857  		x := v_0
 16858  		if v_1.Op != OpARM64MOVDconst {
 16859  			break
 16860  		}
 16861  		c := auxIntToInt64(v_1.AuxInt)
 16862  		v.reset(OpARM64TSTconst)
 16863  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 16864  		v.AddArg(x)
 16865  		return true
 16866  	}
 16867  	return false
 16868  }
 16869  func rewriteValueARM64_OpARM64TSTshiftRA(v *Value) bool {
 16870  	v_1 := v.Args[1]
 16871  	v_0 := v.Args[0]
 16872  	b := v.Block
 16873  	// match: (TSTshiftRA (MOVDconst [c]) x [d])
 16874  	// result: (TSTconst [c] (SRAconst <x.Type> x [d]))
 16875  	for {
 16876  		d := auxIntToInt64(v.AuxInt)
 16877  		if v_0.Op != OpARM64MOVDconst {
 16878  			break
 16879  		}
 16880  		c := auxIntToInt64(v_0.AuxInt)
 16881  		x := v_1
 16882  		v.reset(OpARM64TSTconst)
 16883  		v.AuxInt = int64ToAuxInt(c)
 16884  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
 16885  		v0.AuxInt = int64ToAuxInt(d)
 16886  		v0.AddArg(x)
 16887  		v.AddArg(v0)
 16888  		return true
 16889  	}
 16890  	// match: (TSTshiftRA x (MOVDconst [c]) [d])
 16891  	// result: (TSTconst x [c>>uint64(d)])
 16892  	for {
 16893  		d := auxIntToInt64(v.AuxInt)
 16894  		x := v_0
 16895  		if v_1.Op != OpARM64MOVDconst {
 16896  			break
 16897  		}
 16898  		c := auxIntToInt64(v_1.AuxInt)
 16899  		v.reset(OpARM64TSTconst)
 16900  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 16901  		v.AddArg(x)
 16902  		return true
 16903  	}
 16904  	return false
 16905  }
 16906  func rewriteValueARM64_OpARM64TSTshiftRL(v *Value) bool {
 16907  	v_1 := v.Args[1]
 16908  	v_0 := v.Args[0]
 16909  	b := v.Block
 16910  	// match: (TSTshiftRL (MOVDconst [c]) x [d])
 16911  	// result: (TSTconst [c] (SRLconst <x.Type> x [d]))
 16912  	for {
 16913  		d := auxIntToInt64(v.AuxInt)
 16914  		if v_0.Op != OpARM64MOVDconst {
 16915  			break
 16916  		}
 16917  		c := auxIntToInt64(v_0.AuxInt)
 16918  		x := v_1
 16919  		v.reset(OpARM64TSTconst)
 16920  		v.AuxInt = int64ToAuxInt(c)
 16921  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
 16922  		v0.AuxInt = int64ToAuxInt(d)
 16923  		v0.AddArg(x)
 16924  		v.AddArg(v0)
 16925  		return true
 16926  	}
 16927  	// match: (TSTshiftRL x (MOVDconst [c]) [d])
 16928  	// result: (TSTconst x [int64(uint64(c)>>uint64(d))])
 16929  	for {
 16930  		d := auxIntToInt64(v.AuxInt)
 16931  		x := v_0
 16932  		if v_1.Op != OpARM64MOVDconst {
 16933  			break
 16934  		}
 16935  		c := auxIntToInt64(v_1.AuxInt)
 16936  		v.reset(OpARM64TSTconst)
 16937  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 16938  		v.AddArg(x)
 16939  		return true
 16940  	}
 16941  	return false
 16942  }
 16943  func rewriteValueARM64_OpARM64TSTshiftRO(v *Value) bool {
 16944  	v_1 := v.Args[1]
 16945  	v_0 := v.Args[0]
 16946  	b := v.Block
 16947  	// match: (TSTshiftRO (MOVDconst [c]) x [d])
 16948  	// result: (TSTconst [c] (RORconst <x.Type> x [d]))
 16949  	for {
 16950  		d := auxIntToInt64(v.AuxInt)
 16951  		if v_0.Op != OpARM64MOVDconst {
 16952  			break
 16953  		}
 16954  		c := auxIntToInt64(v_0.AuxInt)
 16955  		x := v_1
 16956  		v.reset(OpARM64TSTconst)
 16957  		v.AuxInt = int64ToAuxInt(c)
 16958  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
 16959  		v0.AuxInt = int64ToAuxInt(d)
 16960  		v0.AddArg(x)
 16961  		v.AddArg(v0)
 16962  		return true
 16963  	}
 16964  	// match: (TSTshiftRO x (MOVDconst [c]) [d])
 16965  	// result: (TSTconst x [rotateRight64(c, d)])
 16966  	for {
 16967  		d := auxIntToInt64(v.AuxInt)
 16968  		x := v_0
 16969  		if v_1.Op != OpARM64MOVDconst {
 16970  			break
 16971  		}
 16972  		c := auxIntToInt64(v_1.AuxInt)
 16973  		v.reset(OpARM64TSTconst)
 16974  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
 16975  		v.AddArg(x)
 16976  		return true
 16977  	}
 16978  	return false
 16979  }
 16980  func rewriteValueARM64_OpARM64UBFIZ(v *Value) bool {
 16981  	v_0 := v.Args[0]
 16982  	// match: (UBFIZ [bfc] (SLLconst [sc] x))
 16983  	// cond: sc < bfc.width()
 16984  	// result: (UBFIZ [armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc)] x)
 16985  	for {
 16986  		bfc := auxIntToArm64BitField(v.AuxInt)
 16987  		if v_0.Op != OpARM64SLLconst {
 16988  			break
 16989  		}
 16990  		sc := auxIntToInt64(v_0.AuxInt)
 16991  		x := v_0.Args[0]
 16992  		if !(sc < bfc.width()) {
 16993  			break
 16994  		}
 16995  		v.reset(OpARM64UBFIZ)
 16996  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()-sc))
 16997  		v.AddArg(x)
 16998  		return true
 16999  	}
 17000  	return false
 17001  }
 17002  func rewriteValueARM64_OpARM64UBFX(v *Value) bool {
 17003  	v_0 := v.Args[0]
 17004  	// match: (UBFX [bfc] (ANDconst [c] x))
 17005  	// cond: isARM64BFMask(0, c, 0) && bfc.lsb() + bfc.width() <= arm64BFWidth(c, 0)
 17006  	// result: (UBFX [bfc] x)
 17007  	for {
 17008  		bfc := auxIntToArm64BitField(v.AuxInt)
 17009  		if v_0.Op != OpARM64ANDconst {
 17010  			break
 17011  		}
 17012  		c := auxIntToInt64(v_0.AuxInt)
 17013  		x := v_0.Args[0]
 17014  		if !(isARM64BFMask(0, c, 0) && bfc.lsb()+bfc.width() <= arm64BFWidth(c, 0)) {
 17015  			break
 17016  		}
 17017  		v.reset(OpARM64UBFX)
 17018  		v.AuxInt = arm64BitFieldToAuxInt(bfc)
 17019  		v.AddArg(x)
 17020  		return true
 17021  	}
 17022  	// match: (UBFX [bfc] e:(MOVWUreg x))
 17023  	// cond: e.Uses == 1 && bfc.lsb() < 32
 17024  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), 32-bfc.lsb()))] x)
 17025  	for {
 17026  		bfc := auxIntToArm64BitField(v.AuxInt)
 17027  		e := v_0
 17028  		if e.Op != OpARM64MOVWUreg {
 17029  			break
 17030  		}
 17031  		x := e.Args[0]
 17032  		if !(e.Uses == 1 && bfc.lsb() < 32) {
 17033  			break
 17034  		}
 17035  		v.reset(OpARM64UBFX)
 17036  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), 32-bfc.lsb())))
 17037  		v.AddArg(x)
 17038  		return true
 17039  	}
 17040  	// match: (UBFX [bfc] e:(MOVHUreg x))
 17041  	// cond: e.Uses == 1 && bfc.lsb() < 16
 17042  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), 16-bfc.lsb()))] x)
 17043  	for {
 17044  		bfc := auxIntToArm64BitField(v.AuxInt)
 17045  		e := v_0
 17046  		if e.Op != OpARM64MOVHUreg {
 17047  			break
 17048  		}
 17049  		x := e.Args[0]
 17050  		if !(e.Uses == 1 && bfc.lsb() < 16) {
 17051  			break
 17052  		}
 17053  		v.reset(OpARM64UBFX)
 17054  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), 16-bfc.lsb())))
 17055  		v.AddArg(x)
 17056  		return true
 17057  	}
 17058  	// match: (UBFX [bfc] e:(MOVBUreg x))
 17059  	// cond: e.Uses == 1 && bfc.lsb() < 8
 17060  	// result: (UBFX [armBFAuxInt(bfc.lsb(), min(bfc.width(), 8-bfc.lsb()))] x)
 17061  	for {
 17062  		bfc := auxIntToArm64BitField(v.AuxInt)
 17063  		e := v_0
 17064  		if e.Op != OpARM64MOVBUreg {
 17065  			break
 17066  		}
 17067  		x := e.Args[0]
 17068  		if !(e.Uses == 1 && bfc.lsb() < 8) {
 17069  			break
 17070  		}
 17071  		v.reset(OpARM64UBFX)
 17072  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb(), min(bfc.width(), 8-bfc.lsb())))
 17073  		v.AddArg(x)
 17074  		return true
 17075  	}
 17076  	// match: (UBFX [bfc] (SRLconst [sc] x))
 17077  	// cond: sc+bfc.width()+bfc.lsb() < 64
 17078  	// result: (UBFX [armBFAuxInt(bfc.lsb()+sc, bfc.width())] x)
 17079  	for {
 17080  		bfc := auxIntToArm64BitField(v.AuxInt)
 17081  		if v_0.Op != OpARM64SRLconst {
 17082  			break
 17083  		}
 17084  		sc := auxIntToInt64(v_0.AuxInt)
 17085  		x := v_0.Args[0]
 17086  		if !(sc+bfc.width()+bfc.lsb() < 64) {
 17087  			break
 17088  		}
 17089  		v.reset(OpARM64UBFX)
 17090  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()+sc, bfc.width()))
 17091  		v.AddArg(x)
 17092  		return true
 17093  	}
 17094  	// match: (UBFX [bfc] (SLLconst [sc] x))
 17095  	// cond: sc == bfc.lsb()
 17096  	// result: (ANDconst [1<<uint(bfc.width())-1] x)
 17097  	for {
 17098  		bfc := auxIntToArm64BitField(v.AuxInt)
 17099  		if v_0.Op != OpARM64SLLconst {
 17100  			break
 17101  		}
 17102  		sc := auxIntToInt64(v_0.AuxInt)
 17103  		x := v_0.Args[0]
 17104  		if !(sc == bfc.lsb()) {
 17105  			break
 17106  		}
 17107  		v.reset(OpARM64ANDconst)
 17108  		v.AuxInt = int64ToAuxInt(1<<uint(bfc.width()) - 1)
 17109  		v.AddArg(x)
 17110  		return true
 17111  	}
 17112  	// match: (UBFX [bfc] (SLLconst [sc] x))
 17113  	// cond: sc < bfc.lsb()
 17114  	// result: (UBFX [armBFAuxInt(bfc.lsb()-sc, bfc.width())] x)
 17115  	for {
 17116  		bfc := auxIntToArm64BitField(v.AuxInt)
 17117  		if v_0.Op != OpARM64SLLconst {
 17118  			break
 17119  		}
 17120  		sc := auxIntToInt64(v_0.AuxInt)
 17121  		x := v_0.Args[0]
 17122  		if !(sc < bfc.lsb()) {
 17123  			break
 17124  		}
 17125  		v.reset(OpARM64UBFX)
 17126  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(bfc.lsb()-sc, bfc.width()))
 17127  		v.AddArg(x)
 17128  		return true
 17129  	}
 17130  	// match: (UBFX [bfc] (SLLconst [sc] x))
 17131  	// cond: sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()
 17132  	// result: (UBFIZ [armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc)] x)
 17133  	for {
 17134  		bfc := auxIntToArm64BitField(v.AuxInt)
 17135  		if v_0.Op != OpARM64SLLconst {
 17136  			break
 17137  		}
 17138  		sc := auxIntToInt64(v_0.AuxInt)
 17139  		x := v_0.Args[0]
 17140  		if !(sc > bfc.lsb() && sc < bfc.lsb()+bfc.width()) {
 17141  			break
 17142  		}
 17143  		v.reset(OpARM64UBFIZ)
 17144  		v.AuxInt = arm64BitFieldToAuxInt(armBFAuxInt(sc-bfc.lsb(), bfc.lsb()+bfc.width()-sc))
 17145  		v.AddArg(x)
 17146  		return true
 17147  	}
 17148  	return false
 17149  }
 17150  func rewriteValueARM64_OpARM64UDIV(v *Value) bool {
 17151  	v_1 := v.Args[1]
 17152  	v_0 := v.Args[0]
 17153  	// match: (UDIV x (MOVDconst [1]))
 17154  	// result: x
 17155  	for {
 17156  		x := v_0
 17157  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 17158  			break
 17159  		}
 17160  		v.copyOf(x)
 17161  		return true
 17162  	}
 17163  	// match: (UDIV x (MOVDconst [c]))
 17164  	// cond: isPowerOfTwo(c)
 17165  	// result: (SRLconst [log64(c)] x)
 17166  	for {
 17167  		x := v_0
 17168  		if v_1.Op != OpARM64MOVDconst {
 17169  			break
 17170  		}
 17171  		c := auxIntToInt64(v_1.AuxInt)
 17172  		if !(isPowerOfTwo(c)) {
 17173  			break
 17174  		}
 17175  		v.reset(OpARM64SRLconst)
 17176  		v.AuxInt = int64ToAuxInt(log64(c))
 17177  		v.AddArg(x)
 17178  		return true
 17179  	}
 17180  	// match: (UDIV (MOVDconst [c]) (MOVDconst [d]))
 17181  	// cond: d != 0
 17182  	// result: (MOVDconst [int64(uint64(c)/uint64(d))])
 17183  	for {
 17184  		if v_0.Op != OpARM64MOVDconst {
 17185  			break
 17186  		}
 17187  		c := auxIntToInt64(v_0.AuxInt)
 17188  		if v_1.Op != OpARM64MOVDconst {
 17189  			break
 17190  		}
 17191  		d := auxIntToInt64(v_1.AuxInt)
 17192  		if !(d != 0) {
 17193  			break
 17194  		}
 17195  		v.reset(OpARM64MOVDconst)
 17196  		v.AuxInt = int64ToAuxInt(int64(uint64(c) / uint64(d)))
 17197  		return true
 17198  	}
 17199  	return false
 17200  }
 17201  func rewriteValueARM64_OpARM64UDIVW(v *Value) bool {
 17202  	v_1 := v.Args[1]
 17203  	v_0 := v.Args[0]
 17204  	b := v.Block
 17205  	// match: (UDIVW x (MOVDconst [c]))
 17206  	// cond: uint32(c)==1
 17207  	// result: (MOVWUreg x)
 17208  	for {
 17209  		x := v_0
 17210  		if v_1.Op != OpARM64MOVDconst {
 17211  			break
 17212  		}
 17213  		c := auxIntToInt64(v_1.AuxInt)
 17214  		if !(uint32(c) == 1) {
 17215  			break
 17216  		}
 17217  		v.reset(OpARM64MOVWUreg)
 17218  		v.AddArg(x)
 17219  		return true
 17220  	}
 17221  	// match: (UDIVW x (MOVDconst [c]))
 17222  	// cond: isPowerOfTwo(c) && is32Bit(c)
 17223  	// result: (SRLconst [log64(c)] (MOVWUreg <v.Type> x))
 17224  	for {
 17225  		x := v_0
 17226  		if v_1.Op != OpARM64MOVDconst {
 17227  			break
 17228  		}
 17229  		c := auxIntToInt64(v_1.AuxInt)
 17230  		if !(isPowerOfTwo(c) && is32Bit(c)) {
 17231  			break
 17232  		}
 17233  		v.reset(OpARM64SRLconst)
 17234  		v.AuxInt = int64ToAuxInt(log64(c))
 17235  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUreg, v.Type)
 17236  		v0.AddArg(x)
 17237  		v.AddArg(v0)
 17238  		return true
 17239  	}
 17240  	// match: (UDIVW (MOVDconst [c]) (MOVDconst [d]))
 17241  	// cond: d != 0
 17242  	// result: (MOVDconst [int64(uint32(c)/uint32(d))])
 17243  	for {
 17244  		if v_0.Op != OpARM64MOVDconst {
 17245  			break
 17246  		}
 17247  		c := auxIntToInt64(v_0.AuxInt)
 17248  		if v_1.Op != OpARM64MOVDconst {
 17249  			break
 17250  		}
 17251  		d := auxIntToInt64(v_1.AuxInt)
 17252  		if !(d != 0) {
 17253  			break
 17254  		}
 17255  		v.reset(OpARM64MOVDconst)
 17256  		v.AuxInt = int64ToAuxInt(int64(uint32(c) / uint32(d)))
 17257  		return true
 17258  	}
 17259  	return false
 17260  }
 17261  func rewriteValueARM64_OpARM64UMOD(v *Value) bool {
 17262  	v_1 := v.Args[1]
 17263  	v_0 := v.Args[0]
 17264  	b := v.Block
 17265  	typ := &b.Func.Config.Types
 17266  	// match: (UMOD <typ.UInt64> x y)
 17267  	// result: (MSUB <typ.UInt64> x y (UDIV <typ.UInt64> x y))
 17268  	for {
 17269  		if v.Type != typ.UInt64 {
 17270  			break
 17271  		}
 17272  		x := v_0
 17273  		y := v_1
 17274  		v.reset(OpARM64MSUB)
 17275  		v.Type = typ.UInt64
 17276  		v0 := b.NewValue0(v.Pos, OpARM64UDIV, typ.UInt64)
 17277  		v0.AddArg2(x, y)
 17278  		v.AddArg3(x, y, v0)
 17279  		return true
 17280  	}
 17281  	// match: (UMOD _ (MOVDconst [1]))
 17282  	// result: (MOVDconst [0])
 17283  	for {
 17284  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 17285  			break
 17286  		}
 17287  		v.reset(OpARM64MOVDconst)
 17288  		v.AuxInt = int64ToAuxInt(0)
 17289  		return true
 17290  	}
 17291  	// match: (UMOD x (MOVDconst [c]))
 17292  	// cond: isPowerOfTwo(c)
 17293  	// result: (ANDconst [c-1] x)
 17294  	for {
 17295  		x := v_0
 17296  		if v_1.Op != OpARM64MOVDconst {
 17297  			break
 17298  		}
 17299  		c := auxIntToInt64(v_1.AuxInt)
 17300  		if !(isPowerOfTwo(c)) {
 17301  			break
 17302  		}
 17303  		v.reset(OpARM64ANDconst)
 17304  		v.AuxInt = int64ToAuxInt(c - 1)
 17305  		v.AddArg(x)
 17306  		return true
 17307  	}
 17308  	// match: (UMOD (MOVDconst [c]) (MOVDconst [d]))
 17309  	// cond: d != 0
 17310  	// result: (MOVDconst [int64(uint64(c)%uint64(d))])
 17311  	for {
 17312  		if v_0.Op != OpARM64MOVDconst {
 17313  			break
 17314  		}
 17315  		c := auxIntToInt64(v_0.AuxInt)
 17316  		if v_1.Op != OpARM64MOVDconst {
 17317  			break
 17318  		}
 17319  		d := auxIntToInt64(v_1.AuxInt)
 17320  		if !(d != 0) {
 17321  			break
 17322  		}
 17323  		v.reset(OpARM64MOVDconst)
 17324  		v.AuxInt = int64ToAuxInt(int64(uint64(c) % uint64(d)))
 17325  		return true
 17326  	}
 17327  	return false
 17328  }
 17329  func rewriteValueARM64_OpARM64UMODW(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: (UMODW <typ.UInt32> x y)
 17335  	// result: (MSUBW <typ.UInt32> x y (UDIVW <typ.UInt32> x y))
 17336  	for {
 17337  		if v.Type != typ.UInt32 {
 17338  			break
 17339  		}
 17340  		x := v_0
 17341  		y := v_1
 17342  		v.reset(OpARM64MSUBW)
 17343  		v.Type = typ.UInt32
 17344  		v0 := b.NewValue0(v.Pos, OpARM64UDIVW, typ.UInt32)
 17345  		v0.AddArg2(x, y)
 17346  		v.AddArg3(x, y, v0)
 17347  		return true
 17348  	}
 17349  	// match: (UMODW _ (MOVDconst [c]))
 17350  	// cond: uint32(c)==1
 17351  	// result: (MOVDconst [0])
 17352  	for {
 17353  		if v_1.Op != OpARM64MOVDconst {
 17354  			break
 17355  		}
 17356  		c := auxIntToInt64(v_1.AuxInt)
 17357  		if !(uint32(c) == 1) {
 17358  			break
 17359  		}
 17360  		v.reset(OpARM64MOVDconst)
 17361  		v.AuxInt = int64ToAuxInt(0)
 17362  		return true
 17363  	}
 17364  	// match: (UMODW x (MOVDconst [c]))
 17365  	// cond: isPowerOfTwo(c) && is32Bit(c)
 17366  	// result: (ANDconst [c-1] x)
 17367  	for {
 17368  		x := v_0
 17369  		if v_1.Op != OpARM64MOVDconst {
 17370  			break
 17371  		}
 17372  		c := auxIntToInt64(v_1.AuxInt)
 17373  		if !(isPowerOfTwo(c) && is32Bit(c)) {
 17374  			break
 17375  		}
 17376  		v.reset(OpARM64ANDconst)
 17377  		v.AuxInt = int64ToAuxInt(c - 1)
 17378  		v.AddArg(x)
 17379  		return true
 17380  	}
 17381  	// match: (UMODW (MOVDconst [c]) (MOVDconst [d]))
 17382  	// cond: d != 0
 17383  	// result: (MOVDconst [int64(uint32(c)%uint32(d))])
 17384  	for {
 17385  		if v_0.Op != OpARM64MOVDconst {
 17386  			break
 17387  		}
 17388  		c := auxIntToInt64(v_0.AuxInt)
 17389  		if v_1.Op != OpARM64MOVDconst {
 17390  			break
 17391  		}
 17392  		d := auxIntToInt64(v_1.AuxInt)
 17393  		if !(d != 0) {
 17394  			break
 17395  		}
 17396  		v.reset(OpARM64MOVDconst)
 17397  		v.AuxInt = int64ToAuxInt(int64(uint32(c) % uint32(d)))
 17398  		return true
 17399  	}
 17400  	return false
 17401  }
 17402  func rewriteValueARM64_OpARM64XOR(v *Value) bool {
 17403  	v_1 := v.Args[1]
 17404  	v_0 := v.Args[0]
 17405  	// match: (XOR x (MOVDconst [c]))
 17406  	// result: (XORconst [c] x)
 17407  	for {
 17408  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 17409  			x := v_0
 17410  			if v_1.Op != OpARM64MOVDconst {
 17411  				continue
 17412  			}
 17413  			c := auxIntToInt64(v_1.AuxInt)
 17414  			v.reset(OpARM64XORconst)
 17415  			v.AuxInt = int64ToAuxInt(c)
 17416  			v.AddArg(x)
 17417  			return true
 17418  		}
 17419  		break
 17420  	}
 17421  	// match: (XOR x x)
 17422  	// result: (MOVDconst [0])
 17423  	for {
 17424  		x := v_0
 17425  		if x != v_1 {
 17426  			break
 17427  		}
 17428  		v.reset(OpARM64MOVDconst)
 17429  		v.AuxInt = int64ToAuxInt(0)
 17430  		return true
 17431  	}
 17432  	// match: (XOR x (MVN y))
 17433  	// result: (EON x y)
 17434  	for {
 17435  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 17436  			x := v_0
 17437  			if v_1.Op != OpARM64MVN {
 17438  				continue
 17439  			}
 17440  			y := v_1.Args[0]
 17441  			v.reset(OpARM64EON)
 17442  			v.AddArg2(x, y)
 17443  			return true
 17444  		}
 17445  		break
 17446  	}
 17447  	// match: (XOR x0 x1:(SLLconst [c] y))
 17448  	// cond: clobberIfDead(x1)
 17449  	// result: (XORshiftLL x0 y [c])
 17450  	for {
 17451  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 17452  			x0 := v_0
 17453  			x1 := v_1
 17454  			if x1.Op != OpARM64SLLconst {
 17455  				continue
 17456  			}
 17457  			c := auxIntToInt64(x1.AuxInt)
 17458  			y := x1.Args[0]
 17459  			if !(clobberIfDead(x1)) {
 17460  				continue
 17461  			}
 17462  			v.reset(OpARM64XORshiftLL)
 17463  			v.AuxInt = int64ToAuxInt(c)
 17464  			v.AddArg2(x0, y)
 17465  			return true
 17466  		}
 17467  		break
 17468  	}
 17469  	// match: (XOR x0 x1:(SRLconst [c] y))
 17470  	// cond: clobberIfDead(x1)
 17471  	// result: (XORshiftRL x0 y [c])
 17472  	for {
 17473  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 17474  			x0 := v_0
 17475  			x1 := v_1
 17476  			if x1.Op != OpARM64SRLconst {
 17477  				continue
 17478  			}
 17479  			c := auxIntToInt64(x1.AuxInt)
 17480  			y := x1.Args[0]
 17481  			if !(clobberIfDead(x1)) {
 17482  				continue
 17483  			}
 17484  			v.reset(OpARM64XORshiftRL)
 17485  			v.AuxInt = int64ToAuxInt(c)
 17486  			v.AddArg2(x0, y)
 17487  			return true
 17488  		}
 17489  		break
 17490  	}
 17491  	// match: (XOR x0 x1:(SRAconst [c] y))
 17492  	// cond: clobberIfDead(x1)
 17493  	// result: (XORshiftRA x0 y [c])
 17494  	for {
 17495  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 17496  			x0 := v_0
 17497  			x1 := v_1
 17498  			if x1.Op != OpARM64SRAconst {
 17499  				continue
 17500  			}
 17501  			c := auxIntToInt64(x1.AuxInt)
 17502  			y := x1.Args[0]
 17503  			if !(clobberIfDead(x1)) {
 17504  				continue
 17505  			}
 17506  			v.reset(OpARM64XORshiftRA)
 17507  			v.AuxInt = int64ToAuxInt(c)
 17508  			v.AddArg2(x0, y)
 17509  			return true
 17510  		}
 17511  		break
 17512  	}
 17513  	// match: (XOR x0 x1:(RORconst [c] y))
 17514  	// cond: clobberIfDead(x1)
 17515  	// result: (XORshiftRO x0 y [c])
 17516  	for {
 17517  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 17518  			x0 := v_0
 17519  			x1 := v_1
 17520  			if x1.Op != OpARM64RORconst {
 17521  				continue
 17522  			}
 17523  			c := auxIntToInt64(x1.AuxInt)
 17524  			y := x1.Args[0]
 17525  			if !(clobberIfDead(x1)) {
 17526  				continue
 17527  			}
 17528  			v.reset(OpARM64XORshiftRO)
 17529  			v.AuxInt = int64ToAuxInt(c)
 17530  			v.AddArg2(x0, y)
 17531  			return true
 17532  		}
 17533  		break
 17534  	}
 17535  	return false
 17536  }
 17537  func rewriteValueARM64_OpARM64XORconst(v *Value) bool {
 17538  	v_0 := v.Args[0]
 17539  	// match: (XORconst [0] x)
 17540  	// result: x
 17541  	for {
 17542  		if auxIntToInt64(v.AuxInt) != 0 {
 17543  			break
 17544  		}
 17545  		x := v_0
 17546  		v.copyOf(x)
 17547  		return true
 17548  	}
 17549  	// match: (XORconst [-1] x)
 17550  	// result: (MVN x)
 17551  	for {
 17552  		if auxIntToInt64(v.AuxInt) != -1 {
 17553  			break
 17554  		}
 17555  		x := v_0
 17556  		v.reset(OpARM64MVN)
 17557  		v.AddArg(x)
 17558  		return true
 17559  	}
 17560  	// match: (XORconst [c] (MOVDconst [d]))
 17561  	// result: (MOVDconst [c^d])
 17562  	for {
 17563  		c := auxIntToInt64(v.AuxInt)
 17564  		if v_0.Op != OpARM64MOVDconst {
 17565  			break
 17566  		}
 17567  		d := auxIntToInt64(v_0.AuxInt)
 17568  		v.reset(OpARM64MOVDconst)
 17569  		v.AuxInt = int64ToAuxInt(c ^ d)
 17570  		return true
 17571  	}
 17572  	// match: (XORconst [c] (XORconst [d] x))
 17573  	// result: (XORconst [c^d] x)
 17574  	for {
 17575  		c := auxIntToInt64(v.AuxInt)
 17576  		if v_0.Op != OpARM64XORconst {
 17577  			break
 17578  		}
 17579  		d := auxIntToInt64(v_0.AuxInt)
 17580  		x := v_0.Args[0]
 17581  		v.reset(OpARM64XORconst)
 17582  		v.AuxInt = int64ToAuxInt(c ^ d)
 17583  		v.AddArg(x)
 17584  		return true
 17585  	}
 17586  	return false
 17587  }
 17588  func rewriteValueARM64_OpARM64XORshiftLL(v *Value) bool {
 17589  	v_1 := v.Args[1]
 17590  	v_0 := v.Args[0]
 17591  	b := v.Block
 17592  	typ := &b.Func.Config.Types
 17593  	// match: (XORshiftLL (MOVDconst [c]) x [d])
 17594  	// result: (XORconst [c] (SLLconst <x.Type> x [d]))
 17595  	for {
 17596  		d := auxIntToInt64(v.AuxInt)
 17597  		if v_0.Op != OpARM64MOVDconst {
 17598  			break
 17599  		}
 17600  		c := auxIntToInt64(v_0.AuxInt)
 17601  		x := v_1
 17602  		v.reset(OpARM64XORconst)
 17603  		v.AuxInt = int64ToAuxInt(c)
 17604  		v0 := b.NewValue0(v.Pos, OpARM64SLLconst, x.Type)
 17605  		v0.AuxInt = int64ToAuxInt(d)
 17606  		v0.AddArg(x)
 17607  		v.AddArg(v0)
 17608  		return true
 17609  	}
 17610  	// match: (XORshiftLL x (MOVDconst [c]) [d])
 17611  	// result: (XORconst x [int64(uint64(c)<<uint64(d))])
 17612  	for {
 17613  		d := auxIntToInt64(v.AuxInt)
 17614  		x := v_0
 17615  		if v_1.Op != OpARM64MOVDconst {
 17616  			break
 17617  		}
 17618  		c := auxIntToInt64(v_1.AuxInt)
 17619  		v.reset(OpARM64XORconst)
 17620  		v.AuxInt = int64ToAuxInt(int64(uint64(c) << uint64(d)))
 17621  		v.AddArg(x)
 17622  		return true
 17623  	}
 17624  	// match: (XORshiftLL (SLLconst x [c]) x [c])
 17625  	// result: (MOVDconst [0])
 17626  	for {
 17627  		c := auxIntToInt64(v.AuxInt)
 17628  		if v_0.Op != OpARM64SLLconst || auxIntToInt64(v_0.AuxInt) != c {
 17629  			break
 17630  		}
 17631  		x := v_0.Args[0]
 17632  		if x != v_1 {
 17633  			break
 17634  		}
 17635  		v.reset(OpARM64MOVDconst)
 17636  		v.AuxInt = int64ToAuxInt(0)
 17637  		return true
 17638  	}
 17639  	// match: (XORshiftLL <typ.UInt16> [8] (UBFX <typ.UInt16> [armBFAuxInt(8, 8)] x) x)
 17640  	// result: (REV16W x)
 17641  	for {
 17642  		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) {
 17643  			break
 17644  		}
 17645  		x := v_0.Args[0]
 17646  		if x != v_1 {
 17647  			break
 17648  		}
 17649  		v.reset(OpARM64REV16W)
 17650  		v.AddArg(x)
 17651  		return true
 17652  	}
 17653  	// match: (XORshiftLL [8] (UBFX [armBFAuxInt(8, 24)] (ANDconst [c1] x)) (ANDconst [c2] x))
 17654  	// cond: uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff
 17655  	// result: (REV16W x)
 17656  	for {
 17657  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64UBFX || auxIntToArm64BitField(v_0.AuxInt) != armBFAuxInt(8, 24) {
 17658  			break
 17659  		}
 17660  		v_0_0 := v_0.Args[0]
 17661  		if v_0_0.Op != OpARM64ANDconst {
 17662  			break
 17663  		}
 17664  		c1 := auxIntToInt64(v_0_0.AuxInt)
 17665  		x := v_0_0.Args[0]
 17666  		if v_1.Op != OpARM64ANDconst {
 17667  			break
 17668  		}
 17669  		c2 := auxIntToInt64(v_1.AuxInt)
 17670  		if x != v_1.Args[0] || !(uint32(c1) == 0xff00ff00 && uint32(c2) == 0x00ff00ff) {
 17671  			break
 17672  		}
 17673  		v.reset(OpARM64REV16W)
 17674  		v.AddArg(x)
 17675  		return true
 17676  	}
 17677  	// match: (XORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 17678  	// cond: (uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff)
 17679  	// result: (REV16 x)
 17680  	for {
 17681  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 17682  			break
 17683  		}
 17684  		v_0_0 := v_0.Args[0]
 17685  		if v_0_0.Op != OpARM64ANDconst {
 17686  			break
 17687  		}
 17688  		c1 := auxIntToInt64(v_0_0.AuxInt)
 17689  		x := v_0_0.Args[0]
 17690  		if v_1.Op != OpARM64ANDconst {
 17691  			break
 17692  		}
 17693  		c2 := auxIntToInt64(v_1.AuxInt)
 17694  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00ff00ff00 && uint64(c2) == 0x00ff00ff00ff00ff) {
 17695  			break
 17696  		}
 17697  		v.reset(OpARM64REV16)
 17698  		v.AddArg(x)
 17699  		return true
 17700  	}
 17701  	// match: (XORshiftLL [8] (SRLconst [8] (ANDconst [c1] x)) (ANDconst [c2] x))
 17702  	// cond: (uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff)
 17703  	// result: (REV16 (ANDconst <x.Type> [0xffffffff] x))
 17704  	for {
 17705  		if auxIntToInt64(v.AuxInt) != 8 || v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 8 {
 17706  			break
 17707  		}
 17708  		v_0_0 := v_0.Args[0]
 17709  		if v_0_0.Op != OpARM64ANDconst {
 17710  			break
 17711  		}
 17712  		c1 := auxIntToInt64(v_0_0.AuxInt)
 17713  		x := v_0_0.Args[0]
 17714  		if v_1.Op != OpARM64ANDconst {
 17715  			break
 17716  		}
 17717  		c2 := auxIntToInt64(v_1.AuxInt)
 17718  		if x != v_1.Args[0] || !(uint64(c1) == 0xff00ff00 && uint64(c2) == 0x00ff00ff) {
 17719  			break
 17720  		}
 17721  		v.reset(OpARM64REV16)
 17722  		v0 := b.NewValue0(v.Pos, OpARM64ANDconst, x.Type)
 17723  		v0.AuxInt = int64ToAuxInt(0xffffffff)
 17724  		v0.AddArg(x)
 17725  		v.AddArg(v0)
 17726  		return true
 17727  	}
 17728  	// match: (XORshiftLL [c] (SRLconst x [64-c]) x2)
 17729  	// result: (EXTRconst [64-c] x2 x)
 17730  	for {
 17731  		c := auxIntToInt64(v.AuxInt)
 17732  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != 64-c {
 17733  			break
 17734  		}
 17735  		x := v_0.Args[0]
 17736  		x2 := v_1
 17737  		v.reset(OpARM64EXTRconst)
 17738  		v.AuxInt = int64ToAuxInt(64 - c)
 17739  		v.AddArg2(x2, x)
 17740  		return true
 17741  	}
 17742  	// match: (XORshiftLL <t> [c] (UBFX [bfc] x) x2)
 17743  	// cond: c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)
 17744  	// result: (EXTRWconst [32-c] x2 x)
 17745  	for {
 17746  		t := v.Type
 17747  		c := auxIntToInt64(v.AuxInt)
 17748  		if v_0.Op != OpARM64UBFX {
 17749  			break
 17750  		}
 17751  		bfc := auxIntToArm64BitField(v_0.AuxInt)
 17752  		x := v_0.Args[0]
 17753  		x2 := v_1
 17754  		if !(c < 32 && t.Size() == 4 && bfc == armBFAuxInt(32-c, c)) {
 17755  			break
 17756  		}
 17757  		v.reset(OpARM64EXTRWconst)
 17758  		v.AuxInt = int64ToAuxInt(32 - c)
 17759  		v.AddArg2(x2, x)
 17760  		return true
 17761  	}
 17762  	return false
 17763  }
 17764  func rewriteValueARM64_OpARM64XORshiftRA(v *Value) bool {
 17765  	v_1 := v.Args[1]
 17766  	v_0 := v.Args[0]
 17767  	b := v.Block
 17768  	// match: (XORshiftRA (MOVDconst [c]) x [d])
 17769  	// result: (XORconst [c] (SRAconst <x.Type> x [d]))
 17770  	for {
 17771  		d := auxIntToInt64(v.AuxInt)
 17772  		if v_0.Op != OpARM64MOVDconst {
 17773  			break
 17774  		}
 17775  		c := auxIntToInt64(v_0.AuxInt)
 17776  		x := v_1
 17777  		v.reset(OpARM64XORconst)
 17778  		v.AuxInt = int64ToAuxInt(c)
 17779  		v0 := b.NewValue0(v.Pos, OpARM64SRAconst, x.Type)
 17780  		v0.AuxInt = int64ToAuxInt(d)
 17781  		v0.AddArg(x)
 17782  		v.AddArg(v0)
 17783  		return true
 17784  	}
 17785  	// match: (XORshiftRA x (MOVDconst [c]) [d])
 17786  	// result: (XORconst x [c>>uint64(d)])
 17787  	for {
 17788  		d := auxIntToInt64(v.AuxInt)
 17789  		x := v_0
 17790  		if v_1.Op != OpARM64MOVDconst {
 17791  			break
 17792  		}
 17793  		c := auxIntToInt64(v_1.AuxInt)
 17794  		v.reset(OpARM64XORconst)
 17795  		v.AuxInt = int64ToAuxInt(c >> uint64(d))
 17796  		v.AddArg(x)
 17797  		return true
 17798  	}
 17799  	// match: (XORshiftRA (SRAconst x [c]) x [c])
 17800  	// result: (MOVDconst [0])
 17801  	for {
 17802  		c := auxIntToInt64(v.AuxInt)
 17803  		if v_0.Op != OpARM64SRAconst || auxIntToInt64(v_0.AuxInt) != c {
 17804  			break
 17805  		}
 17806  		x := v_0.Args[0]
 17807  		if x != v_1 {
 17808  			break
 17809  		}
 17810  		v.reset(OpARM64MOVDconst)
 17811  		v.AuxInt = int64ToAuxInt(0)
 17812  		return true
 17813  	}
 17814  	return false
 17815  }
 17816  func rewriteValueARM64_OpARM64XORshiftRL(v *Value) bool {
 17817  	v_1 := v.Args[1]
 17818  	v_0 := v.Args[0]
 17819  	b := v.Block
 17820  	// match: (XORshiftRL (MOVDconst [c]) x [d])
 17821  	// result: (XORconst [c] (SRLconst <x.Type> x [d]))
 17822  	for {
 17823  		d := auxIntToInt64(v.AuxInt)
 17824  		if v_0.Op != OpARM64MOVDconst {
 17825  			break
 17826  		}
 17827  		c := auxIntToInt64(v_0.AuxInt)
 17828  		x := v_1
 17829  		v.reset(OpARM64XORconst)
 17830  		v.AuxInt = int64ToAuxInt(c)
 17831  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, x.Type)
 17832  		v0.AuxInt = int64ToAuxInt(d)
 17833  		v0.AddArg(x)
 17834  		v.AddArg(v0)
 17835  		return true
 17836  	}
 17837  	// match: (XORshiftRL x (MOVDconst [c]) [d])
 17838  	// result: (XORconst x [int64(uint64(c)>>uint64(d))])
 17839  	for {
 17840  		d := auxIntToInt64(v.AuxInt)
 17841  		x := v_0
 17842  		if v_1.Op != OpARM64MOVDconst {
 17843  			break
 17844  		}
 17845  		c := auxIntToInt64(v_1.AuxInt)
 17846  		v.reset(OpARM64XORconst)
 17847  		v.AuxInt = int64ToAuxInt(int64(uint64(c) >> uint64(d)))
 17848  		v.AddArg(x)
 17849  		return true
 17850  	}
 17851  	// match: (XORshiftRL (SRLconst x [c]) x [c])
 17852  	// result: (MOVDconst [0])
 17853  	for {
 17854  		c := auxIntToInt64(v.AuxInt)
 17855  		if v_0.Op != OpARM64SRLconst || auxIntToInt64(v_0.AuxInt) != c {
 17856  			break
 17857  		}
 17858  		x := v_0.Args[0]
 17859  		if x != v_1 {
 17860  			break
 17861  		}
 17862  		v.reset(OpARM64MOVDconst)
 17863  		v.AuxInt = int64ToAuxInt(0)
 17864  		return true
 17865  	}
 17866  	return false
 17867  }
 17868  func rewriteValueARM64_OpARM64XORshiftRO(v *Value) bool {
 17869  	v_1 := v.Args[1]
 17870  	v_0 := v.Args[0]
 17871  	b := v.Block
 17872  	// match: (XORshiftRO (MOVDconst [c]) x [d])
 17873  	// result: (XORconst [c] (RORconst <x.Type> x [d]))
 17874  	for {
 17875  		d := auxIntToInt64(v.AuxInt)
 17876  		if v_0.Op != OpARM64MOVDconst {
 17877  			break
 17878  		}
 17879  		c := auxIntToInt64(v_0.AuxInt)
 17880  		x := v_1
 17881  		v.reset(OpARM64XORconst)
 17882  		v.AuxInt = int64ToAuxInt(c)
 17883  		v0 := b.NewValue0(v.Pos, OpARM64RORconst, x.Type)
 17884  		v0.AuxInt = int64ToAuxInt(d)
 17885  		v0.AddArg(x)
 17886  		v.AddArg(v0)
 17887  		return true
 17888  	}
 17889  	// match: (XORshiftRO x (MOVDconst [c]) [d])
 17890  	// result: (XORconst x [rotateRight64(c, d)])
 17891  	for {
 17892  		d := auxIntToInt64(v.AuxInt)
 17893  		x := v_0
 17894  		if v_1.Op != OpARM64MOVDconst {
 17895  			break
 17896  		}
 17897  		c := auxIntToInt64(v_1.AuxInt)
 17898  		v.reset(OpARM64XORconst)
 17899  		v.AuxInt = int64ToAuxInt(rotateRight64(c, d))
 17900  		v.AddArg(x)
 17901  		return true
 17902  	}
 17903  	// match: (XORshiftRO (RORconst x [c]) x [c])
 17904  	// result: (MOVDconst [0])
 17905  	for {
 17906  		c := auxIntToInt64(v.AuxInt)
 17907  		if v_0.Op != OpARM64RORconst || auxIntToInt64(v_0.AuxInt) != c {
 17908  			break
 17909  		}
 17910  		x := v_0.Args[0]
 17911  		if x != v_1 {
 17912  			break
 17913  		}
 17914  		v.reset(OpARM64MOVDconst)
 17915  		v.AuxInt = int64ToAuxInt(0)
 17916  		return true
 17917  	}
 17918  	return false
 17919  }
 17920  func rewriteValueARM64_OpAddr(v *Value) bool {
 17921  	v_0 := v.Args[0]
 17922  	// match: (Addr {sym} base)
 17923  	// result: (MOVDaddr {sym} base)
 17924  	for {
 17925  		sym := auxToSym(v.Aux)
 17926  		base := v_0
 17927  		v.reset(OpARM64MOVDaddr)
 17928  		v.Aux = symToAux(sym)
 17929  		v.AddArg(base)
 17930  		return true
 17931  	}
 17932  }
 17933  func rewriteValueARM64_OpAvg64u(v *Value) bool {
 17934  	v_1 := v.Args[1]
 17935  	v_0 := v.Args[0]
 17936  	b := v.Block
 17937  	// match: (Avg64u <t> x y)
 17938  	// result: (ADD (SRLconst <t> (SUB <t> x y) [1]) y)
 17939  	for {
 17940  		t := v.Type
 17941  		x := v_0
 17942  		y := v_1
 17943  		v.reset(OpARM64ADD)
 17944  		v0 := b.NewValue0(v.Pos, OpARM64SRLconst, t)
 17945  		v0.AuxInt = int64ToAuxInt(1)
 17946  		v1 := b.NewValue0(v.Pos, OpARM64SUB, t)
 17947  		v1.AddArg2(x, y)
 17948  		v0.AddArg(v1)
 17949  		v.AddArg2(v0, y)
 17950  		return true
 17951  	}
 17952  }
 17953  func rewriteValueARM64_OpBitLen32(v *Value) bool {
 17954  	v_0 := v.Args[0]
 17955  	b := v.Block
 17956  	typ := &b.Func.Config.Types
 17957  	// match: (BitLen32 x)
 17958  	// result: (SUB (MOVDconst [32]) (CLZW <typ.Int> x))
 17959  	for {
 17960  		x := v_0
 17961  		v.reset(OpARM64SUB)
 17962  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17963  		v0.AuxInt = int64ToAuxInt(32)
 17964  		v1 := b.NewValue0(v.Pos, OpARM64CLZW, typ.Int)
 17965  		v1.AddArg(x)
 17966  		v.AddArg2(v0, v1)
 17967  		return true
 17968  	}
 17969  }
 17970  func rewriteValueARM64_OpBitLen64(v *Value) bool {
 17971  	v_0 := v.Args[0]
 17972  	b := v.Block
 17973  	typ := &b.Func.Config.Types
 17974  	// match: (BitLen64 x)
 17975  	// result: (SUB (MOVDconst [64]) (CLZ <typ.Int> x))
 17976  	for {
 17977  		x := v_0
 17978  		v.reset(OpARM64SUB)
 17979  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 17980  		v0.AuxInt = int64ToAuxInt(64)
 17981  		v1 := b.NewValue0(v.Pos, OpARM64CLZ, typ.Int)
 17982  		v1.AddArg(x)
 17983  		v.AddArg2(v0, v1)
 17984  		return true
 17985  	}
 17986  }
 17987  func rewriteValueARM64_OpBitRev16(v *Value) bool {
 17988  	v_0 := v.Args[0]
 17989  	b := v.Block
 17990  	typ := &b.Func.Config.Types
 17991  	// match: (BitRev16 x)
 17992  	// result: (SRLconst [48] (RBIT <typ.UInt64> x))
 17993  	for {
 17994  		x := v_0
 17995  		v.reset(OpARM64SRLconst)
 17996  		v.AuxInt = int64ToAuxInt(48)
 17997  		v0 := b.NewValue0(v.Pos, OpARM64RBIT, typ.UInt64)
 17998  		v0.AddArg(x)
 17999  		v.AddArg(v0)
 18000  		return true
 18001  	}
 18002  }
 18003  func rewriteValueARM64_OpBitRev8(v *Value) bool {
 18004  	v_0 := v.Args[0]
 18005  	b := v.Block
 18006  	typ := &b.Func.Config.Types
 18007  	// match: (BitRev8 x)
 18008  	// result: (SRLconst [56] (RBIT <typ.UInt64> x))
 18009  	for {
 18010  		x := v_0
 18011  		v.reset(OpARM64SRLconst)
 18012  		v.AuxInt = int64ToAuxInt(56)
 18013  		v0 := b.NewValue0(v.Pos, OpARM64RBIT, typ.UInt64)
 18014  		v0.AddArg(x)
 18015  		v.AddArg(v0)
 18016  		return true
 18017  	}
 18018  }
 18019  func rewriteValueARM64_OpCondSelect(v *Value) bool {
 18020  	v_2 := v.Args[2]
 18021  	v_1 := v.Args[1]
 18022  	v_0 := v.Args[0]
 18023  	b := v.Block
 18024  	// match: (CondSelect x y boolval)
 18025  	// cond: flagArg(boolval) != nil
 18026  	// result: (CSEL [boolval.Op] x y flagArg(boolval))
 18027  	for {
 18028  		x := v_0
 18029  		y := v_1
 18030  		boolval := v_2
 18031  		if !(flagArg(boolval) != nil) {
 18032  			break
 18033  		}
 18034  		v.reset(OpARM64CSEL)
 18035  		v.AuxInt = opToAuxInt(boolval.Op)
 18036  		v.AddArg3(x, y, flagArg(boolval))
 18037  		return true
 18038  	}
 18039  	// match: (CondSelect x y boolval)
 18040  	// cond: flagArg(boolval) == nil
 18041  	// result: (CSEL [OpARM64NotEqual] x y (TSTWconst [1] boolval))
 18042  	for {
 18043  		x := v_0
 18044  		y := v_1
 18045  		boolval := v_2
 18046  		if !(flagArg(boolval) == nil) {
 18047  			break
 18048  		}
 18049  		v.reset(OpARM64CSEL)
 18050  		v.AuxInt = opToAuxInt(OpARM64NotEqual)
 18051  		v0 := b.NewValue0(v.Pos, OpARM64TSTWconst, types.TypeFlags)
 18052  		v0.AuxInt = int32ToAuxInt(1)
 18053  		v0.AddArg(boolval)
 18054  		v.AddArg3(x, y, v0)
 18055  		return true
 18056  	}
 18057  	return false
 18058  }
 18059  func rewriteValueARM64_OpConst16(v *Value) bool {
 18060  	// match: (Const16 [val])
 18061  	// result: (MOVDconst [int64(val)])
 18062  	for {
 18063  		val := auxIntToInt16(v.AuxInt)
 18064  		v.reset(OpARM64MOVDconst)
 18065  		v.AuxInt = int64ToAuxInt(int64(val))
 18066  		return true
 18067  	}
 18068  }
 18069  func rewriteValueARM64_OpConst32(v *Value) bool {
 18070  	// match: (Const32 [val])
 18071  	// result: (MOVDconst [int64(val)])
 18072  	for {
 18073  		val := auxIntToInt32(v.AuxInt)
 18074  		v.reset(OpARM64MOVDconst)
 18075  		v.AuxInt = int64ToAuxInt(int64(val))
 18076  		return true
 18077  	}
 18078  }
 18079  func rewriteValueARM64_OpConst32F(v *Value) bool {
 18080  	// match: (Const32F [val])
 18081  	// result: (FMOVSconst [float64(val)])
 18082  	for {
 18083  		val := auxIntToFloat32(v.AuxInt)
 18084  		v.reset(OpARM64FMOVSconst)
 18085  		v.AuxInt = float64ToAuxInt(float64(val))
 18086  		return true
 18087  	}
 18088  }
 18089  func rewriteValueARM64_OpConst64(v *Value) bool {
 18090  	// match: (Const64 [val])
 18091  	// result: (MOVDconst [int64(val)])
 18092  	for {
 18093  		val := auxIntToInt64(v.AuxInt)
 18094  		v.reset(OpARM64MOVDconst)
 18095  		v.AuxInt = int64ToAuxInt(int64(val))
 18096  		return true
 18097  	}
 18098  }
 18099  func rewriteValueARM64_OpConst64F(v *Value) bool {
 18100  	// match: (Const64F [val])
 18101  	// result: (FMOVDconst [float64(val)])
 18102  	for {
 18103  		val := auxIntToFloat64(v.AuxInt)
 18104  		v.reset(OpARM64FMOVDconst)
 18105  		v.AuxInt = float64ToAuxInt(float64(val))
 18106  		return true
 18107  	}
 18108  }
 18109  func rewriteValueARM64_OpConst8(v *Value) bool {
 18110  	// match: (Const8 [val])
 18111  	// result: (MOVDconst [int64(val)])
 18112  	for {
 18113  		val := auxIntToInt8(v.AuxInt)
 18114  		v.reset(OpARM64MOVDconst)
 18115  		v.AuxInt = int64ToAuxInt(int64(val))
 18116  		return true
 18117  	}
 18118  }
 18119  func rewriteValueARM64_OpConstBool(v *Value) bool {
 18120  	// match: (ConstBool [t])
 18121  	// result: (MOVDconst [b2i(t)])
 18122  	for {
 18123  		t := auxIntToBool(v.AuxInt)
 18124  		v.reset(OpARM64MOVDconst)
 18125  		v.AuxInt = int64ToAuxInt(b2i(t))
 18126  		return true
 18127  	}
 18128  }
 18129  func rewriteValueARM64_OpConstNil(v *Value) bool {
 18130  	// match: (ConstNil)
 18131  	// result: (MOVDconst [0])
 18132  	for {
 18133  		v.reset(OpARM64MOVDconst)
 18134  		v.AuxInt = int64ToAuxInt(0)
 18135  		return true
 18136  	}
 18137  }
 18138  func rewriteValueARM64_OpCtz16(v *Value) bool {
 18139  	v_0 := v.Args[0]
 18140  	b := v.Block
 18141  	typ := &b.Func.Config.Types
 18142  	// match: (Ctz16 <t> x)
 18143  	// result: (CLZW <t> (RBITW <typ.UInt32> (ORconst <typ.UInt32> [0x10000] x)))
 18144  	for {
 18145  		t := v.Type
 18146  		x := v_0
 18147  		v.reset(OpARM64CLZW)
 18148  		v.Type = t
 18149  		v0 := b.NewValue0(v.Pos, OpARM64RBITW, typ.UInt32)
 18150  		v1 := b.NewValue0(v.Pos, OpARM64ORconst, typ.UInt32)
 18151  		v1.AuxInt = int64ToAuxInt(0x10000)
 18152  		v1.AddArg(x)
 18153  		v0.AddArg(v1)
 18154  		v.AddArg(v0)
 18155  		return true
 18156  	}
 18157  }
 18158  func rewriteValueARM64_OpCtz32(v *Value) bool {
 18159  	v_0 := v.Args[0]
 18160  	b := v.Block
 18161  	// match: (Ctz32 <t> x)
 18162  	// result: (CLZW (RBITW <t> x))
 18163  	for {
 18164  		t := v.Type
 18165  		x := v_0
 18166  		v.reset(OpARM64CLZW)
 18167  		v0 := b.NewValue0(v.Pos, OpARM64RBITW, t)
 18168  		v0.AddArg(x)
 18169  		v.AddArg(v0)
 18170  		return true
 18171  	}
 18172  }
 18173  func rewriteValueARM64_OpCtz64(v *Value) bool {
 18174  	v_0 := v.Args[0]
 18175  	b := v.Block
 18176  	// match: (Ctz64 <t> x)
 18177  	// result: (CLZ (RBIT <t> x))
 18178  	for {
 18179  		t := v.Type
 18180  		x := v_0
 18181  		v.reset(OpARM64CLZ)
 18182  		v0 := b.NewValue0(v.Pos, OpARM64RBIT, t)
 18183  		v0.AddArg(x)
 18184  		v.AddArg(v0)
 18185  		return true
 18186  	}
 18187  }
 18188  func rewriteValueARM64_OpCtz8(v *Value) bool {
 18189  	v_0 := v.Args[0]
 18190  	b := v.Block
 18191  	typ := &b.Func.Config.Types
 18192  	// match: (Ctz8 <t> x)
 18193  	// result: (CLZW <t> (RBITW <typ.UInt32> (ORconst <typ.UInt32> [0x100] x)))
 18194  	for {
 18195  		t := v.Type
 18196  		x := v_0
 18197  		v.reset(OpARM64CLZW)
 18198  		v.Type = t
 18199  		v0 := b.NewValue0(v.Pos, OpARM64RBITW, typ.UInt32)
 18200  		v1 := b.NewValue0(v.Pos, OpARM64ORconst, typ.UInt32)
 18201  		v1.AuxInt = int64ToAuxInt(0x100)
 18202  		v1.AddArg(x)
 18203  		v0.AddArg(v1)
 18204  		v.AddArg(v0)
 18205  		return true
 18206  	}
 18207  }
 18208  func rewriteValueARM64_OpDiv16(v *Value) bool {
 18209  	v_1 := v.Args[1]
 18210  	v_0 := v.Args[0]
 18211  	b := v.Block
 18212  	typ := &b.Func.Config.Types
 18213  	// match: (Div16 [false] x y)
 18214  	// result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
 18215  	for {
 18216  		if auxIntToBool(v.AuxInt) != false {
 18217  			break
 18218  		}
 18219  		x := v_0
 18220  		y := v_1
 18221  		v.reset(OpARM64DIVW)
 18222  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 18223  		v0.AddArg(x)
 18224  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 18225  		v1.AddArg(y)
 18226  		v.AddArg2(v0, v1)
 18227  		return true
 18228  	}
 18229  	return false
 18230  }
 18231  func rewriteValueARM64_OpDiv16u(v *Value) bool {
 18232  	v_1 := v.Args[1]
 18233  	v_0 := v.Args[0]
 18234  	b := v.Block
 18235  	typ := &b.Func.Config.Types
 18236  	// match: (Div16u x y)
 18237  	// result: (UDIVW (ZeroExt16to32 x) (ZeroExt16to32 y))
 18238  	for {
 18239  		x := v_0
 18240  		y := v_1
 18241  		v.reset(OpARM64UDIVW)
 18242  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 18243  		v0.AddArg(x)
 18244  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 18245  		v1.AddArg(y)
 18246  		v.AddArg2(v0, v1)
 18247  		return true
 18248  	}
 18249  }
 18250  func rewriteValueARM64_OpDiv32(v *Value) bool {
 18251  	v_1 := v.Args[1]
 18252  	v_0 := v.Args[0]
 18253  	// match: (Div32 [false] x y)
 18254  	// result: (DIVW x y)
 18255  	for {
 18256  		if auxIntToBool(v.AuxInt) != false {
 18257  			break
 18258  		}
 18259  		x := v_0
 18260  		y := v_1
 18261  		v.reset(OpARM64DIVW)
 18262  		v.AddArg2(x, y)
 18263  		return true
 18264  	}
 18265  	return false
 18266  }
 18267  func rewriteValueARM64_OpDiv64(v *Value) bool {
 18268  	v_1 := v.Args[1]
 18269  	v_0 := v.Args[0]
 18270  	// match: (Div64 [false] x y)
 18271  	// result: (DIV x y)
 18272  	for {
 18273  		if auxIntToBool(v.AuxInt) != false {
 18274  			break
 18275  		}
 18276  		x := v_0
 18277  		y := v_1
 18278  		v.reset(OpARM64DIV)
 18279  		v.AddArg2(x, y)
 18280  		return true
 18281  	}
 18282  	return false
 18283  }
 18284  func rewriteValueARM64_OpDiv8(v *Value) bool {
 18285  	v_1 := v.Args[1]
 18286  	v_0 := v.Args[0]
 18287  	b := v.Block
 18288  	typ := &b.Func.Config.Types
 18289  	// match: (Div8 x y)
 18290  	// result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
 18291  	for {
 18292  		x := v_0
 18293  		y := v_1
 18294  		v.reset(OpARM64DIVW)
 18295  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 18296  		v0.AddArg(x)
 18297  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 18298  		v1.AddArg(y)
 18299  		v.AddArg2(v0, v1)
 18300  		return true
 18301  	}
 18302  }
 18303  func rewriteValueARM64_OpDiv8u(v *Value) bool {
 18304  	v_1 := v.Args[1]
 18305  	v_0 := v.Args[0]
 18306  	b := v.Block
 18307  	typ := &b.Func.Config.Types
 18308  	// match: (Div8u x y)
 18309  	// result: (UDIVW (ZeroExt8to32 x) (ZeroExt8to32 y))
 18310  	for {
 18311  		x := v_0
 18312  		y := v_1
 18313  		v.reset(OpARM64UDIVW)
 18314  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 18315  		v0.AddArg(x)
 18316  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 18317  		v1.AddArg(y)
 18318  		v.AddArg2(v0, v1)
 18319  		return true
 18320  	}
 18321  }
 18322  func rewriteValueARM64_OpEq16(v *Value) bool {
 18323  	v_1 := v.Args[1]
 18324  	v_0 := v.Args[0]
 18325  	b := v.Block
 18326  	typ := &b.Func.Config.Types
 18327  	// match: (Eq16 x y)
 18328  	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 18329  	for {
 18330  		x := v_0
 18331  		y := v_1
 18332  		v.reset(OpARM64Equal)
 18333  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18334  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 18335  		v1.AddArg(x)
 18336  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 18337  		v2.AddArg(y)
 18338  		v0.AddArg2(v1, v2)
 18339  		v.AddArg(v0)
 18340  		return true
 18341  	}
 18342  }
 18343  func rewriteValueARM64_OpEq32(v *Value) bool {
 18344  	v_1 := v.Args[1]
 18345  	v_0 := v.Args[0]
 18346  	b := v.Block
 18347  	// match: (Eq32 x y)
 18348  	// result: (Equal (CMPW x y))
 18349  	for {
 18350  		x := v_0
 18351  		y := v_1
 18352  		v.reset(OpARM64Equal)
 18353  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18354  		v0.AddArg2(x, y)
 18355  		v.AddArg(v0)
 18356  		return true
 18357  	}
 18358  }
 18359  func rewriteValueARM64_OpEq32F(v *Value) bool {
 18360  	v_1 := v.Args[1]
 18361  	v_0 := v.Args[0]
 18362  	b := v.Block
 18363  	// match: (Eq32F x y)
 18364  	// result: (Equal (FCMPS x y))
 18365  	for {
 18366  		x := v_0
 18367  		y := v_1
 18368  		v.reset(OpARM64Equal)
 18369  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 18370  		v0.AddArg2(x, y)
 18371  		v.AddArg(v0)
 18372  		return true
 18373  	}
 18374  }
 18375  func rewriteValueARM64_OpEq64(v *Value) bool {
 18376  	v_1 := v.Args[1]
 18377  	v_0 := v.Args[0]
 18378  	b := v.Block
 18379  	// match: (Eq64 x y)
 18380  	// result: (Equal (CMP x y))
 18381  	for {
 18382  		x := v_0
 18383  		y := v_1
 18384  		v.reset(OpARM64Equal)
 18385  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 18386  		v0.AddArg2(x, y)
 18387  		v.AddArg(v0)
 18388  		return true
 18389  	}
 18390  }
 18391  func rewriteValueARM64_OpEq64F(v *Value) bool {
 18392  	v_1 := v.Args[1]
 18393  	v_0 := v.Args[0]
 18394  	b := v.Block
 18395  	// match: (Eq64F x y)
 18396  	// result: (Equal (FCMPD x y))
 18397  	for {
 18398  		x := v_0
 18399  		y := v_1
 18400  		v.reset(OpARM64Equal)
 18401  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 18402  		v0.AddArg2(x, y)
 18403  		v.AddArg(v0)
 18404  		return true
 18405  	}
 18406  }
 18407  func rewriteValueARM64_OpEq8(v *Value) bool {
 18408  	v_1 := v.Args[1]
 18409  	v_0 := v.Args[0]
 18410  	b := v.Block
 18411  	typ := &b.Func.Config.Types
 18412  	// match: (Eq8 x y)
 18413  	// result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 18414  	for {
 18415  		x := v_0
 18416  		y := v_1
 18417  		v.reset(OpARM64Equal)
 18418  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18419  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 18420  		v1.AddArg(x)
 18421  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 18422  		v2.AddArg(y)
 18423  		v0.AddArg2(v1, v2)
 18424  		v.AddArg(v0)
 18425  		return true
 18426  	}
 18427  }
 18428  func rewriteValueARM64_OpEqB(v *Value) bool {
 18429  	v_1 := v.Args[1]
 18430  	v_0 := v.Args[0]
 18431  	b := v.Block
 18432  	typ := &b.Func.Config.Types
 18433  	// match: (EqB x y)
 18434  	// result: (XOR (MOVDconst [1]) (XOR <typ.Bool> x y))
 18435  	for {
 18436  		x := v_0
 18437  		y := v_1
 18438  		v.reset(OpARM64XOR)
 18439  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 18440  		v0.AuxInt = int64ToAuxInt(1)
 18441  		v1 := b.NewValue0(v.Pos, OpARM64XOR, typ.Bool)
 18442  		v1.AddArg2(x, y)
 18443  		v.AddArg2(v0, v1)
 18444  		return true
 18445  	}
 18446  }
 18447  func rewriteValueARM64_OpEqPtr(v *Value) bool {
 18448  	v_1 := v.Args[1]
 18449  	v_0 := v.Args[0]
 18450  	b := v.Block
 18451  	// match: (EqPtr x y)
 18452  	// result: (Equal (CMP x y))
 18453  	for {
 18454  		x := v_0
 18455  		y := v_1
 18456  		v.reset(OpARM64Equal)
 18457  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 18458  		v0.AddArg2(x, y)
 18459  		v.AddArg(v0)
 18460  		return true
 18461  	}
 18462  }
 18463  func rewriteValueARM64_OpFMA(v *Value) bool {
 18464  	v_2 := v.Args[2]
 18465  	v_1 := v.Args[1]
 18466  	v_0 := v.Args[0]
 18467  	// match: (FMA x y z)
 18468  	// result: (FMADDD z x y)
 18469  	for {
 18470  		x := v_0
 18471  		y := v_1
 18472  		z := v_2
 18473  		v.reset(OpARM64FMADDD)
 18474  		v.AddArg3(z, x, y)
 18475  		return true
 18476  	}
 18477  }
 18478  func rewriteValueARM64_OpHmul32(v *Value) bool {
 18479  	v_1 := v.Args[1]
 18480  	v_0 := v.Args[0]
 18481  	b := v.Block
 18482  	typ := &b.Func.Config.Types
 18483  	// match: (Hmul32 x y)
 18484  	// result: (SRAconst (MULL <typ.Int64> x y) [32])
 18485  	for {
 18486  		x := v_0
 18487  		y := v_1
 18488  		v.reset(OpARM64SRAconst)
 18489  		v.AuxInt = int64ToAuxInt(32)
 18490  		v0 := b.NewValue0(v.Pos, OpARM64MULL, typ.Int64)
 18491  		v0.AddArg2(x, y)
 18492  		v.AddArg(v0)
 18493  		return true
 18494  	}
 18495  }
 18496  func rewriteValueARM64_OpHmul32u(v *Value) bool {
 18497  	v_1 := v.Args[1]
 18498  	v_0 := v.Args[0]
 18499  	b := v.Block
 18500  	typ := &b.Func.Config.Types
 18501  	// match: (Hmul32u x y)
 18502  	// result: (SRAconst (UMULL <typ.UInt64> x y) [32])
 18503  	for {
 18504  		x := v_0
 18505  		y := v_1
 18506  		v.reset(OpARM64SRAconst)
 18507  		v.AuxInt = int64ToAuxInt(32)
 18508  		v0 := b.NewValue0(v.Pos, OpARM64UMULL, typ.UInt64)
 18509  		v0.AddArg2(x, y)
 18510  		v.AddArg(v0)
 18511  		return true
 18512  	}
 18513  }
 18514  func rewriteValueARM64_OpIsInBounds(v *Value) bool {
 18515  	v_1 := v.Args[1]
 18516  	v_0 := v.Args[0]
 18517  	b := v.Block
 18518  	// match: (IsInBounds idx len)
 18519  	// result: (LessThanU (CMP idx len))
 18520  	for {
 18521  		idx := v_0
 18522  		len := v_1
 18523  		v.reset(OpARM64LessThanU)
 18524  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 18525  		v0.AddArg2(idx, len)
 18526  		v.AddArg(v0)
 18527  		return true
 18528  	}
 18529  }
 18530  func rewriteValueARM64_OpIsNonNil(v *Value) bool {
 18531  	v_0 := v.Args[0]
 18532  	b := v.Block
 18533  	// match: (IsNonNil ptr)
 18534  	// result: (NotEqual (CMPconst [0] ptr))
 18535  	for {
 18536  		ptr := v_0
 18537  		v.reset(OpARM64NotEqual)
 18538  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 18539  		v0.AuxInt = int64ToAuxInt(0)
 18540  		v0.AddArg(ptr)
 18541  		v.AddArg(v0)
 18542  		return true
 18543  	}
 18544  }
 18545  func rewriteValueARM64_OpIsSliceInBounds(v *Value) bool {
 18546  	v_1 := v.Args[1]
 18547  	v_0 := v.Args[0]
 18548  	b := v.Block
 18549  	// match: (IsSliceInBounds idx len)
 18550  	// result: (LessEqualU (CMP idx len))
 18551  	for {
 18552  		idx := v_0
 18553  		len := v_1
 18554  		v.reset(OpARM64LessEqualU)
 18555  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 18556  		v0.AddArg2(idx, len)
 18557  		v.AddArg(v0)
 18558  		return true
 18559  	}
 18560  }
 18561  func rewriteValueARM64_OpLeq16(v *Value) bool {
 18562  	v_1 := v.Args[1]
 18563  	v_0 := v.Args[0]
 18564  	b := v.Block
 18565  	typ := &b.Func.Config.Types
 18566  	// match: (Leq16 x y)
 18567  	// result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
 18568  	for {
 18569  		x := v_0
 18570  		y := v_1
 18571  		v.reset(OpARM64LessEqual)
 18572  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18573  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 18574  		v1.AddArg(x)
 18575  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 18576  		v2.AddArg(y)
 18577  		v0.AddArg2(v1, v2)
 18578  		v.AddArg(v0)
 18579  		return true
 18580  	}
 18581  }
 18582  func rewriteValueARM64_OpLeq16U(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: (Leq16U x zero:(MOVDconst [0]))
 18588  	// result: (Eq16 x zero)
 18589  	for {
 18590  		x := v_0
 18591  		zero := v_1
 18592  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 18593  			break
 18594  		}
 18595  		v.reset(OpEq16)
 18596  		v.AddArg2(x, zero)
 18597  		return true
 18598  	}
 18599  	// match: (Leq16U (MOVDconst [1]) x)
 18600  	// result: (Neq16 (MOVDconst [0]) x)
 18601  	for {
 18602  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 18603  			break
 18604  		}
 18605  		x := v_1
 18606  		v.reset(OpNeq16)
 18607  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 18608  		v0.AuxInt = int64ToAuxInt(0)
 18609  		v.AddArg2(v0, x)
 18610  		return true
 18611  	}
 18612  	// match: (Leq16U x y)
 18613  	// result: (LessEqualU (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 18614  	for {
 18615  		x := v_0
 18616  		y := v_1
 18617  		v.reset(OpARM64LessEqualU)
 18618  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18619  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 18620  		v1.AddArg(x)
 18621  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 18622  		v2.AddArg(y)
 18623  		v0.AddArg2(v1, v2)
 18624  		v.AddArg(v0)
 18625  		return true
 18626  	}
 18627  }
 18628  func rewriteValueARM64_OpLeq32(v *Value) bool {
 18629  	v_1 := v.Args[1]
 18630  	v_0 := v.Args[0]
 18631  	b := v.Block
 18632  	// match: (Leq32 x y)
 18633  	// result: (LessEqual (CMPW x y))
 18634  	for {
 18635  		x := v_0
 18636  		y := v_1
 18637  		v.reset(OpARM64LessEqual)
 18638  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18639  		v0.AddArg2(x, y)
 18640  		v.AddArg(v0)
 18641  		return true
 18642  	}
 18643  }
 18644  func rewriteValueARM64_OpLeq32F(v *Value) bool {
 18645  	v_1 := v.Args[1]
 18646  	v_0 := v.Args[0]
 18647  	b := v.Block
 18648  	// match: (Leq32F x y)
 18649  	// result: (LessEqualF (FCMPS x y))
 18650  	for {
 18651  		x := v_0
 18652  		y := v_1
 18653  		v.reset(OpARM64LessEqualF)
 18654  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 18655  		v0.AddArg2(x, y)
 18656  		v.AddArg(v0)
 18657  		return true
 18658  	}
 18659  }
 18660  func rewriteValueARM64_OpLeq32U(v *Value) bool {
 18661  	v_1 := v.Args[1]
 18662  	v_0 := v.Args[0]
 18663  	b := v.Block
 18664  	typ := &b.Func.Config.Types
 18665  	// match: (Leq32U x zero:(MOVDconst [0]))
 18666  	// result: (Eq32 x zero)
 18667  	for {
 18668  		x := v_0
 18669  		zero := v_1
 18670  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 18671  			break
 18672  		}
 18673  		v.reset(OpEq32)
 18674  		v.AddArg2(x, zero)
 18675  		return true
 18676  	}
 18677  	// match: (Leq32U (MOVDconst [1]) x)
 18678  	// result: (Neq32 (MOVDconst [0]) x)
 18679  	for {
 18680  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 18681  			break
 18682  		}
 18683  		x := v_1
 18684  		v.reset(OpNeq32)
 18685  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 18686  		v0.AuxInt = int64ToAuxInt(0)
 18687  		v.AddArg2(v0, x)
 18688  		return true
 18689  	}
 18690  	// match: (Leq32U x y)
 18691  	// result: (LessEqualU (CMPW x y))
 18692  	for {
 18693  		x := v_0
 18694  		y := v_1
 18695  		v.reset(OpARM64LessEqualU)
 18696  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18697  		v0.AddArg2(x, y)
 18698  		v.AddArg(v0)
 18699  		return true
 18700  	}
 18701  }
 18702  func rewriteValueARM64_OpLeq64(v *Value) bool {
 18703  	v_1 := v.Args[1]
 18704  	v_0 := v.Args[0]
 18705  	b := v.Block
 18706  	// match: (Leq64 x y)
 18707  	// result: (LessEqual (CMP x y))
 18708  	for {
 18709  		x := v_0
 18710  		y := v_1
 18711  		v.reset(OpARM64LessEqual)
 18712  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 18713  		v0.AddArg2(x, y)
 18714  		v.AddArg(v0)
 18715  		return true
 18716  	}
 18717  }
 18718  func rewriteValueARM64_OpLeq64F(v *Value) bool {
 18719  	v_1 := v.Args[1]
 18720  	v_0 := v.Args[0]
 18721  	b := v.Block
 18722  	// match: (Leq64F x y)
 18723  	// result: (LessEqualF (FCMPD x y))
 18724  	for {
 18725  		x := v_0
 18726  		y := v_1
 18727  		v.reset(OpARM64LessEqualF)
 18728  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 18729  		v0.AddArg2(x, y)
 18730  		v.AddArg(v0)
 18731  		return true
 18732  	}
 18733  }
 18734  func rewriteValueARM64_OpLeq64U(v *Value) bool {
 18735  	v_1 := v.Args[1]
 18736  	v_0 := v.Args[0]
 18737  	b := v.Block
 18738  	typ := &b.Func.Config.Types
 18739  	// match: (Leq64U x zero:(MOVDconst [0]))
 18740  	// result: (Eq64 x zero)
 18741  	for {
 18742  		x := v_0
 18743  		zero := v_1
 18744  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 18745  			break
 18746  		}
 18747  		v.reset(OpEq64)
 18748  		v.AddArg2(x, zero)
 18749  		return true
 18750  	}
 18751  	// match: (Leq64U (MOVDconst [1]) x)
 18752  	// result: (Neq64 (MOVDconst [0]) x)
 18753  	for {
 18754  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 18755  			break
 18756  		}
 18757  		x := v_1
 18758  		v.reset(OpNeq64)
 18759  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 18760  		v0.AuxInt = int64ToAuxInt(0)
 18761  		v.AddArg2(v0, x)
 18762  		return true
 18763  	}
 18764  	// match: (Leq64U x y)
 18765  	// result: (LessEqualU (CMP x y))
 18766  	for {
 18767  		x := v_0
 18768  		y := v_1
 18769  		v.reset(OpARM64LessEqualU)
 18770  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 18771  		v0.AddArg2(x, y)
 18772  		v.AddArg(v0)
 18773  		return true
 18774  	}
 18775  }
 18776  func rewriteValueARM64_OpLeq8(v *Value) bool {
 18777  	v_1 := v.Args[1]
 18778  	v_0 := v.Args[0]
 18779  	b := v.Block
 18780  	typ := &b.Func.Config.Types
 18781  	// match: (Leq8 x y)
 18782  	// result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
 18783  	for {
 18784  		x := v_0
 18785  		y := v_1
 18786  		v.reset(OpARM64LessEqual)
 18787  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18788  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 18789  		v1.AddArg(x)
 18790  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 18791  		v2.AddArg(y)
 18792  		v0.AddArg2(v1, v2)
 18793  		v.AddArg(v0)
 18794  		return true
 18795  	}
 18796  }
 18797  func rewriteValueARM64_OpLeq8U(v *Value) bool {
 18798  	v_1 := v.Args[1]
 18799  	v_0 := v.Args[0]
 18800  	b := v.Block
 18801  	typ := &b.Func.Config.Types
 18802  	// match: (Leq8U x zero:(MOVDconst [0]))
 18803  	// result: (Eq8 x zero)
 18804  	for {
 18805  		x := v_0
 18806  		zero := v_1
 18807  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 18808  			break
 18809  		}
 18810  		v.reset(OpEq8)
 18811  		v.AddArg2(x, zero)
 18812  		return true
 18813  	}
 18814  	// match: (Leq8U (MOVDconst [1]) x)
 18815  	// result: (Neq8 (MOVDconst [0]) x)
 18816  	for {
 18817  		if v_0.Op != OpARM64MOVDconst || auxIntToInt64(v_0.AuxInt) != 1 {
 18818  			break
 18819  		}
 18820  		x := v_1
 18821  		v.reset(OpNeq8)
 18822  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 18823  		v0.AuxInt = int64ToAuxInt(0)
 18824  		v.AddArg2(v0, x)
 18825  		return true
 18826  	}
 18827  	// match: (Leq8U x y)
 18828  	// result: (LessEqualU (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 18829  	for {
 18830  		x := v_0
 18831  		y := v_1
 18832  		v.reset(OpARM64LessEqualU)
 18833  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18834  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 18835  		v1.AddArg(x)
 18836  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 18837  		v2.AddArg(y)
 18838  		v0.AddArg2(v1, v2)
 18839  		v.AddArg(v0)
 18840  		return true
 18841  	}
 18842  }
 18843  func rewriteValueARM64_OpLess16(v *Value) bool {
 18844  	v_1 := v.Args[1]
 18845  	v_0 := v.Args[0]
 18846  	b := v.Block
 18847  	typ := &b.Func.Config.Types
 18848  	// match: (Less16 x y)
 18849  	// result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
 18850  	for {
 18851  		x := v_0
 18852  		y := v_1
 18853  		v.reset(OpARM64LessThan)
 18854  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18855  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 18856  		v1.AddArg(x)
 18857  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 18858  		v2.AddArg(y)
 18859  		v0.AddArg2(v1, v2)
 18860  		v.AddArg(v0)
 18861  		return true
 18862  	}
 18863  }
 18864  func rewriteValueARM64_OpLess16U(v *Value) bool {
 18865  	v_1 := v.Args[1]
 18866  	v_0 := v.Args[0]
 18867  	b := v.Block
 18868  	typ := &b.Func.Config.Types
 18869  	// match: (Less16U zero:(MOVDconst [0]) x)
 18870  	// result: (Neq16 zero x)
 18871  	for {
 18872  		zero := v_0
 18873  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 18874  			break
 18875  		}
 18876  		x := v_1
 18877  		v.reset(OpNeq16)
 18878  		v.AddArg2(zero, x)
 18879  		return true
 18880  	}
 18881  	// match: (Less16U x (MOVDconst [1]))
 18882  	// result: (Eq16 x (MOVDconst [0]))
 18883  	for {
 18884  		x := v_0
 18885  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 18886  			break
 18887  		}
 18888  		v.reset(OpEq16)
 18889  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 18890  		v0.AuxInt = int64ToAuxInt(0)
 18891  		v.AddArg2(x, v0)
 18892  		return true
 18893  	}
 18894  	// match: (Less16U x y)
 18895  	// result: (LessThanU (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 18896  	for {
 18897  		x := v_0
 18898  		y := v_1
 18899  		v.reset(OpARM64LessThanU)
 18900  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18901  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 18902  		v1.AddArg(x)
 18903  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 18904  		v2.AddArg(y)
 18905  		v0.AddArg2(v1, v2)
 18906  		v.AddArg(v0)
 18907  		return true
 18908  	}
 18909  }
 18910  func rewriteValueARM64_OpLess32(v *Value) bool {
 18911  	v_1 := v.Args[1]
 18912  	v_0 := v.Args[0]
 18913  	b := v.Block
 18914  	// match: (Less32 x y)
 18915  	// result: (LessThan (CMPW x y))
 18916  	for {
 18917  		x := v_0
 18918  		y := v_1
 18919  		v.reset(OpARM64LessThan)
 18920  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18921  		v0.AddArg2(x, y)
 18922  		v.AddArg(v0)
 18923  		return true
 18924  	}
 18925  }
 18926  func rewriteValueARM64_OpLess32F(v *Value) bool {
 18927  	v_1 := v.Args[1]
 18928  	v_0 := v.Args[0]
 18929  	b := v.Block
 18930  	// match: (Less32F x y)
 18931  	// result: (LessThanF (FCMPS x y))
 18932  	for {
 18933  		x := v_0
 18934  		y := v_1
 18935  		v.reset(OpARM64LessThanF)
 18936  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 18937  		v0.AddArg2(x, y)
 18938  		v.AddArg(v0)
 18939  		return true
 18940  	}
 18941  }
 18942  func rewriteValueARM64_OpLess32U(v *Value) bool {
 18943  	v_1 := v.Args[1]
 18944  	v_0 := v.Args[0]
 18945  	b := v.Block
 18946  	typ := &b.Func.Config.Types
 18947  	// match: (Less32U zero:(MOVDconst [0]) x)
 18948  	// result: (Neq32 zero x)
 18949  	for {
 18950  		zero := v_0
 18951  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 18952  			break
 18953  		}
 18954  		x := v_1
 18955  		v.reset(OpNeq32)
 18956  		v.AddArg2(zero, x)
 18957  		return true
 18958  	}
 18959  	// match: (Less32U x (MOVDconst [1]))
 18960  	// result: (Eq32 x (MOVDconst [0]))
 18961  	for {
 18962  		x := v_0
 18963  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 18964  			break
 18965  		}
 18966  		v.reset(OpEq32)
 18967  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 18968  		v0.AuxInt = int64ToAuxInt(0)
 18969  		v.AddArg2(x, v0)
 18970  		return true
 18971  	}
 18972  	// match: (Less32U x y)
 18973  	// result: (LessThanU (CMPW x y))
 18974  	for {
 18975  		x := v_0
 18976  		y := v_1
 18977  		v.reset(OpARM64LessThanU)
 18978  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 18979  		v0.AddArg2(x, y)
 18980  		v.AddArg(v0)
 18981  		return true
 18982  	}
 18983  }
 18984  func rewriteValueARM64_OpLess64(v *Value) bool {
 18985  	v_1 := v.Args[1]
 18986  	v_0 := v.Args[0]
 18987  	b := v.Block
 18988  	// match: (Less64 x y)
 18989  	// result: (LessThan (CMP x y))
 18990  	for {
 18991  		x := v_0
 18992  		y := v_1
 18993  		v.reset(OpARM64LessThan)
 18994  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 18995  		v0.AddArg2(x, y)
 18996  		v.AddArg(v0)
 18997  		return true
 18998  	}
 18999  }
 19000  func rewriteValueARM64_OpLess64F(v *Value) bool {
 19001  	v_1 := v.Args[1]
 19002  	v_0 := v.Args[0]
 19003  	b := v.Block
 19004  	// match: (Less64F x y)
 19005  	// result: (LessThanF (FCMPD x y))
 19006  	for {
 19007  		x := v_0
 19008  		y := v_1
 19009  		v.reset(OpARM64LessThanF)
 19010  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 19011  		v0.AddArg2(x, y)
 19012  		v.AddArg(v0)
 19013  		return true
 19014  	}
 19015  }
 19016  func rewriteValueARM64_OpLess64U(v *Value) bool {
 19017  	v_1 := v.Args[1]
 19018  	v_0 := v.Args[0]
 19019  	b := v.Block
 19020  	typ := &b.Func.Config.Types
 19021  	// match: (Less64U zero:(MOVDconst [0]) x)
 19022  	// result: (Neq64 zero x)
 19023  	for {
 19024  		zero := v_0
 19025  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 19026  			break
 19027  		}
 19028  		x := v_1
 19029  		v.reset(OpNeq64)
 19030  		v.AddArg2(zero, x)
 19031  		return true
 19032  	}
 19033  	// match: (Less64U x (MOVDconst [1]))
 19034  	// result: (Eq64 x (MOVDconst [0]))
 19035  	for {
 19036  		x := v_0
 19037  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 19038  			break
 19039  		}
 19040  		v.reset(OpEq64)
 19041  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 19042  		v0.AuxInt = int64ToAuxInt(0)
 19043  		v.AddArg2(x, v0)
 19044  		return true
 19045  	}
 19046  	// match: (Less64U x y)
 19047  	// result: (LessThanU (CMP x y))
 19048  	for {
 19049  		x := v_0
 19050  		y := v_1
 19051  		v.reset(OpARM64LessThanU)
 19052  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 19053  		v0.AddArg2(x, y)
 19054  		v.AddArg(v0)
 19055  		return true
 19056  	}
 19057  }
 19058  func rewriteValueARM64_OpLess8(v *Value) bool {
 19059  	v_1 := v.Args[1]
 19060  	v_0 := v.Args[0]
 19061  	b := v.Block
 19062  	typ := &b.Func.Config.Types
 19063  	// match: (Less8 x y)
 19064  	// result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
 19065  	for {
 19066  		x := v_0
 19067  		y := v_1
 19068  		v.reset(OpARM64LessThan)
 19069  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 19070  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 19071  		v1.AddArg(x)
 19072  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 19073  		v2.AddArg(y)
 19074  		v0.AddArg2(v1, v2)
 19075  		v.AddArg(v0)
 19076  		return true
 19077  	}
 19078  }
 19079  func rewriteValueARM64_OpLess8U(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: (Less8U zero:(MOVDconst [0]) x)
 19085  	// result: (Neq8 zero x)
 19086  	for {
 19087  		zero := v_0
 19088  		if zero.Op != OpARM64MOVDconst || auxIntToInt64(zero.AuxInt) != 0 {
 19089  			break
 19090  		}
 19091  		x := v_1
 19092  		v.reset(OpNeq8)
 19093  		v.AddArg2(zero, x)
 19094  		return true
 19095  	}
 19096  	// match: (Less8U x (MOVDconst [1]))
 19097  	// result: (Eq8 x (MOVDconst [0]))
 19098  	for {
 19099  		x := v_0
 19100  		if v_1.Op != OpARM64MOVDconst || auxIntToInt64(v_1.AuxInt) != 1 {
 19101  			break
 19102  		}
 19103  		v.reset(OpEq8)
 19104  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 19105  		v0.AuxInt = int64ToAuxInt(0)
 19106  		v.AddArg2(x, v0)
 19107  		return true
 19108  	}
 19109  	// match: (Less8U x y)
 19110  	// result: (LessThanU (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 19111  	for {
 19112  		x := v_0
 19113  		y := v_1
 19114  		v.reset(OpARM64LessThanU)
 19115  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 19116  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 19117  		v1.AddArg(x)
 19118  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 19119  		v2.AddArg(y)
 19120  		v0.AddArg2(v1, v2)
 19121  		v.AddArg(v0)
 19122  		return true
 19123  	}
 19124  }
 19125  func rewriteValueARM64_OpLoad(v *Value) bool {
 19126  	v_1 := v.Args[1]
 19127  	v_0 := v.Args[0]
 19128  	// match: (Load <t> ptr mem)
 19129  	// cond: t.IsBoolean()
 19130  	// result: (MOVBUload ptr mem)
 19131  	for {
 19132  		t := v.Type
 19133  		ptr := v_0
 19134  		mem := v_1
 19135  		if !(t.IsBoolean()) {
 19136  			break
 19137  		}
 19138  		v.reset(OpARM64MOVBUload)
 19139  		v.AddArg2(ptr, mem)
 19140  		return true
 19141  	}
 19142  	// match: (Load <t> ptr mem)
 19143  	// cond: (is8BitInt(t) && t.IsSigned())
 19144  	// result: (MOVBload ptr mem)
 19145  	for {
 19146  		t := v.Type
 19147  		ptr := v_0
 19148  		mem := v_1
 19149  		if !(is8BitInt(t) && t.IsSigned()) {
 19150  			break
 19151  		}
 19152  		v.reset(OpARM64MOVBload)
 19153  		v.AddArg2(ptr, mem)
 19154  		return true
 19155  	}
 19156  	// match: (Load <t> ptr mem)
 19157  	// cond: (is8BitInt(t) && !t.IsSigned())
 19158  	// result: (MOVBUload ptr mem)
 19159  	for {
 19160  		t := v.Type
 19161  		ptr := v_0
 19162  		mem := v_1
 19163  		if !(is8BitInt(t) && !t.IsSigned()) {
 19164  			break
 19165  		}
 19166  		v.reset(OpARM64MOVBUload)
 19167  		v.AddArg2(ptr, mem)
 19168  		return true
 19169  	}
 19170  	// match: (Load <t> ptr mem)
 19171  	// cond: (is16BitInt(t) && t.IsSigned())
 19172  	// result: (MOVHload ptr mem)
 19173  	for {
 19174  		t := v.Type
 19175  		ptr := v_0
 19176  		mem := v_1
 19177  		if !(is16BitInt(t) && t.IsSigned()) {
 19178  			break
 19179  		}
 19180  		v.reset(OpARM64MOVHload)
 19181  		v.AddArg2(ptr, mem)
 19182  		return true
 19183  	}
 19184  	// match: (Load <t> ptr mem)
 19185  	// cond: (is16BitInt(t) && !t.IsSigned())
 19186  	// result: (MOVHUload ptr mem)
 19187  	for {
 19188  		t := v.Type
 19189  		ptr := v_0
 19190  		mem := v_1
 19191  		if !(is16BitInt(t) && !t.IsSigned()) {
 19192  			break
 19193  		}
 19194  		v.reset(OpARM64MOVHUload)
 19195  		v.AddArg2(ptr, mem)
 19196  		return true
 19197  	}
 19198  	// match: (Load <t> ptr mem)
 19199  	// cond: (is32BitInt(t) && t.IsSigned())
 19200  	// result: (MOVWload ptr mem)
 19201  	for {
 19202  		t := v.Type
 19203  		ptr := v_0
 19204  		mem := v_1
 19205  		if !(is32BitInt(t) && t.IsSigned()) {
 19206  			break
 19207  		}
 19208  		v.reset(OpARM64MOVWload)
 19209  		v.AddArg2(ptr, mem)
 19210  		return true
 19211  	}
 19212  	// match: (Load <t> ptr mem)
 19213  	// cond: (is32BitInt(t) && !t.IsSigned())
 19214  	// result: (MOVWUload ptr mem)
 19215  	for {
 19216  		t := v.Type
 19217  		ptr := v_0
 19218  		mem := v_1
 19219  		if !(is32BitInt(t) && !t.IsSigned()) {
 19220  			break
 19221  		}
 19222  		v.reset(OpARM64MOVWUload)
 19223  		v.AddArg2(ptr, mem)
 19224  		return true
 19225  	}
 19226  	// match: (Load <t> ptr mem)
 19227  	// cond: (is64BitInt(t) || isPtr(t))
 19228  	// result: (MOVDload ptr mem)
 19229  	for {
 19230  		t := v.Type
 19231  		ptr := v_0
 19232  		mem := v_1
 19233  		if !(is64BitInt(t) || isPtr(t)) {
 19234  			break
 19235  		}
 19236  		v.reset(OpARM64MOVDload)
 19237  		v.AddArg2(ptr, mem)
 19238  		return true
 19239  	}
 19240  	// match: (Load <t> ptr mem)
 19241  	// cond: is32BitFloat(t)
 19242  	// result: (FMOVSload ptr mem)
 19243  	for {
 19244  		t := v.Type
 19245  		ptr := v_0
 19246  		mem := v_1
 19247  		if !(is32BitFloat(t)) {
 19248  			break
 19249  		}
 19250  		v.reset(OpARM64FMOVSload)
 19251  		v.AddArg2(ptr, mem)
 19252  		return true
 19253  	}
 19254  	// match: (Load <t> ptr mem)
 19255  	// cond: is64BitFloat(t)
 19256  	// result: (FMOVDload ptr mem)
 19257  	for {
 19258  		t := v.Type
 19259  		ptr := v_0
 19260  		mem := v_1
 19261  		if !(is64BitFloat(t)) {
 19262  			break
 19263  		}
 19264  		v.reset(OpARM64FMOVDload)
 19265  		v.AddArg2(ptr, mem)
 19266  		return true
 19267  	}
 19268  	return false
 19269  }
 19270  func rewriteValueARM64_OpLocalAddr(v *Value) bool {
 19271  	v_1 := v.Args[1]
 19272  	v_0 := v.Args[0]
 19273  	b := v.Block
 19274  	typ := &b.Func.Config.Types
 19275  	// match: (LocalAddr <t> {sym} base mem)
 19276  	// cond: t.Elem().HasPointers()
 19277  	// result: (MOVDaddr {sym} (SPanchored base mem))
 19278  	for {
 19279  		t := v.Type
 19280  		sym := auxToSym(v.Aux)
 19281  		base := v_0
 19282  		mem := v_1
 19283  		if !(t.Elem().HasPointers()) {
 19284  			break
 19285  		}
 19286  		v.reset(OpARM64MOVDaddr)
 19287  		v.Aux = symToAux(sym)
 19288  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
 19289  		v0.AddArg2(base, mem)
 19290  		v.AddArg(v0)
 19291  		return true
 19292  	}
 19293  	// match: (LocalAddr <t> {sym} base _)
 19294  	// cond: !t.Elem().HasPointers()
 19295  	// result: (MOVDaddr {sym} base)
 19296  	for {
 19297  		t := v.Type
 19298  		sym := auxToSym(v.Aux)
 19299  		base := v_0
 19300  		if !(!t.Elem().HasPointers()) {
 19301  			break
 19302  		}
 19303  		v.reset(OpARM64MOVDaddr)
 19304  		v.Aux = symToAux(sym)
 19305  		v.AddArg(base)
 19306  		return true
 19307  	}
 19308  	return false
 19309  }
 19310  func rewriteValueARM64_OpLsh16x16(v *Value) bool {
 19311  	v_1 := v.Args[1]
 19312  	v_0 := v.Args[0]
 19313  	b := v.Block
 19314  	typ := &b.Func.Config.Types
 19315  	// match: (Lsh16x16 <t> x y)
 19316  	// cond: shiftIsBounded(v)
 19317  	// result: (SLL <t> x y)
 19318  	for {
 19319  		t := v.Type
 19320  		x := v_0
 19321  		y := v_1
 19322  		if !(shiftIsBounded(v)) {
 19323  			break
 19324  		}
 19325  		v.reset(OpARM64SLL)
 19326  		v.Type = t
 19327  		v.AddArg2(x, y)
 19328  		return true
 19329  	}
 19330  	// match: (Lsh16x16 <t> x y)
 19331  	// cond: !shiftIsBounded(v)
 19332  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 19333  	for {
 19334  		t := v.Type
 19335  		x := v_0
 19336  		y := v_1
 19337  		if !(!shiftIsBounded(v)) {
 19338  			break
 19339  		}
 19340  		v.reset(OpARM64CSEL)
 19341  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19342  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19343  		v0.AddArg2(x, y)
 19344  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19345  		v1.AuxInt = int64ToAuxInt(0)
 19346  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19347  		v2.AuxInt = int64ToAuxInt(64)
 19348  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 19349  		v3.AddArg(y)
 19350  		v2.AddArg(v3)
 19351  		v.AddArg3(v0, v1, v2)
 19352  		return true
 19353  	}
 19354  	return false
 19355  }
 19356  func rewriteValueARM64_OpLsh16x32(v *Value) bool {
 19357  	v_1 := v.Args[1]
 19358  	v_0 := v.Args[0]
 19359  	b := v.Block
 19360  	typ := &b.Func.Config.Types
 19361  	// match: (Lsh16x32 <t> x y)
 19362  	// cond: shiftIsBounded(v)
 19363  	// result: (SLL <t> x y)
 19364  	for {
 19365  		t := v.Type
 19366  		x := v_0
 19367  		y := v_1
 19368  		if !(shiftIsBounded(v)) {
 19369  			break
 19370  		}
 19371  		v.reset(OpARM64SLL)
 19372  		v.Type = t
 19373  		v.AddArg2(x, y)
 19374  		return true
 19375  	}
 19376  	// match: (Lsh16x32 <t> x y)
 19377  	// cond: !shiftIsBounded(v)
 19378  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 19379  	for {
 19380  		t := v.Type
 19381  		x := v_0
 19382  		y := v_1
 19383  		if !(!shiftIsBounded(v)) {
 19384  			break
 19385  		}
 19386  		v.reset(OpARM64CSEL)
 19387  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19388  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19389  		v0.AddArg2(x, y)
 19390  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19391  		v1.AuxInt = int64ToAuxInt(0)
 19392  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19393  		v2.AuxInt = int64ToAuxInt(64)
 19394  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 19395  		v3.AddArg(y)
 19396  		v2.AddArg(v3)
 19397  		v.AddArg3(v0, v1, v2)
 19398  		return true
 19399  	}
 19400  	return false
 19401  }
 19402  func rewriteValueARM64_OpLsh16x64(v *Value) bool {
 19403  	v_1 := v.Args[1]
 19404  	v_0 := v.Args[0]
 19405  	b := v.Block
 19406  	// match: (Lsh16x64 <t> x y)
 19407  	// cond: shiftIsBounded(v)
 19408  	// result: (SLL <t> x y)
 19409  	for {
 19410  		t := v.Type
 19411  		x := v_0
 19412  		y := v_1
 19413  		if !(shiftIsBounded(v)) {
 19414  			break
 19415  		}
 19416  		v.reset(OpARM64SLL)
 19417  		v.Type = t
 19418  		v.AddArg2(x, y)
 19419  		return true
 19420  	}
 19421  	// match: (Lsh16x64 <t> x y)
 19422  	// cond: !shiftIsBounded(v)
 19423  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 19424  	for {
 19425  		t := v.Type
 19426  		x := v_0
 19427  		y := v_1
 19428  		if !(!shiftIsBounded(v)) {
 19429  			break
 19430  		}
 19431  		v.reset(OpARM64CSEL)
 19432  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19433  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19434  		v0.AddArg2(x, y)
 19435  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19436  		v1.AuxInt = int64ToAuxInt(0)
 19437  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19438  		v2.AuxInt = int64ToAuxInt(64)
 19439  		v2.AddArg(y)
 19440  		v.AddArg3(v0, v1, v2)
 19441  		return true
 19442  	}
 19443  	return false
 19444  }
 19445  func rewriteValueARM64_OpLsh16x8(v *Value) bool {
 19446  	v_1 := v.Args[1]
 19447  	v_0 := v.Args[0]
 19448  	b := v.Block
 19449  	typ := &b.Func.Config.Types
 19450  	// match: (Lsh16x8 <t> x y)
 19451  	// cond: shiftIsBounded(v)
 19452  	// result: (SLL <t> x y)
 19453  	for {
 19454  		t := v.Type
 19455  		x := v_0
 19456  		y := v_1
 19457  		if !(shiftIsBounded(v)) {
 19458  			break
 19459  		}
 19460  		v.reset(OpARM64SLL)
 19461  		v.Type = t
 19462  		v.AddArg2(x, y)
 19463  		return true
 19464  	}
 19465  	// match: (Lsh16x8 <t> x y)
 19466  	// cond: !shiftIsBounded(v)
 19467  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 19468  	for {
 19469  		t := v.Type
 19470  		x := v_0
 19471  		y := v_1
 19472  		if !(!shiftIsBounded(v)) {
 19473  			break
 19474  		}
 19475  		v.reset(OpARM64CSEL)
 19476  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19477  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19478  		v0.AddArg2(x, y)
 19479  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19480  		v1.AuxInt = int64ToAuxInt(0)
 19481  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19482  		v2.AuxInt = int64ToAuxInt(64)
 19483  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 19484  		v3.AddArg(y)
 19485  		v2.AddArg(v3)
 19486  		v.AddArg3(v0, v1, v2)
 19487  		return true
 19488  	}
 19489  	return false
 19490  }
 19491  func rewriteValueARM64_OpLsh32x16(v *Value) bool {
 19492  	v_1 := v.Args[1]
 19493  	v_0 := v.Args[0]
 19494  	b := v.Block
 19495  	typ := &b.Func.Config.Types
 19496  	// match: (Lsh32x16 <t> x y)
 19497  	// cond: shiftIsBounded(v)
 19498  	// result: (SLL <t> x y)
 19499  	for {
 19500  		t := v.Type
 19501  		x := v_0
 19502  		y := v_1
 19503  		if !(shiftIsBounded(v)) {
 19504  			break
 19505  		}
 19506  		v.reset(OpARM64SLL)
 19507  		v.Type = t
 19508  		v.AddArg2(x, y)
 19509  		return true
 19510  	}
 19511  	// match: (Lsh32x16 <t> x y)
 19512  	// cond: !shiftIsBounded(v)
 19513  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 19514  	for {
 19515  		t := v.Type
 19516  		x := v_0
 19517  		y := v_1
 19518  		if !(!shiftIsBounded(v)) {
 19519  			break
 19520  		}
 19521  		v.reset(OpARM64CSEL)
 19522  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19523  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19524  		v0.AddArg2(x, y)
 19525  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19526  		v1.AuxInt = int64ToAuxInt(0)
 19527  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19528  		v2.AuxInt = int64ToAuxInt(64)
 19529  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 19530  		v3.AddArg(y)
 19531  		v2.AddArg(v3)
 19532  		v.AddArg3(v0, v1, v2)
 19533  		return true
 19534  	}
 19535  	return false
 19536  }
 19537  func rewriteValueARM64_OpLsh32x32(v *Value) bool {
 19538  	v_1 := v.Args[1]
 19539  	v_0 := v.Args[0]
 19540  	b := v.Block
 19541  	typ := &b.Func.Config.Types
 19542  	// match: (Lsh32x32 <t> x y)
 19543  	// cond: shiftIsBounded(v)
 19544  	// result: (SLL <t> x y)
 19545  	for {
 19546  		t := v.Type
 19547  		x := v_0
 19548  		y := v_1
 19549  		if !(shiftIsBounded(v)) {
 19550  			break
 19551  		}
 19552  		v.reset(OpARM64SLL)
 19553  		v.Type = t
 19554  		v.AddArg2(x, y)
 19555  		return true
 19556  	}
 19557  	// match: (Lsh32x32 <t> x y)
 19558  	// cond: !shiftIsBounded(v)
 19559  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 19560  	for {
 19561  		t := v.Type
 19562  		x := v_0
 19563  		y := v_1
 19564  		if !(!shiftIsBounded(v)) {
 19565  			break
 19566  		}
 19567  		v.reset(OpARM64CSEL)
 19568  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19569  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19570  		v0.AddArg2(x, y)
 19571  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19572  		v1.AuxInt = int64ToAuxInt(0)
 19573  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19574  		v2.AuxInt = int64ToAuxInt(64)
 19575  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 19576  		v3.AddArg(y)
 19577  		v2.AddArg(v3)
 19578  		v.AddArg3(v0, v1, v2)
 19579  		return true
 19580  	}
 19581  	return false
 19582  }
 19583  func rewriteValueARM64_OpLsh32x64(v *Value) bool {
 19584  	v_1 := v.Args[1]
 19585  	v_0 := v.Args[0]
 19586  	b := v.Block
 19587  	// match: (Lsh32x64 <t> x y)
 19588  	// cond: shiftIsBounded(v)
 19589  	// result: (SLL <t> x y)
 19590  	for {
 19591  		t := v.Type
 19592  		x := v_0
 19593  		y := v_1
 19594  		if !(shiftIsBounded(v)) {
 19595  			break
 19596  		}
 19597  		v.reset(OpARM64SLL)
 19598  		v.Type = t
 19599  		v.AddArg2(x, y)
 19600  		return true
 19601  	}
 19602  	// match: (Lsh32x64 <t> x y)
 19603  	// cond: !shiftIsBounded(v)
 19604  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 19605  	for {
 19606  		t := v.Type
 19607  		x := v_0
 19608  		y := v_1
 19609  		if !(!shiftIsBounded(v)) {
 19610  			break
 19611  		}
 19612  		v.reset(OpARM64CSEL)
 19613  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19614  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19615  		v0.AddArg2(x, y)
 19616  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19617  		v1.AuxInt = int64ToAuxInt(0)
 19618  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19619  		v2.AuxInt = int64ToAuxInt(64)
 19620  		v2.AddArg(y)
 19621  		v.AddArg3(v0, v1, v2)
 19622  		return true
 19623  	}
 19624  	return false
 19625  }
 19626  func rewriteValueARM64_OpLsh32x8(v *Value) bool {
 19627  	v_1 := v.Args[1]
 19628  	v_0 := v.Args[0]
 19629  	b := v.Block
 19630  	typ := &b.Func.Config.Types
 19631  	// match: (Lsh32x8 <t> x y)
 19632  	// cond: shiftIsBounded(v)
 19633  	// result: (SLL <t> x y)
 19634  	for {
 19635  		t := v.Type
 19636  		x := v_0
 19637  		y := v_1
 19638  		if !(shiftIsBounded(v)) {
 19639  			break
 19640  		}
 19641  		v.reset(OpARM64SLL)
 19642  		v.Type = t
 19643  		v.AddArg2(x, y)
 19644  		return true
 19645  	}
 19646  	// match: (Lsh32x8 <t> x y)
 19647  	// cond: !shiftIsBounded(v)
 19648  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 19649  	for {
 19650  		t := v.Type
 19651  		x := v_0
 19652  		y := v_1
 19653  		if !(!shiftIsBounded(v)) {
 19654  			break
 19655  		}
 19656  		v.reset(OpARM64CSEL)
 19657  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19658  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19659  		v0.AddArg2(x, y)
 19660  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19661  		v1.AuxInt = int64ToAuxInt(0)
 19662  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19663  		v2.AuxInt = int64ToAuxInt(64)
 19664  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 19665  		v3.AddArg(y)
 19666  		v2.AddArg(v3)
 19667  		v.AddArg3(v0, v1, v2)
 19668  		return true
 19669  	}
 19670  	return false
 19671  }
 19672  func rewriteValueARM64_OpLsh64x16(v *Value) bool {
 19673  	v_1 := v.Args[1]
 19674  	v_0 := v.Args[0]
 19675  	b := v.Block
 19676  	typ := &b.Func.Config.Types
 19677  	// match: (Lsh64x16 <t> x y)
 19678  	// cond: shiftIsBounded(v)
 19679  	// result: (SLL <t> x y)
 19680  	for {
 19681  		t := v.Type
 19682  		x := v_0
 19683  		y := v_1
 19684  		if !(shiftIsBounded(v)) {
 19685  			break
 19686  		}
 19687  		v.reset(OpARM64SLL)
 19688  		v.Type = t
 19689  		v.AddArg2(x, y)
 19690  		return true
 19691  	}
 19692  	// match: (Lsh64x16 <t> x y)
 19693  	// cond: !shiftIsBounded(v)
 19694  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 19695  	for {
 19696  		t := v.Type
 19697  		x := v_0
 19698  		y := v_1
 19699  		if !(!shiftIsBounded(v)) {
 19700  			break
 19701  		}
 19702  		v.reset(OpARM64CSEL)
 19703  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19704  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19705  		v0.AddArg2(x, y)
 19706  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19707  		v1.AuxInt = int64ToAuxInt(0)
 19708  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19709  		v2.AuxInt = int64ToAuxInt(64)
 19710  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 19711  		v3.AddArg(y)
 19712  		v2.AddArg(v3)
 19713  		v.AddArg3(v0, v1, v2)
 19714  		return true
 19715  	}
 19716  	return false
 19717  }
 19718  func rewriteValueARM64_OpLsh64x32(v *Value) bool {
 19719  	v_1 := v.Args[1]
 19720  	v_0 := v.Args[0]
 19721  	b := v.Block
 19722  	typ := &b.Func.Config.Types
 19723  	// match: (Lsh64x32 <t> x y)
 19724  	// cond: shiftIsBounded(v)
 19725  	// result: (SLL <t> x y)
 19726  	for {
 19727  		t := v.Type
 19728  		x := v_0
 19729  		y := v_1
 19730  		if !(shiftIsBounded(v)) {
 19731  			break
 19732  		}
 19733  		v.reset(OpARM64SLL)
 19734  		v.Type = t
 19735  		v.AddArg2(x, y)
 19736  		return true
 19737  	}
 19738  	// match: (Lsh64x32 <t> x y)
 19739  	// cond: !shiftIsBounded(v)
 19740  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 19741  	for {
 19742  		t := v.Type
 19743  		x := v_0
 19744  		y := v_1
 19745  		if !(!shiftIsBounded(v)) {
 19746  			break
 19747  		}
 19748  		v.reset(OpARM64CSEL)
 19749  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19750  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19751  		v0.AddArg2(x, y)
 19752  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19753  		v1.AuxInt = int64ToAuxInt(0)
 19754  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19755  		v2.AuxInt = int64ToAuxInt(64)
 19756  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 19757  		v3.AddArg(y)
 19758  		v2.AddArg(v3)
 19759  		v.AddArg3(v0, v1, v2)
 19760  		return true
 19761  	}
 19762  	return false
 19763  }
 19764  func rewriteValueARM64_OpLsh64x64(v *Value) bool {
 19765  	v_1 := v.Args[1]
 19766  	v_0 := v.Args[0]
 19767  	b := v.Block
 19768  	// match: (Lsh64x64 <t> x y)
 19769  	// cond: shiftIsBounded(v)
 19770  	// result: (SLL <t> x y)
 19771  	for {
 19772  		t := v.Type
 19773  		x := v_0
 19774  		y := v_1
 19775  		if !(shiftIsBounded(v)) {
 19776  			break
 19777  		}
 19778  		v.reset(OpARM64SLL)
 19779  		v.Type = t
 19780  		v.AddArg2(x, y)
 19781  		return true
 19782  	}
 19783  	// match: (Lsh64x64 <t> x y)
 19784  	// cond: !shiftIsBounded(v)
 19785  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 19786  	for {
 19787  		t := v.Type
 19788  		x := v_0
 19789  		y := v_1
 19790  		if !(!shiftIsBounded(v)) {
 19791  			break
 19792  		}
 19793  		v.reset(OpARM64CSEL)
 19794  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19795  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19796  		v0.AddArg2(x, y)
 19797  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19798  		v1.AuxInt = int64ToAuxInt(0)
 19799  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19800  		v2.AuxInt = int64ToAuxInt(64)
 19801  		v2.AddArg(y)
 19802  		v.AddArg3(v0, v1, v2)
 19803  		return true
 19804  	}
 19805  	return false
 19806  }
 19807  func rewriteValueARM64_OpLsh64x8(v *Value) bool {
 19808  	v_1 := v.Args[1]
 19809  	v_0 := v.Args[0]
 19810  	b := v.Block
 19811  	typ := &b.Func.Config.Types
 19812  	// match: (Lsh64x8 <t> x y)
 19813  	// cond: shiftIsBounded(v)
 19814  	// result: (SLL <t> x y)
 19815  	for {
 19816  		t := v.Type
 19817  		x := v_0
 19818  		y := v_1
 19819  		if !(shiftIsBounded(v)) {
 19820  			break
 19821  		}
 19822  		v.reset(OpARM64SLL)
 19823  		v.Type = t
 19824  		v.AddArg2(x, y)
 19825  		return true
 19826  	}
 19827  	// match: (Lsh64x8 <t> x y)
 19828  	// cond: !shiftIsBounded(v)
 19829  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 19830  	for {
 19831  		t := v.Type
 19832  		x := v_0
 19833  		y := v_1
 19834  		if !(!shiftIsBounded(v)) {
 19835  			break
 19836  		}
 19837  		v.reset(OpARM64CSEL)
 19838  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19839  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19840  		v0.AddArg2(x, y)
 19841  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19842  		v1.AuxInt = int64ToAuxInt(0)
 19843  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19844  		v2.AuxInt = int64ToAuxInt(64)
 19845  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 19846  		v3.AddArg(y)
 19847  		v2.AddArg(v3)
 19848  		v.AddArg3(v0, v1, v2)
 19849  		return true
 19850  	}
 19851  	return false
 19852  }
 19853  func rewriteValueARM64_OpLsh8x16(v *Value) bool {
 19854  	v_1 := v.Args[1]
 19855  	v_0 := v.Args[0]
 19856  	b := v.Block
 19857  	typ := &b.Func.Config.Types
 19858  	// match: (Lsh8x16 <t> x y)
 19859  	// cond: shiftIsBounded(v)
 19860  	// result: (SLL <t> x y)
 19861  	for {
 19862  		t := v.Type
 19863  		x := v_0
 19864  		y := v_1
 19865  		if !(shiftIsBounded(v)) {
 19866  			break
 19867  		}
 19868  		v.reset(OpARM64SLL)
 19869  		v.Type = t
 19870  		v.AddArg2(x, y)
 19871  		return true
 19872  	}
 19873  	// match: (Lsh8x16 <t> x y)
 19874  	// cond: !shiftIsBounded(v)
 19875  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 19876  	for {
 19877  		t := v.Type
 19878  		x := v_0
 19879  		y := v_1
 19880  		if !(!shiftIsBounded(v)) {
 19881  			break
 19882  		}
 19883  		v.reset(OpARM64CSEL)
 19884  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19885  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19886  		v0.AddArg2(x, y)
 19887  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19888  		v1.AuxInt = int64ToAuxInt(0)
 19889  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19890  		v2.AuxInt = int64ToAuxInt(64)
 19891  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 19892  		v3.AddArg(y)
 19893  		v2.AddArg(v3)
 19894  		v.AddArg3(v0, v1, v2)
 19895  		return true
 19896  	}
 19897  	return false
 19898  }
 19899  func rewriteValueARM64_OpLsh8x32(v *Value) bool {
 19900  	v_1 := v.Args[1]
 19901  	v_0 := v.Args[0]
 19902  	b := v.Block
 19903  	typ := &b.Func.Config.Types
 19904  	// match: (Lsh8x32 <t> x y)
 19905  	// cond: shiftIsBounded(v)
 19906  	// result: (SLL <t> x y)
 19907  	for {
 19908  		t := v.Type
 19909  		x := v_0
 19910  		y := v_1
 19911  		if !(shiftIsBounded(v)) {
 19912  			break
 19913  		}
 19914  		v.reset(OpARM64SLL)
 19915  		v.Type = t
 19916  		v.AddArg2(x, y)
 19917  		return true
 19918  	}
 19919  	// match: (Lsh8x32 <t> x y)
 19920  	// cond: !shiftIsBounded(v)
 19921  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 19922  	for {
 19923  		t := v.Type
 19924  		x := v_0
 19925  		y := v_1
 19926  		if !(!shiftIsBounded(v)) {
 19927  			break
 19928  		}
 19929  		v.reset(OpARM64CSEL)
 19930  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19931  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19932  		v0.AddArg2(x, y)
 19933  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19934  		v1.AuxInt = int64ToAuxInt(0)
 19935  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19936  		v2.AuxInt = int64ToAuxInt(64)
 19937  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 19938  		v3.AddArg(y)
 19939  		v2.AddArg(v3)
 19940  		v.AddArg3(v0, v1, v2)
 19941  		return true
 19942  	}
 19943  	return false
 19944  }
 19945  func rewriteValueARM64_OpLsh8x64(v *Value) bool {
 19946  	v_1 := v.Args[1]
 19947  	v_0 := v.Args[0]
 19948  	b := v.Block
 19949  	// match: (Lsh8x64 <t> x y)
 19950  	// cond: shiftIsBounded(v)
 19951  	// result: (SLL <t> x y)
 19952  	for {
 19953  		t := v.Type
 19954  		x := v_0
 19955  		y := v_1
 19956  		if !(shiftIsBounded(v)) {
 19957  			break
 19958  		}
 19959  		v.reset(OpARM64SLL)
 19960  		v.Type = t
 19961  		v.AddArg2(x, y)
 19962  		return true
 19963  	}
 19964  	// match: (Lsh8x64 <t> x y)
 19965  	// cond: !shiftIsBounded(v)
 19966  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 19967  	for {
 19968  		t := v.Type
 19969  		x := v_0
 19970  		y := v_1
 19971  		if !(!shiftIsBounded(v)) {
 19972  			break
 19973  		}
 19974  		v.reset(OpARM64CSEL)
 19975  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 19976  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 19977  		v0.AddArg2(x, y)
 19978  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 19979  		v1.AuxInt = int64ToAuxInt(0)
 19980  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 19981  		v2.AuxInt = int64ToAuxInt(64)
 19982  		v2.AddArg(y)
 19983  		v.AddArg3(v0, v1, v2)
 19984  		return true
 19985  	}
 19986  	return false
 19987  }
 19988  func rewriteValueARM64_OpLsh8x8(v *Value) bool {
 19989  	v_1 := v.Args[1]
 19990  	v_0 := v.Args[0]
 19991  	b := v.Block
 19992  	typ := &b.Func.Config.Types
 19993  	// match: (Lsh8x8 <t> x y)
 19994  	// cond: shiftIsBounded(v)
 19995  	// result: (SLL <t> x y)
 19996  	for {
 19997  		t := v.Type
 19998  		x := v_0
 19999  		y := v_1
 20000  		if !(shiftIsBounded(v)) {
 20001  			break
 20002  		}
 20003  		v.reset(OpARM64SLL)
 20004  		v.Type = t
 20005  		v.AddArg2(x, y)
 20006  		return true
 20007  	}
 20008  	// match: (Lsh8x8 <t> x y)
 20009  	// cond: !shiftIsBounded(v)
 20010  	// result: (CSEL [OpARM64LessThanU] (SLL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 20011  	for {
 20012  		t := v.Type
 20013  		x := v_0
 20014  		y := v_1
 20015  		if !(!shiftIsBounded(v)) {
 20016  			break
 20017  		}
 20018  		v.reset(OpARM64CSEL)
 20019  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 20020  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 20021  		v0.AddArg2(x, y)
 20022  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 20023  		v1.AuxInt = int64ToAuxInt(0)
 20024  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 20025  		v2.AuxInt = int64ToAuxInt(64)
 20026  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 20027  		v3.AddArg(y)
 20028  		v2.AddArg(v3)
 20029  		v.AddArg3(v0, v1, v2)
 20030  		return true
 20031  	}
 20032  	return false
 20033  }
 20034  func rewriteValueARM64_OpMod16(v *Value) bool {
 20035  	v_1 := v.Args[1]
 20036  	v_0 := v.Args[0]
 20037  	b := v.Block
 20038  	typ := &b.Func.Config.Types
 20039  	// match: (Mod16 x y)
 20040  	// result: (MODW (SignExt16to32 x) (SignExt16to32 y))
 20041  	for {
 20042  		x := v_0
 20043  		y := v_1
 20044  		v.reset(OpARM64MODW)
 20045  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 20046  		v0.AddArg(x)
 20047  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 20048  		v1.AddArg(y)
 20049  		v.AddArg2(v0, v1)
 20050  		return true
 20051  	}
 20052  }
 20053  func rewriteValueARM64_OpMod16u(v *Value) bool {
 20054  	v_1 := v.Args[1]
 20055  	v_0 := v.Args[0]
 20056  	b := v.Block
 20057  	typ := &b.Func.Config.Types
 20058  	// match: (Mod16u x y)
 20059  	// result: (UMODW (ZeroExt16to32 x) (ZeroExt16to32 y))
 20060  	for {
 20061  		x := v_0
 20062  		y := v_1
 20063  		v.reset(OpARM64UMODW)
 20064  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 20065  		v0.AddArg(x)
 20066  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 20067  		v1.AddArg(y)
 20068  		v.AddArg2(v0, v1)
 20069  		return true
 20070  	}
 20071  }
 20072  func rewriteValueARM64_OpMod32(v *Value) bool {
 20073  	v_1 := v.Args[1]
 20074  	v_0 := v.Args[0]
 20075  	// match: (Mod32 x y)
 20076  	// result: (MODW x y)
 20077  	for {
 20078  		x := v_0
 20079  		y := v_1
 20080  		v.reset(OpARM64MODW)
 20081  		v.AddArg2(x, y)
 20082  		return true
 20083  	}
 20084  }
 20085  func rewriteValueARM64_OpMod64(v *Value) bool {
 20086  	v_1 := v.Args[1]
 20087  	v_0 := v.Args[0]
 20088  	// match: (Mod64 x y)
 20089  	// result: (MOD x y)
 20090  	for {
 20091  		x := v_0
 20092  		y := v_1
 20093  		v.reset(OpARM64MOD)
 20094  		v.AddArg2(x, y)
 20095  		return true
 20096  	}
 20097  }
 20098  func rewriteValueARM64_OpMod8(v *Value) bool {
 20099  	v_1 := v.Args[1]
 20100  	v_0 := v.Args[0]
 20101  	b := v.Block
 20102  	typ := &b.Func.Config.Types
 20103  	// match: (Mod8 x y)
 20104  	// result: (MODW (SignExt8to32 x) (SignExt8to32 y))
 20105  	for {
 20106  		x := v_0
 20107  		y := v_1
 20108  		v.reset(OpARM64MODW)
 20109  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 20110  		v0.AddArg(x)
 20111  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 20112  		v1.AddArg(y)
 20113  		v.AddArg2(v0, v1)
 20114  		return true
 20115  	}
 20116  }
 20117  func rewriteValueARM64_OpMod8u(v *Value) bool {
 20118  	v_1 := v.Args[1]
 20119  	v_0 := v.Args[0]
 20120  	b := v.Block
 20121  	typ := &b.Func.Config.Types
 20122  	// match: (Mod8u x y)
 20123  	// result: (UMODW (ZeroExt8to32 x) (ZeroExt8to32 y))
 20124  	for {
 20125  		x := v_0
 20126  		y := v_1
 20127  		v.reset(OpARM64UMODW)
 20128  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 20129  		v0.AddArg(x)
 20130  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 20131  		v1.AddArg(y)
 20132  		v.AddArg2(v0, v1)
 20133  		return true
 20134  	}
 20135  }
 20136  func rewriteValueARM64_OpMove(v *Value) bool {
 20137  	v_2 := v.Args[2]
 20138  	v_1 := v.Args[1]
 20139  	v_0 := v.Args[0]
 20140  	b := v.Block
 20141  	config := b.Func.Config
 20142  	typ := &b.Func.Config.Types
 20143  	// match: (Move [0] _ _ mem)
 20144  	// result: mem
 20145  	for {
 20146  		if auxIntToInt64(v.AuxInt) != 0 {
 20147  			break
 20148  		}
 20149  		mem := v_2
 20150  		v.copyOf(mem)
 20151  		return true
 20152  	}
 20153  	// match: (Move [1] dst src mem)
 20154  	// result: (MOVBstore dst (MOVBUload src mem) mem)
 20155  	for {
 20156  		if auxIntToInt64(v.AuxInt) != 1 {
 20157  			break
 20158  		}
 20159  		dst := v_0
 20160  		src := v_1
 20161  		mem := v_2
 20162  		v.reset(OpARM64MOVBstore)
 20163  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 20164  		v0.AddArg2(src, mem)
 20165  		v.AddArg3(dst, v0, mem)
 20166  		return true
 20167  	}
 20168  	// match: (Move [2] dst src mem)
 20169  	// result: (MOVHstore dst (MOVHUload src mem) mem)
 20170  	for {
 20171  		if auxIntToInt64(v.AuxInt) != 2 {
 20172  			break
 20173  		}
 20174  		dst := v_0
 20175  		src := v_1
 20176  		mem := v_2
 20177  		v.reset(OpARM64MOVHstore)
 20178  		v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 20179  		v0.AddArg2(src, mem)
 20180  		v.AddArg3(dst, v0, mem)
 20181  		return true
 20182  	}
 20183  	// match: (Move [3] dst src mem)
 20184  	// result: (MOVBstore [2] dst (MOVBUload [2] src mem) (MOVHstore dst (MOVHUload src mem) mem))
 20185  	for {
 20186  		if auxIntToInt64(v.AuxInt) != 3 {
 20187  			break
 20188  		}
 20189  		dst := v_0
 20190  		src := v_1
 20191  		mem := v_2
 20192  		v.reset(OpARM64MOVBstore)
 20193  		v.AuxInt = int32ToAuxInt(2)
 20194  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 20195  		v0.AuxInt = int32ToAuxInt(2)
 20196  		v0.AddArg2(src, mem)
 20197  		v1 := b.NewValue0(v.Pos, OpARM64MOVHstore, types.TypeMem)
 20198  		v2 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 20199  		v2.AddArg2(src, mem)
 20200  		v1.AddArg3(dst, v2, mem)
 20201  		v.AddArg3(dst, v0, v1)
 20202  		return true
 20203  	}
 20204  	// match: (Move [4] dst src mem)
 20205  	// result: (MOVWstore dst (MOVWUload src mem) mem)
 20206  	for {
 20207  		if auxIntToInt64(v.AuxInt) != 4 {
 20208  			break
 20209  		}
 20210  		dst := v_0
 20211  		src := v_1
 20212  		mem := v_2
 20213  		v.reset(OpARM64MOVWstore)
 20214  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 20215  		v0.AddArg2(src, mem)
 20216  		v.AddArg3(dst, v0, mem)
 20217  		return true
 20218  	}
 20219  	// match: (Move [5] dst src mem)
 20220  	// result: (MOVBstore [4] dst (MOVBUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
 20221  	for {
 20222  		if auxIntToInt64(v.AuxInt) != 5 {
 20223  			break
 20224  		}
 20225  		dst := v_0
 20226  		src := v_1
 20227  		mem := v_2
 20228  		v.reset(OpARM64MOVBstore)
 20229  		v.AuxInt = int32ToAuxInt(4)
 20230  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 20231  		v0.AuxInt = int32ToAuxInt(4)
 20232  		v0.AddArg2(src, mem)
 20233  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 20234  		v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 20235  		v2.AddArg2(src, mem)
 20236  		v1.AddArg3(dst, v2, mem)
 20237  		v.AddArg3(dst, v0, v1)
 20238  		return true
 20239  	}
 20240  	// match: (Move [6] dst src mem)
 20241  	// result: (MOVHstore [4] dst (MOVHUload [4] src mem) (MOVWstore dst (MOVWUload src mem) mem))
 20242  	for {
 20243  		if auxIntToInt64(v.AuxInt) != 6 {
 20244  			break
 20245  		}
 20246  		dst := v_0
 20247  		src := v_1
 20248  		mem := v_2
 20249  		v.reset(OpARM64MOVHstore)
 20250  		v.AuxInt = int32ToAuxInt(4)
 20251  		v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 20252  		v0.AuxInt = int32ToAuxInt(4)
 20253  		v0.AddArg2(src, mem)
 20254  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 20255  		v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 20256  		v2.AddArg2(src, mem)
 20257  		v1.AddArg3(dst, v2, mem)
 20258  		v.AddArg3(dst, v0, v1)
 20259  		return true
 20260  	}
 20261  	// match: (Move [7] dst src mem)
 20262  	// result: (MOVWstore [3] dst (MOVWUload [3] src mem) (MOVWstore dst (MOVWUload src mem) mem))
 20263  	for {
 20264  		if auxIntToInt64(v.AuxInt) != 7 {
 20265  			break
 20266  		}
 20267  		dst := v_0
 20268  		src := v_1
 20269  		mem := v_2
 20270  		v.reset(OpARM64MOVWstore)
 20271  		v.AuxInt = int32ToAuxInt(3)
 20272  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 20273  		v0.AuxInt = int32ToAuxInt(3)
 20274  		v0.AddArg2(src, mem)
 20275  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 20276  		v2 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 20277  		v2.AddArg2(src, mem)
 20278  		v1.AddArg3(dst, v2, mem)
 20279  		v.AddArg3(dst, v0, v1)
 20280  		return true
 20281  	}
 20282  	// match: (Move [8] dst src mem)
 20283  	// result: (MOVDstore dst (MOVDload src mem) mem)
 20284  	for {
 20285  		if auxIntToInt64(v.AuxInt) != 8 {
 20286  			break
 20287  		}
 20288  		dst := v_0
 20289  		src := v_1
 20290  		mem := v_2
 20291  		v.reset(OpARM64MOVDstore)
 20292  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20293  		v0.AddArg2(src, mem)
 20294  		v.AddArg3(dst, v0, mem)
 20295  		return true
 20296  	}
 20297  	// match: (Move [9] dst src mem)
 20298  	// result: (MOVBstore [8] dst (MOVBUload [8] src mem) (MOVDstore dst (MOVDload src mem) mem))
 20299  	for {
 20300  		if auxIntToInt64(v.AuxInt) != 9 {
 20301  			break
 20302  		}
 20303  		dst := v_0
 20304  		src := v_1
 20305  		mem := v_2
 20306  		v.reset(OpARM64MOVBstore)
 20307  		v.AuxInt = int32ToAuxInt(8)
 20308  		v0 := b.NewValue0(v.Pos, OpARM64MOVBUload, typ.UInt8)
 20309  		v0.AuxInt = int32ToAuxInt(8)
 20310  		v0.AddArg2(src, mem)
 20311  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 20312  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20313  		v2.AddArg2(src, mem)
 20314  		v1.AddArg3(dst, v2, mem)
 20315  		v.AddArg3(dst, v0, v1)
 20316  		return true
 20317  	}
 20318  	// match: (Move [10] dst src mem)
 20319  	// result: (MOVHstore [8] dst (MOVHUload [8] src mem) (MOVDstore dst (MOVDload src mem) mem))
 20320  	for {
 20321  		if auxIntToInt64(v.AuxInt) != 10 {
 20322  			break
 20323  		}
 20324  		dst := v_0
 20325  		src := v_1
 20326  		mem := v_2
 20327  		v.reset(OpARM64MOVHstore)
 20328  		v.AuxInt = int32ToAuxInt(8)
 20329  		v0 := b.NewValue0(v.Pos, OpARM64MOVHUload, typ.UInt16)
 20330  		v0.AuxInt = int32ToAuxInt(8)
 20331  		v0.AddArg2(src, mem)
 20332  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 20333  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20334  		v2.AddArg2(src, mem)
 20335  		v1.AddArg3(dst, v2, mem)
 20336  		v.AddArg3(dst, v0, v1)
 20337  		return true
 20338  	}
 20339  	// match: (Move [11] dst src mem)
 20340  	// result: (MOVDstore [3] dst (MOVDload [3] src mem) (MOVDstore dst (MOVDload src mem) mem))
 20341  	for {
 20342  		if auxIntToInt64(v.AuxInt) != 11 {
 20343  			break
 20344  		}
 20345  		dst := v_0
 20346  		src := v_1
 20347  		mem := v_2
 20348  		v.reset(OpARM64MOVDstore)
 20349  		v.AuxInt = int32ToAuxInt(3)
 20350  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20351  		v0.AuxInt = int32ToAuxInt(3)
 20352  		v0.AddArg2(src, mem)
 20353  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 20354  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20355  		v2.AddArg2(src, mem)
 20356  		v1.AddArg3(dst, v2, mem)
 20357  		v.AddArg3(dst, v0, v1)
 20358  		return true
 20359  	}
 20360  	// match: (Move [12] dst src mem)
 20361  	// result: (MOVWstore [8] dst (MOVWUload [8] src mem) (MOVDstore dst (MOVDload src mem) mem))
 20362  	for {
 20363  		if auxIntToInt64(v.AuxInt) != 12 {
 20364  			break
 20365  		}
 20366  		dst := v_0
 20367  		src := v_1
 20368  		mem := v_2
 20369  		v.reset(OpARM64MOVWstore)
 20370  		v.AuxInt = int32ToAuxInt(8)
 20371  		v0 := b.NewValue0(v.Pos, OpARM64MOVWUload, typ.UInt32)
 20372  		v0.AuxInt = int32ToAuxInt(8)
 20373  		v0.AddArg2(src, mem)
 20374  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 20375  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20376  		v2.AddArg2(src, mem)
 20377  		v1.AddArg3(dst, v2, mem)
 20378  		v.AddArg3(dst, v0, v1)
 20379  		return true
 20380  	}
 20381  	// match: (Move [13] dst src mem)
 20382  	// result: (MOVDstore [5] dst (MOVDload [5] src mem) (MOVDstore dst (MOVDload src mem) mem))
 20383  	for {
 20384  		if auxIntToInt64(v.AuxInt) != 13 {
 20385  			break
 20386  		}
 20387  		dst := v_0
 20388  		src := v_1
 20389  		mem := v_2
 20390  		v.reset(OpARM64MOVDstore)
 20391  		v.AuxInt = int32ToAuxInt(5)
 20392  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20393  		v0.AuxInt = int32ToAuxInt(5)
 20394  		v0.AddArg2(src, mem)
 20395  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 20396  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20397  		v2.AddArg2(src, mem)
 20398  		v1.AddArg3(dst, v2, mem)
 20399  		v.AddArg3(dst, v0, v1)
 20400  		return true
 20401  	}
 20402  	// match: (Move [14] dst src mem)
 20403  	// result: (MOVDstore [6] dst (MOVDload [6] src mem) (MOVDstore dst (MOVDload src mem) mem))
 20404  	for {
 20405  		if auxIntToInt64(v.AuxInt) != 14 {
 20406  			break
 20407  		}
 20408  		dst := v_0
 20409  		src := v_1
 20410  		mem := v_2
 20411  		v.reset(OpARM64MOVDstore)
 20412  		v.AuxInt = int32ToAuxInt(6)
 20413  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20414  		v0.AuxInt = int32ToAuxInt(6)
 20415  		v0.AddArg2(src, mem)
 20416  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 20417  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20418  		v2.AddArg2(src, mem)
 20419  		v1.AddArg3(dst, v2, mem)
 20420  		v.AddArg3(dst, v0, v1)
 20421  		return true
 20422  	}
 20423  	// match: (Move [15] dst src mem)
 20424  	// result: (MOVDstore [7] dst (MOVDload [7] src mem) (MOVDstore dst (MOVDload src mem) mem))
 20425  	for {
 20426  		if auxIntToInt64(v.AuxInt) != 15 {
 20427  			break
 20428  		}
 20429  		dst := v_0
 20430  		src := v_1
 20431  		mem := v_2
 20432  		v.reset(OpARM64MOVDstore)
 20433  		v.AuxInt = int32ToAuxInt(7)
 20434  		v0 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20435  		v0.AuxInt = int32ToAuxInt(7)
 20436  		v0.AddArg2(src, mem)
 20437  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 20438  		v2 := b.NewValue0(v.Pos, OpARM64MOVDload, typ.UInt64)
 20439  		v2.AddArg2(src, mem)
 20440  		v1.AddArg3(dst, v2, mem)
 20441  		v.AddArg3(dst, v0, v1)
 20442  		return true
 20443  	}
 20444  	// match: (Move [16] dst src mem)
 20445  	// result: (STP dst (Select0 <typ.UInt64> (LDP src mem)) (Select1 <typ.UInt64> (LDP src mem)) mem)
 20446  	for {
 20447  		if auxIntToInt64(v.AuxInt) != 16 {
 20448  			break
 20449  		}
 20450  		dst := v_0
 20451  		src := v_1
 20452  		mem := v_2
 20453  		v.reset(OpARM64STP)
 20454  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 20455  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 20456  		v1.AddArg2(src, mem)
 20457  		v0.AddArg(v1)
 20458  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 20459  		v2.AddArg(v1)
 20460  		v.AddArg4(dst, v0, v2, mem)
 20461  		return true
 20462  	}
 20463  	// match: (Move [32] dst src mem)
 20464  	// result: (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))
 20465  	for {
 20466  		if auxIntToInt64(v.AuxInt) != 32 {
 20467  			break
 20468  		}
 20469  		dst := v_0
 20470  		src := v_1
 20471  		mem := v_2
 20472  		v.reset(OpARM64STP)
 20473  		v.AuxInt = int32ToAuxInt(16)
 20474  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 20475  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 20476  		v1.AuxInt = int32ToAuxInt(16)
 20477  		v1.AddArg2(src, mem)
 20478  		v0.AddArg(v1)
 20479  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 20480  		v2.AddArg(v1)
 20481  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 20482  		v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 20483  		v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 20484  		v5.AddArg2(src, mem)
 20485  		v4.AddArg(v5)
 20486  		v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 20487  		v6.AddArg(v5)
 20488  		v3.AddArg4(dst, v4, v6, mem)
 20489  		v.AddArg4(dst, v0, v2, v3)
 20490  		return true
 20491  	}
 20492  	// match: (Move [48] dst src mem)
 20493  	// result: (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)))
 20494  	for {
 20495  		if auxIntToInt64(v.AuxInt) != 48 {
 20496  			break
 20497  		}
 20498  		dst := v_0
 20499  		src := v_1
 20500  		mem := v_2
 20501  		v.reset(OpARM64STP)
 20502  		v.AuxInt = int32ToAuxInt(32)
 20503  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 20504  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 20505  		v1.AuxInt = int32ToAuxInt(32)
 20506  		v1.AddArg2(src, mem)
 20507  		v0.AddArg(v1)
 20508  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 20509  		v2.AddArg(v1)
 20510  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 20511  		v3.AuxInt = int32ToAuxInt(16)
 20512  		v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 20513  		v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 20514  		v5.AuxInt = int32ToAuxInt(16)
 20515  		v5.AddArg2(src, mem)
 20516  		v4.AddArg(v5)
 20517  		v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 20518  		v6.AddArg(v5)
 20519  		v7 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 20520  		v8 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 20521  		v9 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 20522  		v9.AddArg2(src, mem)
 20523  		v8.AddArg(v9)
 20524  		v10 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 20525  		v10.AddArg(v9)
 20526  		v7.AddArg4(dst, v8, v10, mem)
 20527  		v3.AddArg4(dst, v4, v6, v7)
 20528  		v.AddArg4(dst, v0, v2, v3)
 20529  		return true
 20530  	}
 20531  	// match: (Move [64] dst src mem)
 20532  	// result: (STP [48] dst (Select0 <typ.UInt64> (LDP [48] src mem)) (Select1 <typ.UInt64> (LDP [48] 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))))
 20533  	for {
 20534  		if auxIntToInt64(v.AuxInt) != 64 {
 20535  			break
 20536  		}
 20537  		dst := v_0
 20538  		src := v_1
 20539  		mem := v_2
 20540  		v.reset(OpARM64STP)
 20541  		v.AuxInt = int32ToAuxInt(48)
 20542  		v0 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 20543  		v1 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 20544  		v1.AuxInt = int32ToAuxInt(48)
 20545  		v1.AddArg2(src, mem)
 20546  		v0.AddArg(v1)
 20547  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 20548  		v2.AddArg(v1)
 20549  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 20550  		v3.AuxInt = int32ToAuxInt(32)
 20551  		v4 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 20552  		v5 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 20553  		v5.AuxInt = int32ToAuxInt(32)
 20554  		v5.AddArg2(src, mem)
 20555  		v4.AddArg(v5)
 20556  		v6 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 20557  		v6.AddArg(v5)
 20558  		v7 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 20559  		v7.AuxInt = int32ToAuxInt(16)
 20560  		v8 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 20561  		v9 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 20562  		v9.AuxInt = int32ToAuxInt(16)
 20563  		v9.AddArg2(src, mem)
 20564  		v8.AddArg(v9)
 20565  		v10 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 20566  		v10.AddArg(v9)
 20567  		v11 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 20568  		v12 := b.NewValue0(v.Pos, OpSelect0, typ.UInt64)
 20569  		v13 := b.NewValue0(v.Pos, OpARM64LDP, types.NewTuple(typ.UInt64, typ.UInt64))
 20570  		v13.AddArg2(src, mem)
 20571  		v12.AddArg(v13)
 20572  		v14 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 20573  		v14.AddArg(v13)
 20574  		v11.AddArg4(dst, v12, v14, mem)
 20575  		v7.AddArg4(dst, v8, v10, v11)
 20576  		v3.AddArg4(dst, v4, v6, v7)
 20577  		v.AddArg4(dst, v0, v2, v3)
 20578  		return true
 20579  	}
 20580  	// match: (Move [s] dst src mem)
 20581  	// cond: s%16 != 0 && s%16 <= 8 && s > 16
 20582  	// result: (Move [8] (OffPtr <dst.Type> dst [s-8]) (OffPtr <src.Type> src [s-8]) (Move [s-s%16] dst src mem))
 20583  	for {
 20584  		s := auxIntToInt64(v.AuxInt)
 20585  		dst := v_0
 20586  		src := v_1
 20587  		mem := v_2
 20588  		if !(s%16 != 0 && s%16 <= 8 && s > 16) {
 20589  			break
 20590  		}
 20591  		v.reset(OpMove)
 20592  		v.AuxInt = int64ToAuxInt(8)
 20593  		v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type)
 20594  		v0.AuxInt = int64ToAuxInt(s - 8)
 20595  		v0.AddArg(dst)
 20596  		v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type)
 20597  		v1.AuxInt = int64ToAuxInt(s - 8)
 20598  		v1.AddArg(src)
 20599  		v2 := b.NewValue0(v.Pos, OpMove, types.TypeMem)
 20600  		v2.AuxInt = int64ToAuxInt(s - s%16)
 20601  		v2.AddArg3(dst, src, mem)
 20602  		v.AddArg3(v0, v1, v2)
 20603  		return true
 20604  	}
 20605  	// match: (Move [s] dst src mem)
 20606  	// cond: s%16 != 0 && s%16 > 8 && s > 16
 20607  	// result: (Move [16] (OffPtr <dst.Type> dst [s-16]) (OffPtr <src.Type> src [s-16]) (Move [s-s%16] dst src mem))
 20608  	for {
 20609  		s := auxIntToInt64(v.AuxInt)
 20610  		dst := v_0
 20611  		src := v_1
 20612  		mem := v_2
 20613  		if !(s%16 != 0 && s%16 > 8 && s > 16) {
 20614  			break
 20615  		}
 20616  		v.reset(OpMove)
 20617  		v.AuxInt = int64ToAuxInt(16)
 20618  		v0 := b.NewValue0(v.Pos, OpOffPtr, dst.Type)
 20619  		v0.AuxInt = int64ToAuxInt(s - 16)
 20620  		v0.AddArg(dst)
 20621  		v1 := b.NewValue0(v.Pos, OpOffPtr, src.Type)
 20622  		v1.AuxInt = int64ToAuxInt(s - 16)
 20623  		v1.AddArg(src)
 20624  		v2 := b.NewValue0(v.Pos, OpMove, types.TypeMem)
 20625  		v2.AuxInt = int64ToAuxInt(s - s%16)
 20626  		v2.AddArg3(dst, src, mem)
 20627  		v.AddArg3(v0, v1, v2)
 20628  		return true
 20629  	}
 20630  	// match: (Move [s] dst src mem)
 20631  	// cond: s > 64 && s <= 16*64 && s%16 == 0 && !config.noDuffDevice && logLargeCopy(v, s)
 20632  	// result: (DUFFCOPY [8 * (64 - s/16)] dst src mem)
 20633  	for {
 20634  		s := auxIntToInt64(v.AuxInt)
 20635  		dst := v_0
 20636  		src := v_1
 20637  		mem := v_2
 20638  		if !(s > 64 && s <= 16*64 && s%16 == 0 && !config.noDuffDevice && logLargeCopy(v, s)) {
 20639  			break
 20640  		}
 20641  		v.reset(OpARM64DUFFCOPY)
 20642  		v.AuxInt = int64ToAuxInt(8 * (64 - s/16))
 20643  		v.AddArg3(dst, src, mem)
 20644  		return true
 20645  	}
 20646  	// match: (Move [s] dst src mem)
 20647  	// cond: s%16 == 0 && (s > 16*64 || config.noDuffDevice) && logLargeCopy(v, s)
 20648  	// result: (LoweredMove dst src (ADDconst <src.Type> src [s-16]) mem)
 20649  	for {
 20650  		s := auxIntToInt64(v.AuxInt)
 20651  		dst := v_0
 20652  		src := v_1
 20653  		mem := v_2
 20654  		if !(s%16 == 0 && (s > 16*64 || config.noDuffDevice) && logLargeCopy(v, s)) {
 20655  			break
 20656  		}
 20657  		v.reset(OpARM64LoweredMove)
 20658  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, src.Type)
 20659  		v0.AuxInt = int64ToAuxInt(s - 16)
 20660  		v0.AddArg(src)
 20661  		v.AddArg4(dst, src, v0, mem)
 20662  		return true
 20663  	}
 20664  	return false
 20665  }
 20666  func rewriteValueARM64_OpNeq16(v *Value) bool {
 20667  	v_1 := v.Args[1]
 20668  	v_0 := v.Args[0]
 20669  	b := v.Block
 20670  	typ := &b.Func.Config.Types
 20671  	// match: (Neq16 x y)
 20672  	// result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
 20673  	for {
 20674  		x := v_0
 20675  		y := v_1
 20676  		v.reset(OpARM64NotEqual)
 20677  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 20678  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 20679  		v1.AddArg(x)
 20680  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 20681  		v2.AddArg(y)
 20682  		v0.AddArg2(v1, v2)
 20683  		v.AddArg(v0)
 20684  		return true
 20685  	}
 20686  }
 20687  func rewriteValueARM64_OpNeq32(v *Value) bool {
 20688  	v_1 := v.Args[1]
 20689  	v_0 := v.Args[0]
 20690  	b := v.Block
 20691  	// match: (Neq32 x y)
 20692  	// result: (NotEqual (CMPW x y))
 20693  	for {
 20694  		x := v_0
 20695  		y := v_1
 20696  		v.reset(OpARM64NotEqual)
 20697  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 20698  		v0.AddArg2(x, y)
 20699  		v.AddArg(v0)
 20700  		return true
 20701  	}
 20702  }
 20703  func rewriteValueARM64_OpNeq32F(v *Value) bool {
 20704  	v_1 := v.Args[1]
 20705  	v_0 := v.Args[0]
 20706  	b := v.Block
 20707  	// match: (Neq32F x y)
 20708  	// result: (NotEqual (FCMPS x y))
 20709  	for {
 20710  		x := v_0
 20711  		y := v_1
 20712  		v.reset(OpARM64NotEqual)
 20713  		v0 := b.NewValue0(v.Pos, OpARM64FCMPS, types.TypeFlags)
 20714  		v0.AddArg2(x, y)
 20715  		v.AddArg(v0)
 20716  		return true
 20717  	}
 20718  }
 20719  func rewriteValueARM64_OpNeq64(v *Value) bool {
 20720  	v_1 := v.Args[1]
 20721  	v_0 := v.Args[0]
 20722  	b := v.Block
 20723  	// match: (Neq64 x y)
 20724  	// result: (NotEqual (CMP x y))
 20725  	for {
 20726  		x := v_0
 20727  		y := v_1
 20728  		v.reset(OpARM64NotEqual)
 20729  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 20730  		v0.AddArg2(x, y)
 20731  		v.AddArg(v0)
 20732  		return true
 20733  	}
 20734  }
 20735  func rewriteValueARM64_OpNeq64F(v *Value) bool {
 20736  	v_1 := v.Args[1]
 20737  	v_0 := v.Args[0]
 20738  	b := v.Block
 20739  	// match: (Neq64F x y)
 20740  	// result: (NotEqual (FCMPD x y))
 20741  	for {
 20742  		x := v_0
 20743  		y := v_1
 20744  		v.reset(OpARM64NotEqual)
 20745  		v0 := b.NewValue0(v.Pos, OpARM64FCMPD, types.TypeFlags)
 20746  		v0.AddArg2(x, y)
 20747  		v.AddArg(v0)
 20748  		return true
 20749  	}
 20750  }
 20751  func rewriteValueARM64_OpNeq8(v *Value) bool {
 20752  	v_1 := v.Args[1]
 20753  	v_0 := v.Args[0]
 20754  	b := v.Block
 20755  	typ := &b.Func.Config.Types
 20756  	// match: (Neq8 x y)
 20757  	// result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
 20758  	for {
 20759  		x := v_0
 20760  		y := v_1
 20761  		v.reset(OpARM64NotEqual)
 20762  		v0 := b.NewValue0(v.Pos, OpARM64CMPW, types.TypeFlags)
 20763  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 20764  		v1.AddArg(x)
 20765  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 20766  		v2.AddArg(y)
 20767  		v0.AddArg2(v1, v2)
 20768  		v.AddArg(v0)
 20769  		return true
 20770  	}
 20771  }
 20772  func rewriteValueARM64_OpNeqPtr(v *Value) bool {
 20773  	v_1 := v.Args[1]
 20774  	v_0 := v.Args[0]
 20775  	b := v.Block
 20776  	// match: (NeqPtr x y)
 20777  	// result: (NotEqual (CMP x y))
 20778  	for {
 20779  		x := v_0
 20780  		y := v_1
 20781  		v.reset(OpARM64NotEqual)
 20782  		v0 := b.NewValue0(v.Pos, OpARM64CMP, types.TypeFlags)
 20783  		v0.AddArg2(x, y)
 20784  		v.AddArg(v0)
 20785  		return true
 20786  	}
 20787  }
 20788  func rewriteValueARM64_OpNot(v *Value) bool {
 20789  	v_0 := v.Args[0]
 20790  	b := v.Block
 20791  	typ := &b.Func.Config.Types
 20792  	// match: (Not x)
 20793  	// result: (XOR (MOVDconst [1]) x)
 20794  	for {
 20795  		x := v_0
 20796  		v.reset(OpARM64XOR)
 20797  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 20798  		v0.AuxInt = int64ToAuxInt(1)
 20799  		v.AddArg2(v0, x)
 20800  		return true
 20801  	}
 20802  }
 20803  func rewriteValueARM64_OpOffPtr(v *Value) bool {
 20804  	v_0 := v.Args[0]
 20805  	// match: (OffPtr [off] ptr:(SP))
 20806  	// cond: is32Bit(off)
 20807  	// result: (MOVDaddr [int32(off)] ptr)
 20808  	for {
 20809  		off := auxIntToInt64(v.AuxInt)
 20810  		ptr := v_0
 20811  		if ptr.Op != OpSP || !(is32Bit(off)) {
 20812  			break
 20813  		}
 20814  		v.reset(OpARM64MOVDaddr)
 20815  		v.AuxInt = int32ToAuxInt(int32(off))
 20816  		v.AddArg(ptr)
 20817  		return true
 20818  	}
 20819  	// match: (OffPtr [off] ptr)
 20820  	// result: (ADDconst [off] ptr)
 20821  	for {
 20822  		off := auxIntToInt64(v.AuxInt)
 20823  		ptr := v_0
 20824  		v.reset(OpARM64ADDconst)
 20825  		v.AuxInt = int64ToAuxInt(off)
 20826  		v.AddArg(ptr)
 20827  		return true
 20828  	}
 20829  }
 20830  func rewriteValueARM64_OpPanicBounds(v *Value) bool {
 20831  	v_2 := v.Args[2]
 20832  	v_1 := v.Args[1]
 20833  	v_0 := v.Args[0]
 20834  	// match: (PanicBounds [kind] x y mem)
 20835  	// cond: boundsABI(kind) == 0
 20836  	// result: (LoweredPanicBoundsA [kind] x y mem)
 20837  	for {
 20838  		kind := auxIntToInt64(v.AuxInt)
 20839  		x := v_0
 20840  		y := v_1
 20841  		mem := v_2
 20842  		if !(boundsABI(kind) == 0) {
 20843  			break
 20844  		}
 20845  		v.reset(OpARM64LoweredPanicBoundsA)
 20846  		v.AuxInt = int64ToAuxInt(kind)
 20847  		v.AddArg3(x, y, mem)
 20848  		return true
 20849  	}
 20850  	// match: (PanicBounds [kind] x y mem)
 20851  	// cond: boundsABI(kind) == 1
 20852  	// result: (LoweredPanicBoundsB [kind] x y mem)
 20853  	for {
 20854  		kind := auxIntToInt64(v.AuxInt)
 20855  		x := v_0
 20856  		y := v_1
 20857  		mem := v_2
 20858  		if !(boundsABI(kind) == 1) {
 20859  			break
 20860  		}
 20861  		v.reset(OpARM64LoweredPanicBoundsB)
 20862  		v.AuxInt = int64ToAuxInt(kind)
 20863  		v.AddArg3(x, y, mem)
 20864  		return true
 20865  	}
 20866  	// match: (PanicBounds [kind] x y mem)
 20867  	// cond: boundsABI(kind) == 2
 20868  	// result: (LoweredPanicBoundsC [kind] x y mem)
 20869  	for {
 20870  		kind := auxIntToInt64(v.AuxInt)
 20871  		x := v_0
 20872  		y := v_1
 20873  		mem := v_2
 20874  		if !(boundsABI(kind) == 2) {
 20875  			break
 20876  		}
 20877  		v.reset(OpARM64LoweredPanicBoundsC)
 20878  		v.AuxInt = int64ToAuxInt(kind)
 20879  		v.AddArg3(x, y, mem)
 20880  		return true
 20881  	}
 20882  	return false
 20883  }
 20884  func rewriteValueARM64_OpPopCount16(v *Value) bool {
 20885  	v_0 := v.Args[0]
 20886  	b := v.Block
 20887  	typ := &b.Func.Config.Types
 20888  	// match: (PopCount16 <t> x)
 20889  	// result: (FMOVDfpgp <t> (VUADDLV <typ.Float64> (VCNT <typ.Float64> (FMOVDgpfp <typ.Float64> (ZeroExt16to64 x)))))
 20890  	for {
 20891  		t := v.Type
 20892  		x := v_0
 20893  		v.reset(OpARM64FMOVDfpgp)
 20894  		v.Type = t
 20895  		v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
 20896  		v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
 20897  		v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
 20898  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 20899  		v3.AddArg(x)
 20900  		v2.AddArg(v3)
 20901  		v1.AddArg(v2)
 20902  		v0.AddArg(v1)
 20903  		v.AddArg(v0)
 20904  		return true
 20905  	}
 20906  }
 20907  func rewriteValueARM64_OpPopCount32(v *Value) bool {
 20908  	v_0 := v.Args[0]
 20909  	b := v.Block
 20910  	typ := &b.Func.Config.Types
 20911  	// match: (PopCount32 <t> x)
 20912  	// result: (FMOVDfpgp <t> (VUADDLV <typ.Float64> (VCNT <typ.Float64> (FMOVDgpfp <typ.Float64> (ZeroExt32to64 x)))))
 20913  	for {
 20914  		t := v.Type
 20915  		x := v_0
 20916  		v.reset(OpARM64FMOVDfpgp)
 20917  		v.Type = t
 20918  		v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
 20919  		v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
 20920  		v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
 20921  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 20922  		v3.AddArg(x)
 20923  		v2.AddArg(v3)
 20924  		v1.AddArg(v2)
 20925  		v0.AddArg(v1)
 20926  		v.AddArg(v0)
 20927  		return true
 20928  	}
 20929  }
 20930  func rewriteValueARM64_OpPopCount64(v *Value) bool {
 20931  	v_0 := v.Args[0]
 20932  	b := v.Block
 20933  	typ := &b.Func.Config.Types
 20934  	// match: (PopCount64 <t> x)
 20935  	// result: (FMOVDfpgp <t> (VUADDLV <typ.Float64> (VCNT <typ.Float64> (FMOVDgpfp <typ.Float64> x))))
 20936  	for {
 20937  		t := v.Type
 20938  		x := v_0
 20939  		v.reset(OpARM64FMOVDfpgp)
 20940  		v.Type = t
 20941  		v0 := b.NewValue0(v.Pos, OpARM64VUADDLV, typ.Float64)
 20942  		v1 := b.NewValue0(v.Pos, OpARM64VCNT, typ.Float64)
 20943  		v2 := b.NewValue0(v.Pos, OpARM64FMOVDgpfp, typ.Float64)
 20944  		v2.AddArg(x)
 20945  		v1.AddArg(v2)
 20946  		v0.AddArg(v1)
 20947  		v.AddArg(v0)
 20948  		return true
 20949  	}
 20950  }
 20951  func rewriteValueARM64_OpPrefetchCache(v *Value) bool {
 20952  	v_1 := v.Args[1]
 20953  	v_0 := v.Args[0]
 20954  	// match: (PrefetchCache addr mem)
 20955  	// result: (PRFM [0] addr mem)
 20956  	for {
 20957  		addr := v_0
 20958  		mem := v_1
 20959  		v.reset(OpARM64PRFM)
 20960  		v.AuxInt = int64ToAuxInt(0)
 20961  		v.AddArg2(addr, mem)
 20962  		return true
 20963  	}
 20964  }
 20965  func rewriteValueARM64_OpPrefetchCacheStreamed(v *Value) bool {
 20966  	v_1 := v.Args[1]
 20967  	v_0 := v.Args[0]
 20968  	// match: (PrefetchCacheStreamed addr mem)
 20969  	// result: (PRFM [1] addr mem)
 20970  	for {
 20971  		addr := v_0
 20972  		mem := v_1
 20973  		v.reset(OpARM64PRFM)
 20974  		v.AuxInt = int64ToAuxInt(1)
 20975  		v.AddArg2(addr, mem)
 20976  		return true
 20977  	}
 20978  }
 20979  func rewriteValueARM64_OpPubBarrier(v *Value) bool {
 20980  	v_0 := v.Args[0]
 20981  	// match: (PubBarrier mem)
 20982  	// result: (DMB [0xe] mem)
 20983  	for {
 20984  		mem := v_0
 20985  		v.reset(OpARM64DMB)
 20986  		v.AuxInt = int64ToAuxInt(0xe)
 20987  		v.AddArg(mem)
 20988  		return true
 20989  	}
 20990  }
 20991  func rewriteValueARM64_OpRotateLeft16(v *Value) bool {
 20992  	v_1 := v.Args[1]
 20993  	v_0 := v.Args[0]
 20994  	b := v.Block
 20995  	typ := &b.Func.Config.Types
 20996  	// match: (RotateLeft16 <t> x (MOVDconst [c]))
 20997  	// result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
 20998  	for {
 20999  		t := v.Type
 21000  		x := v_0
 21001  		if v_1.Op != OpARM64MOVDconst {
 21002  			break
 21003  		}
 21004  		c := auxIntToInt64(v_1.AuxInt)
 21005  		v.reset(OpOr16)
 21006  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 21007  		v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 21008  		v1.AuxInt = int64ToAuxInt(c & 15)
 21009  		v0.AddArg2(x, v1)
 21010  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 21011  		v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 21012  		v3.AuxInt = int64ToAuxInt(-c & 15)
 21013  		v2.AddArg2(x, v3)
 21014  		v.AddArg2(v0, v2)
 21015  		return true
 21016  	}
 21017  	// match: (RotateLeft16 <t> x y)
 21018  	// result: (RORW <t> (ORshiftLL <typ.UInt32> (ZeroExt16to32 x) (ZeroExt16to32 x) [16]) (NEG <typ.Int64> y))
 21019  	for {
 21020  		t := v.Type
 21021  		x := v_0
 21022  		y := v_1
 21023  		v.reset(OpARM64RORW)
 21024  		v.Type = t
 21025  		v0 := b.NewValue0(v.Pos, OpARM64ORshiftLL, typ.UInt32)
 21026  		v0.AuxInt = int64ToAuxInt(16)
 21027  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 21028  		v1.AddArg(x)
 21029  		v0.AddArg2(v1, v1)
 21030  		v2 := b.NewValue0(v.Pos, OpARM64NEG, typ.Int64)
 21031  		v2.AddArg(y)
 21032  		v.AddArg2(v0, v2)
 21033  		return true
 21034  	}
 21035  }
 21036  func rewriteValueARM64_OpRotateLeft32(v *Value) bool {
 21037  	v_1 := v.Args[1]
 21038  	v_0 := v.Args[0]
 21039  	b := v.Block
 21040  	// match: (RotateLeft32 x y)
 21041  	// result: (RORW x (NEG <y.Type> y))
 21042  	for {
 21043  		x := v_0
 21044  		y := v_1
 21045  		v.reset(OpARM64RORW)
 21046  		v0 := b.NewValue0(v.Pos, OpARM64NEG, y.Type)
 21047  		v0.AddArg(y)
 21048  		v.AddArg2(x, v0)
 21049  		return true
 21050  	}
 21051  }
 21052  func rewriteValueARM64_OpRotateLeft64(v *Value) bool {
 21053  	v_1 := v.Args[1]
 21054  	v_0 := v.Args[0]
 21055  	b := v.Block
 21056  	// match: (RotateLeft64 x y)
 21057  	// result: (ROR x (NEG <y.Type> y))
 21058  	for {
 21059  		x := v_0
 21060  		y := v_1
 21061  		v.reset(OpARM64ROR)
 21062  		v0 := b.NewValue0(v.Pos, OpARM64NEG, y.Type)
 21063  		v0.AddArg(y)
 21064  		v.AddArg2(x, v0)
 21065  		return true
 21066  	}
 21067  }
 21068  func rewriteValueARM64_OpRotateLeft8(v *Value) bool {
 21069  	v_1 := v.Args[1]
 21070  	v_0 := v.Args[0]
 21071  	b := v.Block
 21072  	typ := &b.Func.Config.Types
 21073  	// match: (RotateLeft8 <t> x (MOVDconst [c]))
 21074  	// result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
 21075  	for {
 21076  		t := v.Type
 21077  		x := v_0
 21078  		if v_1.Op != OpARM64MOVDconst {
 21079  			break
 21080  		}
 21081  		c := auxIntToInt64(v_1.AuxInt)
 21082  		v.reset(OpOr8)
 21083  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 21084  		v1 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 21085  		v1.AuxInt = int64ToAuxInt(c & 7)
 21086  		v0.AddArg2(x, v1)
 21087  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 21088  		v3 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 21089  		v3.AuxInt = int64ToAuxInt(-c & 7)
 21090  		v2.AddArg2(x, v3)
 21091  		v.AddArg2(v0, v2)
 21092  		return true
 21093  	}
 21094  	// match: (RotateLeft8 <t> x y)
 21095  	// result: (OR <t> (SLL <t> x (ANDconst <typ.Int64> [7] y)) (SRL <t> (ZeroExt8to64 x) (ANDconst <typ.Int64> [7] (NEG <typ.Int64> y))))
 21096  	for {
 21097  		t := v.Type
 21098  		x := v_0
 21099  		y := v_1
 21100  		v.reset(OpARM64OR)
 21101  		v.Type = t
 21102  		v0 := b.NewValue0(v.Pos, OpARM64SLL, t)
 21103  		v1 := b.NewValue0(v.Pos, OpARM64ANDconst, typ.Int64)
 21104  		v1.AuxInt = int64ToAuxInt(7)
 21105  		v1.AddArg(y)
 21106  		v0.AddArg2(x, v1)
 21107  		v2 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21108  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21109  		v3.AddArg(x)
 21110  		v4 := b.NewValue0(v.Pos, OpARM64ANDconst, typ.Int64)
 21111  		v4.AuxInt = int64ToAuxInt(7)
 21112  		v5 := b.NewValue0(v.Pos, OpARM64NEG, typ.Int64)
 21113  		v5.AddArg(y)
 21114  		v4.AddArg(v5)
 21115  		v2.AddArg2(v3, v4)
 21116  		v.AddArg2(v0, v2)
 21117  		return true
 21118  	}
 21119  }
 21120  func rewriteValueARM64_OpRsh16Ux16(v *Value) bool {
 21121  	v_1 := v.Args[1]
 21122  	v_0 := v.Args[0]
 21123  	b := v.Block
 21124  	typ := &b.Func.Config.Types
 21125  	// match: (Rsh16Ux16 <t> x y)
 21126  	// cond: shiftIsBounded(v)
 21127  	// result: (SRL <t> (ZeroExt16to64 x) y)
 21128  	for {
 21129  		t := v.Type
 21130  		x := v_0
 21131  		y := v_1
 21132  		if !(shiftIsBounded(v)) {
 21133  			break
 21134  		}
 21135  		v.reset(OpARM64SRL)
 21136  		v.Type = t
 21137  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21138  		v0.AddArg(x)
 21139  		v.AddArg2(v0, y)
 21140  		return true
 21141  	}
 21142  	// match: (Rsh16Ux16 <t> x y)
 21143  	// cond: !shiftIsBounded(v)
 21144  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 21145  	for {
 21146  		t := v.Type
 21147  		x := v_0
 21148  		y := v_1
 21149  		if !(!shiftIsBounded(v)) {
 21150  			break
 21151  		}
 21152  		v.reset(OpARM64CSEL)
 21153  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21154  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21155  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21156  		v1.AddArg(x)
 21157  		v0.AddArg2(v1, y)
 21158  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21159  		v2.AuxInt = int64ToAuxInt(0)
 21160  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21161  		v3.AuxInt = int64ToAuxInt(64)
 21162  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21163  		v4.AddArg(y)
 21164  		v3.AddArg(v4)
 21165  		v.AddArg3(v0, v2, v3)
 21166  		return true
 21167  	}
 21168  	return false
 21169  }
 21170  func rewriteValueARM64_OpRsh16Ux32(v *Value) bool {
 21171  	v_1 := v.Args[1]
 21172  	v_0 := v.Args[0]
 21173  	b := v.Block
 21174  	typ := &b.Func.Config.Types
 21175  	// match: (Rsh16Ux32 <t> x y)
 21176  	// cond: shiftIsBounded(v)
 21177  	// result: (SRL <t> (ZeroExt16to64 x) y)
 21178  	for {
 21179  		t := v.Type
 21180  		x := v_0
 21181  		y := v_1
 21182  		if !(shiftIsBounded(v)) {
 21183  			break
 21184  		}
 21185  		v.reset(OpARM64SRL)
 21186  		v.Type = t
 21187  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21188  		v0.AddArg(x)
 21189  		v.AddArg2(v0, y)
 21190  		return true
 21191  	}
 21192  	// match: (Rsh16Ux32 <t> x y)
 21193  	// cond: !shiftIsBounded(v)
 21194  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 21195  	for {
 21196  		t := v.Type
 21197  		x := v_0
 21198  		y := v_1
 21199  		if !(!shiftIsBounded(v)) {
 21200  			break
 21201  		}
 21202  		v.reset(OpARM64CSEL)
 21203  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21204  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21205  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21206  		v1.AddArg(x)
 21207  		v0.AddArg2(v1, y)
 21208  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21209  		v2.AuxInt = int64ToAuxInt(0)
 21210  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21211  		v3.AuxInt = int64ToAuxInt(64)
 21212  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21213  		v4.AddArg(y)
 21214  		v3.AddArg(v4)
 21215  		v.AddArg3(v0, v2, v3)
 21216  		return true
 21217  	}
 21218  	return false
 21219  }
 21220  func rewriteValueARM64_OpRsh16Ux64(v *Value) bool {
 21221  	v_1 := v.Args[1]
 21222  	v_0 := v.Args[0]
 21223  	b := v.Block
 21224  	typ := &b.Func.Config.Types
 21225  	// match: (Rsh16Ux64 <t> x y)
 21226  	// cond: shiftIsBounded(v)
 21227  	// result: (SRL <t> (ZeroExt16to64 x) y)
 21228  	for {
 21229  		t := v.Type
 21230  		x := v_0
 21231  		y := v_1
 21232  		if !(shiftIsBounded(v)) {
 21233  			break
 21234  		}
 21235  		v.reset(OpARM64SRL)
 21236  		v.Type = t
 21237  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21238  		v0.AddArg(x)
 21239  		v.AddArg2(v0, y)
 21240  		return true
 21241  	}
 21242  	// match: (Rsh16Ux64 <t> x y)
 21243  	// cond: !shiftIsBounded(v)
 21244  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
 21245  	for {
 21246  		t := v.Type
 21247  		x := v_0
 21248  		y := v_1
 21249  		if !(!shiftIsBounded(v)) {
 21250  			break
 21251  		}
 21252  		v.reset(OpARM64CSEL)
 21253  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21254  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21255  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21256  		v1.AddArg(x)
 21257  		v0.AddArg2(v1, y)
 21258  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21259  		v2.AuxInt = int64ToAuxInt(0)
 21260  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21261  		v3.AuxInt = int64ToAuxInt(64)
 21262  		v3.AddArg(y)
 21263  		v.AddArg3(v0, v2, v3)
 21264  		return true
 21265  	}
 21266  	return false
 21267  }
 21268  func rewriteValueARM64_OpRsh16Ux8(v *Value) bool {
 21269  	v_1 := v.Args[1]
 21270  	v_0 := v.Args[0]
 21271  	b := v.Block
 21272  	typ := &b.Func.Config.Types
 21273  	// match: (Rsh16Ux8 <t> x y)
 21274  	// cond: shiftIsBounded(v)
 21275  	// result: (SRL <t> (ZeroExt16to64 x) y)
 21276  	for {
 21277  		t := v.Type
 21278  		x := v_0
 21279  		y := v_1
 21280  		if !(shiftIsBounded(v)) {
 21281  			break
 21282  		}
 21283  		v.reset(OpARM64SRL)
 21284  		v.Type = t
 21285  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21286  		v0.AddArg(x)
 21287  		v.AddArg2(v0, y)
 21288  		return true
 21289  	}
 21290  	// match: (Rsh16Ux8 <t> x y)
 21291  	// cond: !shiftIsBounded(v)
 21292  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt16to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 21293  	for {
 21294  		t := v.Type
 21295  		x := v_0
 21296  		y := v_1
 21297  		if !(!shiftIsBounded(v)) {
 21298  			break
 21299  		}
 21300  		v.reset(OpARM64CSEL)
 21301  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21302  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21303  		v1 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21304  		v1.AddArg(x)
 21305  		v0.AddArg2(v1, y)
 21306  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21307  		v2.AuxInt = int64ToAuxInt(0)
 21308  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21309  		v3.AuxInt = int64ToAuxInt(64)
 21310  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21311  		v4.AddArg(y)
 21312  		v3.AddArg(v4)
 21313  		v.AddArg3(v0, v2, v3)
 21314  		return true
 21315  	}
 21316  	return false
 21317  }
 21318  func rewriteValueARM64_OpRsh16x16(v *Value) bool {
 21319  	v_1 := v.Args[1]
 21320  	v_0 := v.Args[0]
 21321  	b := v.Block
 21322  	typ := &b.Func.Config.Types
 21323  	// match: (Rsh16x16 <t> x y)
 21324  	// cond: shiftIsBounded(v)
 21325  	// result: (SRA <t> (SignExt16to64 x) y)
 21326  	for {
 21327  		t := v.Type
 21328  		x := v_0
 21329  		y := v_1
 21330  		if !(shiftIsBounded(v)) {
 21331  			break
 21332  		}
 21333  		v.reset(OpARM64SRA)
 21334  		v.Type = t
 21335  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 21336  		v0.AddArg(x)
 21337  		v.AddArg2(v0, y)
 21338  		return true
 21339  	}
 21340  	// match: (Rsh16x16 x y)
 21341  	// cond: !shiftIsBounded(v)
 21342  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 21343  	for {
 21344  		x := v_0
 21345  		y := v_1
 21346  		if !(!shiftIsBounded(v)) {
 21347  			break
 21348  		}
 21349  		v.reset(OpARM64SRA)
 21350  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 21351  		v0.AddArg(x)
 21352  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21353  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21354  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21355  		v2.AuxInt = int64ToAuxInt(63)
 21356  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21357  		v3.AuxInt = int64ToAuxInt(64)
 21358  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21359  		v4.AddArg(y)
 21360  		v3.AddArg(v4)
 21361  		v1.AddArg3(y, v2, v3)
 21362  		v.AddArg2(v0, v1)
 21363  		return true
 21364  	}
 21365  	return false
 21366  }
 21367  func rewriteValueARM64_OpRsh16x32(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: (Rsh16x32 <t> x y)
 21373  	// cond: shiftIsBounded(v)
 21374  	// result: (SRA <t> (SignExt16to64 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(OpARM64SRA)
 21383  		v.Type = t
 21384  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 21385  		v0.AddArg(x)
 21386  		v.AddArg2(v0, y)
 21387  		return true
 21388  	}
 21389  	// match: (Rsh16x32 x y)
 21390  	// cond: !shiftIsBounded(v)
 21391  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 21392  	for {
 21393  		x := v_0
 21394  		y := v_1
 21395  		if !(!shiftIsBounded(v)) {
 21396  			break
 21397  		}
 21398  		v.reset(OpARM64SRA)
 21399  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 21400  		v0.AddArg(x)
 21401  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21402  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21403  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21404  		v2.AuxInt = int64ToAuxInt(63)
 21405  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21406  		v3.AuxInt = int64ToAuxInt(64)
 21407  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21408  		v4.AddArg(y)
 21409  		v3.AddArg(v4)
 21410  		v1.AddArg3(y, v2, v3)
 21411  		v.AddArg2(v0, v1)
 21412  		return true
 21413  	}
 21414  	return false
 21415  }
 21416  func rewriteValueARM64_OpRsh16x64(v *Value) bool {
 21417  	v_1 := v.Args[1]
 21418  	v_0 := v.Args[0]
 21419  	b := v.Block
 21420  	typ := &b.Func.Config.Types
 21421  	// match: (Rsh16x64 <t> x y)
 21422  	// cond: shiftIsBounded(v)
 21423  	// result: (SRA <t> (SignExt16to64 x) y)
 21424  	for {
 21425  		t := v.Type
 21426  		x := v_0
 21427  		y := v_1
 21428  		if !(shiftIsBounded(v)) {
 21429  			break
 21430  		}
 21431  		v.reset(OpARM64SRA)
 21432  		v.Type = t
 21433  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 21434  		v0.AddArg(x)
 21435  		v.AddArg2(v0, y)
 21436  		return true
 21437  	}
 21438  	// match: (Rsh16x64 x y)
 21439  	// cond: !shiftIsBounded(v)
 21440  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 21441  	for {
 21442  		x := v_0
 21443  		y := v_1
 21444  		if !(!shiftIsBounded(v)) {
 21445  			break
 21446  		}
 21447  		v.reset(OpARM64SRA)
 21448  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 21449  		v0.AddArg(x)
 21450  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21451  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21452  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21453  		v2.AuxInt = int64ToAuxInt(63)
 21454  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21455  		v3.AuxInt = int64ToAuxInt(64)
 21456  		v3.AddArg(y)
 21457  		v1.AddArg3(y, v2, v3)
 21458  		v.AddArg2(v0, v1)
 21459  		return true
 21460  	}
 21461  	return false
 21462  }
 21463  func rewriteValueARM64_OpRsh16x8(v *Value) bool {
 21464  	v_1 := v.Args[1]
 21465  	v_0 := v.Args[0]
 21466  	b := v.Block
 21467  	typ := &b.Func.Config.Types
 21468  	// match: (Rsh16x8 <t> x y)
 21469  	// cond: shiftIsBounded(v)
 21470  	// result: (SRA <t> (SignExt16to64 x) y)
 21471  	for {
 21472  		t := v.Type
 21473  		x := v_0
 21474  		y := v_1
 21475  		if !(shiftIsBounded(v)) {
 21476  			break
 21477  		}
 21478  		v.reset(OpARM64SRA)
 21479  		v.Type = t
 21480  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 21481  		v0.AddArg(x)
 21482  		v.AddArg2(v0, y)
 21483  		return true
 21484  	}
 21485  	// match: (Rsh16x8 x y)
 21486  	// cond: !shiftIsBounded(v)
 21487  	// result: (SRA (SignExt16to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 21488  	for {
 21489  		x := v_0
 21490  		y := v_1
 21491  		if !(!shiftIsBounded(v)) {
 21492  			break
 21493  		}
 21494  		v.reset(OpARM64SRA)
 21495  		v0 := b.NewValue0(v.Pos, OpSignExt16to64, typ.Int64)
 21496  		v0.AddArg(x)
 21497  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21498  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21499  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21500  		v2.AuxInt = int64ToAuxInt(63)
 21501  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21502  		v3.AuxInt = int64ToAuxInt(64)
 21503  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21504  		v4.AddArg(y)
 21505  		v3.AddArg(v4)
 21506  		v1.AddArg3(y, v2, v3)
 21507  		v.AddArg2(v0, v1)
 21508  		return true
 21509  	}
 21510  	return false
 21511  }
 21512  func rewriteValueARM64_OpRsh32Ux16(v *Value) bool {
 21513  	v_1 := v.Args[1]
 21514  	v_0 := v.Args[0]
 21515  	b := v.Block
 21516  	typ := &b.Func.Config.Types
 21517  	// match: (Rsh32Ux16 <t> x y)
 21518  	// cond: shiftIsBounded(v)
 21519  	// result: (SRL <t> (ZeroExt32to64 x) y)
 21520  	for {
 21521  		t := v.Type
 21522  		x := v_0
 21523  		y := v_1
 21524  		if !(shiftIsBounded(v)) {
 21525  			break
 21526  		}
 21527  		v.reset(OpARM64SRL)
 21528  		v.Type = t
 21529  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21530  		v0.AddArg(x)
 21531  		v.AddArg2(v0, y)
 21532  		return true
 21533  	}
 21534  	// match: (Rsh32Ux16 <t> x y)
 21535  	// cond: !shiftIsBounded(v)
 21536  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 21537  	for {
 21538  		t := v.Type
 21539  		x := v_0
 21540  		y := v_1
 21541  		if !(!shiftIsBounded(v)) {
 21542  			break
 21543  		}
 21544  		v.reset(OpARM64CSEL)
 21545  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21546  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21547  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21548  		v1.AddArg(x)
 21549  		v0.AddArg2(v1, y)
 21550  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21551  		v2.AuxInt = int64ToAuxInt(0)
 21552  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21553  		v3.AuxInt = int64ToAuxInt(64)
 21554  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21555  		v4.AddArg(y)
 21556  		v3.AddArg(v4)
 21557  		v.AddArg3(v0, v2, v3)
 21558  		return true
 21559  	}
 21560  	return false
 21561  }
 21562  func rewriteValueARM64_OpRsh32Ux32(v *Value) bool {
 21563  	v_1 := v.Args[1]
 21564  	v_0 := v.Args[0]
 21565  	b := v.Block
 21566  	typ := &b.Func.Config.Types
 21567  	// match: (Rsh32Ux32 <t> x y)
 21568  	// cond: shiftIsBounded(v)
 21569  	// result: (SRL <t> (ZeroExt32to64 x) y)
 21570  	for {
 21571  		t := v.Type
 21572  		x := v_0
 21573  		y := v_1
 21574  		if !(shiftIsBounded(v)) {
 21575  			break
 21576  		}
 21577  		v.reset(OpARM64SRL)
 21578  		v.Type = t
 21579  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21580  		v0.AddArg(x)
 21581  		v.AddArg2(v0, y)
 21582  		return true
 21583  	}
 21584  	// match: (Rsh32Ux32 <t> x y)
 21585  	// cond: !shiftIsBounded(v)
 21586  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 21587  	for {
 21588  		t := v.Type
 21589  		x := v_0
 21590  		y := v_1
 21591  		if !(!shiftIsBounded(v)) {
 21592  			break
 21593  		}
 21594  		v.reset(OpARM64CSEL)
 21595  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21596  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21597  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21598  		v1.AddArg(x)
 21599  		v0.AddArg2(v1, y)
 21600  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21601  		v2.AuxInt = int64ToAuxInt(0)
 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  		v.AddArg3(v0, v2, v3)
 21608  		return true
 21609  	}
 21610  	return false
 21611  }
 21612  func rewriteValueARM64_OpRsh32Ux64(v *Value) bool {
 21613  	v_1 := v.Args[1]
 21614  	v_0 := v.Args[0]
 21615  	b := v.Block
 21616  	typ := &b.Func.Config.Types
 21617  	// match: (Rsh32Ux64 <t> x y)
 21618  	// cond: shiftIsBounded(v)
 21619  	// result: (SRL <t> (ZeroExt32to64 x) y)
 21620  	for {
 21621  		t := v.Type
 21622  		x := v_0
 21623  		y := v_1
 21624  		if !(shiftIsBounded(v)) {
 21625  			break
 21626  		}
 21627  		v.reset(OpARM64SRL)
 21628  		v.Type = t
 21629  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21630  		v0.AddArg(x)
 21631  		v.AddArg2(v0, y)
 21632  		return true
 21633  	}
 21634  	// match: (Rsh32Ux64 <t> x y)
 21635  	// cond: !shiftIsBounded(v)
 21636  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
 21637  	for {
 21638  		t := v.Type
 21639  		x := v_0
 21640  		y := v_1
 21641  		if !(!shiftIsBounded(v)) {
 21642  			break
 21643  		}
 21644  		v.reset(OpARM64CSEL)
 21645  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21646  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21647  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21648  		v1.AddArg(x)
 21649  		v0.AddArg2(v1, y)
 21650  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21651  		v2.AuxInt = int64ToAuxInt(0)
 21652  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21653  		v3.AuxInt = int64ToAuxInt(64)
 21654  		v3.AddArg(y)
 21655  		v.AddArg3(v0, v2, v3)
 21656  		return true
 21657  	}
 21658  	return false
 21659  }
 21660  func rewriteValueARM64_OpRsh32Ux8(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: (Rsh32Ux8 <t> x y)
 21666  	// cond: shiftIsBounded(v)
 21667  	// result: (SRL <t> (ZeroExt32to64 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(OpARM64SRL)
 21676  		v.Type = t
 21677  		v0 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21678  		v0.AddArg(x)
 21679  		v.AddArg2(v0, y)
 21680  		return true
 21681  	}
 21682  	// match: (Rsh32Ux8 <t> x y)
 21683  	// cond: !shiftIsBounded(v)
 21684  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt32to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 21685  	for {
 21686  		t := v.Type
 21687  		x := v_0
 21688  		y := v_1
 21689  		if !(!shiftIsBounded(v)) {
 21690  			break
 21691  		}
 21692  		v.reset(OpARM64CSEL)
 21693  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21694  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21695  		v1 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21696  		v1.AddArg(x)
 21697  		v0.AddArg2(v1, y)
 21698  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 21699  		v2.AuxInt = int64ToAuxInt(0)
 21700  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21701  		v3.AuxInt = int64ToAuxInt(64)
 21702  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21703  		v4.AddArg(y)
 21704  		v3.AddArg(v4)
 21705  		v.AddArg3(v0, v2, v3)
 21706  		return true
 21707  	}
 21708  	return false
 21709  }
 21710  func rewriteValueARM64_OpRsh32x16(v *Value) bool {
 21711  	v_1 := v.Args[1]
 21712  	v_0 := v.Args[0]
 21713  	b := v.Block
 21714  	typ := &b.Func.Config.Types
 21715  	// match: (Rsh32x16 <t> x y)
 21716  	// cond: shiftIsBounded(v)
 21717  	// result: (SRA <t> (SignExt32to64 x) y)
 21718  	for {
 21719  		t := v.Type
 21720  		x := v_0
 21721  		y := v_1
 21722  		if !(shiftIsBounded(v)) {
 21723  			break
 21724  		}
 21725  		v.reset(OpARM64SRA)
 21726  		v.Type = t
 21727  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 21728  		v0.AddArg(x)
 21729  		v.AddArg2(v0, y)
 21730  		return true
 21731  	}
 21732  	// match: (Rsh32x16 x y)
 21733  	// cond: !shiftIsBounded(v)
 21734  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 21735  	for {
 21736  		x := v_0
 21737  		y := v_1
 21738  		if !(!shiftIsBounded(v)) {
 21739  			break
 21740  		}
 21741  		v.reset(OpARM64SRA)
 21742  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 21743  		v0.AddArg(x)
 21744  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21745  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21746  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21747  		v2.AuxInt = int64ToAuxInt(63)
 21748  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21749  		v3.AuxInt = int64ToAuxInt(64)
 21750  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21751  		v4.AddArg(y)
 21752  		v3.AddArg(v4)
 21753  		v1.AddArg3(y, v2, v3)
 21754  		v.AddArg2(v0, v1)
 21755  		return true
 21756  	}
 21757  	return false
 21758  }
 21759  func rewriteValueARM64_OpRsh32x32(v *Value) bool {
 21760  	v_1 := v.Args[1]
 21761  	v_0 := v.Args[0]
 21762  	b := v.Block
 21763  	typ := &b.Func.Config.Types
 21764  	// match: (Rsh32x32 <t> x y)
 21765  	// cond: shiftIsBounded(v)
 21766  	// result: (SRA <t> (SignExt32to64 x) y)
 21767  	for {
 21768  		t := v.Type
 21769  		x := v_0
 21770  		y := v_1
 21771  		if !(shiftIsBounded(v)) {
 21772  			break
 21773  		}
 21774  		v.reset(OpARM64SRA)
 21775  		v.Type = t
 21776  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 21777  		v0.AddArg(x)
 21778  		v.AddArg2(v0, y)
 21779  		return true
 21780  	}
 21781  	// match: (Rsh32x32 x y)
 21782  	// cond: !shiftIsBounded(v)
 21783  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 21784  	for {
 21785  		x := v_0
 21786  		y := v_1
 21787  		if !(!shiftIsBounded(v)) {
 21788  			break
 21789  		}
 21790  		v.reset(OpARM64SRA)
 21791  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 21792  		v0.AddArg(x)
 21793  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21794  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21795  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21796  		v2.AuxInt = int64ToAuxInt(63)
 21797  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21798  		v3.AuxInt = int64ToAuxInt(64)
 21799  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21800  		v4.AddArg(y)
 21801  		v3.AddArg(v4)
 21802  		v1.AddArg3(y, v2, v3)
 21803  		v.AddArg2(v0, v1)
 21804  		return true
 21805  	}
 21806  	return false
 21807  }
 21808  func rewriteValueARM64_OpRsh32x64(v *Value) bool {
 21809  	v_1 := v.Args[1]
 21810  	v_0 := v.Args[0]
 21811  	b := v.Block
 21812  	typ := &b.Func.Config.Types
 21813  	// match: (Rsh32x64 <t> x y)
 21814  	// cond: shiftIsBounded(v)
 21815  	// result: (SRA <t> (SignExt32to64 x) y)
 21816  	for {
 21817  		t := v.Type
 21818  		x := v_0
 21819  		y := v_1
 21820  		if !(shiftIsBounded(v)) {
 21821  			break
 21822  		}
 21823  		v.reset(OpARM64SRA)
 21824  		v.Type = t
 21825  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 21826  		v0.AddArg(x)
 21827  		v.AddArg2(v0, y)
 21828  		return true
 21829  	}
 21830  	// match: (Rsh32x64 x y)
 21831  	// cond: !shiftIsBounded(v)
 21832  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 21833  	for {
 21834  		x := v_0
 21835  		y := v_1
 21836  		if !(!shiftIsBounded(v)) {
 21837  			break
 21838  		}
 21839  		v.reset(OpARM64SRA)
 21840  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 21841  		v0.AddArg(x)
 21842  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21843  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21844  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21845  		v2.AuxInt = int64ToAuxInt(63)
 21846  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21847  		v3.AuxInt = int64ToAuxInt(64)
 21848  		v3.AddArg(y)
 21849  		v1.AddArg3(y, v2, v3)
 21850  		v.AddArg2(v0, v1)
 21851  		return true
 21852  	}
 21853  	return false
 21854  }
 21855  func rewriteValueARM64_OpRsh32x8(v *Value) bool {
 21856  	v_1 := v.Args[1]
 21857  	v_0 := v.Args[0]
 21858  	b := v.Block
 21859  	typ := &b.Func.Config.Types
 21860  	// match: (Rsh32x8 <t> x y)
 21861  	// cond: shiftIsBounded(v)
 21862  	// result: (SRA <t> (SignExt32to64 x) y)
 21863  	for {
 21864  		t := v.Type
 21865  		x := v_0
 21866  		y := v_1
 21867  		if !(shiftIsBounded(v)) {
 21868  			break
 21869  		}
 21870  		v.reset(OpARM64SRA)
 21871  		v.Type = t
 21872  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 21873  		v0.AddArg(x)
 21874  		v.AddArg2(v0, y)
 21875  		return true
 21876  	}
 21877  	// match: (Rsh32x8 x y)
 21878  	// cond: !shiftIsBounded(v)
 21879  	// result: (SRA (SignExt32to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 21880  	for {
 21881  		x := v_0
 21882  		y := v_1
 21883  		if !(!shiftIsBounded(v)) {
 21884  			break
 21885  		}
 21886  		v.reset(OpARM64SRA)
 21887  		v0 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
 21888  		v0.AddArg(x)
 21889  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 21890  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 21891  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 21892  		v2.AuxInt = int64ToAuxInt(63)
 21893  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21894  		v3.AuxInt = int64ToAuxInt(64)
 21895  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 21896  		v4.AddArg(y)
 21897  		v3.AddArg(v4)
 21898  		v1.AddArg3(y, v2, v3)
 21899  		v.AddArg2(v0, v1)
 21900  		return true
 21901  	}
 21902  	return false
 21903  }
 21904  func rewriteValueARM64_OpRsh64Ux16(v *Value) bool {
 21905  	v_1 := v.Args[1]
 21906  	v_0 := v.Args[0]
 21907  	b := v.Block
 21908  	typ := &b.Func.Config.Types
 21909  	// match: (Rsh64Ux16 <t> x y)
 21910  	// cond: shiftIsBounded(v)
 21911  	// result: (SRL <t> x y)
 21912  	for {
 21913  		t := v.Type
 21914  		x := v_0
 21915  		y := v_1
 21916  		if !(shiftIsBounded(v)) {
 21917  			break
 21918  		}
 21919  		v.reset(OpARM64SRL)
 21920  		v.Type = t
 21921  		v.AddArg2(x, y)
 21922  		return true
 21923  	}
 21924  	// match: (Rsh64Ux16 <t> x y)
 21925  	// cond: !shiftIsBounded(v)
 21926  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 21927  	for {
 21928  		t := v.Type
 21929  		x := v_0
 21930  		y := v_1
 21931  		if !(!shiftIsBounded(v)) {
 21932  			break
 21933  		}
 21934  		v.reset(OpARM64CSEL)
 21935  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21936  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21937  		v0.AddArg2(x, y)
 21938  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 21939  		v1.AuxInt = int64ToAuxInt(0)
 21940  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21941  		v2.AuxInt = int64ToAuxInt(64)
 21942  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 21943  		v3.AddArg(y)
 21944  		v2.AddArg(v3)
 21945  		v.AddArg3(v0, v1, v2)
 21946  		return true
 21947  	}
 21948  	return false
 21949  }
 21950  func rewriteValueARM64_OpRsh64Ux32(v *Value) bool {
 21951  	v_1 := v.Args[1]
 21952  	v_0 := v.Args[0]
 21953  	b := v.Block
 21954  	typ := &b.Func.Config.Types
 21955  	// match: (Rsh64Ux32 <t> x y)
 21956  	// cond: shiftIsBounded(v)
 21957  	// result: (SRL <t> x y)
 21958  	for {
 21959  		t := v.Type
 21960  		x := v_0
 21961  		y := v_1
 21962  		if !(shiftIsBounded(v)) {
 21963  			break
 21964  		}
 21965  		v.reset(OpARM64SRL)
 21966  		v.Type = t
 21967  		v.AddArg2(x, y)
 21968  		return true
 21969  	}
 21970  	// match: (Rsh64Ux32 <t> x y)
 21971  	// cond: !shiftIsBounded(v)
 21972  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 21973  	for {
 21974  		t := v.Type
 21975  		x := v_0
 21976  		y := v_1
 21977  		if !(!shiftIsBounded(v)) {
 21978  			break
 21979  		}
 21980  		v.reset(OpARM64CSEL)
 21981  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 21982  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 21983  		v0.AddArg2(x, y)
 21984  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 21985  		v1.AuxInt = int64ToAuxInt(0)
 21986  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 21987  		v2.AuxInt = int64ToAuxInt(64)
 21988  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 21989  		v3.AddArg(y)
 21990  		v2.AddArg(v3)
 21991  		v.AddArg3(v0, v1, v2)
 21992  		return true
 21993  	}
 21994  	return false
 21995  }
 21996  func rewriteValueARM64_OpRsh64Ux64(v *Value) bool {
 21997  	v_1 := v.Args[1]
 21998  	v_0 := v.Args[0]
 21999  	b := v.Block
 22000  	// match: (Rsh64Ux64 <t> x y)
 22001  	// cond: shiftIsBounded(v)
 22002  	// result: (SRL <t> x y)
 22003  	for {
 22004  		t := v.Type
 22005  		x := v_0
 22006  		y := v_1
 22007  		if !(shiftIsBounded(v)) {
 22008  			break
 22009  		}
 22010  		v.reset(OpARM64SRL)
 22011  		v.Type = t
 22012  		v.AddArg2(x, y)
 22013  		return true
 22014  	}
 22015  	// match: (Rsh64Ux64 <t> x y)
 22016  	// cond: !shiftIsBounded(v)
 22017  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] y))
 22018  	for {
 22019  		t := v.Type
 22020  		x := v_0
 22021  		y := v_1
 22022  		if !(!shiftIsBounded(v)) {
 22023  			break
 22024  		}
 22025  		v.reset(OpARM64CSEL)
 22026  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 22027  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 22028  		v0.AddArg2(x, y)
 22029  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 22030  		v1.AuxInt = int64ToAuxInt(0)
 22031  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22032  		v2.AuxInt = int64ToAuxInt(64)
 22033  		v2.AddArg(y)
 22034  		v.AddArg3(v0, v1, v2)
 22035  		return true
 22036  	}
 22037  	return false
 22038  }
 22039  func rewriteValueARM64_OpRsh64Ux8(v *Value) bool {
 22040  	v_1 := v.Args[1]
 22041  	v_0 := v.Args[0]
 22042  	b := v.Block
 22043  	typ := &b.Func.Config.Types
 22044  	// match: (Rsh64Ux8 <t> x y)
 22045  	// cond: shiftIsBounded(v)
 22046  	// result: (SRL <t> x y)
 22047  	for {
 22048  		t := v.Type
 22049  		x := v_0
 22050  		y := v_1
 22051  		if !(shiftIsBounded(v)) {
 22052  			break
 22053  		}
 22054  		v.reset(OpARM64SRL)
 22055  		v.Type = t
 22056  		v.AddArg2(x, y)
 22057  		return true
 22058  	}
 22059  	// match: (Rsh64Ux8 <t> x y)
 22060  	// cond: !shiftIsBounded(v)
 22061  	// result: (CSEL [OpARM64LessThanU] (SRL <t> x y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 22062  	for {
 22063  		t := v.Type
 22064  		x := v_0
 22065  		y := v_1
 22066  		if !(!shiftIsBounded(v)) {
 22067  			break
 22068  		}
 22069  		v.reset(OpARM64CSEL)
 22070  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 22071  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 22072  		v0.AddArg2(x, y)
 22073  		v1 := b.NewValue0(v.Pos, OpConst64, t)
 22074  		v1.AuxInt = int64ToAuxInt(0)
 22075  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22076  		v2.AuxInt = int64ToAuxInt(64)
 22077  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22078  		v3.AddArg(y)
 22079  		v2.AddArg(v3)
 22080  		v.AddArg3(v0, v1, v2)
 22081  		return true
 22082  	}
 22083  	return false
 22084  }
 22085  func rewriteValueARM64_OpRsh64x16(v *Value) bool {
 22086  	v_1 := v.Args[1]
 22087  	v_0 := v.Args[0]
 22088  	b := v.Block
 22089  	typ := &b.Func.Config.Types
 22090  	// match: (Rsh64x16 <t> x y)
 22091  	// cond: shiftIsBounded(v)
 22092  	// result: (SRA <t> x y)
 22093  	for {
 22094  		t := v.Type
 22095  		x := v_0
 22096  		y := v_1
 22097  		if !(shiftIsBounded(v)) {
 22098  			break
 22099  		}
 22100  		v.reset(OpARM64SRA)
 22101  		v.Type = t
 22102  		v.AddArg2(x, y)
 22103  		return true
 22104  	}
 22105  	// match: (Rsh64x16 x y)
 22106  	// cond: !shiftIsBounded(v)
 22107  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 22108  	for {
 22109  		x := v_0
 22110  		y := v_1
 22111  		if !(!shiftIsBounded(v)) {
 22112  			break
 22113  		}
 22114  		v.reset(OpARM64SRA)
 22115  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 22116  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 22117  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 22118  		v1.AuxInt = int64ToAuxInt(63)
 22119  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22120  		v2.AuxInt = int64ToAuxInt(64)
 22121  		v3 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 22122  		v3.AddArg(y)
 22123  		v2.AddArg(v3)
 22124  		v0.AddArg3(y, v1, v2)
 22125  		v.AddArg2(x, v0)
 22126  		return true
 22127  	}
 22128  	return false
 22129  }
 22130  func rewriteValueARM64_OpRsh64x32(v *Value) bool {
 22131  	v_1 := v.Args[1]
 22132  	v_0 := v.Args[0]
 22133  	b := v.Block
 22134  	typ := &b.Func.Config.Types
 22135  	// match: (Rsh64x32 <t> x y)
 22136  	// cond: shiftIsBounded(v)
 22137  	// result: (SRA <t> x y)
 22138  	for {
 22139  		t := v.Type
 22140  		x := v_0
 22141  		y := v_1
 22142  		if !(shiftIsBounded(v)) {
 22143  			break
 22144  		}
 22145  		v.reset(OpARM64SRA)
 22146  		v.Type = t
 22147  		v.AddArg2(x, y)
 22148  		return true
 22149  	}
 22150  	// match: (Rsh64x32 x y)
 22151  	// cond: !shiftIsBounded(v)
 22152  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 22153  	for {
 22154  		x := v_0
 22155  		y := v_1
 22156  		if !(!shiftIsBounded(v)) {
 22157  			break
 22158  		}
 22159  		v.reset(OpARM64SRA)
 22160  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 22161  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 22162  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 22163  		v1.AuxInt = int64ToAuxInt(63)
 22164  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22165  		v2.AuxInt = int64ToAuxInt(64)
 22166  		v3 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 22167  		v3.AddArg(y)
 22168  		v2.AddArg(v3)
 22169  		v0.AddArg3(y, v1, v2)
 22170  		v.AddArg2(x, v0)
 22171  		return true
 22172  	}
 22173  	return false
 22174  }
 22175  func rewriteValueARM64_OpRsh64x64(v *Value) bool {
 22176  	v_1 := v.Args[1]
 22177  	v_0 := v.Args[0]
 22178  	b := v.Block
 22179  	// match: (Rsh64x64 <t> x y)
 22180  	// cond: shiftIsBounded(v)
 22181  	// result: (SRA <t> x y)
 22182  	for {
 22183  		t := v.Type
 22184  		x := v_0
 22185  		y := v_1
 22186  		if !(shiftIsBounded(v)) {
 22187  			break
 22188  		}
 22189  		v.reset(OpARM64SRA)
 22190  		v.Type = t
 22191  		v.AddArg2(x, y)
 22192  		return true
 22193  	}
 22194  	// match: (Rsh64x64 x y)
 22195  	// cond: !shiftIsBounded(v)
 22196  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 22197  	for {
 22198  		x := v_0
 22199  		y := v_1
 22200  		if !(!shiftIsBounded(v)) {
 22201  			break
 22202  		}
 22203  		v.reset(OpARM64SRA)
 22204  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 22205  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 22206  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 22207  		v1.AuxInt = int64ToAuxInt(63)
 22208  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22209  		v2.AuxInt = int64ToAuxInt(64)
 22210  		v2.AddArg(y)
 22211  		v0.AddArg3(y, v1, v2)
 22212  		v.AddArg2(x, v0)
 22213  		return true
 22214  	}
 22215  	return false
 22216  }
 22217  func rewriteValueARM64_OpRsh64x8(v *Value) bool {
 22218  	v_1 := v.Args[1]
 22219  	v_0 := v.Args[0]
 22220  	b := v.Block
 22221  	typ := &b.Func.Config.Types
 22222  	// match: (Rsh64x8 <t> x y)
 22223  	// cond: shiftIsBounded(v)
 22224  	// result: (SRA <t> x y)
 22225  	for {
 22226  		t := v.Type
 22227  		x := v_0
 22228  		y := v_1
 22229  		if !(shiftIsBounded(v)) {
 22230  			break
 22231  		}
 22232  		v.reset(OpARM64SRA)
 22233  		v.Type = t
 22234  		v.AddArg2(x, y)
 22235  		return true
 22236  	}
 22237  	// match: (Rsh64x8 x y)
 22238  	// cond: !shiftIsBounded(v)
 22239  	// result: (SRA x (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 22240  	for {
 22241  		x := v_0
 22242  		y := v_1
 22243  		if !(!shiftIsBounded(v)) {
 22244  			break
 22245  		}
 22246  		v.reset(OpARM64SRA)
 22247  		v0 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 22248  		v0.AuxInt = opToAuxInt(OpARM64LessThanU)
 22249  		v1 := b.NewValue0(v.Pos, OpConst64, y.Type)
 22250  		v1.AuxInt = int64ToAuxInt(63)
 22251  		v2 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22252  		v2.AuxInt = int64ToAuxInt(64)
 22253  		v3 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22254  		v3.AddArg(y)
 22255  		v2.AddArg(v3)
 22256  		v0.AddArg3(y, v1, v2)
 22257  		v.AddArg2(x, v0)
 22258  		return true
 22259  	}
 22260  	return false
 22261  }
 22262  func rewriteValueARM64_OpRsh8Ux16(v *Value) bool {
 22263  	v_1 := v.Args[1]
 22264  	v_0 := v.Args[0]
 22265  	b := v.Block
 22266  	typ := &b.Func.Config.Types
 22267  	// match: (Rsh8Ux16 <t> x y)
 22268  	// cond: shiftIsBounded(v)
 22269  	// result: (SRL <t> (ZeroExt8to64 x) y)
 22270  	for {
 22271  		t := v.Type
 22272  		x := v_0
 22273  		y := v_1
 22274  		if !(shiftIsBounded(v)) {
 22275  			break
 22276  		}
 22277  		v.reset(OpARM64SRL)
 22278  		v.Type = t
 22279  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22280  		v0.AddArg(x)
 22281  		v.AddArg2(v0, y)
 22282  		return true
 22283  	}
 22284  	// match: (Rsh8Ux16 <t> x y)
 22285  	// cond: !shiftIsBounded(v)
 22286  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt16to64 y)))
 22287  	for {
 22288  		t := v.Type
 22289  		x := v_0
 22290  		y := v_1
 22291  		if !(!shiftIsBounded(v)) {
 22292  			break
 22293  		}
 22294  		v.reset(OpARM64CSEL)
 22295  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 22296  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 22297  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22298  		v1.AddArg(x)
 22299  		v0.AddArg2(v1, y)
 22300  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 22301  		v2.AuxInt = int64ToAuxInt(0)
 22302  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22303  		v3.AuxInt = int64ToAuxInt(64)
 22304  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 22305  		v4.AddArg(y)
 22306  		v3.AddArg(v4)
 22307  		v.AddArg3(v0, v2, v3)
 22308  		return true
 22309  	}
 22310  	return false
 22311  }
 22312  func rewriteValueARM64_OpRsh8Ux32(v *Value) bool {
 22313  	v_1 := v.Args[1]
 22314  	v_0 := v.Args[0]
 22315  	b := v.Block
 22316  	typ := &b.Func.Config.Types
 22317  	// match: (Rsh8Ux32 <t> x y)
 22318  	// cond: shiftIsBounded(v)
 22319  	// result: (SRL <t> (ZeroExt8to64 x) y)
 22320  	for {
 22321  		t := v.Type
 22322  		x := v_0
 22323  		y := v_1
 22324  		if !(shiftIsBounded(v)) {
 22325  			break
 22326  		}
 22327  		v.reset(OpARM64SRL)
 22328  		v.Type = t
 22329  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22330  		v0.AddArg(x)
 22331  		v.AddArg2(v0, y)
 22332  		return true
 22333  	}
 22334  	// match: (Rsh8Ux32 <t> x y)
 22335  	// cond: !shiftIsBounded(v)
 22336  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt32to64 y)))
 22337  	for {
 22338  		t := v.Type
 22339  		x := v_0
 22340  		y := v_1
 22341  		if !(!shiftIsBounded(v)) {
 22342  			break
 22343  		}
 22344  		v.reset(OpARM64CSEL)
 22345  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 22346  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 22347  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22348  		v1.AddArg(x)
 22349  		v0.AddArg2(v1, y)
 22350  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 22351  		v2.AuxInt = int64ToAuxInt(0)
 22352  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22353  		v3.AuxInt = int64ToAuxInt(64)
 22354  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 22355  		v4.AddArg(y)
 22356  		v3.AddArg(v4)
 22357  		v.AddArg3(v0, v2, v3)
 22358  		return true
 22359  	}
 22360  	return false
 22361  }
 22362  func rewriteValueARM64_OpRsh8Ux64(v *Value) bool {
 22363  	v_1 := v.Args[1]
 22364  	v_0 := v.Args[0]
 22365  	b := v.Block
 22366  	typ := &b.Func.Config.Types
 22367  	// match: (Rsh8Ux64 <t> x y)
 22368  	// cond: shiftIsBounded(v)
 22369  	// result: (SRL <t> (ZeroExt8to64 x) y)
 22370  	for {
 22371  		t := v.Type
 22372  		x := v_0
 22373  		y := v_1
 22374  		if !(shiftIsBounded(v)) {
 22375  			break
 22376  		}
 22377  		v.reset(OpARM64SRL)
 22378  		v.Type = t
 22379  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22380  		v0.AddArg(x)
 22381  		v.AddArg2(v0, y)
 22382  		return true
 22383  	}
 22384  	// match: (Rsh8Ux64 <t> x y)
 22385  	// cond: !shiftIsBounded(v)
 22386  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] y))
 22387  	for {
 22388  		t := v.Type
 22389  		x := v_0
 22390  		y := v_1
 22391  		if !(!shiftIsBounded(v)) {
 22392  			break
 22393  		}
 22394  		v.reset(OpARM64CSEL)
 22395  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 22396  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 22397  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22398  		v1.AddArg(x)
 22399  		v0.AddArg2(v1, y)
 22400  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 22401  		v2.AuxInt = int64ToAuxInt(0)
 22402  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22403  		v3.AuxInt = int64ToAuxInt(64)
 22404  		v3.AddArg(y)
 22405  		v.AddArg3(v0, v2, v3)
 22406  		return true
 22407  	}
 22408  	return false
 22409  }
 22410  func rewriteValueARM64_OpRsh8Ux8(v *Value) bool {
 22411  	v_1 := v.Args[1]
 22412  	v_0 := v.Args[0]
 22413  	b := v.Block
 22414  	typ := &b.Func.Config.Types
 22415  	// match: (Rsh8Ux8 <t> x y)
 22416  	// cond: shiftIsBounded(v)
 22417  	// result: (SRL <t> (ZeroExt8to64 x) y)
 22418  	for {
 22419  		t := v.Type
 22420  		x := v_0
 22421  		y := v_1
 22422  		if !(shiftIsBounded(v)) {
 22423  			break
 22424  		}
 22425  		v.reset(OpARM64SRL)
 22426  		v.Type = t
 22427  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22428  		v0.AddArg(x)
 22429  		v.AddArg2(v0, y)
 22430  		return true
 22431  	}
 22432  	// match: (Rsh8Ux8 <t> x y)
 22433  	// cond: !shiftIsBounded(v)
 22434  	// result: (CSEL [OpARM64LessThanU] (SRL <t> (ZeroExt8to64 x) y) (Const64 <t> [0]) (CMPconst [64] (ZeroExt8to64 y)))
 22435  	for {
 22436  		t := v.Type
 22437  		x := v_0
 22438  		y := v_1
 22439  		if !(!shiftIsBounded(v)) {
 22440  			break
 22441  		}
 22442  		v.reset(OpARM64CSEL)
 22443  		v.AuxInt = opToAuxInt(OpARM64LessThanU)
 22444  		v0 := b.NewValue0(v.Pos, OpARM64SRL, t)
 22445  		v1 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22446  		v1.AddArg(x)
 22447  		v0.AddArg2(v1, y)
 22448  		v2 := b.NewValue0(v.Pos, OpConst64, t)
 22449  		v2.AuxInt = int64ToAuxInt(0)
 22450  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22451  		v3.AuxInt = int64ToAuxInt(64)
 22452  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22453  		v4.AddArg(y)
 22454  		v3.AddArg(v4)
 22455  		v.AddArg3(v0, v2, v3)
 22456  		return true
 22457  	}
 22458  	return false
 22459  }
 22460  func rewriteValueARM64_OpRsh8x16(v *Value) bool {
 22461  	v_1 := v.Args[1]
 22462  	v_0 := v.Args[0]
 22463  	b := v.Block
 22464  	typ := &b.Func.Config.Types
 22465  	// match: (Rsh8x16 <t> x y)
 22466  	// cond: shiftIsBounded(v)
 22467  	// result: (SRA <t> (SignExt8to64 x) y)
 22468  	for {
 22469  		t := v.Type
 22470  		x := v_0
 22471  		y := v_1
 22472  		if !(shiftIsBounded(v)) {
 22473  			break
 22474  		}
 22475  		v.reset(OpARM64SRA)
 22476  		v.Type = t
 22477  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 22478  		v0.AddArg(x)
 22479  		v.AddArg2(v0, y)
 22480  		return true
 22481  	}
 22482  	// match: (Rsh8x16 x y)
 22483  	// cond: !shiftIsBounded(v)
 22484  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt16to64 y))))
 22485  	for {
 22486  		x := v_0
 22487  		y := v_1
 22488  		if !(!shiftIsBounded(v)) {
 22489  			break
 22490  		}
 22491  		v.reset(OpARM64SRA)
 22492  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 22493  		v0.AddArg(x)
 22494  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 22495  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 22496  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 22497  		v2.AuxInt = int64ToAuxInt(63)
 22498  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22499  		v3.AuxInt = int64ToAuxInt(64)
 22500  		v4 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
 22501  		v4.AddArg(y)
 22502  		v3.AddArg(v4)
 22503  		v1.AddArg3(y, v2, v3)
 22504  		v.AddArg2(v0, v1)
 22505  		return true
 22506  	}
 22507  	return false
 22508  }
 22509  func rewriteValueARM64_OpRsh8x32(v *Value) bool {
 22510  	v_1 := v.Args[1]
 22511  	v_0 := v.Args[0]
 22512  	b := v.Block
 22513  	typ := &b.Func.Config.Types
 22514  	// match: (Rsh8x32 <t> x y)
 22515  	// cond: shiftIsBounded(v)
 22516  	// result: (SRA <t> (SignExt8to64 x) y)
 22517  	for {
 22518  		t := v.Type
 22519  		x := v_0
 22520  		y := v_1
 22521  		if !(shiftIsBounded(v)) {
 22522  			break
 22523  		}
 22524  		v.reset(OpARM64SRA)
 22525  		v.Type = t
 22526  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 22527  		v0.AddArg(x)
 22528  		v.AddArg2(v0, y)
 22529  		return true
 22530  	}
 22531  	// match: (Rsh8x32 x y)
 22532  	// cond: !shiftIsBounded(v)
 22533  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt32to64 y))))
 22534  	for {
 22535  		x := v_0
 22536  		y := v_1
 22537  		if !(!shiftIsBounded(v)) {
 22538  			break
 22539  		}
 22540  		v.reset(OpARM64SRA)
 22541  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 22542  		v0.AddArg(x)
 22543  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 22544  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 22545  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 22546  		v2.AuxInt = int64ToAuxInt(63)
 22547  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22548  		v3.AuxInt = int64ToAuxInt(64)
 22549  		v4 := b.NewValue0(v.Pos, OpZeroExt32to64, typ.UInt64)
 22550  		v4.AddArg(y)
 22551  		v3.AddArg(v4)
 22552  		v1.AddArg3(y, v2, v3)
 22553  		v.AddArg2(v0, v1)
 22554  		return true
 22555  	}
 22556  	return false
 22557  }
 22558  func rewriteValueARM64_OpRsh8x64(v *Value) bool {
 22559  	v_1 := v.Args[1]
 22560  	v_0 := v.Args[0]
 22561  	b := v.Block
 22562  	typ := &b.Func.Config.Types
 22563  	// match: (Rsh8x64 <t> x y)
 22564  	// cond: shiftIsBounded(v)
 22565  	// result: (SRA <t> (SignExt8to64 x) y)
 22566  	for {
 22567  		t := v.Type
 22568  		x := v_0
 22569  		y := v_1
 22570  		if !(shiftIsBounded(v)) {
 22571  			break
 22572  		}
 22573  		v.reset(OpARM64SRA)
 22574  		v.Type = t
 22575  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 22576  		v0.AddArg(x)
 22577  		v.AddArg2(v0, y)
 22578  		return true
 22579  	}
 22580  	// match: (Rsh8x64 x y)
 22581  	// cond: !shiftIsBounded(v)
 22582  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] y)))
 22583  	for {
 22584  		x := v_0
 22585  		y := v_1
 22586  		if !(!shiftIsBounded(v)) {
 22587  			break
 22588  		}
 22589  		v.reset(OpARM64SRA)
 22590  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 22591  		v0.AddArg(x)
 22592  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 22593  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 22594  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 22595  		v2.AuxInt = int64ToAuxInt(63)
 22596  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22597  		v3.AuxInt = int64ToAuxInt(64)
 22598  		v3.AddArg(y)
 22599  		v1.AddArg3(y, v2, v3)
 22600  		v.AddArg2(v0, v1)
 22601  		return true
 22602  	}
 22603  	return false
 22604  }
 22605  func rewriteValueARM64_OpRsh8x8(v *Value) bool {
 22606  	v_1 := v.Args[1]
 22607  	v_0 := v.Args[0]
 22608  	b := v.Block
 22609  	typ := &b.Func.Config.Types
 22610  	// match: (Rsh8x8 <t> x y)
 22611  	// cond: shiftIsBounded(v)
 22612  	// result: (SRA <t> (SignExt8to64 x) y)
 22613  	for {
 22614  		t := v.Type
 22615  		x := v_0
 22616  		y := v_1
 22617  		if !(shiftIsBounded(v)) {
 22618  			break
 22619  		}
 22620  		v.reset(OpARM64SRA)
 22621  		v.Type = t
 22622  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 22623  		v0.AddArg(x)
 22624  		v.AddArg2(v0, y)
 22625  		return true
 22626  	}
 22627  	// match: (Rsh8x8 x y)
 22628  	// cond: !shiftIsBounded(v)
 22629  	// result: (SRA (SignExt8to64 x) (CSEL [OpARM64LessThanU] <y.Type> y (Const64 <y.Type> [63]) (CMPconst [64] (ZeroExt8to64 y))))
 22630  	for {
 22631  		x := v_0
 22632  		y := v_1
 22633  		if !(!shiftIsBounded(v)) {
 22634  			break
 22635  		}
 22636  		v.reset(OpARM64SRA)
 22637  		v0 := b.NewValue0(v.Pos, OpSignExt8to64, typ.Int64)
 22638  		v0.AddArg(x)
 22639  		v1 := b.NewValue0(v.Pos, OpARM64CSEL, y.Type)
 22640  		v1.AuxInt = opToAuxInt(OpARM64LessThanU)
 22641  		v2 := b.NewValue0(v.Pos, OpConst64, y.Type)
 22642  		v2.AuxInt = int64ToAuxInt(63)
 22643  		v3 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22644  		v3.AuxInt = int64ToAuxInt(64)
 22645  		v4 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
 22646  		v4.AddArg(y)
 22647  		v3.AddArg(v4)
 22648  		v1.AddArg3(y, v2, v3)
 22649  		v.AddArg2(v0, v1)
 22650  		return true
 22651  	}
 22652  	return false
 22653  }
 22654  func rewriteValueARM64_OpSelect0(v *Value) bool {
 22655  	v_0 := v.Args[0]
 22656  	b := v.Block
 22657  	typ := &b.Func.Config.Types
 22658  	// match: (Select0 (Mul64uhilo x y))
 22659  	// result: (UMULH x y)
 22660  	for {
 22661  		if v_0.Op != OpMul64uhilo {
 22662  			break
 22663  		}
 22664  		y := v_0.Args[1]
 22665  		x := v_0.Args[0]
 22666  		v.reset(OpARM64UMULH)
 22667  		v.AddArg2(x, y)
 22668  		return true
 22669  	}
 22670  	// match: (Select0 (Add64carry x y c))
 22671  	// result: (Select0 <typ.UInt64> (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] c))))
 22672  	for {
 22673  		if v_0.Op != OpAdd64carry {
 22674  			break
 22675  		}
 22676  		c := v_0.Args[2]
 22677  		x := v_0.Args[0]
 22678  		y := v_0.Args[1]
 22679  		v.reset(OpSelect0)
 22680  		v.Type = typ.UInt64
 22681  		v0 := b.NewValue0(v.Pos, OpARM64ADCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 22682  		v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 22683  		v2 := b.NewValue0(v.Pos, OpARM64ADDSconstflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 22684  		v2.AuxInt = int64ToAuxInt(-1)
 22685  		v2.AddArg(c)
 22686  		v1.AddArg(v2)
 22687  		v0.AddArg3(x, y, v1)
 22688  		v.AddArg(v0)
 22689  		return true
 22690  	}
 22691  	// match: (Select0 (Sub64borrow x y bo))
 22692  	// result: (Select0 <typ.UInt64> (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags bo))))
 22693  	for {
 22694  		if v_0.Op != OpSub64borrow {
 22695  			break
 22696  		}
 22697  		bo := v_0.Args[2]
 22698  		x := v_0.Args[0]
 22699  		y := v_0.Args[1]
 22700  		v.reset(OpSelect0)
 22701  		v.Type = typ.UInt64
 22702  		v0 := b.NewValue0(v.Pos, OpARM64SBCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 22703  		v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 22704  		v2 := b.NewValue0(v.Pos, OpARM64NEGSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 22705  		v2.AddArg(bo)
 22706  		v1.AddArg(v2)
 22707  		v0.AddArg3(x, y, v1)
 22708  		v.AddArg(v0)
 22709  		return true
 22710  	}
 22711  	// match: (Select0 (Mul64uover x y))
 22712  	// result: (MUL x y)
 22713  	for {
 22714  		if v_0.Op != OpMul64uover {
 22715  			break
 22716  		}
 22717  		y := v_0.Args[1]
 22718  		x := v_0.Args[0]
 22719  		v.reset(OpARM64MUL)
 22720  		v.AddArg2(x, y)
 22721  		return true
 22722  	}
 22723  	return false
 22724  }
 22725  func rewriteValueARM64_OpSelect1(v *Value) bool {
 22726  	v_0 := v.Args[0]
 22727  	b := v.Block
 22728  	typ := &b.Func.Config.Types
 22729  	// match: (Select1 (Mul64uhilo x y))
 22730  	// result: (MUL x y)
 22731  	for {
 22732  		if v_0.Op != OpMul64uhilo {
 22733  			break
 22734  		}
 22735  		y := v_0.Args[1]
 22736  		x := v_0.Args[0]
 22737  		v.reset(OpARM64MUL)
 22738  		v.AddArg2(x, y)
 22739  		return true
 22740  	}
 22741  	// match: (Select1 (Add64carry x y c))
 22742  	// result: (ADCzerocarry <typ.UInt64> (Select1 <types.TypeFlags> (ADCSflags x y (Select1 <types.TypeFlags> (ADDSconstflags [-1] c)))))
 22743  	for {
 22744  		if v_0.Op != OpAdd64carry {
 22745  			break
 22746  		}
 22747  		c := v_0.Args[2]
 22748  		x := v_0.Args[0]
 22749  		y := v_0.Args[1]
 22750  		v.reset(OpARM64ADCzerocarry)
 22751  		v.Type = typ.UInt64
 22752  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 22753  		v1 := b.NewValue0(v.Pos, OpARM64ADCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 22754  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 22755  		v3 := b.NewValue0(v.Pos, OpARM64ADDSconstflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 22756  		v3.AuxInt = int64ToAuxInt(-1)
 22757  		v3.AddArg(c)
 22758  		v2.AddArg(v3)
 22759  		v1.AddArg3(x, y, v2)
 22760  		v0.AddArg(v1)
 22761  		v.AddArg(v0)
 22762  		return true
 22763  	}
 22764  	// match: (Select1 (Sub64borrow x y bo))
 22765  	// result: (NEG <typ.UInt64> (NGCzerocarry <typ.UInt64> (Select1 <types.TypeFlags> (SBCSflags x y (Select1 <types.TypeFlags> (NEGSflags bo))))))
 22766  	for {
 22767  		if v_0.Op != OpSub64borrow {
 22768  			break
 22769  		}
 22770  		bo := v_0.Args[2]
 22771  		x := v_0.Args[0]
 22772  		y := v_0.Args[1]
 22773  		v.reset(OpARM64NEG)
 22774  		v.Type = typ.UInt64
 22775  		v0 := b.NewValue0(v.Pos, OpARM64NGCzerocarry, typ.UInt64)
 22776  		v1 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 22777  		v2 := b.NewValue0(v.Pos, OpARM64SBCSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 22778  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 22779  		v4 := b.NewValue0(v.Pos, OpARM64NEGSflags, types.NewTuple(typ.UInt64, types.TypeFlags))
 22780  		v4.AddArg(bo)
 22781  		v3.AddArg(v4)
 22782  		v2.AddArg3(x, y, v3)
 22783  		v1.AddArg(v2)
 22784  		v0.AddArg(v1)
 22785  		v.AddArg(v0)
 22786  		return true
 22787  	}
 22788  	// match: (Select1 (Mul64uover x y))
 22789  	// result: (NotEqual (CMPconst (UMULH <typ.UInt64> x y) [0]))
 22790  	for {
 22791  		if v_0.Op != OpMul64uover {
 22792  			break
 22793  		}
 22794  		y := v_0.Args[1]
 22795  		x := v_0.Args[0]
 22796  		v.reset(OpARM64NotEqual)
 22797  		v0 := b.NewValue0(v.Pos, OpARM64CMPconst, types.TypeFlags)
 22798  		v0.AuxInt = int64ToAuxInt(0)
 22799  		v1 := b.NewValue0(v.Pos, OpARM64UMULH, typ.UInt64)
 22800  		v1.AddArg2(x, y)
 22801  		v0.AddArg(v1)
 22802  		v.AddArg(v0)
 22803  		return true
 22804  	}
 22805  	return false
 22806  }
 22807  func rewriteValueARM64_OpSelectN(v *Value) bool {
 22808  	v_0 := v.Args[0]
 22809  	b := v.Block
 22810  	config := b.Func.Config
 22811  	// match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
 22812  	// 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)
 22813  	// result: (Move [sz] dst src mem)
 22814  	for {
 22815  		if auxIntToInt64(v.AuxInt) != 0 {
 22816  			break
 22817  		}
 22818  		call := v_0
 22819  		if call.Op != OpARM64CALLstatic || len(call.Args) != 1 {
 22820  			break
 22821  		}
 22822  		sym := auxToCall(call.Aux)
 22823  		s1 := call.Args[0]
 22824  		if s1.Op != OpARM64MOVDstore {
 22825  			break
 22826  		}
 22827  		_ = s1.Args[2]
 22828  		s1_1 := s1.Args[1]
 22829  		if s1_1.Op != OpARM64MOVDconst {
 22830  			break
 22831  		}
 22832  		sz := auxIntToInt64(s1_1.AuxInt)
 22833  		s2 := s1.Args[2]
 22834  		if s2.Op != OpARM64MOVDstore {
 22835  			break
 22836  		}
 22837  		_ = s2.Args[2]
 22838  		src := s2.Args[1]
 22839  		s3 := s2.Args[2]
 22840  		if s3.Op != OpARM64MOVDstore {
 22841  			break
 22842  		}
 22843  		mem := s3.Args[2]
 22844  		dst := s3.Args[1]
 22845  		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)) {
 22846  			break
 22847  		}
 22848  		v.reset(OpMove)
 22849  		v.AuxInt = int64ToAuxInt(sz)
 22850  		v.AddArg3(dst, src, mem)
 22851  		return true
 22852  	}
 22853  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
 22854  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 22855  	// result: (Move [sz] dst src mem)
 22856  	for {
 22857  		if auxIntToInt64(v.AuxInt) != 0 {
 22858  			break
 22859  		}
 22860  		call := v_0
 22861  		if call.Op != OpARM64CALLstatic || len(call.Args) != 4 {
 22862  			break
 22863  		}
 22864  		sym := auxToCall(call.Aux)
 22865  		mem := call.Args[3]
 22866  		dst := call.Args[0]
 22867  		src := call.Args[1]
 22868  		call_2 := call.Args[2]
 22869  		if call_2.Op != OpARM64MOVDconst {
 22870  			break
 22871  		}
 22872  		sz := auxIntToInt64(call_2.AuxInt)
 22873  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 22874  			break
 22875  		}
 22876  		v.reset(OpMove)
 22877  		v.AuxInt = int64ToAuxInt(sz)
 22878  		v.AddArg3(dst, src, mem)
 22879  		return true
 22880  	}
 22881  	return false
 22882  }
 22883  func rewriteValueARM64_OpSlicemask(v *Value) bool {
 22884  	v_0 := v.Args[0]
 22885  	b := v.Block
 22886  	// match: (Slicemask <t> x)
 22887  	// result: (SRAconst (NEG <t> x) [63])
 22888  	for {
 22889  		t := v.Type
 22890  		x := v_0
 22891  		v.reset(OpARM64SRAconst)
 22892  		v.AuxInt = int64ToAuxInt(63)
 22893  		v0 := b.NewValue0(v.Pos, OpARM64NEG, t)
 22894  		v0.AddArg(x)
 22895  		v.AddArg(v0)
 22896  		return true
 22897  	}
 22898  }
 22899  func rewriteValueARM64_OpStore(v *Value) bool {
 22900  	v_2 := v.Args[2]
 22901  	v_1 := v.Args[1]
 22902  	v_0 := v.Args[0]
 22903  	// match: (Store {t} ptr val mem)
 22904  	// cond: t.Size() == 1
 22905  	// result: (MOVBstore ptr val mem)
 22906  	for {
 22907  		t := auxToType(v.Aux)
 22908  		ptr := v_0
 22909  		val := v_1
 22910  		mem := v_2
 22911  		if !(t.Size() == 1) {
 22912  			break
 22913  		}
 22914  		v.reset(OpARM64MOVBstore)
 22915  		v.AddArg3(ptr, val, mem)
 22916  		return true
 22917  	}
 22918  	// match: (Store {t} ptr val mem)
 22919  	// cond: t.Size() == 2
 22920  	// result: (MOVHstore ptr val mem)
 22921  	for {
 22922  		t := auxToType(v.Aux)
 22923  		ptr := v_0
 22924  		val := v_1
 22925  		mem := v_2
 22926  		if !(t.Size() == 2) {
 22927  			break
 22928  		}
 22929  		v.reset(OpARM64MOVHstore)
 22930  		v.AddArg3(ptr, val, mem)
 22931  		return true
 22932  	}
 22933  	// match: (Store {t} ptr val mem)
 22934  	// cond: t.Size() == 4 && !t.IsFloat()
 22935  	// result: (MOVWstore ptr val mem)
 22936  	for {
 22937  		t := auxToType(v.Aux)
 22938  		ptr := v_0
 22939  		val := v_1
 22940  		mem := v_2
 22941  		if !(t.Size() == 4 && !t.IsFloat()) {
 22942  			break
 22943  		}
 22944  		v.reset(OpARM64MOVWstore)
 22945  		v.AddArg3(ptr, val, mem)
 22946  		return true
 22947  	}
 22948  	// match: (Store {t} ptr val mem)
 22949  	// cond: t.Size() == 8 && !t.IsFloat()
 22950  	// result: (MOVDstore ptr val mem)
 22951  	for {
 22952  		t := auxToType(v.Aux)
 22953  		ptr := v_0
 22954  		val := v_1
 22955  		mem := v_2
 22956  		if !(t.Size() == 8 && !t.IsFloat()) {
 22957  			break
 22958  		}
 22959  		v.reset(OpARM64MOVDstore)
 22960  		v.AddArg3(ptr, val, mem)
 22961  		return true
 22962  	}
 22963  	// match: (Store {t} ptr val mem)
 22964  	// cond: t.Size() == 4 && t.IsFloat()
 22965  	// result: (FMOVSstore ptr val mem)
 22966  	for {
 22967  		t := auxToType(v.Aux)
 22968  		ptr := v_0
 22969  		val := v_1
 22970  		mem := v_2
 22971  		if !(t.Size() == 4 && t.IsFloat()) {
 22972  			break
 22973  		}
 22974  		v.reset(OpARM64FMOVSstore)
 22975  		v.AddArg3(ptr, val, mem)
 22976  		return true
 22977  	}
 22978  	// match: (Store {t} ptr val mem)
 22979  	// cond: t.Size() == 8 && t.IsFloat()
 22980  	// result: (FMOVDstore ptr val mem)
 22981  	for {
 22982  		t := auxToType(v.Aux)
 22983  		ptr := v_0
 22984  		val := v_1
 22985  		mem := v_2
 22986  		if !(t.Size() == 8 && t.IsFloat()) {
 22987  			break
 22988  		}
 22989  		v.reset(OpARM64FMOVDstore)
 22990  		v.AddArg3(ptr, val, mem)
 22991  		return true
 22992  	}
 22993  	return false
 22994  }
 22995  func rewriteValueARM64_OpZero(v *Value) bool {
 22996  	v_1 := v.Args[1]
 22997  	v_0 := v.Args[0]
 22998  	b := v.Block
 22999  	config := b.Func.Config
 23000  	typ := &b.Func.Config.Types
 23001  	// match: (Zero [0] _ mem)
 23002  	// result: mem
 23003  	for {
 23004  		if auxIntToInt64(v.AuxInt) != 0 {
 23005  			break
 23006  		}
 23007  		mem := v_1
 23008  		v.copyOf(mem)
 23009  		return true
 23010  	}
 23011  	// match: (Zero [1] ptr mem)
 23012  	// result: (MOVBstore ptr (MOVDconst [0]) mem)
 23013  	for {
 23014  		if auxIntToInt64(v.AuxInt) != 1 {
 23015  			break
 23016  		}
 23017  		ptr := v_0
 23018  		mem := v_1
 23019  		v.reset(OpARM64MOVBstore)
 23020  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23021  		v0.AuxInt = int64ToAuxInt(0)
 23022  		v.AddArg3(ptr, v0, mem)
 23023  		return true
 23024  	}
 23025  	// match: (Zero [2] ptr mem)
 23026  	// result: (MOVHstore ptr (MOVDconst [0]) mem)
 23027  	for {
 23028  		if auxIntToInt64(v.AuxInt) != 2 {
 23029  			break
 23030  		}
 23031  		ptr := v_0
 23032  		mem := v_1
 23033  		v.reset(OpARM64MOVHstore)
 23034  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23035  		v0.AuxInt = int64ToAuxInt(0)
 23036  		v.AddArg3(ptr, v0, mem)
 23037  		return true
 23038  	}
 23039  	// match: (Zero [4] ptr mem)
 23040  	// result: (MOVWstore ptr (MOVDconst [0]) mem)
 23041  	for {
 23042  		if auxIntToInt64(v.AuxInt) != 4 {
 23043  			break
 23044  		}
 23045  		ptr := v_0
 23046  		mem := v_1
 23047  		v.reset(OpARM64MOVWstore)
 23048  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23049  		v0.AuxInt = int64ToAuxInt(0)
 23050  		v.AddArg3(ptr, v0, mem)
 23051  		return true
 23052  	}
 23053  	// match: (Zero [3] ptr mem)
 23054  	// result: (MOVBstore [2] ptr (MOVDconst [0]) (MOVHstore ptr (MOVDconst [0]) mem))
 23055  	for {
 23056  		if auxIntToInt64(v.AuxInt) != 3 {
 23057  			break
 23058  		}
 23059  		ptr := v_0
 23060  		mem := v_1
 23061  		v.reset(OpARM64MOVBstore)
 23062  		v.AuxInt = int32ToAuxInt(2)
 23063  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23064  		v0.AuxInt = int64ToAuxInt(0)
 23065  		v1 := b.NewValue0(v.Pos, OpARM64MOVHstore, types.TypeMem)
 23066  		v1.AddArg3(ptr, v0, mem)
 23067  		v.AddArg3(ptr, v0, v1)
 23068  		return true
 23069  	}
 23070  	// match: (Zero [5] ptr mem)
 23071  	// result: (MOVBstore [4] ptr (MOVDconst [0]) (MOVWstore ptr (MOVDconst [0]) mem))
 23072  	for {
 23073  		if auxIntToInt64(v.AuxInt) != 5 {
 23074  			break
 23075  		}
 23076  		ptr := v_0
 23077  		mem := v_1
 23078  		v.reset(OpARM64MOVBstore)
 23079  		v.AuxInt = int32ToAuxInt(4)
 23080  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23081  		v0.AuxInt = int64ToAuxInt(0)
 23082  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 23083  		v1.AddArg3(ptr, v0, mem)
 23084  		v.AddArg3(ptr, v0, v1)
 23085  		return true
 23086  	}
 23087  	// match: (Zero [6] ptr mem)
 23088  	// result: (MOVHstore [4] ptr (MOVDconst [0]) (MOVWstore ptr (MOVDconst [0]) mem))
 23089  	for {
 23090  		if auxIntToInt64(v.AuxInt) != 6 {
 23091  			break
 23092  		}
 23093  		ptr := v_0
 23094  		mem := v_1
 23095  		v.reset(OpARM64MOVHstore)
 23096  		v.AuxInt = int32ToAuxInt(4)
 23097  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23098  		v0.AuxInt = int64ToAuxInt(0)
 23099  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 23100  		v1.AddArg3(ptr, v0, mem)
 23101  		v.AddArg3(ptr, v0, v1)
 23102  		return true
 23103  	}
 23104  	// match: (Zero [7] ptr mem)
 23105  	// result: (MOVWstore [3] ptr (MOVDconst [0]) (MOVWstore ptr (MOVDconst [0]) mem))
 23106  	for {
 23107  		if auxIntToInt64(v.AuxInt) != 7 {
 23108  			break
 23109  		}
 23110  		ptr := v_0
 23111  		mem := v_1
 23112  		v.reset(OpARM64MOVWstore)
 23113  		v.AuxInt = int32ToAuxInt(3)
 23114  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23115  		v0.AuxInt = int64ToAuxInt(0)
 23116  		v1 := b.NewValue0(v.Pos, OpARM64MOVWstore, types.TypeMem)
 23117  		v1.AddArg3(ptr, v0, mem)
 23118  		v.AddArg3(ptr, v0, v1)
 23119  		return true
 23120  	}
 23121  	// match: (Zero [8] ptr mem)
 23122  	// result: (MOVDstore ptr (MOVDconst [0]) mem)
 23123  	for {
 23124  		if auxIntToInt64(v.AuxInt) != 8 {
 23125  			break
 23126  		}
 23127  		ptr := v_0
 23128  		mem := v_1
 23129  		v.reset(OpARM64MOVDstore)
 23130  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23131  		v0.AuxInt = int64ToAuxInt(0)
 23132  		v.AddArg3(ptr, v0, mem)
 23133  		return true
 23134  	}
 23135  	// match: (Zero [9] ptr mem)
 23136  	// result: (MOVBstore [8] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 23137  	for {
 23138  		if auxIntToInt64(v.AuxInt) != 9 {
 23139  			break
 23140  		}
 23141  		ptr := v_0
 23142  		mem := v_1
 23143  		v.reset(OpARM64MOVBstore)
 23144  		v.AuxInt = int32ToAuxInt(8)
 23145  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23146  		v0.AuxInt = int64ToAuxInt(0)
 23147  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 23148  		v1.AddArg3(ptr, v0, mem)
 23149  		v.AddArg3(ptr, v0, v1)
 23150  		return true
 23151  	}
 23152  	// match: (Zero [10] ptr mem)
 23153  	// result: (MOVHstore [8] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 23154  	for {
 23155  		if auxIntToInt64(v.AuxInt) != 10 {
 23156  			break
 23157  		}
 23158  		ptr := v_0
 23159  		mem := v_1
 23160  		v.reset(OpARM64MOVHstore)
 23161  		v.AuxInt = int32ToAuxInt(8)
 23162  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23163  		v0.AuxInt = int64ToAuxInt(0)
 23164  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 23165  		v1.AddArg3(ptr, v0, mem)
 23166  		v.AddArg3(ptr, v0, v1)
 23167  		return true
 23168  	}
 23169  	// match: (Zero [11] ptr mem)
 23170  	// result: (MOVDstore [3] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 23171  	for {
 23172  		if auxIntToInt64(v.AuxInt) != 11 {
 23173  			break
 23174  		}
 23175  		ptr := v_0
 23176  		mem := v_1
 23177  		v.reset(OpARM64MOVDstore)
 23178  		v.AuxInt = int32ToAuxInt(3)
 23179  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23180  		v0.AuxInt = int64ToAuxInt(0)
 23181  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 23182  		v1.AddArg3(ptr, v0, mem)
 23183  		v.AddArg3(ptr, v0, v1)
 23184  		return true
 23185  	}
 23186  	// match: (Zero [12] ptr mem)
 23187  	// result: (MOVWstore [8] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 23188  	for {
 23189  		if auxIntToInt64(v.AuxInt) != 12 {
 23190  			break
 23191  		}
 23192  		ptr := v_0
 23193  		mem := v_1
 23194  		v.reset(OpARM64MOVWstore)
 23195  		v.AuxInt = int32ToAuxInt(8)
 23196  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23197  		v0.AuxInt = int64ToAuxInt(0)
 23198  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 23199  		v1.AddArg3(ptr, v0, mem)
 23200  		v.AddArg3(ptr, v0, v1)
 23201  		return true
 23202  	}
 23203  	// match: (Zero [13] ptr mem)
 23204  	// result: (MOVDstore [5] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 23205  	for {
 23206  		if auxIntToInt64(v.AuxInt) != 13 {
 23207  			break
 23208  		}
 23209  		ptr := v_0
 23210  		mem := v_1
 23211  		v.reset(OpARM64MOVDstore)
 23212  		v.AuxInt = int32ToAuxInt(5)
 23213  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23214  		v0.AuxInt = int64ToAuxInt(0)
 23215  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 23216  		v1.AddArg3(ptr, v0, mem)
 23217  		v.AddArg3(ptr, v0, v1)
 23218  		return true
 23219  	}
 23220  	// match: (Zero [14] ptr mem)
 23221  	// result: (MOVDstore [6] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 23222  	for {
 23223  		if auxIntToInt64(v.AuxInt) != 14 {
 23224  			break
 23225  		}
 23226  		ptr := v_0
 23227  		mem := v_1
 23228  		v.reset(OpARM64MOVDstore)
 23229  		v.AuxInt = int32ToAuxInt(6)
 23230  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23231  		v0.AuxInt = int64ToAuxInt(0)
 23232  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 23233  		v1.AddArg3(ptr, v0, mem)
 23234  		v.AddArg3(ptr, v0, v1)
 23235  		return true
 23236  	}
 23237  	// match: (Zero [15] ptr mem)
 23238  	// result: (MOVDstore [7] ptr (MOVDconst [0]) (MOVDstore ptr (MOVDconst [0]) mem))
 23239  	for {
 23240  		if auxIntToInt64(v.AuxInt) != 15 {
 23241  			break
 23242  		}
 23243  		ptr := v_0
 23244  		mem := v_1
 23245  		v.reset(OpARM64MOVDstore)
 23246  		v.AuxInt = int32ToAuxInt(7)
 23247  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23248  		v0.AuxInt = int64ToAuxInt(0)
 23249  		v1 := b.NewValue0(v.Pos, OpARM64MOVDstore, types.TypeMem)
 23250  		v1.AddArg3(ptr, v0, mem)
 23251  		v.AddArg3(ptr, v0, v1)
 23252  		return true
 23253  	}
 23254  	// match: (Zero [16] ptr mem)
 23255  	// result: (STP [0] ptr (MOVDconst [0]) (MOVDconst [0]) mem)
 23256  	for {
 23257  		if auxIntToInt64(v.AuxInt) != 16 {
 23258  			break
 23259  		}
 23260  		ptr := v_0
 23261  		mem := v_1
 23262  		v.reset(OpARM64STP)
 23263  		v.AuxInt = int32ToAuxInt(0)
 23264  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23265  		v0.AuxInt = int64ToAuxInt(0)
 23266  		v.AddArg4(ptr, v0, v0, mem)
 23267  		return true
 23268  	}
 23269  	// match: (Zero [32] ptr mem)
 23270  	// result: (STP [16] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [0] ptr (MOVDconst [0]) (MOVDconst [0]) mem))
 23271  	for {
 23272  		if auxIntToInt64(v.AuxInt) != 32 {
 23273  			break
 23274  		}
 23275  		ptr := v_0
 23276  		mem := v_1
 23277  		v.reset(OpARM64STP)
 23278  		v.AuxInt = int32ToAuxInt(16)
 23279  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23280  		v0.AuxInt = int64ToAuxInt(0)
 23281  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 23282  		v1.AuxInt = int32ToAuxInt(0)
 23283  		v1.AddArg4(ptr, v0, v0, mem)
 23284  		v.AddArg4(ptr, v0, v0, v1)
 23285  		return true
 23286  	}
 23287  	// match: (Zero [48] ptr mem)
 23288  	// result: (STP [32] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [16] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [0] ptr (MOVDconst [0]) (MOVDconst [0]) mem)))
 23289  	for {
 23290  		if auxIntToInt64(v.AuxInt) != 48 {
 23291  			break
 23292  		}
 23293  		ptr := v_0
 23294  		mem := v_1
 23295  		v.reset(OpARM64STP)
 23296  		v.AuxInt = int32ToAuxInt(32)
 23297  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23298  		v0.AuxInt = int64ToAuxInt(0)
 23299  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 23300  		v1.AuxInt = int32ToAuxInt(16)
 23301  		v2 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 23302  		v2.AuxInt = int32ToAuxInt(0)
 23303  		v2.AddArg4(ptr, v0, v0, mem)
 23304  		v1.AddArg4(ptr, v0, v0, v2)
 23305  		v.AddArg4(ptr, v0, v0, v1)
 23306  		return true
 23307  	}
 23308  	// match: (Zero [64] ptr mem)
 23309  	// result: (STP [48] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [32] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [16] ptr (MOVDconst [0]) (MOVDconst [0]) (STP [0] ptr (MOVDconst [0]) (MOVDconst [0]) mem))))
 23310  	for {
 23311  		if auxIntToInt64(v.AuxInt) != 64 {
 23312  			break
 23313  		}
 23314  		ptr := v_0
 23315  		mem := v_1
 23316  		v.reset(OpARM64STP)
 23317  		v.AuxInt = int32ToAuxInt(48)
 23318  		v0 := b.NewValue0(v.Pos, OpARM64MOVDconst, typ.UInt64)
 23319  		v0.AuxInt = int64ToAuxInt(0)
 23320  		v1 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 23321  		v1.AuxInt = int32ToAuxInt(32)
 23322  		v2 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 23323  		v2.AuxInt = int32ToAuxInt(16)
 23324  		v3 := b.NewValue0(v.Pos, OpARM64STP, types.TypeMem)
 23325  		v3.AuxInt = int32ToAuxInt(0)
 23326  		v3.AddArg4(ptr, v0, v0, mem)
 23327  		v2.AddArg4(ptr, v0, v0, v3)
 23328  		v1.AddArg4(ptr, v0, v0, v2)
 23329  		v.AddArg4(ptr, v0, v0, v1)
 23330  		return true
 23331  	}
 23332  	// match: (Zero [s] ptr mem)
 23333  	// cond: s%16 != 0 && s%16 <= 8 && s > 16
 23334  	// result: (Zero [8] (OffPtr <ptr.Type> ptr [s-8]) (Zero [s-s%16] ptr mem))
 23335  	for {
 23336  		s := auxIntToInt64(v.AuxInt)
 23337  		ptr := v_0
 23338  		mem := v_1
 23339  		if !(s%16 != 0 && s%16 <= 8 && s > 16) {
 23340  			break
 23341  		}
 23342  		v.reset(OpZero)
 23343  		v.AuxInt = int64ToAuxInt(8)
 23344  		v0 := b.NewValue0(v.Pos, OpOffPtr, ptr.Type)
 23345  		v0.AuxInt = int64ToAuxInt(s - 8)
 23346  		v0.AddArg(ptr)
 23347  		v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
 23348  		v1.AuxInt = int64ToAuxInt(s - s%16)
 23349  		v1.AddArg2(ptr, mem)
 23350  		v.AddArg2(v0, v1)
 23351  		return true
 23352  	}
 23353  	// match: (Zero [s] ptr mem)
 23354  	// cond: s%16 != 0 && s%16 > 8 && s > 16
 23355  	// result: (Zero [16] (OffPtr <ptr.Type> ptr [s-16]) (Zero [s-s%16] ptr mem))
 23356  	for {
 23357  		s := auxIntToInt64(v.AuxInt)
 23358  		ptr := v_0
 23359  		mem := v_1
 23360  		if !(s%16 != 0 && s%16 > 8 && s > 16) {
 23361  			break
 23362  		}
 23363  		v.reset(OpZero)
 23364  		v.AuxInt = int64ToAuxInt(16)
 23365  		v0 := b.NewValue0(v.Pos, OpOffPtr, ptr.Type)
 23366  		v0.AuxInt = int64ToAuxInt(s - 16)
 23367  		v0.AddArg(ptr)
 23368  		v1 := b.NewValue0(v.Pos, OpZero, types.TypeMem)
 23369  		v1.AuxInt = int64ToAuxInt(s - s%16)
 23370  		v1.AddArg2(ptr, mem)
 23371  		v.AddArg2(v0, v1)
 23372  		return true
 23373  	}
 23374  	// match: (Zero [s] ptr mem)
 23375  	// cond: s%16 == 0 && s > 64 && s <= 16*64 && !config.noDuffDevice
 23376  	// result: (DUFFZERO [4 * (64 - s/16)] ptr mem)
 23377  	for {
 23378  		s := auxIntToInt64(v.AuxInt)
 23379  		ptr := v_0
 23380  		mem := v_1
 23381  		if !(s%16 == 0 && s > 64 && s <= 16*64 && !config.noDuffDevice) {
 23382  			break
 23383  		}
 23384  		v.reset(OpARM64DUFFZERO)
 23385  		v.AuxInt = int64ToAuxInt(4 * (64 - s/16))
 23386  		v.AddArg2(ptr, mem)
 23387  		return true
 23388  	}
 23389  	// match: (Zero [s] ptr mem)
 23390  	// cond: s%16 == 0 && (s > 16*64 || config.noDuffDevice)
 23391  	// result: (LoweredZero ptr (ADDconst <ptr.Type> [s-16] ptr) mem)
 23392  	for {
 23393  		s := auxIntToInt64(v.AuxInt)
 23394  		ptr := v_0
 23395  		mem := v_1
 23396  		if !(s%16 == 0 && (s > 16*64 || config.noDuffDevice)) {
 23397  			break
 23398  		}
 23399  		v.reset(OpARM64LoweredZero)
 23400  		v0 := b.NewValue0(v.Pos, OpARM64ADDconst, ptr.Type)
 23401  		v0.AuxInt = int64ToAuxInt(s - 16)
 23402  		v0.AddArg(ptr)
 23403  		v.AddArg3(ptr, v0, mem)
 23404  		return true
 23405  	}
 23406  	return false
 23407  }
 23408  func rewriteBlockARM64(b *Block) bool {
 23409  	typ := &b.Func.Config.Types
 23410  	switch b.Kind {
 23411  	case BlockARM64EQ:
 23412  		// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
 23413  		// cond: z.Uses == 1
 23414  		// result: (EQ (TST x y) yes no)
 23415  		for b.Controls[0].Op == OpARM64CMPconst {
 23416  			v_0 := b.Controls[0]
 23417  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23418  				break
 23419  			}
 23420  			z := v_0.Args[0]
 23421  			if z.Op != OpARM64AND {
 23422  				break
 23423  			}
 23424  			_ = z.Args[1]
 23425  			z_0 := z.Args[0]
 23426  			z_1 := z.Args[1]
 23427  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23428  				x := z_0
 23429  				y := z_1
 23430  				if !(z.Uses == 1) {
 23431  					continue
 23432  				}
 23433  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 23434  				v0.AddArg2(x, y)
 23435  				b.resetWithControl(BlockARM64EQ, v0)
 23436  				return true
 23437  			}
 23438  			break
 23439  		}
 23440  		// match: (EQ (CMPconst [0] x:(ANDconst [c] y)) yes no)
 23441  		// cond: x.Uses == 1
 23442  		// result: (EQ (TSTconst [c] y) yes no)
 23443  		for b.Controls[0].Op == OpARM64CMPconst {
 23444  			v_0 := b.Controls[0]
 23445  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23446  				break
 23447  			}
 23448  			x := v_0.Args[0]
 23449  			if x.Op != OpARM64ANDconst {
 23450  				break
 23451  			}
 23452  			c := auxIntToInt64(x.AuxInt)
 23453  			y := x.Args[0]
 23454  			if !(x.Uses == 1) {
 23455  				break
 23456  			}
 23457  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 23458  			v0.AuxInt = int64ToAuxInt(c)
 23459  			v0.AddArg(y)
 23460  			b.resetWithControl(BlockARM64EQ, v0)
 23461  			return true
 23462  		}
 23463  		// match: (EQ (CMPWconst [0] z:(AND x y)) yes no)
 23464  		// cond: z.Uses == 1
 23465  		// result: (EQ (TSTW x y) yes no)
 23466  		for b.Controls[0].Op == OpARM64CMPWconst {
 23467  			v_0 := b.Controls[0]
 23468  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23469  				break
 23470  			}
 23471  			z := v_0.Args[0]
 23472  			if z.Op != OpARM64AND {
 23473  				break
 23474  			}
 23475  			_ = z.Args[1]
 23476  			z_0 := z.Args[0]
 23477  			z_1 := z.Args[1]
 23478  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23479  				x := z_0
 23480  				y := z_1
 23481  				if !(z.Uses == 1) {
 23482  					continue
 23483  				}
 23484  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 23485  				v0.AddArg2(x, y)
 23486  				b.resetWithControl(BlockARM64EQ, v0)
 23487  				return true
 23488  			}
 23489  			break
 23490  		}
 23491  		// match: (EQ (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 23492  		// cond: x.Uses == 1
 23493  		// result: (EQ (TSTWconst [int32(c)] y) yes no)
 23494  		for b.Controls[0].Op == OpARM64CMPWconst {
 23495  			v_0 := b.Controls[0]
 23496  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23497  				break
 23498  			}
 23499  			x := v_0.Args[0]
 23500  			if x.Op != OpARM64ANDconst {
 23501  				break
 23502  			}
 23503  			c := auxIntToInt64(x.AuxInt)
 23504  			y := x.Args[0]
 23505  			if !(x.Uses == 1) {
 23506  				break
 23507  			}
 23508  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 23509  			v0.AuxInt = int32ToAuxInt(int32(c))
 23510  			v0.AddArg(y)
 23511  			b.resetWithControl(BlockARM64EQ, v0)
 23512  			return true
 23513  		}
 23514  		// match: (EQ (CMPconst [0] x:(ADDconst [c] y)) yes no)
 23515  		// cond: x.Uses == 1
 23516  		// result: (EQ (CMNconst [c] y) yes no)
 23517  		for b.Controls[0].Op == OpARM64CMPconst {
 23518  			v_0 := b.Controls[0]
 23519  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23520  				break
 23521  			}
 23522  			x := v_0.Args[0]
 23523  			if x.Op != OpARM64ADDconst {
 23524  				break
 23525  			}
 23526  			c := auxIntToInt64(x.AuxInt)
 23527  			y := x.Args[0]
 23528  			if !(x.Uses == 1) {
 23529  				break
 23530  			}
 23531  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 23532  			v0.AuxInt = int64ToAuxInt(c)
 23533  			v0.AddArg(y)
 23534  			b.resetWithControl(BlockARM64EQ, v0)
 23535  			return true
 23536  		}
 23537  		// match: (EQ (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 23538  		// cond: x.Uses == 1
 23539  		// result: (EQ (CMNWconst [int32(c)] y) yes no)
 23540  		for b.Controls[0].Op == OpARM64CMPWconst {
 23541  			v_0 := b.Controls[0]
 23542  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23543  				break
 23544  			}
 23545  			x := v_0.Args[0]
 23546  			if x.Op != OpARM64ADDconst {
 23547  				break
 23548  			}
 23549  			c := auxIntToInt64(x.AuxInt)
 23550  			y := x.Args[0]
 23551  			if !(x.Uses == 1) {
 23552  				break
 23553  			}
 23554  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 23555  			v0.AuxInt = int32ToAuxInt(int32(c))
 23556  			v0.AddArg(y)
 23557  			b.resetWithControl(BlockARM64EQ, v0)
 23558  			return true
 23559  		}
 23560  		// match: (EQ (CMPconst [0] z:(ADD x y)) yes no)
 23561  		// cond: z.Uses == 1
 23562  		// result: (EQ (CMN x y) yes no)
 23563  		for b.Controls[0].Op == OpARM64CMPconst {
 23564  			v_0 := b.Controls[0]
 23565  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23566  				break
 23567  			}
 23568  			z := v_0.Args[0]
 23569  			if z.Op != OpARM64ADD {
 23570  				break
 23571  			}
 23572  			_ = z.Args[1]
 23573  			z_0 := z.Args[0]
 23574  			z_1 := z.Args[1]
 23575  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23576  				x := z_0
 23577  				y := z_1
 23578  				if !(z.Uses == 1) {
 23579  					continue
 23580  				}
 23581  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23582  				v0.AddArg2(x, y)
 23583  				b.resetWithControl(BlockARM64EQ, v0)
 23584  				return true
 23585  			}
 23586  			break
 23587  		}
 23588  		// match: (EQ (CMPWconst [0] z:(ADD x y)) yes no)
 23589  		// cond: z.Uses == 1
 23590  		// result: (EQ (CMNW x y) yes no)
 23591  		for b.Controls[0].Op == OpARM64CMPWconst {
 23592  			v_0 := b.Controls[0]
 23593  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23594  				break
 23595  			}
 23596  			z := v_0.Args[0]
 23597  			if z.Op != OpARM64ADD {
 23598  				break
 23599  			}
 23600  			_ = z.Args[1]
 23601  			z_0 := z.Args[0]
 23602  			z_1 := z.Args[1]
 23603  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23604  				x := z_0
 23605  				y := z_1
 23606  				if !(z.Uses == 1) {
 23607  					continue
 23608  				}
 23609  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23610  				v0.AddArg2(x, y)
 23611  				b.resetWithControl(BlockARM64EQ, v0)
 23612  				return true
 23613  			}
 23614  			break
 23615  		}
 23616  		// match: (EQ (CMP x z:(NEG y)) yes no)
 23617  		// cond: z.Uses == 1
 23618  		// result: (EQ (CMN x y) yes no)
 23619  		for b.Controls[0].Op == OpARM64CMP {
 23620  			v_0 := b.Controls[0]
 23621  			_ = v_0.Args[1]
 23622  			x := v_0.Args[0]
 23623  			z := v_0.Args[1]
 23624  			if z.Op != OpARM64NEG {
 23625  				break
 23626  			}
 23627  			y := z.Args[0]
 23628  			if !(z.Uses == 1) {
 23629  				break
 23630  			}
 23631  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23632  			v0.AddArg2(x, y)
 23633  			b.resetWithControl(BlockARM64EQ, v0)
 23634  			return true
 23635  		}
 23636  		// match: (EQ (CMPW x z:(NEG y)) yes no)
 23637  		// cond: z.Uses == 1
 23638  		// result: (EQ (CMNW x y) yes no)
 23639  		for b.Controls[0].Op == OpARM64CMPW {
 23640  			v_0 := b.Controls[0]
 23641  			_ = v_0.Args[1]
 23642  			x := v_0.Args[0]
 23643  			z := v_0.Args[1]
 23644  			if z.Op != OpARM64NEG {
 23645  				break
 23646  			}
 23647  			y := z.Args[0]
 23648  			if !(z.Uses == 1) {
 23649  				break
 23650  			}
 23651  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23652  			v0.AddArg2(x, y)
 23653  			b.resetWithControl(BlockARM64EQ, v0)
 23654  			return true
 23655  		}
 23656  		// match: (EQ (CMPconst [0] x) yes no)
 23657  		// result: (Z x yes no)
 23658  		for b.Controls[0].Op == OpARM64CMPconst {
 23659  			v_0 := b.Controls[0]
 23660  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23661  				break
 23662  			}
 23663  			x := v_0.Args[0]
 23664  			b.resetWithControl(BlockARM64Z, x)
 23665  			return true
 23666  		}
 23667  		// match: (EQ (CMPWconst [0] x) yes no)
 23668  		// result: (ZW x yes no)
 23669  		for b.Controls[0].Op == OpARM64CMPWconst {
 23670  			v_0 := b.Controls[0]
 23671  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23672  				break
 23673  			}
 23674  			x := v_0.Args[0]
 23675  			b.resetWithControl(BlockARM64ZW, x)
 23676  			return true
 23677  		}
 23678  		// match: (EQ (CMPconst [0] z:(MADD a x y)) yes no)
 23679  		// cond: z.Uses==1
 23680  		// result: (EQ (CMN a (MUL <x.Type> x y)) yes no)
 23681  		for b.Controls[0].Op == OpARM64CMPconst {
 23682  			v_0 := b.Controls[0]
 23683  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23684  				break
 23685  			}
 23686  			z := v_0.Args[0]
 23687  			if z.Op != OpARM64MADD {
 23688  				break
 23689  			}
 23690  			y := z.Args[2]
 23691  			a := z.Args[0]
 23692  			x := z.Args[1]
 23693  			if !(z.Uses == 1) {
 23694  				break
 23695  			}
 23696  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 23697  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23698  			v1.AddArg2(x, y)
 23699  			v0.AddArg2(a, v1)
 23700  			b.resetWithControl(BlockARM64EQ, v0)
 23701  			return true
 23702  		}
 23703  		// match: (EQ (CMPconst [0] z:(MSUB a x y)) yes no)
 23704  		// cond: z.Uses==1
 23705  		// result: (EQ (CMP a (MUL <x.Type> x y)) yes no)
 23706  		for b.Controls[0].Op == OpARM64CMPconst {
 23707  			v_0 := b.Controls[0]
 23708  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23709  				break
 23710  			}
 23711  			z := v_0.Args[0]
 23712  			if z.Op != OpARM64MSUB {
 23713  				break
 23714  			}
 23715  			y := z.Args[2]
 23716  			a := z.Args[0]
 23717  			x := z.Args[1]
 23718  			if !(z.Uses == 1) {
 23719  				break
 23720  			}
 23721  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 23722  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 23723  			v1.AddArg2(x, y)
 23724  			v0.AddArg2(a, v1)
 23725  			b.resetWithControl(BlockARM64EQ, v0)
 23726  			return true
 23727  		}
 23728  		// match: (EQ (CMPWconst [0] z:(MADDW a x y)) yes no)
 23729  		// cond: z.Uses==1
 23730  		// result: (EQ (CMNW a (MULW <x.Type> x y)) yes no)
 23731  		for b.Controls[0].Op == OpARM64CMPWconst {
 23732  			v_0 := b.Controls[0]
 23733  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23734  				break
 23735  			}
 23736  			z := v_0.Args[0]
 23737  			if z.Op != OpARM64MADDW {
 23738  				break
 23739  			}
 23740  			y := z.Args[2]
 23741  			a := z.Args[0]
 23742  			x := z.Args[1]
 23743  			if !(z.Uses == 1) {
 23744  				break
 23745  			}
 23746  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 23747  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23748  			v1.AddArg2(x, y)
 23749  			v0.AddArg2(a, v1)
 23750  			b.resetWithControl(BlockARM64EQ, v0)
 23751  			return true
 23752  		}
 23753  		// match: (EQ (CMPWconst [0] z:(MSUBW a x y)) yes no)
 23754  		// cond: z.Uses==1
 23755  		// result: (EQ (CMPW a (MULW <x.Type> x y)) yes no)
 23756  		for b.Controls[0].Op == OpARM64CMPWconst {
 23757  			v_0 := b.Controls[0]
 23758  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23759  				break
 23760  			}
 23761  			z := v_0.Args[0]
 23762  			if z.Op != OpARM64MSUBW {
 23763  				break
 23764  			}
 23765  			y := z.Args[2]
 23766  			a := z.Args[0]
 23767  			x := z.Args[1]
 23768  			if !(z.Uses == 1) {
 23769  				break
 23770  			}
 23771  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 23772  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 23773  			v1.AddArg2(x, y)
 23774  			v0.AddArg2(a, v1)
 23775  			b.resetWithControl(BlockARM64EQ, v0)
 23776  			return true
 23777  		}
 23778  		// match: (EQ (TSTconst [c] x) yes no)
 23779  		// cond: oneBit(c)
 23780  		// result: (TBZ [int64(ntz64(c))] x yes no)
 23781  		for b.Controls[0].Op == OpARM64TSTconst {
 23782  			v_0 := b.Controls[0]
 23783  			c := auxIntToInt64(v_0.AuxInt)
 23784  			x := v_0.Args[0]
 23785  			if !(oneBit(c)) {
 23786  				break
 23787  			}
 23788  			b.resetWithControl(BlockARM64TBZ, x)
 23789  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 23790  			return true
 23791  		}
 23792  		// match: (EQ (TSTWconst [c] x) yes no)
 23793  		// cond: oneBit(int64(uint32(c)))
 23794  		// result: (TBZ [int64(ntz64(int64(uint32(c))))] x yes no)
 23795  		for b.Controls[0].Op == OpARM64TSTWconst {
 23796  			v_0 := b.Controls[0]
 23797  			c := auxIntToInt32(v_0.AuxInt)
 23798  			x := v_0.Args[0]
 23799  			if !(oneBit(int64(uint32(c)))) {
 23800  				break
 23801  			}
 23802  			b.resetWithControl(BlockARM64TBZ, x)
 23803  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 23804  			return true
 23805  		}
 23806  		// match: (EQ (FlagConstant [fc]) yes no)
 23807  		// cond: fc.eq()
 23808  		// result: (First yes no)
 23809  		for b.Controls[0].Op == OpARM64FlagConstant {
 23810  			v_0 := b.Controls[0]
 23811  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23812  			if !(fc.eq()) {
 23813  				break
 23814  			}
 23815  			b.Reset(BlockFirst)
 23816  			return true
 23817  		}
 23818  		// match: (EQ (FlagConstant [fc]) yes no)
 23819  		// cond: !fc.eq()
 23820  		// result: (First no yes)
 23821  		for b.Controls[0].Op == OpARM64FlagConstant {
 23822  			v_0 := b.Controls[0]
 23823  			fc := auxIntToFlagConstant(v_0.AuxInt)
 23824  			if !(!fc.eq()) {
 23825  				break
 23826  			}
 23827  			b.Reset(BlockFirst)
 23828  			b.swapSuccessors()
 23829  			return true
 23830  		}
 23831  		// match: (EQ (InvertFlags cmp) yes no)
 23832  		// result: (EQ cmp yes no)
 23833  		for b.Controls[0].Op == OpARM64InvertFlags {
 23834  			v_0 := b.Controls[0]
 23835  			cmp := v_0.Args[0]
 23836  			b.resetWithControl(BlockARM64EQ, cmp)
 23837  			return true
 23838  		}
 23839  	case BlockARM64FGE:
 23840  		// match: (FGE (InvertFlags cmp) yes no)
 23841  		// result: (FLE cmp yes no)
 23842  		for b.Controls[0].Op == OpARM64InvertFlags {
 23843  			v_0 := b.Controls[0]
 23844  			cmp := v_0.Args[0]
 23845  			b.resetWithControl(BlockARM64FLE, cmp)
 23846  			return true
 23847  		}
 23848  	case BlockARM64FGT:
 23849  		// match: (FGT (InvertFlags cmp) yes no)
 23850  		// result: (FLT cmp yes no)
 23851  		for b.Controls[0].Op == OpARM64InvertFlags {
 23852  			v_0 := b.Controls[0]
 23853  			cmp := v_0.Args[0]
 23854  			b.resetWithControl(BlockARM64FLT, cmp)
 23855  			return true
 23856  		}
 23857  	case BlockARM64FLE:
 23858  		// match: (FLE (InvertFlags cmp) yes no)
 23859  		// result: (FGE cmp yes no)
 23860  		for b.Controls[0].Op == OpARM64InvertFlags {
 23861  			v_0 := b.Controls[0]
 23862  			cmp := v_0.Args[0]
 23863  			b.resetWithControl(BlockARM64FGE, cmp)
 23864  			return true
 23865  		}
 23866  	case BlockARM64FLT:
 23867  		// match: (FLT (InvertFlags cmp) yes no)
 23868  		// result: (FGT cmp yes no)
 23869  		for b.Controls[0].Op == OpARM64InvertFlags {
 23870  			v_0 := b.Controls[0]
 23871  			cmp := v_0.Args[0]
 23872  			b.resetWithControl(BlockARM64FGT, cmp)
 23873  			return true
 23874  		}
 23875  	case BlockARM64GE:
 23876  		// match: (GE (CMPconst [0] z:(AND x y)) yes no)
 23877  		// cond: z.Uses == 1
 23878  		// result: (GE (TST x y) yes no)
 23879  		for b.Controls[0].Op == OpARM64CMPconst {
 23880  			v_0 := b.Controls[0]
 23881  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23882  				break
 23883  			}
 23884  			z := v_0.Args[0]
 23885  			if z.Op != OpARM64AND {
 23886  				break
 23887  			}
 23888  			_ = z.Args[1]
 23889  			z_0 := z.Args[0]
 23890  			z_1 := z.Args[1]
 23891  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23892  				x := z_0
 23893  				y := z_1
 23894  				if !(z.Uses == 1) {
 23895  					continue
 23896  				}
 23897  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 23898  				v0.AddArg2(x, y)
 23899  				b.resetWithControl(BlockARM64GE, v0)
 23900  				return true
 23901  			}
 23902  			break
 23903  		}
 23904  		// match: (GE (CMPconst [0] x:(ANDconst [c] y)) yes no)
 23905  		// cond: x.Uses == 1
 23906  		// result: (GE (TSTconst [c] y) yes no)
 23907  		for b.Controls[0].Op == OpARM64CMPconst {
 23908  			v_0 := b.Controls[0]
 23909  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23910  				break
 23911  			}
 23912  			x := v_0.Args[0]
 23913  			if x.Op != OpARM64ANDconst {
 23914  				break
 23915  			}
 23916  			c := auxIntToInt64(x.AuxInt)
 23917  			y := x.Args[0]
 23918  			if !(x.Uses == 1) {
 23919  				break
 23920  			}
 23921  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 23922  			v0.AuxInt = int64ToAuxInt(c)
 23923  			v0.AddArg(y)
 23924  			b.resetWithControl(BlockARM64GE, v0)
 23925  			return true
 23926  		}
 23927  		// match: (GE (CMPWconst [0] z:(AND x y)) yes no)
 23928  		// cond: z.Uses == 1
 23929  		// result: (GE (TSTW x y) yes no)
 23930  		for b.Controls[0].Op == OpARM64CMPWconst {
 23931  			v_0 := b.Controls[0]
 23932  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23933  				break
 23934  			}
 23935  			z := v_0.Args[0]
 23936  			if z.Op != OpARM64AND {
 23937  				break
 23938  			}
 23939  			_ = z.Args[1]
 23940  			z_0 := z.Args[0]
 23941  			z_1 := z.Args[1]
 23942  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 23943  				x := z_0
 23944  				y := z_1
 23945  				if !(z.Uses == 1) {
 23946  					continue
 23947  				}
 23948  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 23949  				v0.AddArg2(x, y)
 23950  				b.resetWithControl(BlockARM64GE, v0)
 23951  				return true
 23952  			}
 23953  			break
 23954  		}
 23955  		// match: (GE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 23956  		// cond: x.Uses == 1
 23957  		// result: (GE (TSTWconst [int32(c)] y) yes no)
 23958  		for b.Controls[0].Op == OpARM64CMPWconst {
 23959  			v_0 := b.Controls[0]
 23960  			if auxIntToInt32(v_0.AuxInt) != 0 {
 23961  				break
 23962  			}
 23963  			x := v_0.Args[0]
 23964  			if x.Op != OpARM64ANDconst {
 23965  				break
 23966  			}
 23967  			c := auxIntToInt64(x.AuxInt)
 23968  			y := x.Args[0]
 23969  			if !(x.Uses == 1) {
 23970  				break
 23971  			}
 23972  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 23973  			v0.AuxInt = int32ToAuxInt(int32(c))
 23974  			v0.AddArg(y)
 23975  			b.resetWithControl(BlockARM64GE, v0)
 23976  			return true
 23977  		}
 23978  		// match: (GE (CMPconst [0] x:(ADDconst [c] y)) yes no)
 23979  		// cond: x.Uses == 1
 23980  		// result: (GEnoov (CMNconst [c] y) yes no)
 23981  		for b.Controls[0].Op == OpARM64CMPconst {
 23982  			v_0 := b.Controls[0]
 23983  			if auxIntToInt64(v_0.AuxInt) != 0 {
 23984  				break
 23985  			}
 23986  			x := v_0.Args[0]
 23987  			if x.Op != OpARM64ADDconst {
 23988  				break
 23989  			}
 23990  			c := auxIntToInt64(x.AuxInt)
 23991  			y := x.Args[0]
 23992  			if !(x.Uses == 1) {
 23993  				break
 23994  			}
 23995  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 23996  			v0.AuxInt = int64ToAuxInt(c)
 23997  			v0.AddArg(y)
 23998  			b.resetWithControl(BlockARM64GEnoov, v0)
 23999  			return true
 24000  		}
 24001  		// match: (GE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 24002  		// cond: x.Uses == 1
 24003  		// result: (GEnoov (CMNWconst [int32(c)] y) yes no)
 24004  		for b.Controls[0].Op == OpARM64CMPWconst {
 24005  			v_0 := b.Controls[0]
 24006  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24007  				break
 24008  			}
 24009  			x := v_0.Args[0]
 24010  			if x.Op != OpARM64ADDconst {
 24011  				break
 24012  			}
 24013  			c := auxIntToInt64(x.AuxInt)
 24014  			y := x.Args[0]
 24015  			if !(x.Uses == 1) {
 24016  				break
 24017  			}
 24018  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 24019  			v0.AuxInt = int32ToAuxInt(int32(c))
 24020  			v0.AddArg(y)
 24021  			b.resetWithControl(BlockARM64GEnoov, v0)
 24022  			return true
 24023  		}
 24024  		// match: (GE (CMPconst [0] z:(ADD x y)) yes no)
 24025  		// cond: z.Uses == 1
 24026  		// result: (GEnoov (CMN x y) yes no)
 24027  		for b.Controls[0].Op == OpARM64CMPconst {
 24028  			v_0 := b.Controls[0]
 24029  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24030  				break
 24031  			}
 24032  			z := v_0.Args[0]
 24033  			if z.Op != OpARM64ADD {
 24034  				break
 24035  			}
 24036  			_ = z.Args[1]
 24037  			z_0 := z.Args[0]
 24038  			z_1 := z.Args[1]
 24039  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24040  				x := z_0
 24041  				y := z_1
 24042  				if !(z.Uses == 1) {
 24043  					continue
 24044  				}
 24045  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24046  				v0.AddArg2(x, y)
 24047  				b.resetWithControl(BlockARM64GEnoov, v0)
 24048  				return true
 24049  			}
 24050  			break
 24051  		}
 24052  		// match: (GE (CMPWconst [0] z:(ADD x y)) yes no)
 24053  		// cond: z.Uses == 1
 24054  		// result: (GEnoov (CMNW x y) yes no)
 24055  		for b.Controls[0].Op == OpARM64CMPWconst {
 24056  			v_0 := b.Controls[0]
 24057  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24058  				break
 24059  			}
 24060  			z := v_0.Args[0]
 24061  			if z.Op != OpARM64ADD {
 24062  				break
 24063  			}
 24064  			_ = z.Args[1]
 24065  			z_0 := z.Args[0]
 24066  			z_1 := z.Args[1]
 24067  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24068  				x := z_0
 24069  				y := z_1
 24070  				if !(z.Uses == 1) {
 24071  					continue
 24072  				}
 24073  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24074  				v0.AddArg2(x, y)
 24075  				b.resetWithControl(BlockARM64GEnoov, v0)
 24076  				return true
 24077  			}
 24078  			break
 24079  		}
 24080  		// match: (GE (CMPconst [0] z:(MADD a x y)) yes no)
 24081  		// cond: z.Uses==1
 24082  		// result: (GEnoov (CMN a (MUL <x.Type> x y)) yes no)
 24083  		for b.Controls[0].Op == OpARM64CMPconst {
 24084  			v_0 := b.Controls[0]
 24085  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24086  				break
 24087  			}
 24088  			z := v_0.Args[0]
 24089  			if z.Op != OpARM64MADD {
 24090  				break
 24091  			}
 24092  			y := z.Args[2]
 24093  			a := z.Args[0]
 24094  			x := z.Args[1]
 24095  			if !(z.Uses == 1) {
 24096  				break
 24097  			}
 24098  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24099  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24100  			v1.AddArg2(x, y)
 24101  			v0.AddArg2(a, v1)
 24102  			b.resetWithControl(BlockARM64GEnoov, v0)
 24103  			return true
 24104  		}
 24105  		// match: (GE (CMPconst [0] z:(MSUB a x y)) yes no)
 24106  		// cond: z.Uses==1
 24107  		// result: (GEnoov (CMP a (MUL <x.Type> x y)) yes no)
 24108  		for b.Controls[0].Op == OpARM64CMPconst {
 24109  			v_0 := b.Controls[0]
 24110  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24111  				break
 24112  			}
 24113  			z := v_0.Args[0]
 24114  			if z.Op != OpARM64MSUB {
 24115  				break
 24116  			}
 24117  			y := z.Args[2]
 24118  			a := z.Args[0]
 24119  			x := z.Args[1]
 24120  			if !(z.Uses == 1) {
 24121  				break
 24122  			}
 24123  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 24124  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24125  			v1.AddArg2(x, y)
 24126  			v0.AddArg2(a, v1)
 24127  			b.resetWithControl(BlockARM64GEnoov, v0)
 24128  			return true
 24129  		}
 24130  		// match: (GE (CMPWconst [0] z:(MADDW a x y)) yes no)
 24131  		// cond: z.Uses==1
 24132  		// result: (GEnoov (CMNW a (MULW <x.Type> x y)) yes no)
 24133  		for b.Controls[0].Op == OpARM64CMPWconst {
 24134  			v_0 := b.Controls[0]
 24135  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24136  				break
 24137  			}
 24138  			z := v_0.Args[0]
 24139  			if z.Op != OpARM64MADDW {
 24140  				break
 24141  			}
 24142  			y := z.Args[2]
 24143  			a := z.Args[0]
 24144  			x := z.Args[1]
 24145  			if !(z.Uses == 1) {
 24146  				break
 24147  			}
 24148  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24149  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24150  			v1.AddArg2(x, y)
 24151  			v0.AddArg2(a, v1)
 24152  			b.resetWithControl(BlockARM64GEnoov, v0)
 24153  			return true
 24154  		}
 24155  		// match: (GE (CMPWconst [0] z:(MSUBW a x y)) yes no)
 24156  		// cond: z.Uses==1
 24157  		// result: (GEnoov (CMPW a (MULW <x.Type> x y)) yes no)
 24158  		for b.Controls[0].Op == OpARM64CMPWconst {
 24159  			v_0 := b.Controls[0]
 24160  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24161  				break
 24162  			}
 24163  			z := v_0.Args[0]
 24164  			if z.Op != OpARM64MSUBW {
 24165  				break
 24166  			}
 24167  			y := z.Args[2]
 24168  			a := z.Args[0]
 24169  			x := z.Args[1]
 24170  			if !(z.Uses == 1) {
 24171  				break
 24172  			}
 24173  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 24174  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24175  			v1.AddArg2(x, y)
 24176  			v0.AddArg2(a, v1)
 24177  			b.resetWithControl(BlockARM64GEnoov, v0)
 24178  			return true
 24179  		}
 24180  		// match: (GE (CMPWconst [0] x) yes no)
 24181  		// result: (TBZ [31] x yes no)
 24182  		for b.Controls[0].Op == OpARM64CMPWconst {
 24183  			v_0 := b.Controls[0]
 24184  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24185  				break
 24186  			}
 24187  			x := v_0.Args[0]
 24188  			b.resetWithControl(BlockARM64TBZ, x)
 24189  			b.AuxInt = int64ToAuxInt(31)
 24190  			return true
 24191  		}
 24192  		// match: (GE (CMPconst [0] x) yes no)
 24193  		// result: (TBZ [63] x yes no)
 24194  		for b.Controls[0].Op == OpARM64CMPconst {
 24195  			v_0 := b.Controls[0]
 24196  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24197  				break
 24198  			}
 24199  			x := v_0.Args[0]
 24200  			b.resetWithControl(BlockARM64TBZ, x)
 24201  			b.AuxInt = int64ToAuxInt(63)
 24202  			return true
 24203  		}
 24204  		// match: (GE (FlagConstant [fc]) yes no)
 24205  		// cond: fc.ge()
 24206  		// result: (First yes no)
 24207  		for b.Controls[0].Op == OpARM64FlagConstant {
 24208  			v_0 := b.Controls[0]
 24209  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24210  			if !(fc.ge()) {
 24211  				break
 24212  			}
 24213  			b.Reset(BlockFirst)
 24214  			return true
 24215  		}
 24216  		// match: (GE (FlagConstant [fc]) yes no)
 24217  		// cond: !fc.ge()
 24218  		// result: (First no yes)
 24219  		for b.Controls[0].Op == OpARM64FlagConstant {
 24220  			v_0 := b.Controls[0]
 24221  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24222  			if !(!fc.ge()) {
 24223  				break
 24224  			}
 24225  			b.Reset(BlockFirst)
 24226  			b.swapSuccessors()
 24227  			return true
 24228  		}
 24229  		// match: (GE (InvertFlags cmp) yes no)
 24230  		// result: (LE cmp yes no)
 24231  		for b.Controls[0].Op == OpARM64InvertFlags {
 24232  			v_0 := b.Controls[0]
 24233  			cmp := v_0.Args[0]
 24234  			b.resetWithControl(BlockARM64LE, cmp)
 24235  			return true
 24236  		}
 24237  	case BlockARM64GEnoov:
 24238  		// match: (GEnoov (FlagConstant [fc]) yes no)
 24239  		// cond: fc.geNoov()
 24240  		// result: (First yes no)
 24241  		for b.Controls[0].Op == OpARM64FlagConstant {
 24242  			v_0 := b.Controls[0]
 24243  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24244  			if !(fc.geNoov()) {
 24245  				break
 24246  			}
 24247  			b.Reset(BlockFirst)
 24248  			return true
 24249  		}
 24250  		// match: (GEnoov (FlagConstant [fc]) yes no)
 24251  		// cond: !fc.geNoov()
 24252  		// result: (First no yes)
 24253  		for b.Controls[0].Op == OpARM64FlagConstant {
 24254  			v_0 := b.Controls[0]
 24255  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24256  			if !(!fc.geNoov()) {
 24257  				break
 24258  			}
 24259  			b.Reset(BlockFirst)
 24260  			b.swapSuccessors()
 24261  			return true
 24262  		}
 24263  		// match: (GEnoov (InvertFlags cmp) yes no)
 24264  		// result: (LEnoov cmp yes no)
 24265  		for b.Controls[0].Op == OpARM64InvertFlags {
 24266  			v_0 := b.Controls[0]
 24267  			cmp := v_0.Args[0]
 24268  			b.resetWithControl(BlockARM64LEnoov, cmp)
 24269  			return true
 24270  		}
 24271  	case BlockARM64GT:
 24272  		// match: (GT (CMPconst [0] z:(AND x y)) yes no)
 24273  		// cond: z.Uses == 1
 24274  		// result: (GT (TST x y) yes no)
 24275  		for b.Controls[0].Op == OpARM64CMPconst {
 24276  			v_0 := b.Controls[0]
 24277  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24278  				break
 24279  			}
 24280  			z := v_0.Args[0]
 24281  			if z.Op != OpARM64AND {
 24282  				break
 24283  			}
 24284  			_ = z.Args[1]
 24285  			z_0 := z.Args[0]
 24286  			z_1 := z.Args[1]
 24287  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24288  				x := z_0
 24289  				y := z_1
 24290  				if !(z.Uses == 1) {
 24291  					continue
 24292  				}
 24293  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 24294  				v0.AddArg2(x, y)
 24295  				b.resetWithControl(BlockARM64GT, v0)
 24296  				return true
 24297  			}
 24298  			break
 24299  		}
 24300  		// match: (GT (CMPconst [0] x:(ANDconst [c] y)) yes no)
 24301  		// cond: x.Uses == 1
 24302  		// result: (GT (TSTconst [c] y) yes no)
 24303  		for b.Controls[0].Op == OpARM64CMPconst {
 24304  			v_0 := b.Controls[0]
 24305  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24306  				break
 24307  			}
 24308  			x := v_0.Args[0]
 24309  			if x.Op != OpARM64ANDconst {
 24310  				break
 24311  			}
 24312  			c := auxIntToInt64(x.AuxInt)
 24313  			y := x.Args[0]
 24314  			if !(x.Uses == 1) {
 24315  				break
 24316  			}
 24317  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 24318  			v0.AuxInt = int64ToAuxInt(c)
 24319  			v0.AddArg(y)
 24320  			b.resetWithControl(BlockARM64GT, v0)
 24321  			return true
 24322  		}
 24323  		// match: (GT (CMPWconst [0] z:(AND x y)) yes no)
 24324  		// cond: z.Uses == 1
 24325  		// result: (GT (TSTW x y) yes no)
 24326  		for b.Controls[0].Op == OpARM64CMPWconst {
 24327  			v_0 := b.Controls[0]
 24328  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24329  				break
 24330  			}
 24331  			z := v_0.Args[0]
 24332  			if z.Op != OpARM64AND {
 24333  				break
 24334  			}
 24335  			_ = z.Args[1]
 24336  			z_0 := z.Args[0]
 24337  			z_1 := z.Args[1]
 24338  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24339  				x := z_0
 24340  				y := z_1
 24341  				if !(z.Uses == 1) {
 24342  					continue
 24343  				}
 24344  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 24345  				v0.AddArg2(x, y)
 24346  				b.resetWithControl(BlockARM64GT, v0)
 24347  				return true
 24348  			}
 24349  			break
 24350  		}
 24351  		// match: (GT (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 24352  		// cond: x.Uses == 1
 24353  		// result: (GT (TSTWconst [int32(c)] 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  			x := v_0.Args[0]
 24360  			if x.Op != OpARM64ANDconst {
 24361  				break
 24362  			}
 24363  			c := auxIntToInt64(x.AuxInt)
 24364  			y := x.Args[0]
 24365  			if !(x.Uses == 1) {
 24366  				break
 24367  			}
 24368  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 24369  			v0.AuxInt = int32ToAuxInt(int32(c))
 24370  			v0.AddArg(y)
 24371  			b.resetWithControl(BlockARM64GT, v0)
 24372  			return true
 24373  		}
 24374  		// match: (GT (CMPconst [0] x:(ADDconst [c] y)) yes no)
 24375  		// cond: x.Uses == 1
 24376  		// result: (GTnoov (CMNconst [c] y) yes no)
 24377  		for b.Controls[0].Op == OpARM64CMPconst {
 24378  			v_0 := b.Controls[0]
 24379  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24380  				break
 24381  			}
 24382  			x := v_0.Args[0]
 24383  			if x.Op != OpARM64ADDconst {
 24384  				break
 24385  			}
 24386  			c := auxIntToInt64(x.AuxInt)
 24387  			y := x.Args[0]
 24388  			if !(x.Uses == 1) {
 24389  				break
 24390  			}
 24391  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 24392  			v0.AuxInt = int64ToAuxInt(c)
 24393  			v0.AddArg(y)
 24394  			b.resetWithControl(BlockARM64GTnoov, v0)
 24395  			return true
 24396  		}
 24397  		// match: (GT (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 24398  		// cond: x.Uses == 1
 24399  		// result: (GTnoov (CMNWconst [int32(c)] y) yes no)
 24400  		for b.Controls[0].Op == OpARM64CMPWconst {
 24401  			v_0 := b.Controls[0]
 24402  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24403  				break
 24404  			}
 24405  			x := v_0.Args[0]
 24406  			if x.Op != OpARM64ADDconst {
 24407  				break
 24408  			}
 24409  			c := auxIntToInt64(x.AuxInt)
 24410  			y := x.Args[0]
 24411  			if !(x.Uses == 1) {
 24412  				break
 24413  			}
 24414  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 24415  			v0.AuxInt = int32ToAuxInt(int32(c))
 24416  			v0.AddArg(y)
 24417  			b.resetWithControl(BlockARM64GTnoov, v0)
 24418  			return true
 24419  		}
 24420  		// match: (GT (CMPconst [0] z:(ADD x y)) yes no)
 24421  		// cond: z.Uses == 1
 24422  		// result: (GTnoov (CMN x y) yes no)
 24423  		for b.Controls[0].Op == OpARM64CMPconst {
 24424  			v_0 := b.Controls[0]
 24425  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24426  				break
 24427  			}
 24428  			z := v_0.Args[0]
 24429  			if z.Op != OpARM64ADD {
 24430  				break
 24431  			}
 24432  			_ = z.Args[1]
 24433  			z_0 := z.Args[0]
 24434  			z_1 := z.Args[1]
 24435  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24436  				x := z_0
 24437  				y := z_1
 24438  				if !(z.Uses == 1) {
 24439  					continue
 24440  				}
 24441  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24442  				v0.AddArg2(x, y)
 24443  				b.resetWithControl(BlockARM64GTnoov, v0)
 24444  				return true
 24445  			}
 24446  			break
 24447  		}
 24448  		// match: (GT (CMPWconst [0] z:(ADD x y)) yes no)
 24449  		// cond: z.Uses == 1
 24450  		// result: (GTnoov (CMNW x y) yes no)
 24451  		for b.Controls[0].Op == OpARM64CMPWconst {
 24452  			v_0 := b.Controls[0]
 24453  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24454  				break
 24455  			}
 24456  			z := v_0.Args[0]
 24457  			if z.Op != OpARM64ADD {
 24458  				break
 24459  			}
 24460  			_ = z.Args[1]
 24461  			z_0 := z.Args[0]
 24462  			z_1 := z.Args[1]
 24463  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24464  				x := z_0
 24465  				y := z_1
 24466  				if !(z.Uses == 1) {
 24467  					continue
 24468  				}
 24469  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24470  				v0.AddArg2(x, y)
 24471  				b.resetWithControl(BlockARM64GTnoov, v0)
 24472  				return true
 24473  			}
 24474  			break
 24475  		}
 24476  		// match: (GT (CMPconst [0] z:(MADD a x y)) yes no)
 24477  		// cond: z.Uses==1
 24478  		// result: (GTnoov (CMN a (MUL <x.Type> x y)) yes no)
 24479  		for b.Controls[0].Op == OpARM64CMPconst {
 24480  			v_0 := b.Controls[0]
 24481  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24482  				break
 24483  			}
 24484  			z := v_0.Args[0]
 24485  			if z.Op != OpARM64MADD {
 24486  				break
 24487  			}
 24488  			y := z.Args[2]
 24489  			a := z.Args[0]
 24490  			x := z.Args[1]
 24491  			if !(z.Uses == 1) {
 24492  				break
 24493  			}
 24494  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24495  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24496  			v1.AddArg2(x, y)
 24497  			v0.AddArg2(a, v1)
 24498  			b.resetWithControl(BlockARM64GTnoov, v0)
 24499  			return true
 24500  		}
 24501  		// match: (GT (CMPconst [0] z:(MSUB a x y)) yes no)
 24502  		// cond: z.Uses==1
 24503  		// result: (GTnoov (CMP a (MUL <x.Type> x y)) yes no)
 24504  		for b.Controls[0].Op == OpARM64CMPconst {
 24505  			v_0 := b.Controls[0]
 24506  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24507  				break
 24508  			}
 24509  			z := v_0.Args[0]
 24510  			if z.Op != OpARM64MSUB {
 24511  				break
 24512  			}
 24513  			y := z.Args[2]
 24514  			a := z.Args[0]
 24515  			x := z.Args[1]
 24516  			if !(z.Uses == 1) {
 24517  				break
 24518  			}
 24519  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 24520  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 24521  			v1.AddArg2(x, y)
 24522  			v0.AddArg2(a, v1)
 24523  			b.resetWithControl(BlockARM64GTnoov, v0)
 24524  			return true
 24525  		}
 24526  		// match: (GT (CMPWconst [0] z:(MADDW a x y)) yes no)
 24527  		// cond: z.Uses==1
 24528  		// result: (GTnoov (CMNW a (MULW <x.Type> x y)) yes no)
 24529  		for b.Controls[0].Op == OpARM64CMPWconst {
 24530  			v_0 := b.Controls[0]
 24531  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24532  				break
 24533  			}
 24534  			z := v_0.Args[0]
 24535  			if z.Op != OpARM64MADDW {
 24536  				break
 24537  			}
 24538  			y := z.Args[2]
 24539  			a := z.Args[0]
 24540  			x := z.Args[1]
 24541  			if !(z.Uses == 1) {
 24542  				break
 24543  			}
 24544  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24545  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24546  			v1.AddArg2(x, y)
 24547  			v0.AddArg2(a, v1)
 24548  			b.resetWithControl(BlockARM64GTnoov, v0)
 24549  			return true
 24550  		}
 24551  		// match: (GT (CMPWconst [0] z:(MSUBW a x y)) yes no)
 24552  		// cond: z.Uses==1
 24553  		// result: (GTnoov (CMPW a (MULW <x.Type> x y)) yes no)
 24554  		for b.Controls[0].Op == OpARM64CMPWconst {
 24555  			v_0 := b.Controls[0]
 24556  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24557  				break
 24558  			}
 24559  			z := v_0.Args[0]
 24560  			if z.Op != OpARM64MSUBW {
 24561  				break
 24562  			}
 24563  			y := z.Args[2]
 24564  			a := z.Args[0]
 24565  			x := z.Args[1]
 24566  			if !(z.Uses == 1) {
 24567  				break
 24568  			}
 24569  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 24570  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 24571  			v1.AddArg2(x, y)
 24572  			v0.AddArg2(a, v1)
 24573  			b.resetWithControl(BlockARM64GTnoov, v0)
 24574  			return true
 24575  		}
 24576  		// match: (GT (FlagConstant [fc]) yes no)
 24577  		// cond: fc.gt()
 24578  		// result: (First yes no)
 24579  		for b.Controls[0].Op == OpARM64FlagConstant {
 24580  			v_0 := b.Controls[0]
 24581  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24582  			if !(fc.gt()) {
 24583  				break
 24584  			}
 24585  			b.Reset(BlockFirst)
 24586  			return true
 24587  		}
 24588  		// match: (GT (FlagConstant [fc]) yes no)
 24589  		// cond: !fc.gt()
 24590  		// result: (First no yes)
 24591  		for b.Controls[0].Op == OpARM64FlagConstant {
 24592  			v_0 := b.Controls[0]
 24593  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24594  			if !(!fc.gt()) {
 24595  				break
 24596  			}
 24597  			b.Reset(BlockFirst)
 24598  			b.swapSuccessors()
 24599  			return true
 24600  		}
 24601  		// match: (GT (InvertFlags cmp) yes no)
 24602  		// result: (LT cmp yes no)
 24603  		for b.Controls[0].Op == OpARM64InvertFlags {
 24604  			v_0 := b.Controls[0]
 24605  			cmp := v_0.Args[0]
 24606  			b.resetWithControl(BlockARM64LT, cmp)
 24607  			return true
 24608  		}
 24609  	case BlockARM64GTnoov:
 24610  		// match: (GTnoov (FlagConstant [fc]) yes no)
 24611  		// cond: fc.gtNoov()
 24612  		// result: (First yes no)
 24613  		for b.Controls[0].Op == OpARM64FlagConstant {
 24614  			v_0 := b.Controls[0]
 24615  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24616  			if !(fc.gtNoov()) {
 24617  				break
 24618  			}
 24619  			b.Reset(BlockFirst)
 24620  			return true
 24621  		}
 24622  		// match: (GTnoov (FlagConstant [fc]) yes no)
 24623  		// cond: !fc.gtNoov()
 24624  		// result: (First no yes)
 24625  		for b.Controls[0].Op == OpARM64FlagConstant {
 24626  			v_0 := b.Controls[0]
 24627  			fc := auxIntToFlagConstant(v_0.AuxInt)
 24628  			if !(!fc.gtNoov()) {
 24629  				break
 24630  			}
 24631  			b.Reset(BlockFirst)
 24632  			b.swapSuccessors()
 24633  			return true
 24634  		}
 24635  		// match: (GTnoov (InvertFlags cmp) yes no)
 24636  		// result: (LTnoov cmp yes no)
 24637  		for b.Controls[0].Op == OpARM64InvertFlags {
 24638  			v_0 := b.Controls[0]
 24639  			cmp := v_0.Args[0]
 24640  			b.resetWithControl(BlockARM64LTnoov, cmp)
 24641  			return true
 24642  		}
 24643  	case BlockIf:
 24644  		// match: (If (Equal cc) yes no)
 24645  		// result: (EQ cc yes no)
 24646  		for b.Controls[0].Op == OpARM64Equal {
 24647  			v_0 := b.Controls[0]
 24648  			cc := v_0.Args[0]
 24649  			b.resetWithControl(BlockARM64EQ, cc)
 24650  			return true
 24651  		}
 24652  		// match: (If (NotEqual cc) yes no)
 24653  		// result: (NE cc yes no)
 24654  		for b.Controls[0].Op == OpARM64NotEqual {
 24655  			v_0 := b.Controls[0]
 24656  			cc := v_0.Args[0]
 24657  			b.resetWithControl(BlockARM64NE, cc)
 24658  			return true
 24659  		}
 24660  		// match: (If (LessThan cc) yes no)
 24661  		// result: (LT cc yes no)
 24662  		for b.Controls[0].Op == OpARM64LessThan {
 24663  			v_0 := b.Controls[0]
 24664  			cc := v_0.Args[0]
 24665  			b.resetWithControl(BlockARM64LT, cc)
 24666  			return true
 24667  		}
 24668  		// match: (If (LessThanU cc) yes no)
 24669  		// result: (ULT cc yes no)
 24670  		for b.Controls[0].Op == OpARM64LessThanU {
 24671  			v_0 := b.Controls[0]
 24672  			cc := v_0.Args[0]
 24673  			b.resetWithControl(BlockARM64ULT, cc)
 24674  			return true
 24675  		}
 24676  		// match: (If (LessEqual cc) yes no)
 24677  		// result: (LE cc yes no)
 24678  		for b.Controls[0].Op == OpARM64LessEqual {
 24679  			v_0 := b.Controls[0]
 24680  			cc := v_0.Args[0]
 24681  			b.resetWithControl(BlockARM64LE, cc)
 24682  			return true
 24683  		}
 24684  		// match: (If (LessEqualU cc) yes no)
 24685  		// result: (ULE cc yes no)
 24686  		for b.Controls[0].Op == OpARM64LessEqualU {
 24687  			v_0 := b.Controls[0]
 24688  			cc := v_0.Args[0]
 24689  			b.resetWithControl(BlockARM64ULE, cc)
 24690  			return true
 24691  		}
 24692  		// match: (If (GreaterThan cc) yes no)
 24693  		// result: (GT cc yes no)
 24694  		for b.Controls[0].Op == OpARM64GreaterThan {
 24695  			v_0 := b.Controls[0]
 24696  			cc := v_0.Args[0]
 24697  			b.resetWithControl(BlockARM64GT, cc)
 24698  			return true
 24699  		}
 24700  		// match: (If (GreaterThanU cc) yes no)
 24701  		// result: (UGT cc yes no)
 24702  		for b.Controls[0].Op == OpARM64GreaterThanU {
 24703  			v_0 := b.Controls[0]
 24704  			cc := v_0.Args[0]
 24705  			b.resetWithControl(BlockARM64UGT, cc)
 24706  			return true
 24707  		}
 24708  		// match: (If (GreaterEqual cc) yes no)
 24709  		// result: (GE cc yes no)
 24710  		for b.Controls[0].Op == OpARM64GreaterEqual {
 24711  			v_0 := b.Controls[0]
 24712  			cc := v_0.Args[0]
 24713  			b.resetWithControl(BlockARM64GE, cc)
 24714  			return true
 24715  		}
 24716  		// match: (If (GreaterEqualU cc) yes no)
 24717  		// result: (UGE cc yes no)
 24718  		for b.Controls[0].Op == OpARM64GreaterEqualU {
 24719  			v_0 := b.Controls[0]
 24720  			cc := v_0.Args[0]
 24721  			b.resetWithControl(BlockARM64UGE, cc)
 24722  			return true
 24723  		}
 24724  		// match: (If (LessThanF cc) yes no)
 24725  		// result: (FLT cc yes no)
 24726  		for b.Controls[0].Op == OpARM64LessThanF {
 24727  			v_0 := b.Controls[0]
 24728  			cc := v_0.Args[0]
 24729  			b.resetWithControl(BlockARM64FLT, cc)
 24730  			return true
 24731  		}
 24732  		// match: (If (LessEqualF cc) yes no)
 24733  		// result: (FLE cc yes no)
 24734  		for b.Controls[0].Op == OpARM64LessEqualF {
 24735  			v_0 := b.Controls[0]
 24736  			cc := v_0.Args[0]
 24737  			b.resetWithControl(BlockARM64FLE, cc)
 24738  			return true
 24739  		}
 24740  		// match: (If (GreaterThanF cc) yes no)
 24741  		// result: (FGT cc yes no)
 24742  		for b.Controls[0].Op == OpARM64GreaterThanF {
 24743  			v_0 := b.Controls[0]
 24744  			cc := v_0.Args[0]
 24745  			b.resetWithControl(BlockARM64FGT, cc)
 24746  			return true
 24747  		}
 24748  		// match: (If (GreaterEqualF cc) yes no)
 24749  		// result: (FGE cc yes no)
 24750  		for b.Controls[0].Op == OpARM64GreaterEqualF {
 24751  			v_0 := b.Controls[0]
 24752  			cc := v_0.Args[0]
 24753  			b.resetWithControl(BlockARM64FGE, cc)
 24754  			return true
 24755  		}
 24756  		// match: (If cond yes no)
 24757  		// result: (TBNZ [0] cond yes no)
 24758  		for {
 24759  			cond := b.Controls[0]
 24760  			b.resetWithControl(BlockARM64TBNZ, cond)
 24761  			b.AuxInt = int64ToAuxInt(0)
 24762  			return true
 24763  		}
 24764  	case BlockJumpTable:
 24765  		// match: (JumpTable idx)
 24766  		// result: (JUMPTABLE {makeJumpTableSym(b)} idx (MOVDaddr <typ.Uintptr> {makeJumpTableSym(b)} (SB)))
 24767  		for {
 24768  			idx := b.Controls[0]
 24769  			v0 := b.NewValue0(b.Pos, OpARM64MOVDaddr, typ.Uintptr)
 24770  			v0.Aux = symToAux(makeJumpTableSym(b))
 24771  			v1 := b.NewValue0(b.Pos, OpSB, typ.Uintptr)
 24772  			v0.AddArg(v1)
 24773  			b.resetWithControl2(BlockARM64JUMPTABLE, idx, v0)
 24774  			b.Aux = symToAux(makeJumpTableSym(b))
 24775  			return true
 24776  		}
 24777  	case BlockARM64LE:
 24778  		// match: (LE (CMPconst [0] z:(AND x y)) yes no)
 24779  		// cond: z.Uses == 1
 24780  		// result: (LE (TST x y) yes no)
 24781  		for b.Controls[0].Op == OpARM64CMPconst {
 24782  			v_0 := b.Controls[0]
 24783  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24784  				break
 24785  			}
 24786  			z := v_0.Args[0]
 24787  			if z.Op != OpARM64AND {
 24788  				break
 24789  			}
 24790  			_ = z.Args[1]
 24791  			z_0 := z.Args[0]
 24792  			z_1 := z.Args[1]
 24793  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24794  				x := z_0
 24795  				y := z_1
 24796  				if !(z.Uses == 1) {
 24797  					continue
 24798  				}
 24799  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 24800  				v0.AddArg2(x, y)
 24801  				b.resetWithControl(BlockARM64LE, v0)
 24802  				return true
 24803  			}
 24804  			break
 24805  		}
 24806  		// match: (LE (CMPconst [0] x:(ANDconst [c] y)) yes no)
 24807  		// cond: x.Uses == 1
 24808  		// result: (LE (TSTconst [c] y) yes no)
 24809  		for b.Controls[0].Op == OpARM64CMPconst {
 24810  			v_0 := b.Controls[0]
 24811  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24812  				break
 24813  			}
 24814  			x := v_0.Args[0]
 24815  			if x.Op != OpARM64ANDconst {
 24816  				break
 24817  			}
 24818  			c := auxIntToInt64(x.AuxInt)
 24819  			y := x.Args[0]
 24820  			if !(x.Uses == 1) {
 24821  				break
 24822  			}
 24823  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 24824  			v0.AuxInt = int64ToAuxInt(c)
 24825  			v0.AddArg(y)
 24826  			b.resetWithControl(BlockARM64LE, v0)
 24827  			return true
 24828  		}
 24829  		// match: (LE (CMPWconst [0] z:(AND x y)) yes no)
 24830  		// cond: z.Uses == 1
 24831  		// result: (LE (TSTW x y) yes no)
 24832  		for b.Controls[0].Op == OpARM64CMPWconst {
 24833  			v_0 := b.Controls[0]
 24834  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24835  				break
 24836  			}
 24837  			z := v_0.Args[0]
 24838  			if z.Op != OpARM64AND {
 24839  				break
 24840  			}
 24841  			_ = z.Args[1]
 24842  			z_0 := z.Args[0]
 24843  			z_1 := z.Args[1]
 24844  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24845  				x := z_0
 24846  				y := z_1
 24847  				if !(z.Uses == 1) {
 24848  					continue
 24849  				}
 24850  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 24851  				v0.AddArg2(x, y)
 24852  				b.resetWithControl(BlockARM64LE, v0)
 24853  				return true
 24854  			}
 24855  			break
 24856  		}
 24857  		// match: (LE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 24858  		// cond: x.Uses == 1
 24859  		// result: (LE (TSTWconst [int32(c)] y) yes no)
 24860  		for b.Controls[0].Op == OpARM64CMPWconst {
 24861  			v_0 := b.Controls[0]
 24862  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24863  				break
 24864  			}
 24865  			x := v_0.Args[0]
 24866  			if x.Op != OpARM64ANDconst {
 24867  				break
 24868  			}
 24869  			c := auxIntToInt64(x.AuxInt)
 24870  			y := x.Args[0]
 24871  			if !(x.Uses == 1) {
 24872  				break
 24873  			}
 24874  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 24875  			v0.AuxInt = int32ToAuxInt(int32(c))
 24876  			v0.AddArg(y)
 24877  			b.resetWithControl(BlockARM64LE, v0)
 24878  			return true
 24879  		}
 24880  		// match: (LE (CMPconst [0] x:(ADDconst [c] y)) yes no)
 24881  		// cond: x.Uses == 1
 24882  		// result: (LEnoov (CMNconst [c] y) yes no)
 24883  		for b.Controls[0].Op == OpARM64CMPconst {
 24884  			v_0 := b.Controls[0]
 24885  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24886  				break
 24887  			}
 24888  			x := v_0.Args[0]
 24889  			if x.Op != OpARM64ADDconst {
 24890  				break
 24891  			}
 24892  			c := auxIntToInt64(x.AuxInt)
 24893  			y := x.Args[0]
 24894  			if !(x.Uses == 1) {
 24895  				break
 24896  			}
 24897  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 24898  			v0.AuxInt = int64ToAuxInt(c)
 24899  			v0.AddArg(y)
 24900  			b.resetWithControl(BlockARM64LEnoov, v0)
 24901  			return true
 24902  		}
 24903  		// match: (LE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 24904  		// cond: x.Uses == 1
 24905  		// result: (LEnoov (CMNWconst [int32(c)] y) yes no)
 24906  		for b.Controls[0].Op == OpARM64CMPWconst {
 24907  			v_0 := b.Controls[0]
 24908  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24909  				break
 24910  			}
 24911  			x := v_0.Args[0]
 24912  			if x.Op != OpARM64ADDconst {
 24913  				break
 24914  			}
 24915  			c := auxIntToInt64(x.AuxInt)
 24916  			y := x.Args[0]
 24917  			if !(x.Uses == 1) {
 24918  				break
 24919  			}
 24920  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 24921  			v0.AuxInt = int32ToAuxInt(int32(c))
 24922  			v0.AddArg(y)
 24923  			b.resetWithControl(BlockARM64LEnoov, v0)
 24924  			return true
 24925  		}
 24926  		// match: (LE (CMPconst [0] z:(ADD x y)) yes no)
 24927  		// cond: z.Uses == 1
 24928  		// result: (LEnoov (CMN x y) yes no)
 24929  		for b.Controls[0].Op == OpARM64CMPconst {
 24930  			v_0 := b.Controls[0]
 24931  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24932  				break
 24933  			}
 24934  			z := v_0.Args[0]
 24935  			if z.Op != OpARM64ADD {
 24936  				break
 24937  			}
 24938  			_ = z.Args[1]
 24939  			z_0 := z.Args[0]
 24940  			z_1 := z.Args[1]
 24941  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24942  				x := z_0
 24943  				y := z_1
 24944  				if !(z.Uses == 1) {
 24945  					continue
 24946  				}
 24947  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 24948  				v0.AddArg2(x, y)
 24949  				b.resetWithControl(BlockARM64LEnoov, v0)
 24950  				return true
 24951  			}
 24952  			break
 24953  		}
 24954  		// match: (LE (CMPWconst [0] z:(ADD x y)) yes no)
 24955  		// cond: z.Uses == 1
 24956  		// result: (LEnoov (CMNW x y) yes no)
 24957  		for b.Controls[0].Op == OpARM64CMPWconst {
 24958  			v_0 := b.Controls[0]
 24959  			if auxIntToInt32(v_0.AuxInt) != 0 {
 24960  				break
 24961  			}
 24962  			z := v_0.Args[0]
 24963  			if z.Op != OpARM64ADD {
 24964  				break
 24965  			}
 24966  			_ = z.Args[1]
 24967  			z_0 := z.Args[0]
 24968  			z_1 := z.Args[1]
 24969  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 24970  				x := z_0
 24971  				y := z_1
 24972  				if !(z.Uses == 1) {
 24973  					continue
 24974  				}
 24975  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 24976  				v0.AddArg2(x, y)
 24977  				b.resetWithControl(BlockARM64LEnoov, v0)
 24978  				return true
 24979  			}
 24980  			break
 24981  		}
 24982  		// match: (LE (CMPconst [0] z:(MADD a x y)) yes no)
 24983  		// cond: z.Uses==1
 24984  		// result: (LEnoov (CMN a (MUL <x.Type> x y)) yes no)
 24985  		for b.Controls[0].Op == OpARM64CMPconst {
 24986  			v_0 := b.Controls[0]
 24987  			if auxIntToInt64(v_0.AuxInt) != 0 {
 24988  				break
 24989  			}
 24990  			z := v_0.Args[0]
 24991  			if z.Op != OpARM64MADD {
 24992  				break
 24993  			}
 24994  			y := z.Args[2]
 24995  			a := z.Args[0]
 24996  			x := z.Args[1]
 24997  			if !(z.Uses == 1) {
 24998  				break
 24999  			}
 25000  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 25001  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 25002  			v1.AddArg2(x, y)
 25003  			v0.AddArg2(a, v1)
 25004  			b.resetWithControl(BlockARM64LEnoov, v0)
 25005  			return true
 25006  		}
 25007  		// match: (LE (CMPconst [0] z:(MSUB a x y)) yes no)
 25008  		// cond: z.Uses==1
 25009  		// result: (LEnoov (CMP a (MUL <x.Type> x y)) yes no)
 25010  		for b.Controls[0].Op == OpARM64CMPconst {
 25011  			v_0 := b.Controls[0]
 25012  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25013  				break
 25014  			}
 25015  			z := v_0.Args[0]
 25016  			if z.Op != OpARM64MSUB {
 25017  				break
 25018  			}
 25019  			y := z.Args[2]
 25020  			a := z.Args[0]
 25021  			x := z.Args[1]
 25022  			if !(z.Uses == 1) {
 25023  				break
 25024  			}
 25025  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 25026  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 25027  			v1.AddArg2(x, y)
 25028  			v0.AddArg2(a, v1)
 25029  			b.resetWithControl(BlockARM64LEnoov, v0)
 25030  			return true
 25031  		}
 25032  		// match: (LE (CMPWconst [0] z:(MADDW a x y)) yes no)
 25033  		// cond: z.Uses==1
 25034  		// result: (LEnoov (CMNW a (MULW <x.Type> x y)) yes no)
 25035  		for b.Controls[0].Op == OpARM64CMPWconst {
 25036  			v_0 := b.Controls[0]
 25037  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25038  				break
 25039  			}
 25040  			z := v_0.Args[0]
 25041  			if z.Op != OpARM64MADDW {
 25042  				break
 25043  			}
 25044  			y := z.Args[2]
 25045  			a := z.Args[0]
 25046  			x := z.Args[1]
 25047  			if !(z.Uses == 1) {
 25048  				break
 25049  			}
 25050  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 25051  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 25052  			v1.AddArg2(x, y)
 25053  			v0.AddArg2(a, v1)
 25054  			b.resetWithControl(BlockARM64LEnoov, v0)
 25055  			return true
 25056  		}
 25057  		// match: (LE (CMPWconst [0] z:(MSUBW a x y)) yes no)
 25058  		// cond: z.Uses==1
 25059  		// result: (LEnoov (CMPW a (MULW <x.Type> x y)) yes no)
 25060  		for b.Controls[0].Op == OpARM64CMPWconst {
 25061  			v_0 := b.Controls[0]
 25062  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25063  				break
 25064  			}
 25065  			z := v_0.Args[0]
 25066  			if z.Op != OpARM64MSUBW {
 25067  				break
 25068  			}
 25069  			y := z.Args[2]
 25070  			a := z.Args[0]
 25071  			x := z.Args[1]
 25072  			if !(z.Uses == 1) {
 25073  				break
 25074  			}
 25075  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 25076  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 25077  			v1.AddArg2(x, y)
 25078  			v0.AddArg2(a, v1)
 25079  			b.resetWithControl(BlockARM64LEnoov, v0)
 25080  			return true
 25081  		}
 25082  		// match: (LE (FlagConstant [fc]) yes no)
 25083  		// cond: fc.le()
 25084  		// result: (First yes no)
 25085  		for b.Controls[0].Op == OpARM64FlagConstant {
 25086  			v_0 := b.Controls[0]
 25087  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25088  			if !(fc.le()) {
 25089  				break
 25090  			}
 25091  			b.Reset(BlockFirst)
 25092  			return true
 25093  		}
 25094  		// match: (LE (FlagConstant [fc]) yes no)
 25095  		// cond: !fc.le()
 25096  		// result: (First no yes)
 25097  		for b.Controls[0].Op == OpARM64FlagConstant {
 25098  			v_0 := b.Controls[0]
 25099  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25100  			if !(!fc.le()) {
 25101  				break
 25102  			}
 25103  			b.Reset(BlockFirst)
 25104  			b.swapSuccessors()
 25105  			return true
 25106  		}
 25107  		// match: (LE (InvertFlags cmp) yes no)
 25108  		// result: (GE cmp yes no)
 25109  		for b.Controls[0].Op == OpARM64InvertFlags {
 25110  			v_0 := b.Controls[0]
 25111  			cmp := v_0.Args[0]
 25112  			b.resetWithControl(BlockARM64GE, cmp)
 25113  			return true
 25114  		}
 25115  	case BlockARM64LEnoov:
 25116  		// match: (LEnoov (FlagConstant [fc]) yes no)
 25117  		// cond: fc.leNoov()
 25118  		// result: (First yes no)
 25119  		for b.Controls[0].Op == OpARM64FlagConstant {
 25120  			v_0 := b.Controls[0]
 25121  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25122  			if !(fc.leNoov()) {
 25123  				break
 25124  			}
 25125  			b.Reset(BlockFirst)
 25126  			return true
 25127  		}
 25128  		// match: (LEnoov (FlagConstant [fc]) yes no)
 25129  		// cond: !fc.leNoov()
 25130  		// result: (First no yes)
 25131  		for b.Controls[0].Op == OpARM64FlagConstant {
 25132  			v_0 := b.Controls[0]
 25133  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25134  			if !(!fc.leNoov()) {
 25135  				break
 25136  			}
 25137  			b.Reset(BlockFirst)
 25138  			b.swapSuccessors()
 25139  			return true
 25140  		}
 25141  		// match: (LEnoov (InvertFlags cmp) yes no)
 25142  		// result: (GEnoov cmp yes no)
 25143  		for b.Controls[0].Op == OpARM64InvertFlags {
 25144  			v_0 := b.Controls[0]
 25145  			cmp := v_0.Args[0]
 25146  			b.resetWithControl(BlockARM64GEnoov, cmp)
 25147  			return true
 25148  		}
 25149  	case BlockARM64LT:
 25150  		// match: (LT (CMPconst [0] z:(AND x y)) yes no)
 25151  		// cond: z.Uses == 1
 25152  		// result: (LT (TST x y) yes no)
 25153  		for b.Controls[0].Op == OpARM64CMPconst {
 25154  			v_0 := b.Controls[0]
 25155  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25156  				break
 25157  			}
 25158  			z := v_0.Args[0]
 25159  			if z.Op != OpARM64AND {
 25160  				break
 25161  			}
 25162  			_ = z.Args[1]
 25163  			z_0 := z.Args[0]
 25164  			z_1 := z.Args[1]
 25165  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 25166  				x := z_0
 25167  				y := z_1
 25168  				if !(z.Uses == 1) {
 25169  					continue
 25170  				}
 25171  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 25172  				v0.AddArg2(x, y)
 25173  				b.resetWithControl(BlockARM64LT, v0)
 25174  				return true
 25175  			}
 25176  			break
 25177  		}
 25178  		// match: (LT (CMPconst [0] x:(ANDconst [c] y)) yes no)
 25179  		// cond: x.Uses == 1
 25180  		// result: (LT (TSTconst [c] y) yes no)
 25181  		for b.Controls[0].Op == OpARM64CMPconst {
 25182  			v_0 := b.Controls[0]
 25183  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25184  				break
 25185  			}
 25186  			x := v_0.Args[0]
 25187  			if x.Op != OpARM64ANDconst {
 25188  				break
 25189  			}
 25190  			c := auxIntToInt64(x.AuxInt)
 25191  			y := x.Args[0]
 25192  			if !(x.Uses == 1) {
 25193  				break
 25194  			}
 25195  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 25196  			v0.AuxInt = int64ToAuxInt(c)
 25197  			v0.AddArg(y)
 25198  			b.resetWithControl(BlockARM64LT, v0)
 25199  			return true
 25200  		}
 25201  		// match: (LT (CMPWconst [0] z:(AND x y)) yes no)
 25202  		// cond: z.Uses == 1
 25203  		// result: (LT (TSTW x y) yes no)
 25204  		for b.Controls[0].Op == OpARM64CMPWconst {
 25205  			v_0 := b.Controls[0]
 25206  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25207  				break
 25208  			}
 25209  			z := v_0.Args[0]
 25210  			if z.Op != OpARM64AND {
 25211  				break
 25212  			}
 25213  			_ = z.Args[1]
 25214  			z_0 := z.Args[0]
 25215  			z_1 := z.Args[1]
 25216  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 25217  				x := z_0
 25218  				y := z_1
 25219  				if !(z.Uses == 1) {
 25220  					continue
 25221  				}
 25222  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 25223  				v0.AddArg2(x, y)
 25224  				b.resetWithControl(BlockARM64LT, v0)
 25225  				return true
 25226  			}
 25227  			break
 25228  		}
 25229  		// match: (LT (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 25230  		// cond: x.Uses == 1
 25231  		// result: (LT (TSTWconst [int32(c)] y) yes no)
 25232  		for b.Controls[0].Op == OpARM64CMPWconst {
 25233  			v_0 := b.Controls[0]
 25234  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25235  				break
 25236  			}
 25237  			x := v_0.Args[0]
 25238  			if x.Op != OpARM64ANDconst {
 25239  				break
 25240  			}
 25241  			c := auxIntToInt64(x.AuxInt)
 25242  			y := x.Args[0]
 25243  			if !(x.Uses == 1) {
 25244  				break
 25245  			}
 25246  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 25247  			v0.AuxInt = int32ToAuxInt(int32(c))
 25248  			v0.AddArg(y)
 25249  			b.resetWithControl(BlockARM64LT, v0)
 25250  			return true
 25251  		}
 25252  		// match: (LT (CMPconst [0] x:(ADDconst [c] y)) yes no)
 25253  		// cond: x.Uses == 1
 25254  		// result: (LTnoov (CMNconst [c] y) yes no)
 25255  		for b.Controls[0].Op == OpARM64CMPconst {
 25256  			v_0 := b.Controls[0]
 25257  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25258  				break
 25259  			}
 25260  			x := v_0.Args[0]
 25261  			if x.Op != OpARM64ADDconst {
 25262  				break
 25263  			}
 25264  			c := auxIntToInt64(x.AuxInt)
 25265  			y := x.Args[0]
 25266  			if !(x.Uses == 1) {
 25267  				break
 25268  			}
 25269  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 25270  			v0.AuxInt = int64ToAuxInt(c)
 25271  			v0.AddArg(y)
 25272  			b.resetWithControl(BlockARM64LTnoov, v0)
 25273  			return true
 25274  		}
 25275  		// match: (LT (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 25276  		// cond: x.Uses == 1
 25277  		// result: (LTnoov (CMNWconst [int32(c)] y) yes no)
 25278  		for b.Controls[0].Op == OpARM64CMPWconst {
 25279  			v_0 := b.Controls[0]
 25280  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25281  				break
 25282  			}
 25283  			x := v_0.Args[0]
 25284  			if x.Op != OpARM64ADDconst {
 25285  				break
 25286  			}
 25287  			c := auxIntToInt64(x.AuxInt)
 25288  			y := x.Args[0]
 25289  			if !(x.Uses == 1) {
 25290  				break
 25291  			}
 25292  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 25293  			v0.AuxInt = int32ToAuxInt(int32(c))
 25294  			v0.AddArg(y)
 25295  			b.resetWithControl(BlockARM64LTnoov, v0)
 25296  			return true
 25297  		}
 25298  		// match: (LT (CMPconst [0] z:(ADD x y)) yes no)
 25299  		// cond: z.Uses == 1
 25300  		// result: (LTnoov (CMN x y) yes no)
 25301  		for b.Controls[0].Op == OpARM64CMPconst {
 25302  			v_0 := b.Controls[0]
 25303  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25304  				break
 25305  			}
 25306  			z := v_0.Args[0]
 25307  			if z.Op != OpARM64ADD {
 25308  				break
 25309  			}
 25310  			_ = z.Args[1]
 25311  			z_0 := z.Args[0]
 25312  			z_1 := z.Args[1]
 25313  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 25314  				x := z_0
 25315  				y := z_1
 25316  				if !(z.Uses == 1) {
 25317  					continue
 25318  				}
 25319  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 25320  				v0.AddArg2(x, y)
 25321  				b.resetWithControl(BlockARM64LTnoov, v0)
 25322  				return true
 25323  			}
 25324  			break
 25325  		}
 25326  		// match: (LT (CMPWconst [0] z:(ADD x y)) yes no)
 25327  		// cond: z.Uses == 1
 25328  		// result: (LTnoov (CMNW x y) yes no)
 25329  		for b.Controls[0].Op == OpARM64CMPWconst {
 25330  			v_0 := b.Controls[0]
 25331  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25332  				break
 25333  			}
 25334  			z := v_0.Args[0]
 25335  			if z.Op != OpARM64ADD {
 25336  				break
 25337  			}
 25338  			_ = z.Args[1]
 25339  			z_0 := z.Args[0]
 25340  			z_1 := z.Args[1]
 25341  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 25342  				x := z_0
 25343  				y := z_1
 25344  				if !(z.Uses == 1) {
 25345  					continue
 25346  				}
 25347  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 25348  				v0.AddArg2(x, y)
 25349  				b.resetWithControl(BlockARM64LTnoov, v0)
 25350  				return true
 25351  			}
 25352  			break
 25353  		}
 25354  		// match: (LT (CMPconst [0] z:(MADD a x y)) yes no)
 25355  		// cond: z.Uses==1
 25356  		// result: (LTnoov (CMN a (MUL <x.Type> x y)) yes no)
 25357  		for b.Controls[0].Op == OpARM64CMPconst {
 25358  			v_0 := b.Controls[0]
 25359  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25360  				break
 25361  			}
 25362  			z := v_0.Args[0]
 25363  			if z.Op != OpARM64MADD {
 25364  				break
 25365  			}
 25366  			y := z.Args[2]
 25367  			a := z.Args[0]
 25368  			x := z.Args[1]
 25369  			if !(z.Uses == 1) {
 25370  				break
 25371  			}
 25372  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 25373  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 25374  			v1.AddArg2(x, y)
 25375  			v0.AddArg2(a, v1)
 25376  			b.resetWithControl(BlockARM64LTnoov, v0)
 25377  			return true
 25378  		}
 25379  		// match: (LT (CMPconst [0] z:(MSUB a x y)) yes no)
 25380  		// cond: z.Uses==1
 25381  		// result: (LTnoov (CMP a (MUL <x.Type> x y)) yes no)
 25382  		for b.Controls[0].Op == OpARM64CMPconst {
 25383  			v_0 := b.Controls[0]
 25384  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25385  				break
 25386  			}
 25387  			z := v_0.Args[0]
 25388  			if z.Op != OpARM64MSUB {
 25389  				break
 25390  			}
 25391  			y := z.Args[2]
 25392  			a := z.Args[0]
 25393  			x := z.Args[1]
 25394  			if !(z.Uses == 1) {
 25395  				break
 25396  			}
 25397  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 25398  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 25399  			v1.AddArg2(x, y)
 25400  			v0.AddArg2(a, v1)
 25401  			b.resetWithControl(BlockARM64LTnoov, v0)
 25402  			return true
 25403  		}
 25404  		// match: (LT (CMPWconst [0] z:(MADDW a x y)) yes no)
 25405  		// cond: z.Uses==1
 25406  		// result: (LTnoov (CMNW a (MULW <x.Type> x y)) yes no)
 25407  		for b.Controls[0].Op == OpARM64CMPWconst {
 25408  			v_0 := b.Controls[0]
 25409  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25410  				break
 25411  			}
 25412  			z := v_0.Args[0]
 25413  			if z.Op != OpARM64MADDW {
 25414  				break
 25415  			}
 25416  			y := z.Args[2]
 25417  			a := z.Args[0]
 25418  			x := z.Args[1]
 25419  			if !(z.Uses == 1) {
 25420  				break
 25421  			}
 25422  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 25423  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 25424  			v1.AddArg2(x, y)
 25425  			v0.AddArg2(a, v1)
 25426  			b.resetWithControl(BlockARM64LTnoov, v0)
 25427  			return true
 25428  		}
 25429  		// match: (LT (CMPWconst [0] z:(MSUBW a x y)) yes no)
 25430  		// cond: z.Uses==1
 25431  		// result: (LTnoov (CMPW a (MULW <x.Type> x y)) yes no)
 25432  		for b.Controls[0].Op == OpARM64CMPWconst {
 25433  			v_0 := b.Controls[0]
 25434  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25435  				break
 25436  			}
 25437  			z := v_0.Args[0]
 25438  			if z.Op != OpARM64MSUBW {
 25439  				break
 25440  			}
 25441  			y := z.Args[2]
 25442  			a := z.Args[0]
 25443  			x := z.Args[1]
 25444  			if !(z.Uses == 1) {
 25445  				break
 25446  			}
 25447  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 25448  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 25449  			v1.AddArg2(x, y)
 25450  			v0.AddArg2(a, v1)
 25451  			b.resetWithControl(BlockARM64LTnoov, v0)
 25452  			return true
 25453  		}
 25454  		// match: (LT (CMPWconst [0] x) yes no)
 25455  		// result: (TBNZ [31] x yes no)
 25456  		for b.Controls[0].Op == OpARM64CMPWconst {
 25457  			v_0 := b.Controls[0]
 25458  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25459  				break
 25460  			}
 25461  			x := v_0.Args[0]
 25462  			b.resetWithControl(BlockARM64TBNZ, x)
 25463  			b.AuxInt = int64ToAuxInt(31)
 25464  			return true
 25465  		}
 25466  		// match: (LT (CMPconst [0] x) yes no)
 25467  		// result: (TBNZ [63] x yes no)
 25468  		for b.Controls[0].Op == OpARM64CMPconst {
 25469  			v_0 := b.Controls[0]
 25470  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25471  				break
 25472  			}
 25473  			x := v_0.Args[0]
 25474  			b.resetWithControl(BlockARM64TBNZ, x)
 25475  			b.AuxInt = int64ToAuxInt(63)
 25476  			return true
 25477  		}
 25478  		// match: (LT (FlagConstant [fc]) yes no)
 25479  		// cond: fc.lt()
 25480  		// result: (First yes no)
 25481  		for b.Controls[0].Op == OpARM64FlagConstant {
 25482  			v_0 := b.Controls[0]
 25483  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25484  			if !(fc.lt()) {
 25485  				break
 25486  			}
 25487  			b.Reset(BlockFirst)
 25488  			return true
 25489  		}
 25490  		// match: (LT (FlagConstant [fc]) yes no)
 25491  		// cond: !fc.lt()
 25492  		// result: (First no yes)
 25493  		for b.Controls[0].Op == OpARM64FlagConstant {
 25494  			v_0 := b.Controls[0]
 25495  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25496  			if !(!fc.lt()) {
 25497  				break
 25498  			}
 25499  			b.Reset(BlockFirst)
 25500  			b.swapSuccessors()
 25501  			return true
 25502  		}
 25503  		// match: (LT (InvertFlags cmp) yes no)
 25504  		// result: (GT cmp yes no)
 25505  		for b.Controls[0].Op == OpARM64InvertFlags {
 25506  			v_0 := b.Controls[0]
 25507  			cmp := v_0.Args[0]
 25508  			b.resetWithControl(BlockARM64GT, cmp)
 25509  			return true
 25510  		}
 25511  	case BlockARM64LTnoov:
 25512  		// match: (LTnoov (FlagConstant [fc]) yes no)
 25513  		// cond: fc.ltNoov()
 25514  		// result: (First yes no)
 25515  		for b.Controls[0].Op == OpARM64FlagConstant {
 25516  			v_0 := b.Controls[0]
 25517  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25518  			if !(fc.ltNoov()) {
 25519  				break
 25520  			}
 25521  			b.Reset(BlockFirst)
 25522  			return true
 25523  		}
 25524  		// match: (LTnoov (FlagConstant [fc]) yes no)
 25525  		// cond: !fc.ltNoov()
 25526  		// result: (First no yes)
 25527  		for b.Controls[0].Op == OpARM64FlagConstant {
 25528  			v_0 := b.Controls[0]
 25529  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25530  			if !(!fc.ltNoov()) {
 25531  				break
 25532  			}
 25533  			b.Reset(BlockFirst)
 25534  			b.swapSuccessors()
 25535  			return true
 25536  		}
 25537  		// match: (LTnoov (InvertFlags cmp) yes no)
 25538  		// result: (GTnoov cmp yes no)
 25539  		for b.Controls[0].Op == OpARM64InvertFlags {
 25540  			v_0 := b.Controls[0]
 25541  			cmp := v_0.Args[0]
 25542  			b.resetWithControl(BlockARM64GTnoov, cmp)
 25543  			return true
 25544  		}
 25545  	case BlockARM64NE:
 25546  		// match: (NE (CMPconst [0] z:(AND x y)) yes no)
 25547  		// cond: z.Uses == 1
 25548  		// result: (NE (TST x y) yes no)
 25549  		for b.Controls[0].Op == OpARM64CMPconst {
 25550  			v_0 := b.Controls[0]
 25551  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25552  				break
 25553  			}
 25554  			z := v_0.Args[0]
 25555  			if z.Op != OpARM64AND {
 25556  				break
 25557  			}
 25558  			_ = z.Args[1]
 25559  			z_0 := z.Args[0]
 25560  			z_1 := z.Args[1]
 25561  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 25562  				x := z_0
 25563  				y := z_1
 25564  				if !(z.Uses == 1) {
 25565  					continue
 25566  				}
 25567  				v0 := b.NewValue0(v_0.Pos, OpARM64TST, types.TypeFlags)
 25568  				v0.AddArg2(x, y)
 25569  				b.resetWithControl(BlockARM64NE, v0)
 25570  				return true
 25571  			}
 25572  			break
 25573  		}
 25574  		// match: (NE (CMPconst [0] x:(ANDconst [c] y)) yes no)
 25575  		// cond: x.Uses == 1
 25576  		// result: (NE (TSTconst [c] y) yes no)
 25577  		for b.Controls[0].Op == OpARM64CMPconst {
 25578  			v_0 := b.Controls[0]
 25579  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25580  				break
 25581  			}
 25582  			x := v_0.Args[0]
 25583  			if x.Op != OpARM64ANDconst {
 25584  				break
 25585  			}
 25586  			c := auxIntToInt64(x.AuxInt)
 25587  			y := x.Args[0]
 25588  			if !(x.Uses == 1) {
 25589  				break
 25590  			}
 25591  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTconst, types.TypeFlags)
 25592  			v0.AuxInt = int64ToAuxInt(c)
 25593  			v0.AddArg(y)
 25594  			b.resetWithControl(BlockARM64NE, v0)
 25595  			return true
 25596  		}
 25597  		// match: (NE (CMPWconst [0] z:(AND x y)) yes no)
 25598  		// cond: z.Uses == 1
 25599  		// result: (NE (TSTW x y) yes no)
 25600  		for b.Controls[0].Op == OpARM64CMPWconst {
 25601  			v_0 := b.Controls[0]
 25602  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25603  				break
 25604  			}
 25605  			z := v_0.Args[0]
 25606  			if z.Op != OpARM64AND {
 25607  				break
 25608  			}
 25609  			_ = z.Args[1]
 25610  			z_0 := z.Args[0]
 25611  			z_1 := z.Args[1]
 25612  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 25613  				x := z_0
 25614  				y := z_1
 25615  				if !(z.Uses == 1) {
 25616  					continue
 25617  				}
 25618  				v0 := b.NewValue0(v_0.Pos, OpARM64TSTW, types.TypeFlags)
 25619  				v0.AddArg2(x, y)
 25620  				b.resetWithControl(BlockARM64NE, v0)
 25621  				return true
 25622  			}
 25623  			break
 25624  		}
 25625  		// match: (NE (CMPWconst [0] x:(ANDconst [c] y)) yes no)
 25626  		// cond: x.Uses == 1
 25627  		// result: (NE (TSTWconst [int32(c)] y) yes no)
 25628  		for b.Controls[0].Op == OpARM64CMPWconst {
 25629  			v_0 := b.Controls[0]
 25630  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25631  				break
 25632  			}
 25633  			x := v_0.Args[0]
 25634  			if x.Op != OpARM64ANDconst {
 25635  				break
 25636  			}
 25637  			c := auxIntToInt64(x.AuxInt)
 25638  			y := x.Args[0]
 25639  			if !(x.Uses == 1) {
 25640  				break
 25641  			}
 25642  			v0 := b.NewValue0(v_0.Pos, OpARM64TSTWconst, types.TypeFlags)
 25643  			v0.AuxInt = int32ToAuxInt(int32(c))
 25644  			v0.AddArg(y)
 25645  			b.resetWithControl(BlockARM64NE, v0)
 25646  			return true
 25647  		}
 25648  		// match: (NE (CMPconst [0] x:(ADDconst [c] y)) yes no)
 25649  		// cond: x.Uses == 1
 25650  		// result: (NE (CMNconst [c] y) yes no)
 25651  		for b.Controls[0].Op == OpARM64CMPconst {
 25652  			v_0 := b.Controls[0]
 25653  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25654  				break
 25655  			}
 25656  			x := v_0.Args[0]
 25657  			if x.Op != OpARM64ADDconst {
 25658  				break
 25659  			}
 25660  			c := auxIntToInt64(x.AuxInt)
 25661  			y := x.Args[0]
 25662  			if !(x.Uses == 1) {
 25663  				break
 25664  			}
 25665  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNconst, types.TypeFlags)
 25666  			v0.AuxInt = int64ToAuxInt(c)
 25667  			v0.AddArg(y)
 25668  			b.resetWithControl(BlockARM64NE, v0)
 25669  			return true
 25670  		}
 25671  		// match: (NE (CMPWconst [0] x:(ADDconst [c] y)) yes no)
 25672  		// cond: x.Uses == 1
 25673  		// result: (NE (CMNWconst [int32(c)] y) yes no)
 25674  		for b.Controls[0].Op == OpARM64CMPWconst {
 25675  			v_0 := b.Controls[0]
 25676  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25677  				break
 25678  			}
 25679  			x := v_0.Args[0]
 25680  			if x.Op != OpARM64ADDconst {
 25681  				break
 25682  			}
 25683  			c := auxIntToInt64(x.AuxInt)
 25684  			y := x.Args[0]
 25685  			if !(x.Uses == 1) {
 25686  				break
 25687  			}
 25688  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNWconst, types.TypeFlags)
 25689  			v0.AuxInt = int32ToAuxInt(int32(c))
 25690  			v0.AddArg(y)
 25691  			b.resetWithControl(BlockARM64NE, v0)
 25692  			return true
 25693  		}
 25694  		// match: (NE (CMPconst [0] z:(ADD x y)) yes no)
 25695  		// cond: z.Uses == 1
 25696  		// result: (NE (CMN x y) yes no)
 25697  		for b.Controls[0].Op == OpARM64CMPconst {
 25698  			v_0 := b.Controls[0]
 25699  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25700  				break
 25701  			}
 25702  			z := v_0.Args[0]
 25703  			if z.Op != OpARM64ADD {
 25704  				break
 25705  			}
 25706  			_ = z.Args[1]
 25707  			z_0 := z.Args[0]
 25708  			z_1 := z.Args[1]
 25709  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 25710  				x := z_0
 25711  				y := z_1
 25712  				if !(z.Uses == 1) {
 25713  					continue
 25714  				}
 25715  				v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 25716  				v0.AddArg2(x, y)
 25717  				b.resetWithControl(BlockARM64NE, v0)
 25718  				return true
 25719  			}
 25720  			break
 25721  		}
 25722  		// match: (NE (CMPWconst [0] z:(ADD x y)) yes no)
 25723  		// cond: z.Uses == 1
 25724  		// result: (NE (CMNW x y) yes no)
 25725  		for b.Controls[0].Op == OpARM64CMPWconst {
 25726  			v_0 := b.Controls[0]
 25727  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25728  				break
 25729  			}
 25730  			z := v_0.Args[0]
 25731  			if z.Op != OpARM64ADD {
 25732  				break
 25733  			}
 25734  			_ = z.Args[1]
 25735  			z_0 := z.Args[0]
 25736  			z_1 := z.Args[1]
 25737  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 25738  				x := z_0
 25739  				y := z_1
 25740  				if !(z.Uses == 1) {
 25741  					continue
 25742  				}
 25743  				v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 25744  				v0.AddArg2(x, y)
 25745  				b.resetWithControl(BlockARM64NE, v0)
 25746  				return true
 25747  			}
 25748  			break
 25749  		}
 25750  		// match: (NE (CMP x z:(NEG y)) yes no)
 25751  		// cond: z.Uses == 1
 25752  		// result: (NE (CMN x y) yes no)
 25753  		for b.Controls[0].Op == OpARM64CMP {
 25754  			v_0 := b.Controls[0]
 25755  			_ = v_0.Args[1]
 25756  			x := v_0.Args[0]
 25757  			z := v_0.Args[1]
 25758  			if z.Op != OpARM64NEG {
 25759  				break
 25760  			}
 25761  			y := z.Args[0]
 25762  			if !(z.Uses == 1) {
 25763  				break
 25764  			}
 25765  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 25766  			v0.AddArg2(x, y)
 25767  			b.resetWithControl(BlockARM64NE, v0)
 25768  			return true
 25769  		}
 25770  		// match: (NE (CMPW x z:(NEG y)) yes no)
 25771  		// cond: z.Uses == 1
 25772  		// result: (NE (CMNW x y) yes no)
 25773  		for b.Controls[0].Op == OpARM64CMPW {
 25774  			v_0 := b.Controls[0]
 25775  			_ = v_0.Args[1]
 25776  			x := v_0.Args[0]
 25777  			z := v_0.Args[1]
 25778  			if z.Op != OpARM64NEG {
 25779  				break
 25780  			}
 25781  			y := z.Args[0]
 25782  			if !(z.Uses == 1) {
 25783  				break
 25784  			}
 25785  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 25786  			v0.AddArg2(x, y)
 25787  			b.resetWithControl(BlockARM64NE, v0)
 25788  			return true
 25789  		}
 25790  		// match: (NE (CMPconst [0] x) yes no)
 25791  		// result: (NZ x yes no)
 25792  		for b.Controls[0].Op == OpARM64CMPconst {
 25793  			v_0 := b.Controls[0]
 25794  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25795  				break
 25796  			}
 25797  			x := v_0.Args[0]
 25798  			b.resetWithControl(BlockARM64NZ, x)
 25799  			return true
 25800  		}
 25801  		// match: (NE (CMPWconst [0] x) yes no)
 25802  		// result: (NZW x yes no)
 25803  		for b.Controls[0].Op == OpARM64CMPWconst {
 25804  			v_0 := b.Controls[0]
 25805  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25806  				break
 25807  			}
 25808  			x := v_0.Args[0]
 25809  			b.resetWithControl(BlockARM64NZW, x)
 25810  			return true
 25811  		}
 25812  		// match: (NE (CMPconst [0] z:(MADD a x y)) yes no)
 25813  		// cond: z.Uses==1
 25814  		// result: (NE (CMN a (MUL <x.Type> x y)) yes no)
 25815  		for b.Controls[0].Op == OpARM64CMPconst {
 25816  			v_0 := b.Controls[0]
 25817  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25818  				break
 25819  			}
 25820  			z := v_0.Args[0]
 25821  			if z.Op != OpARM64MADD {
 25822  				break
 25823  			}
 25824  			y := z.Args[2]
 25825  			a := z.Args[0]
 25826  			x := z.Args[1]
 25827  			if !(z.Uses == 1) {
 25828  				break
 25829  			}
 25830  			v0 := b.NewValue0(v_0.Pos, OpARM64CMN, types.TypeFlags)
 25831  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 25832  			v1.AddArg2(x, y)
 25833  			v0.AddArg2(a, v1)
 25834  			b.resetWithControl(BlockARM64NE, v0)
 25835  			return true
 25836  		}
 25837  		// match: (NE (CMPconst [0] z:(MSUB a x y)) yes no)
 25838  		// cond: z.Uses==1
 25839  		// result: (NE (CMP a (MUL <x.Type> x y)) yes no)
 25840  		for b.Controls[0].Op == OpARM64CMPconst {
 25841  			v_0 := b.Controls[0]
 25842  			if auxIntToInt64(v_0.AuxInt) != 0 {
 25843  				break
 25844  			}
 25845  			z := v_0.Args[0]
 25846  			if z.Op != OpARM64MSUB {
 25847  				break
 25848  			}
 25849  			y := z.Args[2]
 25850  			a := z.Args[0]
 25851  			x := z.Args[1]
 25852  			if !(z.Uses == 1) {
 25853  				break
 25854  			}
 25855  			v0 := b.NewValue0(v_0.Pos, OpARM64CMP, types.TypeFlags)
 25856  			v1 := b.NewValue0(v_0.Pos, OpARM64MUL, x.Type)
 25857  			v1.AddArg2(x, y)
 25858  			v0.AddArg2(a, v1)
 25859  			b.resetWithControl(BlockARM64NE, v0)
 25860  			return true
 25861  		}
 25862  		// match: (NE (CMPWconst [0] z:(MADDW a x y)) yes no)
 25863  		// cond: z.Uses==1
 25864  		// result: (NE (CMNW a (MULW <x.Type> x y)) yes no)
 25865  		for b.Controls[0].Op == OpARM64CMPWconst {
 25866  			v_0 := b.Controls[0]
 25867  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25868  				break
 25869  			}
 25870  			z := v_0.Args[0]
 25871  			if z.Op != OpARM64MADDW {
 25872  				break
 25873  			}
 25874  			y := z.Args[2]
 25875  			a := z.Args[0]
 25876  			x := z.Args[1]
 25877  			if !(z.Uses == 1) {
 25878  				break
 25879  			}
 25880  			v0 := b.NewValue0(v_0.Pos, OpARM64CMNW, types.TypeFlags)
 25881  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 25882  			v1.AddArg2(x, y)
 25883  			v0.AddArg2(a, v1)
 25884  			b.resetWithControl(BlockARM64NE, v0)
 25885  			return true
 25886  		}
 25887  		// match: (NE (CMPWconst [0] z:(MSUBW a x y)) yes no)
 25888  		// cond: z.Uses==1
 25889  		// result: (NE (CMPW a (MULW <x.Type> x y)) yes no)
 25890  		for b.Controls[0].Op == OpARM64CMPWconst {
 25891  			v_0 := b.Controls[0]
 25892  			if auxIntToInt32(v_0.AuxInt) != 0 {
 25893  				break
 25894  			}
 25895  			z := v_0.Args[0]
 25896  			if z.Op != OpARM64MSUBW {
 25897  				break
 25898  			}
 25899  			y := z.Args[2]
 25900  			a := z.Args[0]
 25901  			x := z.Args[1]
 25902  			if !(z.Uses == 1) {
 25903  				break
 25904  			}
 25905  			v0 := b.NewValue0(v_0.Pos, OpARM64CMPW, types.TypeFlags)
 25906  			v1 := b.NewValue0(v_0.Pos, OpARM64MULW, x.Type)
 25907  			v1.AddArg2(x, y)
 25908  			v0.AddArg2(a, v1)
 25909  			b.resetWithControl(BlockARM64NE, v0)
 25910  			return true
 25911  		}
 25912  		// match: (NE (TSTconst [c] x) yes no)
 25913  		// cond: oneBit(c)
 25914  		// result: (TBNZ [int64(ntz64(c))] x yes no)
 25915  		for b.Controls[0].Op == OpARM64TSTconst {
 25916  			v_0 := b.Controls[0]
 25917  			c := auxIntToInt64(v_0.AuxInt)
 25918  			x := v_0.Args[0]
 25919  			if !(oneBit(c)) {
 25920  				break
 25921  			}
 25922  			b.resetWithControl(BlockARM64TBNZ, x)
 25923  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 25924  			return true
 25925  		}
 25926  		// match: (NE (TSTWconst [c] x) yes no)
 25927  		// cond: oneBit(int64(uint32(c)))
 25928  		// result: (TBNZ [int64(ntz64(int64(uint32(c))))] x yes no)
 25929  		for b.Controls[0].Op == OpARM64TSTWconst {
 25930  			v_0 := b.Controls[0]
 25931  			c := auxIntToInt32(v_0.AuxInt)
 25932  			x := v_0.Args[0]
 25933  			if !(oneBit(int64(uint32(c)))) {
 25934  				break
 25935  			}
 25936  			b.resetWithControl(BlockARM64TBNZ, x)
 25937  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 25938  			return true
 25939  		}
 25940  		// match: (NE (FlagConstant [fc]) yes no)
 25941  		// cond: fc.ne()
 25942  		// result: (First yes no)
 25943  		for b.Controls[0].Op == OpARM64FlagConstant {
 25944  			v_0 := b.Controls[0]
 25945  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25946  			if !(fc.ne()) {
 25947  				break
 25948  			}
 25949  			b.Reset(BlockFirst)
 25950  			return true
 25951  		}
 25952  		// match: (NE (FlagConstant [fc]) yes no)
 25953  		// cond: !fc.ne()
 25954  		// result: (First no yes)
 25955  		for b.Controls[0].Op == OpARM64FlagConstant {
 25956  			v_0 := b.Controls[0]
 25957  			fc := auxIntToFlagConstant(v_0.AuxInt)
 25958  			if !(!fc.ne()) {
 25959  				break
 25960  			}
 25961  			b.Reset(BlockFirst)
 25962  			b.swapSuccessors()
 25963  			return true
 25964  		}
 25965  		// match: (NE (InvertFlags cmp) yes no)
 25966  		// result: (NE cmp yes no)
 25967  		for b.Controls[0].Op == OpARM64InvertFlags {
 25968  			v_0 := b.Controls[0]
 25969  			cmp := v_0.Args[0]
 25970  			b.resetWithControl(BlockARM64NE, cmp)
 25971  			return true
 25972  		}
 25973  	case BlockARM64NZ:
 25974  		// match: (NZ (Equal cc) yes no)
 25975  		// result: (EQ cc yes no)
 25976  		for b.Controls[0].Op == OpARM64Equal {
 25977  			v_0 := b.Controls[0]
 25978  			cc := v_0.Args[0]
 25979  			b.resetWithControl(BlockARM64EQ, cc)
 25980  			return true
 25981  		}
 25982  		// match: (NZ (NotEqual cc) yes no)
 25983  		// result: (NE cc yes no)
 25984  		for b.Controls[0].Op == OpARM64NotEqual {
 25985  			v_0 := b.Controls[0]
 25986  			cc := v_0.Args[0]
 25987  			b.resetWithControl(BlockARM64NE, cc)
 25988  			return true
 25989  		}
 25990  		// match: (NZ (LessThan cc) yes no)
 25991  		// result: (LT cc yes no)
 25992  		for b.Controls[0].Op == OpARM64LessThan {
 25993  			v_0 := b.Controls[0]
 25994  			cc := v_0.Args[0]
 25995  			b.resetWithControl(BlockARM64LT, cc)
 25996  			return true
 25997  		}
 25998  		// match: (NZ (LessThanU cc) yes no)
 25999  		// result: (ULT cc yes no)
 26000  		for b.Controls[0].Op == OpARM64LessThanU {
 26001  			v_0 := b.Controls[0]
 26002  			cc := v_0.Args[0]
 26003  			b.resetWithControl(BlockARM64ULT, cc)
 26004  			return true
 26005  		}
 26006  		// match: (NZ (LessEqual cc) yes no)
 26007  		// result: (LE cc yes no)
 26008  		for b.Controls[0].Op == OpARM64LessEqual {
 26009  			v_0 := b.Controls[0]
 26010  			cc := v_0.Args[0]
 26011  			b.resetWithControl(BlockARM64LE, cc)
 26012  			return true
 26013  		}
 26014  		// match: (NZ (LessEqualU cc) yes no)
 26015  		// result: (ULE cc yes no)
 26016  		for b.Controls[0].Op == OpARM64LessEqualU {
 26017  			v_0 := b.Controls[0]
 26018  			cc := v_0.Args[0]
 26019  			b.resetWithControl(BlockARM64ULE, cc)
 26020  			return true
 26021  		}
 26022  		// match: (NZ (GreaterThan cc) yes no)
 26023  		// result: (GT cc yes no)
 26024  		for b.Controls[0].Op == OpARM64GreaterThan {
 26025  			v_0 := b.Controls[0]
 26026  			cc := v_0.Args[0]
 26027  			b.resetWithControl(BlockARM64GT, cc)
 26028  			return true
 26029  		}
 26030  		// match: (NZ (GreaterThanU cc) yes no)
 26031  		// result: (UGT cc yes no)
 26032  		for b.Controls[0].Op == OpARM64GreaterThanU {
 26033  			v_0 := b.Controls[0]
 26034  			cc := v_0.Args[0]
 26035  			b.resetWithControl(BlockARM64UGT, cc)
 26036  			return true
 26037  		}
 26038  		// match: (NZ (GreaterEqual cc) yes no)
 26039  		// result: (GE cc yes no)
 26040  		for b.Controls[0].Op == OpARM64GreaterEqual {
 26041  			v_0 := b.Controls[0]
 26042  			cc := v_0.Args[0]
 26043  			b.resetWithControl(BlockARM64GE, cc)
 26044  			return true
 26045  		}
 26046  		// match: (NZ (GreaterEqualU cc) yes no)
 26047  		// result: (UGE cc yes no)
 26048  		for b.Controls[0].Op == OpARM64GreaterEqualU {
 26049  			v_0 := b.Controls[0]
 26050  			cc := v_0.Args[0]
 26051  			b.resetWithControl(BlockARM64UGE, cc)
 26052  			return true
 26053  		}
 26054  		// match: (NZ (LessThanF cc) yes no)
 26055  		// result: (FLT cc yes no)
 26056  		for b.Controls[0].Op == OpARM64LessThanF {
 26057  			v_0 := b.Controls[0]
 26058  			cc := v_0.Args[0]
 26059  			b.resetWithControl(BlockARM64FLT, cc)
 26060  			return true
 26061  		}
 26062  		// match: (NZ (LessEqualF cc) yes no)
 26063  		// result: (FLE cc yes no)
 26064  		for b.Controls[0].Op == OpARM64LessEqualF {
 26065  			v_0 := b.Controls[0]
 26066  			cc := v_0.Args[0]
 26067  			b.resetWithControl(BlockARM64FLE, cc)
 26068  			return true
 26069  		}
 26070  		// match: (NZ (GreaterThanF cc) yes no)
 26071  		// result: (FGT cc yes no)
 26072  		for b.Controls[0].Op == OpARM64GreaterThanF {
 26073  			v_0 := b.Controls[0]
 26074  			cc := v_0.Args[0]
 26075  			b.resetWithControl(BlockARM64FGT, cc)
 26076  			return true
 26077  		}
 26078  		// match: (NZ (GreaterEqualF cc) yes no)
 26079  		// result: (FGE cc yes no)
 26080  		for b.Controls[0].Op == OpARM64GreaterEqualF {
 26081  			v_0 := b.Controls[0]
 26082  			cc := v_0.Args[0]
 26083  			b.resetWithControl(BlockARM64FGE, cc)
 26084  			return true
 26085  		}
 26086  		// match: (NZ (ANDconst [c] x) yes no)
 26087  		// cond: oneBit(c)
 26088  		// result: (TBNZ [int64(ntz64(c))] x yes no)
 26089  		for b.Controls[0].Op == OpARM64ANDconst {
 26090  			v_0 := b.Controls[0]
 26091  			c := auxIntToInt64(v_0.AuxInt)
 26092  			x := v_0.Args[0]
 26093  			if !(oneBit(c)) {
 26094  				break
 26095  			}
 26096  			b.resetWithControl(BlockARM64TBNZ, x)
 26097  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 26098  			return true
 26099  		}
 26100  		// match: (NZ (MOVDconst [0]) yes no)
 26101  		// result: (First no yes)
 26102  		for b.Controls[0].Op == OpARM64MOVDconst {
 26103  			v_0 := b.Controls[0]
 26104  			if auxIntToInt64(v_0.AuxInt) != 0 {
 26105  				break
 26106  			}
 26107  			b.Reset(BlockFirst)
 26108  			b.swapSuccessors()
 26109  			return true
 26110  		}
 26111  		// match: (NZ (MOVDconst [c]) yes no)
 26112  		// cond: c != 0
 26113  		// result: (First yes no)
 26114  		for b.Controls[0].Op == OpARM64MOVDconst {
 26115  			v_0 := b.Controls[0]
 26116  			c := auxIntToInt64(v_0.AuxInt)
 26117  			if !(c != 0) {
 26118  				break
 26119  			}
 26120  			b.Reset(BlockFirst)
 26121  			return true
 26122  		}
 26123  	case BlockARM64NZW:
 26124  		// match: (NZW (ANDconst [c] x) yes no)
 26125  		// cond: oneBit(int64(uint32(c)))
 26126  		// result: (TBNZ [int64(ntz64(int64(uint32(c))))] x yes no)
 26127  		for b.Controls[0].Op == OpARM64ANDconst {
 26128  			v_0 := b.Controls[0]
 26129  			c := auxIntToInt64(v_0.AuxInt)
 26130  			x := v_0.Args[0]
 26131  			if !(oneBit(int64(uint32(c)))) {
 26132  				break
 26133  			}
 26134  			b.resetWithControl(BlockARM64TBNZ, x)
 26135  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 26136  			return true
 26137  		}
 26138  		// match: (NZW (MOVDconst [c]) yes no)
 26139  		// cond: int32(c) == 0
 26140  		// result: (First no yes)
 26141  		for b.Controls[0].Op == OpARM64MOVDconst {
 26142  			v_0 := b.Controls[0]
 26143  			c := auxIntToInt64(v_0.AuxInt)
 26144  			if !(int32(c) == 0) {
 26145  				break
 26146  			}
 26147  			b.Reset(BlockFirst)
 26148  			b.swapSuccessors()
 26149  			return true
 26150  		}
 26151  		// match: (NZW (MOVDconst [c]) yes no)
 26152  		// cond: int32(c) != 0
 26153  		// result: (First yes no)
 26154  		for b.Controls[0].Op == OpARM64MOVDconst {
 26155  			v_0 := b.Controls[0]
 26156  			c := auxIntToInt64(v_0.AuxInt)
 26157  			if !(int32(c) != 0) {
 26158  				break
 26159  			}
 26160  			b.Reset(BlockFirst)
 26161  			return true
 26162  		}
 26163  	case BlockARM64TBNZ:
 26164  		// match: (TBNZ [0] (Equal cc) yes no)
 26165  		// result: (EQ cc yes no)
 26166  		for b.Controls[0].Op == OpARM64Equal {
 26167  			v_0 := b.Controls[0]
 26168  			cc := v_0.Args[0]
 26169  			if auxIntToInt64(b.AuxInt) != 0 {
 26170  				break
 26171  			}
 26172  			b.resetWithControl(BlockARM64EQ, cc)
 26173  			return true
 26174  		}
 26175  		// match: (TBNZ [0] (NotEqual cc) yes no)
 26176  		// result: (NE cc yes no)
 26177  		for b.Controls[0].Op == OpARM64NotEqual {
 26178  			v_0 := b.Controls[0]
 26179  			cc := v_0.Args[0]
 26180  			if auxIntToInt64(b.AuxInt) != 0 {
 26181  				break
 26182  			}
 26183  			b.resetWithControl(BlockARM64NE, cc)
 26184  			return true
 26185  		}
 26186  		// match: (TBNZ [0] (LessThan cc) yes no)
 26187  		// result: (LT cc yes no)
 26188  		for b.Controls[0].Op == OpARM64LessThan {
 26189  			v_0 := b.Controls[0]
 26190  			cc := v_0.Args[0]
 26191  			if auxIntToInt64(b.AuxInt) != 0 {
 26192  				break
 26193  			}
 26194  			b.resetWithControl(BlockARM64LT, cc)
 26195  			return true
 26196  		}
 26197  		// match: (TBNZ [0] (LessThanU cc) yes no)
 26198  		// result: (ULT cc yes no)
 26199  		for b.Controls[0].Op == OpARM64LessThanU {
 26200  			v_0 := b.Controls[0]
 26201  			cc := v_0.Args[0]
 26202  			if auxIntToInt64(b.AuxInt) != 0 {
 26203  				break
 26204  			}
 26205  			b.resetWithControl(BlockARM64ULT, cc)
 26206  			return true
 26207  		}
 26208  		// match: (TBNZ [0] (LessEqual cc) yes no)
 26209  		// result: (LE cc yes no)
 26210  		for b.Controls[0].Op == OpARM64LessEqual {
 26211  			v_0 := b.Controls[0]
 26212  			cc := v_0.Args[0]
 26213  			if auxIntToInt64(b.AuxInt) != 0 {
 26214  				break
 26215  			}
 26216  			b.resetWithControl(BlockARM64LE, cc)
 26217  			return true
 26218  		}
 26219  		// match: (TBNZ [0] (LessEqualU cc) yes no)
 26220  		// result: (ULE cc yes no)
 26221  		for b.Controls[0].Op == OpARM64LessEqualU {
 26222  			v_0 := b.Controls[0]
 26223  			cc := v_0.Args[0]
 26224  			if auxIntToInt64(b.AuxInt) != 0 {
 26225  				break
 26226  			}
 26227  			b.resetWithControl(BlockARM64ULE, cc)
 26228  			return true
 26229  		}
 26230  		// match: (TBNZ [0] (GreaterThan cc) yes no)
 26231  		// result: (GT cc yes no)
 26232  		for b.Controls[0].Op == OpARM64GreaterThan {
 26233  			v_0 := b.Controls[0]
 26234  			cc := v_0.Args[0]
 26235  			if auxIntToInt64(b.AuxInt) != 0 {
 26236  				break
 26237  			}
 26238  			b.resetWithControl(BlockARM64GT, cc)
 26239  			return true
 26240  		}
 26241  		// match: (TBNZ [0] (GreaterThanU cc) yes no)
 26242  		// result: (UGT cc yes no)
 26243  		for b.Controls[0].Op == OpARM64GreaterThanU {
 26244  			v_0 := b.Controls[0]
 26245  			cc := v_0.Args[0]
 26246  			if auxIntToInt64(b.AuxInt) != 0 {
 26247  				break
 26248  			}
 26249  			b.resetWithControl(BlockARM64UGT, cc)
 26250  			return true
 26251  		}
 26252  		// match: (TBNZ [0] (GreaterEqual cc) yes no)
 26253  		// result: (GE cc yes no)
 26254  		for b.Controls[0].Op == OpARM64GreaterEqual {
 26255  			v_0 := b.Controls[0]
 26256  			cc := v_0.Args[0]
 26257  			if auxIntToInt64(b.AuxInt) != 0 {
 26258  				break
 26259  			}
 26260  			b.resetWithControl(BlockARM64GE, cc)
 26261  			return true
 26262  		}
 26263  		// match: (TBNZ [0] (GreaterEqualU cc) yes no)
 26264  		// result: (UGE cc yes no)
 26265  		for b.Controls[0].Op == OpARM64GreaterEqualU {
 26266  			v_0 := b.Controls[0]
 26267  			cc := v_0.Args[0]
 26268  			if auxIntToInt64(b.AuxInt) != 0 {
 26269  				break
 26270  			}
 26271  			b.resetWithControl(BlockARM64UGE, cc)
 26272  			return true
 26273  		}
 26274  		// match: (TBNZ [0] (LessThanF cc) yes no)
 26275  		// result: (FLT cc yes no)
 26276  		for b.Controls[0].Op == OpARM64LessThanF {
 26277  			v_0 := b.Controls[0]
 26278  			cc := v_0.Args[0]
 26279  			if auxIntToInt64(b.AuxInt) != 0 {
 26280  				break
 26281  			}
 26282  			b.resetWithControl(BlockARM64FLT, cc)
 26283  			return true
 26284  		}
 26285  		// match: (TBNZ [0] (LessEqualF cc) yes no)
 26286  		// result: (FLE cc yes no)
 26287  		for b.Controls[0].Op == OpARM64LessEqualF {
 26288  			v_0 := b.Controls[0]
 26289  			cc := v_0.Args[0]
 26290  			if auxIntToInt64(b.AuxInt) != 0 {
 26291  				break
 26292  			}
 26293  			b.resetWithControl(BlockARM64FLE, cc)
 26294  			return true
 26295  		}
 26296  		// match: (TBNZ [0] (GreaterThanF cc) yes no)
 26297  		// result: (FGT cc yes no)
 26298  		for b.Controls[0].Op == OpARM64GreaterThanF {
 26299  			v_0 := b.Controls[0]
 26300  			cc := v_0.Args[0]
 26301  			if auxIntToInt64(b.AuxInt) != 0 {
 26302  				break
 26303  			}
 26304  			b.resetWithControl(BlockARM64FGT, cc)
 26305  			return true
 26306  		}
 26307  		// match: (TBNZ [0] (GreaterEqualF cc) yes no)
 26308  		// result: (FGE cc yes no)
 26309  		for b.Controls[0].Op == OpARM64GreaterEqualF {
 26310  			v_0 := b.Controls[0]
 26311  			cc := v_0.Args[0]
 26312  			if auxIntToInt64(b.AuxInt) != 0 {
 26313  				break
 26314  			}
 26315  			b.resetWithControl(BlockARM64FGE, cc)
 26316  			return true
 26317  		}
 26318  	case BlockARM64UGE:
 26319  		// match: (UGE (FlagConstant [fc]) yes no)
 26320  		// cond: fc.uge()
 26321  		// result: (First yes no)
 26322  		for b.Controls[0].Op == OpARM64FlagConstant {
 26323  			v_0 := b.Controls[0]
 26324  			fc := auxIntToFlagConstant(v_0.AuxInt)
 26325  			if !(fc.uge()) {
 26326  				break
 26327  			}
 26328  			b.Reset(BlockFirst)
 26329  			return true
 26330  		}
 26331  		// match: (UGE (FlagConstant [fc]) yes no)
 26332  		// cond: !fc.uge()
 26333  		// result: (First no yes)
 26334  		for b.Controls[0].Op == OpARM64FlagConstant {
 26335  			v_0 := b.Controls[0]
 26336  			fc := auxIntToFlagConstant(v_0.AuxInt)
 26337  			if !(!fc.uge()) {
 26338  				break
 26339  			}
 26340  			b.Reset(BlockFirst)
 26341  			b.swapSuccessors()
 26342  			return true
 26343  		}
 26344  		// match: (UGE (InvertFlags cmp) yes no)
 26345  		// result: (ULE cmp yes no)
 26346  		for b.Controls[0].Op == OpARM64InvertFlags {
 26347  			v_0 := b.Controls[0]
 26348  			cmp := v_0.Args[0]
 26349  			b.resetWithControl(BlockARM64ULE, cmp)
 26350  			return true
 26351  		}
 26352  	case BlockARM64UGT:
 26353  		// match: (UGT (FlagConstant [fc]) yes no)
 26354  		// cond: fc.ugt()
 26355  		// result: (First yes no)
 26356  		for b.Controls[0].Op == OpARM64FlagConstant {
 26357  			v_0 := b.Controls[0]
 26358  			fc := auxIntToFlagConstant(v_0.AuxInt)
 26359  			if !(fc.ugt()) {
 26360  				break
 26361  			}
 26362  			b.Reset(BlockFirst)
 26363  			return true
 26364  		}
 26365  		// match: (UGT (FlagConstant [fc]) yes no)
 26366  		// cond: !fc.ugt()
 26367  		// result: (First no yes)
 26368  		for b.Controls[0].Op == OpARM64FlagConstant {
 26369  			v_0 := b.Controls[0]
 26370  			fc := auxIntToFlagConstant(v_0.AuxInt)
 26371  			if !(!fc.ugt()) {
 26372  				break
 26373  			}
 26374  			b.Reset(BlockFirst)
 26375  			b.swapSuccessors()
 26376  			return true
 26377  		}
 26378  		// match: (UGT (InvertFlags cmp) yes no)
 26379  		// result: (ULT cmp yes no)
 26380  		for b.Controls[0].Op == OpARM64InvertFlags {
 26381  			v_0 := b.Controls[0]
 26382  			cmp := v_0.Args[0]
 26383  			b.resetWithControl(BlockARM64ULT, cmp)
 26384  			return true
 26385  		}
 26386  	case BlockARM64ULE:
 26387  		// match: (ULE (FlagConstant [fc]) yes no)
 26388  		// cond: fc.ule()
 26389  		// result: (First yes no)
 26390  		for b.Controls[0].Op == OpARM64FlagConstant {
 26391  			v_0 := b.Controls[0]
 26392  			fc := auxIntToFlagConstant(v_0.AuxInt)
 26393  			if !(fc.ule()) {
 26394  				break
 26395  			}
 26396  			b.Reset(BlockFirst)
 26397  			return true
 26398  		}
 26399  		// match: (ULE (FlagConstant [fc]) yes no)
 26400  		// cond: !fc.ule()
 26401  		// result: (First no yes)
 26402  		for b.Controls[0].Op == OpARM64FlagConstant {
 26403  			v_0 := b.Controls[0]
 26404  			fc := auxIntToFlagConstant(v_0.AuxInt)
 26405  			if !(!fc.ule()) {
 26406  				break
 26407  			}
 26408  			b.Reset(BlockFirst)
 26409  			b.swapSuccessors()
 26410  			return true
 26411  		}
 26412  		// match: (ULE (InvertFlags cmp) yes no)
 26413  		// result: (UGE cmp yes no)
 26414  		for b.Controls[0].Op == OpARM64InvertFlags {
 26415  			v_0 := b.Controls[0]
 26416  			cmp := v_0.Args[0]
 26417  			b.resetWithControl(BlockARM64UGE, cmp)
 26418  			return true
 26419  		}
 26420  	case BlockARM64ULT:
 26421  		// match: (ULT (FlagConstant [fc]) yes no)
 26422  		// cond: fc.ult()
 26423  		// result: (First yes no)
 26424  		for b.Controls[0].Op == OpARM64FlagConstant {
 26425  			v_0 := b.Controls[0]
 26426  			fc := auxIntToFlagConstant(v_0.AuxInt)
 26427  			if !(fc.ult()) {
 26428  				break
 26429  			}
 26430  			b.Reset(BlockFirst)
 26431  			return true
 26432  		}
 26433  		// match: (ULT (FlagConstant [fc]) yes no)
 26434  		// cond: !fc.ult()
 26435  		// result: (First no yes)
 26436  		for b.Controls[0].Op == OpARM64FlagConstant {
 26437  			v_0 := b.Controls[0]
 26438  			fc := auxIntToFlagConstant(v_0.AuxInt)
 26439  			if !(!fc.ult()) {
 26440  				break
 26441  			}
 26442  			b.Reset(BlockFirst)
 26443  			b.swapSuccessors()
 26444  			return true
 26445  		}
 26446  		// match: (ULT (InvertFlags cmp) yes no)
 26447  		// result: (UGT cmp yes no)
 26448  		for b.Controls[0].Op == OpARM64InvertFlags {
 26449  			v_0 := b.Controls[0]
 26450  			cmp := v_0.Args[0]
 26451  			b.resetWithControl(BlockARM64UGT, cmp)
 26452  			return true
 26453  		}
 26454  	case BlockARM64Z:
 26455  		// match: (Z (ANDconst [c] x) yes no)
 26456  		// cond: oneBit(c)
 26457  		// result: (TBZ [int64(ntz64(c))] x yes no)
 26458  		for b.Controls[0].Op == OpARM64ANDconst {
 26459  			v_0 := b.Controls[0]
 26460  			c := auxIntToInt64(v_0.AuxInt)
 26461  			x := v_0.Args[0]
 26462  			if !(oneBit(c)) {
 26463  				break
 26464  			}
 26465  			b.resetWithControl(BlockARM64TBZ, x)
 26466  			b.AuxInt = int64ToAuxInt(int64(ntz64(c)))
 26467  			return true
 26468  		}
 26469  		// match: (Z (MOVDconst [0]) yes no)
 26470  		// result: (First yes no)
 26471  		for b.Controls[0].Op == OpARM64MOVDconst {
 26472  			v_0 := b.Controls[0]
 26473  			if auxIntToInt64(v_0.AuxInt) != 0 {
 26474  				break
 26475  			}
 26476  			b.Reset(BlockFirst)
 26477  			return true
 26478  		}
 26479  		// match: (Z (MOVDconst [c]) yes no)
 26480  		// cond: c != 0
 26481  		// result: (First no yes)
 26482  		for b.Controls[0].Op == OpARM64MOVDconst {
 26483  			v_0 := b.Controls[0]
 26484  			c := auxIntToInt64(v_0.AuxInt)
 26485  			if !(c != 0) {
 26486  				break
 26487  			}
 26488  			b.Reset(BlockFirst)
 26489  			b.swapSuccessors()
 26490  			return true
 26491  		}
 26492  	case BlockARM64ZW:
 26493  		// match: (ZW (ANDconst [c] x) yes no)
 26494  		// cond: oneBit(int64(uint32(c)))
 26495  		// result: (TBZ [int64(ntz64(int64(uint32(c))))] x yes no)
 26496  		for b.Controls[0].Op == OpARM64ANDconst {
 26497  			v_0 := b.Controls[0]
 26498  			c := auxIntToInt64(v_0.AuxInt)
 26499  			x := v_0.Args[0]
 26500  			if !(oneBit(int64(uint32(c)))) {
 26501  				break
 26502  			}
 26503  			b.resetWithControl(BlockARM64TBZ, x)
 26504  			b.AuxInt = int64ToAuxInt(int64(ntz64(int64(uint32(c)))))
 26505  			return true
 26506  		}
 26507  		// match: (ZW (MOVDconst [c]) yes no)
 26508  		// cond: int32(c) == 0
 26509  		// result: (First yes no)
 26510  		for b.Controls[0].Op == OpARM64MOVDconst {
 26511  			v_0 := b.Controls[0]
 26512  			c := auxIntToInt64(v_0.AuxInt)
 26513  			if !(int32(c) == 0) {
 26514  				break
 26515  			}
 26516  			b.Reset(BlockFirst)
 26517  			return true
 26518  		}
 26519  		// match: (ZW (MOVDconst [c]) yes no)
 26520  		// cond: int32(c) != 0
 26521  		// result: (First no yes)
 26522  		for b.Controls[0].Op == OpARM64MOVDconst {
 26523  			v_0 := b.Controls[0]
 26524  			c := auxIntToInt64(v_0.AuxInt)
 26525  			if !(int32(c) != 0) {
 26526  				break
 26527  			}
 26528  			b.Reset(BlockFirst)
 26529  			b.swapSuccessors()
 26530  			return true
 26531  		}
 26532  	}
 26533  	return false
 26534  }
 26535  

View as plain text