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

     1  // Code generated from _gen/PPC64.rules using 'go generate'; DO NOT EDIT.
     2  
     3  package ssa
     4  
     5  import "internal/buildcfg"
     6  import "math"
     7  import "cmd/compile/internal/types"
     8  
     9  func rewriteValuePPC64(v *Value) bool {
    10  	switch v.Op {
    11  	case OpAbs:
    12  		v.Op = OpPPC64FABS
    13  		return true
    14  	case OpAdd16:
    15  		v.Op = OpPPC64ADD
    16  		return true
    17  	case OpAdd32:
    18  		v.Op = OpPPC64ADD
    19  		return true
    20  	case OpAdd32F:
    21  		v.Op = OpPPC64FADDS
    22  		return true
    23  	case OpAdd64:
    24  		v.Op = OpPPC64ADD
    25  		return true
    26  	case OpAdd64F:
    27  		v.Op = OpPPC64FADD
    28  		return true
    29  	case OpAdd8:
    30  		v.Op = OpPPC64ADD
    31  		return true
    32  	case OpAddPtr:
    33  		v.Op = OpPPC64ADD
    34  		return true
    35  	case OpAddr:
    36  		return rewriteValuePPC64_OpAddr(v)
    37  	case OpAnd16:
    38  		v.Op = OpPPC64AND
    39  		return true
    40  	case OpAnd32:
    41  		v.Op = OpPPC64AND
    42  		return true
    43  	case OpAnd64:
    44  		v.Op = OpPPC64AND
    45  		return true
    46  	case OpAnd8:
    47  		v.Op = OpPPC64AND
    48  		return true
    49  	case OpAndB:
    50  		v.Op = OpPPC64AND
    51  		return true
    52  	case OpAtomicAdd32:
    53  		v.Op = OpPPC64LoweredAtomicAdd32
    54  		return true
    55  	case OpAtomicAdd64:
    56  		v.Op = OpPPC64LoweredAtomicAdd64
    57  		return true
    58  	case OpAtomicAnd32:
    59  		v.Op = OpPPC64LoweredAtomicAnd32
    60  		return true
    61  	case OpAtomicAnd8:
    62  		v.Op = OpPPC64LoweredAtomicAnd8
    63  		return true
    64  	case OpAtomicCompareAndSwap32:
    65  		return rewriteValuePPC64_OpAtomicCompareAndSwap32(v)
    66  	case OpAtomicCompareAndSwap64:
    67  		return rewriteValuePPC64_OpAtomicCompareAndSwap64(v)
    68  	case OpAtomicCompareAndSwapRel32:
    69  		return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v)
    70  	case OpAtomicExchange32:
    71  		v.Op = OpPPC64LoweredAtomicExchange32
    72  		return true
    73  	case OpAtomicExchange64:
    74  		v.Op = OpPPC64LoweredAtomicExchange64
    75  		return true
    76  	case OpAtomicExchange8:
    77  		v.Op = OpPPC64LoweredAtomicExchange8
    78  		return true
    79  	case OpAtomicLoad32:
    80  		return rewriteValuePPC64_OpAtomicLoad32(v)
    81  	case OpAtomicLoad64:
    82  		return rewriteValuePPC64_OpAtomicLoad64(v)
    83  	case OpAtomicLoad8:
    84  		return rewriteValuePPC64_OpAtomicLoad8(v)
    85  	case OpAtomicLoadAcq32:
    86  		return rewriteValuePPC64_OpAtomicLoadAcq32(v)
    87  	case OpAtomicLoadAcq64:
    88  		return rewriteValuePPC64_OpAtomicLoadAcq64(v)
    89  	case OpAtomicLoadPtr:
    90  		return rewriteValuePPC64_OpAtomicLoadPtr(v)
    91  	case OpAtomicOr32:
    92  		v.Op = OpPPC64LoweredAtomicOr32
    93  		return true
    94  	case OpAtomicOr8:
    95  		v.Op = OpPPC64LoweredAtomicOr8
    96  		return true
    97  	case OpAtomicStore32:
    98  		return rewriteValuePPC64_OpAtomicStore32(v)
    99  	case OpAtomicStore64:
   100  		return rewriteValuePPC64_OpAtomicStore64(v)
   101  	case OpAtomicStore8:
   102  		return rewriteValuePPC64_OpAtomicStore8(v)
   103  	case OpAtomicStoreRel32:
   104  		return rewriteValuePPC64_OpAtomicStoreRel32(v)
   105  	case OpAtomicStoreRel64:
   106  		return rewriteValuePPC64_OpAtomicStoreRel64(v)
   107  	case OpAvg64u:
   108  		return rewriteValuePPC64_OpAvg64u(v)
   109  	case OpBitLen16:
   110  		return rewriteValuePPC64_OpBitLen16(v)
   111  	case OpBitLen32:
   112  		return rewriteValuePPC64_OpBitLen32(v)
   113  	case OpBitLen64:
   114  		return rewriteValuePPC64_OpBitLen64(v)
   115  	case OpBitLen8:
   116  		return rewriteValuePPC64_OpBitLen8(v)
   117  	case OpBswap16:
   118  		return rewriteValuePPC64_OpBswap16(v)
   119  	case OpBswap32:
   120  		return rewriteValuePPC64_OpBswap32(v)
   121  	case OpBswap64:
   122  		return rewriteValuePPC64_OpBswap64(v)
   123  	case OpCeil:
   124  		v.Op = OpPPC64FCEIL
   125  		return true
   126  	case OpClosureCall:
   127  		v.Op = OpPPC64CALLclosure
   128  		return true
   129  	case OpCom16:
   130  		return rewriteValuePPC64_OpCom16(v)
   131  	case OpCom32:
   132  		return rewriteValuePPC64_OpCom32(v)
   133  	case OpCom64:
   134  		return rewriteValuePPC64_OpCom64(v)
   135  	case OpCom8:
   136  		return rewriteValuePPC64_OpCom8(v)
   137  	case OpCondSelect:
   138  		return rewriteValuePPC64_OpCondSelect(v)
   139  	case OpConst16:
   140  		return rewriteValuePPC64_OpConst16(v)
   141  	case OpConst32:
   142  		return rewriteValuePPC64_OpConst32(v)
   143  	case OpConst32F:
   144  		v.Op = OpPPC64FMOVSconst
   145  		return true
   146  	case OpConst64:
   147  		return rewriteValuePPC64_OpConst64(v)
   148  	case OpConst64F:
   149  		v.Op = OpPPC64FMOVDconst
   150  		return true
   151  	case OpConst8:
   152  		return rewriteValuePPC64_OpConst8(v)
   153  	case OpConstBool:
   154  		return rewriteValuePPC64_OpConstBool(v)
   155  	case OpConstNil:
   156  		return rewriteValuePPC64_OpConstNil(v)
   157  	case OpCopysign:
   158  		return rewriteValuePPC64_OpCopysign(v)
   159  	case OpCtz16:
   160  		return rewriteValuePPC64_OpCtz16(v)
   161  	case OpCtz16NonZero:
   162  		v.Op = OpCtz64
   163  		return true
   164  	case OpCtz32:
   165  		return rewriteValuePPC64_OpCtz32(v)
   166  	case OpCtz32NonZero:
   167  		v.Op = OpCtz64
   168  		return true
   169  	case OpCtz64:
   170  		return rewriteValuePPC64_OpCtz64(v)
   171  	case OpCtz64NonZero:
   172  		v.Op = OpCtz64
   173  		return true
   174  	case OpCtz8:
   175  		return rewriteValuePPC64_OpCtz8(v)
   176  	case OpCtz8NonZero:
   177  		v.Op = OpCtz64
   178  		return true
   179  	case OpCvt32Fto32:
   180  		return rewriteValuePPC64_OpCvt32Fto32(v)
   181  	case OpCvt32Fto64:
   182  		return rewriteValuePPC64_OpCvt32Fto64(v)
   183  	case OpCvt32Fto64F:
   184  		v.Op = OpCopy
   185  		return true
   186  	case OpCvt32to32F:
   187  		return rewriteValuePPC64_OpCvt32to32F(v)
   188  	case OpCvt32to64F:
   189  		return rewriteValuePPC64_OpCvt32to64F(v)
   190  	case OpCvt64Fto32:
   191  		return rewriteValuePPC64_OpCvt64Fto32(v)
   192  	case OpCvt64Fto32F:
   193  		v.Op = OpPPC64FRSP
   194  		return true
   195  	case OpCvt64Fto64:
   196  		return rewriteValuePPC64_OpCvt64Fto64(v)
   197  	case OpCvt64to32F:
   198  		return rewriteValuePPC64_OpCvt64to32F(v)
   199  	case OpCvt64to64F:
   200  		return rewriteValuePPC64_OpCvt64to64F(v)
   201  	case OpCvtBoolToUint8:
   202  		v.Op = OpCopy
   203  		return true
   204  	case OpDiv16:
   205  		return rewriteValuePPC64_OpDiv16(v)
   206  	case OpDiv16u:
   207  		return rewriteValuePPC64_OpDiv16u(v)
   208  	case OpDiv32:
   209  		return rewriteValuePPC64_OpDiv32(v)
   210  	case OpDiv32F:
   211  		v.Op = OpPPC64FDIVS
   212  		return true
   213  	case OpDiv32u:
   214  		v.Op = OpPPC64DIVWU
   215  		return true
   216  	case OpDiv64:
   217  		return rewriteValuePPC64_OpDiv64(v)
   218  	case OpDiv64F:
   219  		v.Op = OpPPC64FDIV
   220  		return true
   221  	case OpDiv64u:
   222  		v.Op = OpPPC64DIVDU
   223  		return true
   224  	case OpDiv8:
   225  		return rewriteValuePPC64_OpDiv8(v)
   226  	case OpDiv8u:
   227  		return rewriteValuePPC64_OpDiv8u(v)
   228  	case OpEq16:
   229  		return rewriteValuePPC64_OpEq16(v)
   230  	case OpEq32:
   231  		return rewriteValuePPC64_OpEq32(v)
   232  	case OpEq32F:
   233  		return rewriteValuePPC64_OpEq32F(v)
   234  	case OpEq64:
   235  		return rewriteValuePPC64_OpEq64(v)
   236  	case OpEq64F:
   237  		return rewriteValuePPC64_OpEq64F(v)
   238  	case OpEq8:
   239  		return rewriteValuePPC64_OpEq8(v)
   240  	case OpEqB:
   241  		return rewriteValuePPC64_OpEqB(v)
   242  	case OpEqPtr:
   243  		return rewriteValuePPC64_OpEqPtr(v)
   244  	case OpFMA:
   245  		v.Op = OpPPC64FMADD
   246  		return true
   247  	case OpFloor:
   248  		v.Op = OpPPC64FFLOOR
   249  		return true
   250  	case OpGetCallerPC:
   251  		v.Op = OpPPC64LoweredGetCallerPC
   252  		return true
   253  	case OpGetCallerSP:
   254  		v.Op = OpPPC64LoweredGetCallerSP
   255  		return true
   256  	case OpGetClosurePtr:
   257  		v.Op = OpPPC64LoweredGetClosurePtr
   258  		return true
   259  	case OpHmul32:
   260  		v.Op = OpPPC64MULHW
   261  		return true
   262  	case OpHmul32u:
   263  		v.Op = OpPPC64MULHWU
   264  		return true
   265  	case OpHmul64:
   266  		v.Op = OpPPC64MULHD
   267  		return true
   268  	case OpHmul64u:
   269  		v.Op = OpPPC64MULHDU
   270  		return true
   271  	case OpInterCall:
   272  		v.Op = OpPPC64CALLinter
   273  		return true
   274  	case OpIsInBounds:
   275  		return rewriteValuePPC64_OpIsInBounds(v)
   276  	case OpIsNonNil:
   277  		return rewriteValuePPC64_OpIsNonNil(v)
   278  	case OpIsSliceInBounds:
   279  		return rewriteValuePPC64_OpIsSliceInBounds(v)
   280  	case OpLeq16:
   281  		return rewriteValuePPC64_OpLeq16(v)
   282  	case OpLeq16U:
   283  		return rewriteValuePPC64_OpLeq16U(v)
   284  	case OpLeq32:
   285  		return rewriteValuePPC64_OpLeq32(v)
   286  	case OpLeq32F:
   287  		return rewriteValuePPC64_OpLeq32F(v)
   288  	case OpLeq32U:
   289  		return rewriteValuePPC64_OpLeq32U(v)
   290  	case OpLeq64:
   291  		return rewriteValuePPC64_OpLeq64(v)
   292  	case OpLeq64F:
   293  		return rewriteValuePPC64_OpLeq64F(v)
   294  	case OpLeq64U:
   295  		return rewriteValuePPC64_OpLeq64U(v)
   296  	case OpLeq8:
   297  		return rewriteValuePPC64_OpLeq8(v)
   298  	case OpLeq8U:
   299  		return rewriteValuePPC64_OpLeq8U(v)
   300  	case OpLess16:
   301  		return rewriteValuePPC64_OpLess16(v)
   302  	case OpLess16U:
   303  		return rewriteValuePPC64_OpLess16U(v)
   304  	case OpLess32:
   305  		return rewriteValuePPC64_OpLess32(v)
   306  	case OpLess32F:
   307  		return rewriteValuePPC64_OpLess32F(v)
   308  	case OpLess32U:
   309  		return rewriteValuePPC64_OpLess32U(v)
   310  	case OpLess64:
   311  		return rewriteValuePPC64_OpLess64(v)
   312  	case OpLess64F:
   313  		return rewriteValuePPC64_OpLess64F(v)
   314  	case OpLess64U:
   315  		return rewriteValuePPC64_OpLess64U(v)
   316  	case OpLess8:
   317  		return rewriteValuePPC64_OpLess8(v)
   318  	case OpLess8U:
   319  		return rewriteValuePPC64_OpLess8U(v)
   320  	case OpLoad:
   321  		return rewriteValuePPC64_OpLoad(v)
   322  	case OpLocalAddr:
   323  		return rewriteValuePPC64_OpLocalAddr(v)
   324  	case OpLsh16x16:
   325  		return rewriteValuePPC64_OpLsh16x16(v)
   326  	case OpLsh16x32:
   327  		return rewriteValuePPC64_OpLsh16x32(v)
   328  	case OpLsh16x64:
   329  		return rewriteValuePPC64_OpLsh16x64(v)
   330  	case OpLsh16x8:
   331  		return rewriteValuePPC64_OpLsh16x8(v)
   332  	case OpLsh32x16:
   333  		return rewriteValuePPC64_OpLsh32x16(v)
   334  	case OpLsh32x32:
   335  		return rewriteValuePPC64_OpLsh32x32(v)
   336  	case OpLsh32x64:
   337  		return rewriteValuePPC64_OpLsh32x64(v)
   338  	case OpLsh32x8:
   339  		return rewriteValuePPC64_OpLsh32x8(v)
   340  	case OpLsh64x16:
   341  		return rewriteValuePPC64_OpLsh64x16(v)
   342  	case OpLsh64x32:
   343  		return rewriteValuePPC64_OpLsh64x32(v)
   344  	case OpLsh64x64:
   345  		return rewriteValuePPC64_OpLsh64x64(v)
   346  	case OpLsh64x8:
   347  		return rewriteValuePPC64_OpLsh64x8(v)
   348  	case OpLsh8x16:
   349  		return rewriteValuePPC64_OpLsh8x16(v)
   350  	case OpLsh8x32:
   351  		return rewriteValuePPC64_OpLsh8x32(v)
   352  	case OpLsh8x64:
   353  		return rewriteValuePPC64_OpLsh8x64(v)
   354  	case OpLsh8x8:
   355  		return rewriteValuePPC64_OpLsh8x8(v)
   356  	case OpMax32F:
   357  		return rewriteValuePPC64_OpMax32F(v)
   358  	case OpMax64F:
   359  		return rewriteValuePPC64_OpMax64F(v)
   360  	case OpMin32F:
   361  		return rewriteValuePPC64_OpMin32F(v)
   362  	case OpMin64F:
   363  		return rewriteValuePPC64_OpMin64F(v)
   364  	case OpMod16:
   365  		return rewriteValuePPC64_OpMod16(v)
   366  	case OpMod16u:
   367  		return rewriteValuePPC64_OpMod16u(v)
   368  	case OpMod32:
   369  		return rewriteValuePPC64_OpMod32(v)
   370  	case OpMod32u:
   371  		return rewriteValuePPC64_OpMod32u(v)
   372  	case OpMod64:
   373  		return rewriteValuePPC64_OpMod64(v)
   374  	case OpMod64u:
   375  		return rewriteValuePPC64_OpMod64u(v)
   376  	case OpMod8:
   377  		return rewriteValuePPC64_OpMod8(v)
   378  	case OpMod8u:
   379  		return rewriteValuePPC64_OpMod8u(v)
   380  	case OpMove:
   381  		return rewriteValuePPC64_OpMove(v)
   382  	case OpMul16:
   383  		v.Op = OpPPC64MULLW
   384  		return true
   385  	case OpMul32:
   386  		v.Op = OpPPC64MULLW
   387  		return true
   388  	case OpMul32F:
   389  		v.Op = OpPPC64FMULS
   390  		return true
   391  	case OpMul64:
   392  		v.Op = OpPPC64MULLD
   393  		return true
   394  	case OpMul64F:
   395  		v.Op = OpPPC64FMUL
   396  		return true
   397  	case OpMul8:
   398  		v.Op = OpPPC64MULLW
   399  		return true
   400  	case OpNeg16:
   401  		v.Op = OpPPC64NEG
   402  		return true
   403  	case OpNeg32:
   404  		v.Op = OpPPC64NEG
   405  		return true
   406  	case OpNeg32F:
   407  		v.Op = OpPPC64FNEG
   408  		return true
   409  	case OpNeg64:
   410  		v.Op = OpPPC64NEG
   411  		return true
   412  	case OpNeg64F:
   413  		v.Op = OpPPC64FNEG
   414  		return true
   415  	case OpNeg8:
   416  		v.Op = OpPPC64NEG
   417  		return true
   418  	case OpNeq16:
   419  		return rewriteValuePPC64_OpNeq16(v)
   420  	case OpNeq32:
   421  		return rewriteValuePPC64_OpNeq32(v)
   422  	case OpNeq32F:
   423  		return rewriteValuePPC64_OpNeq32F(v)
   424  	case OpNeq64:
   425  		return rewriteValuePPC64_OpNeq64(v)
   426  	case OpNeq64F:
   427  		return rewriteValuePPC64_OpNeq64F(v)
   428  	case OpNeq8:
   429  		return rewriteValuePPC64_OpNeq8(v)
   430  	case OpNeqB:
   431  		v.Op = OpPPC64XOR
   432  		return true
   433  	case OpNeqPtr:
   434  		return rewriteValuePPC64_OpNeqPtr(v)
   435  	case OpNilCheck:
   436  		v.Op = OpPPC64LoweredNilCheck
   437  		return true
   438  	case OpNot:
   439  		return rewriteValuePPC64_OpNot(v)
   440  	case OpOffPtr:
   441  		return rewriteValuePPC64_OpOffPtr(v)
   442  	case OpOr16:
   443  		v.Op = OpPPC64OR
   444  		return true
   445  	case OpOr32:
   446  		v.Op = OpPPC64OR
   447  		return true
   448  	case OpOr64:
   449  		v.Op = OpPPC64OR
   450  		return true
   451  	case OpOr8:
   452  		v.Op = OpPPC64OR
   453  		return true
   454  	case OpOrB:
   455  		v.Op = OpPPC64OR
   456  		return true
   457  	case OpPPC64ADD:
   458  		return rewriteValuePPC64_OpPPC64ADD(v)
   459  	case OpPPC64ADDC:
   460  		return rewriteValuePPC64_OpPPC64ADDC(v)
   461  	case OpPPC64ADDE:
   462  		return rewriteValuePPC64_OpPPC64ADDE(v)
   463  	case OpPPC64ADDconst:
   464  		return rewriteValuePPC64_OpPPC64ADDconst(v)
   465  	case OpPPC64AND:
   466  		return rewriteValuePPC64_OpPPC64AND(v)
   467  	case OpPPC64ANDN:
   468  		return rewriteValuePPC64_OpPPC64ANDN(v)
   469  	case OpPPC64ANDconst:
   470  		return rewriteValuePPC64_OpPPC64ANDconst(v)
   471  	case OpPPC64BRD:
   472  		return rewriteValuePPC64_OpPPC64BRD(v)
   473  	case OpPPC64BRH:
   474  		return rewriteValuePPC64_OpPPC64BRH(v)
   475  	case OpPPC64BRW:
   476  		return rewriteValuePPC64_OpPPC64BRW(v)
   477  	case OpPPC64CLRLSLDI:
   478  		return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
   479  	case OpPPC64CMP:
   480  		return rewriteValuePPC64_OpPPC64CMP(v)
   481  	case OpPPC64CMPU:
   482  		return rewriteValuePPC64_OpPPC64CMPU(v)
   483  	case OpPPC64CMPUconst:
   484  		return rewriteValuePPC64_OpPPC64CMPUconst(v)
   485  	case OpPPC64CMPW:
   486  		return rewriteValuePPC64_OpPPC64CMPW(v)
   487  	case OpPPC64CMPWU:
   488  		return rewriteValuePPC64_OpPPC64CMPWU(v)
   489  	case OpPPC64CMPWUconst:
   490  		return rewriteValuePPC64_OpPPC64CMPWUconst(v)
   491  	case OpPPC64CMPWconst:
   492  		return rewriteValuePPC64_OpPPC64CMPWconst(v)
   493  	case OpPPC64CMPconst:
   494  		return rewriteValuePPC64_OpPPC64CMPconst(v)
   495  	case OpPPC64Equal:
   496  		return rewriteValuePPC64_OpPPC64Equal(v)
   497  	case OpPPC64FABS:
   498  		return rewriteValuePPC64_OpPPC64FABS(v)
   499  	case OpPPC64FADD:
   500  		return rewriteValuePPC64_OpPPC64FADD(v)
   501  	case OpPPC64FADDS:
   502  		return rewriteValuePPC64_OpPPC64FADDS(v)
   503  	case OpPPC64FCEIL:
   504  		return rewriteValuePPC64_OpPPC64FCEIL(v)
   505  	case OpPPC64FFLOOR:
   506  		return rewriteValuePPC64_OpPPC64FFLOOR(v)
   507  	case OpPPC64FGreaterEqual:
   508  		return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
   509  	case OpPPC64FGreaterThan:
   510  		return rewriteValuePPC64_OpPPC64FGreaterThan(v)
   511  	case OpPPC64FLessEqual:
   512  		return rewriteValuePPC64_OpPPC64FLessEqual(v)
   513  	case OpPPC64FLessThan:
   514  		return rewriteValuePPC64_OpPPC64FLessThan(v)
   515  	case OpPPC64FMOVDload:
   516  		return rewriteValuePPC64_OpPPC64FMOVDload(v)
   517  	case OpPPC64FMOVDstore:
   518  		return rewriteValuePPC64_OpPPC64FMOVDstore(v)
   519  	case OpPPC64FMOVSload:
   520  		return rewriteValuePPC64_OpPPC64FMOVSload(v)
   521  	case OpPPC64FMOVSstore:
   522  		return rewriteValuePPC64_OpPPC64FMOVSstore(v)
   523  	case OpPPC64FNEG:
   524  		return rewriteValuePPC64_OpPPC64FNEG(v)
   525  	case OpPPC64FSQRT:
   526  		return rewriteValuePPC64_OpPPC64FSQRT(v)
   527  	case OpPPC64FSUB:
   528  		return rewriteValuePPC64_OpPPC64FSUB(v)
   529  	case OpPPC64FSUBS:
   530  		return rewriteValuePPC64_OpPPC64FSUBS(v)
   531  	case OpPPC64FTRUNC:
   532  		return rewriteValuePPC64_OpPPC64FTRUNC(v)
   533  	case OpPPC64GreaterEqual:
   534  		return rewriteValuePPC64_OpPPC64GreaterEqual(v)
   535  	case OpPPC64GreaterThan:
   536  		return rewriteValuePPC64_OpPPC64GreaterThan(v)
   537  	case OpPPC64ISEL:
   538  		return rewriteValuePPC64_OpPPC64ISEL(v)
   539  	case OpPPC64LessEqual:
   540  		return rewriteValuePPC64_OpPPC64LessEqual(v)
   541  	case OpPPC64LessThan:
   542  		return rewriteValuePPC64_OpPPC64LessThan(v)
   543  	case OpPPC64LoweredPanicBoundsCR:
   544  		return rewriteValuePPC64_OpPPC64LoweredPanicBoundsCR(v)
   545  	case OpPPC64LoweredPanicBoundsRC:
   546  		return rewriteValuePPC64_OpPPC64LoweredPanicBoundsRC(v)
   547  	case OpPPC64LoweredPanicBoundsRR:
   548  		return rewriteValuePPC64_OpPPC64LoweredPanicBoundsRR(v)
   549  	case OpPPC64MFVSRD:
   550  		return rewriteValuePPC64_OpPPC64MFVSRD(v)
   551  	case OpPPC64MOVBZload:
   552  		return rewriteValuePPC64_OpPPC64MOVBZload(v)
   553  	case OpPPC64MOVBZloadidx:
   554  		return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
   555  	case OpPPC64MOVBZreg:
   556  		return rewriteValuePPC64_OpPPC64MOVBZreg(v)
   557  	case OpPPC64MOVBreg:
   558  		return rewriteValuePPC64_OpPPC64MOVBreg(v)
   559  	case OpPPC64MOVBstore:
   560  		return rewriteValuePPC64_OpPPC64MOVBstore(v)
   561  	case OpPPC64MOVBstoreidx:
   562  		return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
   563  	case OpPPC64MOVBstorezero:
   564  		return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
   565  	case OpPPC64MOVDaddr:
   566  		return rewriteValuePPC64_OpPPC64MOVDaddr(v)
   567  	case OpPPC64MOVDload:
   568  		return rewriteValuePPC64_OpPPC64MOVDload(v)
   569  	case OpPPC64MOVDloadidx:
   570  		return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
   571  	case OpPPC64MOVDstore:
   572  		return rewriteValuePPC64_OpPPC64MOVDstore(v)
   573  	case OpPPC64MOVDstoreidx:
   574  		return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
   575  	case OpPPC64MOVDstorezero:
   576  		return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
   577  	case OpPPC64MOVHBRstore:
   578  		return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
   579  	case OpPPC64MOVHZload:
   580  		return rewriteValuePPC64_OpPPC64MOVHZload(v)
   581  	case OpPPC64MOVHZloadidx:
   582  		return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
   583  	case OpPPC64MOVHZreg:
   584  		return rewriteValuePPC64_OpPPC64MOVHZreg(v)
   585  	case OpPPC64MOVHload:
   586  		return rewriteValuePPC64_OpPPC64MOVHload(v)
   587  	case OpPPC64MOVHloadidx:
   588  		return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
   589  	case OpPPC64MOVHreg:
   590  		return rewriteValuePPC64_OpPPC64MOVHreg(v)
   591  	case OpPPC64MOVHstore:
   592  		return rewriteValuePPC64_OpPPC64MOVHstore(v)
   593  	case OpPPC64MOVHstoreidx:
   594  		return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
   595  	case OpPPC64MOVHstorezero:
   596  		return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
   597  	case OpPPC64MOVWBRstore:
   598  		return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
   599  	case OpPPC64MOVWZload:
   600  		return rewriteValuePPC64_OpPPC64MOVWZload(v)
   601  	case OpPPC64MOVWZloadidx:
   602  		return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
   603  	case OpPPC64MOVWZreg:
   604  		return rewriteValuePPC64_OpPPC64MOVWZreg(v)
   605  	case OpPPC64MOVWload:
   606  		return rewriteValuePPC64_OpPPC64MOVWload(v)
   607  	case OpPPC64MOVWloadidx:
   608  		return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
   609  	case OpPPC64MOVWreg:
   610  		return rewriteValuePPC64_OpPPC64MOVWreg(v)
   611  	case OpPPC64MOVWstore:
   612  		return rewriteValuePPC64_OpPPC64MOVWstore(v)
   613  	case OpPPC64MOVWstoreidx:
   614  		return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
   615  	case OpPPC64MOVWstorezero:
   616  		return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
   617  	case OpPPC64MTVSRD:
   618  		return rewriteValuePPC64_OpPPC64MTVSRD(v)
   619  	case OpPPC64MULLD:
   620  		return rewriteValuePPC64_OpPPC64MULLD(v)
   621  	case OpPPC64MULLW:
   622  		return rewriteValuePPC64_OpPPC64MULLW(v)
   623  	case OpPPC64NEG:
   624  		return rewriteValuePPC64_OpPPC64NEG(v)
   625  	case OpPPC64NOR:
   626  		return rewriteValuePPC64_OpPPC64NOR(v)
   627  	case OpPPC64NotEqual:
   628  		return rewriteValuePPC64_OpPPC64NotEqual(v)
   629  	case OpPPC64OR:
   630  		return rewriteValuePPC64_OpPPC64OR(v)
   631  	case OpPPC64ORN:
   632  		return rewriteValuePPC64_OpPPC64ORN(v)
   633  	case OpPPC64ORconst:
   634  		return rewriteValuePPC64_OpPPC64ORconst(v)
   635  	case OpPPC64RLWINM:
   636  		return rewriteValuePPC64_OpPPC64RLWINM(v)
   637  	case OpPPC64ROTL:
   638  		return rewriteValuePPC64_OpPPC64ROTL(v)
   639  	case OpPPC64ROTLW:
   640  		return rewriteValuePPC64_OpPPC64ROTLW(v)
   641  	case OpPPC64ROTLWconst:
   642  		return rewriteValuePPC64_OpPPC64ROTLWconst(v)
   643  	case OpPPC64SETBC:
   644  		return rewriteValuePPC64_OpPPC64SETBC(v)
   645  	case OpPPC64SETBCR:
   646  		return rewriteValuePPC64_OpPPC64SETBCR(v)
   647  	case OpPPC64SLD:
   648  		return rewriteValuePPC64_OpPPC64SLD(v)
   649  	case OpPPC64SLDconst:
   650  		return rewriteValuePPC64_OpPPC64SLDconst(v)
   651  	case OpPPC64SLW:
   652  		return rewriteValuePPC64_OpPPC64SLW(v)
   653  	case OpPPC64SLWconst:
   654  		return rewriteValuePPC64_OpPPC64SLWconst(v)
   655  	case OpPPC64SRAD:
   656  		return rewriteValuePPC64_OpPPC64SRAD(v)
   657  	case OpPPC64SRAW:
   658  		return rewriteValuePPC64_OpPPC64SRAW(v)
   659  	case OpPPC64SRD:
   660  		return rewriteValuePPC64_OpPPC64SRD(v)
   661  	case OpPPC64SRW:
   662  		return rewriteValuePPC64_OpPPC64SRW(v)
   663  	case OpPPC64SRWconst:
   664  		return rewriteValuePPC64_OpPPC64SRWconst(v)
   665  	case OpPPC64SUB:
   666  		return rewriteValuePPC64_OpPPC64SUB(v)
   667  	case OpPPC64SUBE:
   668  		return rewriteValuePPC64_OpPPC64SUBE(v)
   669  	case OpPPC64SUBFCconst:
   670  		return rewriteValuePPC64_OpPPC64SUBFCconst(v)
   671  	case OpPPC64XOR:
   672  		return rewriteValuePPC64_OpPPC64XOR(v)
   673  	case OpPPC64XORconst:
   674  		return rewriteValuePPC64_OpPPC64XORconst(v)
   675  	case OpPanicBounds:
   676  		v.Op = OpPPC64LoweredPanicBoundsRR
   677  		return true
   678  	case OpPopCount16:
   679  		return rewriteValuePPC64_OpPopCount16(v)
   680  	case OpPopCount32:
   681  		return rewriteValuePPC64_OpPopCount32(v)
   682  	case OpPopCount64:
   683  		v.Op = OpPPC64POPCNTD
   684  		return true
   685  	case OpPopCount8:
   686  		return rewriteValuePPC64_OpPopCount8(v)
   687  	case OpPrefetchCache:
   688  		return rewriteValuePPC64_OpPrefetchCache(v)
   689  	case OpPrefetchCacheStreamed:
   690  		return rewriteValuePPC64_OpPrefetchCacheStreamed(v)
   691  	case OpPubBarrier:
   692  		v.Op = OpPPC64LoweredPubBarrier
   693  		return true
   694  	case OpRotateLeft16:
   695  		return rewriteValuePPC64_OpRotateLeft16(v)
   696  	case OpRotateLeft32:
   697  		v.Op = OpPPC64ROTLW
   698  		return true
   699  	case OpRotateLeft64:
   700  		v.Op = OpPPC64ROTL
   701  		return true
   702  	case OpRotateLeft8:
   703  		return rewriteValuePPC64_OpRotateLeft8(v)
   704  	case OpRound:
   705  		v.Op = OpPPC64FROUND
   706  		return true
   707  	case OpRound32F:
   708  		v.Op = OpPPC64LoweredRound32F
   709  		return true
   710  	case OpRound64F:
   711  		v.Op = OpPPC64LoweredRound64F
   712  		return true
   713  	case OpRsh16Ux16:
   714  		return rewriteValuePPC64_OpRsh16Ux16(v)
   715  	case OpRsh16Ux32:
   716  		return rewriteValuePPC64_OpRsh16Ux32(v)
   717  	case OpRsh16Ux64:
   718  		return rewriteValuePPC64_OpRsh16Ux64(v)
   719  	case OpRsh16Ux8:
   720  		return rewriteValuePPC64_OpRsh16Ux8(v)
   721  	case OpRsh16x16:
   722  		return rewriteValuePPC64_OpRsh16x16(v)
   723  	case OpRsh16x32:
   724  		return rewriteValuePPC64_OpRsh16x32(v)
   725  	case OpRsh16x64:
   726  		return rewriteValuePPC64_OpRsh16x64(v)
   727  	case OpRsh16x8:
   728  		return rewriteValuePPC64_OpRsh16x8(v)
   729  	case OpRsh32Ux16:
   730  		return rewriteValuePPC64_OpRsh32Ux16(v)
   731  	case OpRsh32Ux32:
   732  		return rewriteValuePPC64_OpRsh32Ux32(v)
   733  	case OpRsh32Ux64:
   734  		return rewriteValuePPC64_OpRsh32Ux64(v)
   735  	case OpRsh32Ux8:
   736  		return rewriteValuePPC64_OpRsh32Ux8(v)
   737  	case OpRsh32x16:
   738  		return rewriteValuePPC64_OpRsh32x16(v)
   739  	case OpRsh32x32:
   740  		return rewriteValuePPC64_OpRsh32x32(v)
   741  	case OpRsh32x64:
   742  		return rewriteValuePPC64_OpRsh32x64(v)
   743  	case OpRsh32x8:
   744  		return rewriteValuePPC64_OpRsh32x8(v)
   745  	case OpRsh64Ux16:
   746  		return rewriteValuePPC64_OpRsh64Ux16(v)
   747  	case OpRsh64Ux32:
   748  		return rewriteValuePPC64_OpRsh64Ux32(v)
   749  	case OpRsh64Ux64:
   750  		return rewriteValuePPC64_OpRsh64Ux64(v)
   751  	case OpRsh64Ux8:
   752  		return rewriteValuePPC64_OpRsh64Ux8(v)
   753  	case OpRsh64x16:
   754  		return rewriteValuePPC64_OpRsh64x16(v)
   755  	case OpRsh64x32:
   756  		return rewriteValuePPC64_OpRsh64x32(v)
   757  	case OpRsh64x64:
   758  		return rewriteValuePPC64_OpRsh64x64(v)
   759  	case OpRsh64x8:
   760  		return rewriteValuePPC64_OpRsh64x8(v)
   761  	case OpRsh8Ux16:
   762  		return rewriteValuePPC64_OpRsh8Ux16(v)
   763  	case OpRsh8Ux32:
   764  		return rewriteValuePPC64_OpRsh8Ux32(v)
   765  	case OpRsh8Ux64:
   766  		return rewriteValuePPC64_OpRsh8Ux64(v)
   767  	case OpRsh8Ux8:
   768  		return rewriteValuePPC64_OpRsh8Ux8(v)
   769  	case OpRsh8x16:
   770  		return rewriteValuePPC64_OpRsh8x16(v)
   771  	case OpRsh8x32:
   772  		return rewriteValuePPC64_OpRsh8x32(v)
   773  	case OpRsh8x64:
   774  		return rewriteValuePPC64_OpRsh8x64(v)
   775  	case OpRsh8x8:
   776  		return rewriteValuePPC64_OpRsh8x8(v)
   777  	case OpSelect0:
   778  		return rewriteValuePPC64_OpSelect0(v)
   779  	case OpSelect1:
   780  		return rewriteValuePPC64_OpSelect1(v)
   781  	case OpSelectN:
   782  		return rewriteValuePPC64_OpSelectN(v)
   783  	case OpSignExt16to32:
   784  		v.Op = OpPPC64MOVHreg
   785  		return true
   786  	case OpSignExt16to64:
   787  		v.Op = OpPPC64MOVHreg
   788  		return true
   789  	case OpSignExt32to64:
   790  		v.Op = OpPPC64MOVWreg
   791  		return true
   792  	case OpSignExt8to16:
   793  		v.Op = OpPPC64MOVBreg
   794  		return true
   795  	case OpSignExt8to32:
   796  		v.Op = OpPPC64MOVBreg
   797  		return true
   798  	case OpSignExt8to64:
   799  		v.Op = OpPPC64MOVBreg
   800  		return true
   801  	case OpSlicemask:
   802  		return rewriteValuePPC64_OpSlicemask(v)
   803  	case OpSqrt:
   804  		v.Op = OpPPC64FSQRT
   805  		return true
   806  	case OpSqrt32:
   807  		v.Op = OpPPC64FSQRTS
   808  		return true
   809  	case OpStaticCall:
   810  		v.Op = OpPPC64CALLstatic
   811  		return true
   812  	case OpStore:
   813  		return rewriteValuePPC64_OpStore(v)
   814  	case OpSub16:
   815  		v.Op = OpPPC64SUB
   816  		return true
   817  	case OpSub32:
   818  		v.Op = OpPPC64SUB
   819  		return true
   820  	case OpSub32F:
   821  		v.Op = OpPPC64FSUBS
   822  		return true
   823  	case OpSub64:
   824  		v.Op = OpPPC64SUB
   825  		return true
   826  	case OpSub64F:
   827  		v.Op = OpPPC64FSUB
   828  		return true
   829  	case OpSub8:
   830  		v.Op = OpPPC64SUB
   831  		return true
   832  	case OpSubPtr:
   833  		v.Op = OpPPC64SUB
   834  		return true
   835  	case OpTailCall:
   836  		v.Op = OpPPC64CALLtail
   837  		return true
   838  	case OpTrunc:
   839  		v.Op = OpPPC64FTRUNC
   840  		return true
   841  	case OpTrunc16to8:
   842  		return rewriteValuePPC64_OpTrunc16to8(v)
   843  	case OpTrunc32to16:
   844  		return rewriteValuePPC64_OpTrunc32to16(v)
   845  	case OpTrunc32to8:
   846  		return rewriteValuePPC64_OpTrunc32to8(v)
   847  	case OpTrunc64to16:
   848  		return rewriteValuePPC64_OpTrunc64to16(v)
   849  	case OpTrunc64to32:
   850  		return rewriteValuePPC64_OpTrunc64to32(v)
   851  	case OpTrunc64to8:
   852  		return rewriteValuePPC64_OpTrunc64to8(v)
   853  	case OpWB:
   854  		v.Op = OpPPC64LoweredWB
   855  		return true
   856  	case OpXor16:
   857  		v.Op = OpPPC64XOR
   858  		return true
   859  	case OpXor32:
   860  		v.Op = OpPPC64XOR
   861  		return true
   862  	case OpXor64:
   863  		v.Op = OpPPC64XOR
   864  		return true
   865  	case OpXor8:
   866  		v.Op = OpPPC64XOR
   867  		return true
   868  	case OpZero:
   869  		return rewriteValuePPC64_OpZero(v)
   870  	case OpZeroExt16to32:
   871  		v.Op = OpPPC64MOVHZreg
   872  		return true
   873  	case OpZeroExt16to64:
   874  		v.Op = OpPPC64MOVHZreg
   875  		return true
   876  	case OpZeroExt32to64:
   877  		v.Op = OpPPC64MOVWZreg
   878  		return true
   879  	case OpZeroExt8to16:
   880  		v.Op = OpPPC64MOVBZreg
   881  		return true
   882  	case OpZeroExt8to32:
   883  		v.Op = OpPPC64MOVBZreg
   884  		return true
   885  	case OpZeroExt8to64:
   886  		v.Op = OpPPC64MOVBZreg
   887  		return true
   888  	}
   889  	return false
   890  }
   891  func rewriteValuePPC64_OpAddr(v *Value) bool {
   892  	v_0 := v.Args[0]
   893  	// match: (Addr {sym} base)
   894  	// result: (MOVDaddr {sym} [0] base)
   895  	for {
   896  		sym := auxToSym(v.Aux)
   897  		base := v_0
   898  		v.reset(OpPPC64MOVDaddr)
   899  		v.AuxInt = int32ToAuxInt(0)
   900  		v.Aux = symToAux(sym)
   901  		v.AddArg(base)
   902  		return true
   903  	}
   904  }
   905  func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
   906  	v_3 := v.Args[3]
   907  	v_2 := v.Args[2]
   908  	v_1 := v.Args[1]
   909  	v_0 := v.Args[0]
   910  	// match: (AtomicCompareAndSwap32 ptr old new_ mem)
   911  	// result: (LoweredAtomicCas32 [1] ptr old new_ mem)
   912  	for {
   913  		ptr := v_0
   914  		old := v_1
   915  		new_ := v_2
   916  		mem := v_3
   917  		v.reset(OpPPC64LoweredAtomicCas32)
   918  		v.AuxInt = int64ToAuxInt(1)
   919  		v.AddArg4(ptr, old, new_, mem)
   920  		return true
   921  	}
   922  }
   923  func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
   924  	v_3 := v.Args[3]
   925  	v_2 := v.Args[2]
   926  	v_1 := v.Args[1]
   927  	v_0 := v.Args[0]
   928  	// match: (AtomicCompareAndSwap64 ptr old new_ mem)
   929  	// result: (LoweredAtomicCas64 [1] ptr old new_ mem)
   930  	for {
   931  		ptr := v_0
   932  		old := v_1
   933  		new_ := v_2
   934  		mem := v_3
   935  		v.reset(OpPPC64LoweredAtomicCas64)
   936  		v.AuxInt = int64ToAuxInt(1)
   937  		v.AddArg4(ptr, old, new_, mem)
   938  		return true
   939  	}
   940  }
   941  func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
   942  	v_3 := v.Args[3]
   943  	v_2 := v.Args[2]
   944  	v_1 := v.Args[1]
   945  	v_0 := v.Args[0]
   946  	// match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
   947  	// result: (LoweredAtomicCas32 [0] ptr old new_ mem)
   948  	for {
   949  		ptr := v_0
   950  		old := v_1
   951  		new_ := v_2
   952  		mem := v_3
   953  		v.reset(OpPPC64LoweredAtomicCas32)
   954  		v.AuxInt = int64ToAuxInt(0)
   955  		v.AddArg4(ptr, old, new_, mem)
   956  		return true
   957  	}
   958  }
   959  func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
   960  	v_1 := v.Args[1]
   961  	v_0 := v.Args[0]
   962  	// match: (AtomicLoad32 ptr mem)
   963  	// result: (LoweredAtomicLoad32 [1] ptr mem)
   964  	for {
   965  		ptr := v_0
   966  		mem := v_1
   967  		v.reset(OpPPC64LoweredAtomicLoad32)
   968  		v.AuxInt = int64ToAuxInt(1)
   969  		v.AddArg2(ptr, mem)
   970  		return true
   971  	}
   972  }
   973  func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
   974  	v_1 := v.Args[1]
   975  	v_0 := v.Args[0]
   976  	// match: (AtomicLoad64 ptr mem)
   977  	// result: (LoweredAtomicLoad64 [1] ptr mem)
   978  	for {
   979  		ptr := v_0
   980  		mem := v_1
   981  		v.reset(OpPPC64LoweredAtomicLoad64)
   982  		v.AuxInt = int64ToAuxInt(1)
   983  		v.AddArg2(ptr, mem)
   984  		return true
   985  	}
   986  }
   987  func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
   988  	v_1 := v.Args[1]
   989  	v_0 := v.Args[0]
   990  	// match: (AtomicLoad8 ptr mem)
   991  	// result: (LoweredAtomicLoad8 [1] ptr mem)
   992  	for {
   993  		ptr := v_0
   994  		mem := v_1
   995  		v.reset(OpPPC64LoweredAtomicLoad8)
   996  		v.AuxInt = int64ToAuxInt(1)
   997  		v.AddArg2(ptr, mem)
   998  		return true
   999  	}
  1000  }
  1001  func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
  1002  	v_1 := v.Args[1]
  1003  	v_0 := v.Args[0]
  1004  	// match: (AtomicLoadAcq32 ptr mem)
  1005  	// result: (LoweredAtomicLoad32 [0] ptr mem)
  1006  	for {
  1007  		ptr := v_0
  1008  		mem := v_1
  1009  		v.reset(OpPPC64LoweredAtomicLoad32)
  1010  		v.AuxInt = int64ToAuxInt(0)
  1011  		v.AddArg2(ptr, mem)
  1012  		return true
  1013  	}
  1014  }
  1015  func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
  1016  	v_1 := v.Args[1]
  1017  	v_0 := v.Args[0]
  1018  	// match: (AtomicLoadAcq64 ptr mem)
  1019  	// result: (LoweredAtomicLoad64 [0] ptr mem)
  1020  	for {
  1021  		ptr := v_0
  1022  		mem := v_1
  1023  		v.reset(OpPPC64LoweredAtomicLoad64)
  1024  		v.AuxInt = int64ToAuxInt(0)
  1025  		v.AddArg2(ptr, mem)
  1026  		return true
  1027  	}
  1028  }
  1029  func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
  1030  	v_1 := v.Args[1]
  1031  	v_0 := v.Args[0]
  1032  	// match: (AtomicLoadPtr ptr mem)
  1033  	// result: (LoweredAtomicLoadPtr [1] ptr mem)
  1034  	for {
  1035  		ptr := v_0
  1036  		mem := v_1
  1037  		v.reset(OpPPC64LoweredAtomicLoadPtr)
  1038  		v.AuxInt = int64ToAuxInt(1)
  1039  		v.AddArg2(ptr, mem)
  1040  		return true
  1041  	}
  1042  }
  1043  func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
  1044  	v_2 := v.Args[2]
  1045  	v_1 := v.Args[1]
  1046  	v_0 := v.Args[0]
  1047  	// match: (AtomicStore32 ptr val mem)
  1048  	// result: (LoweredAtomicStore32 [1] ptr val mem)
  1049  	for {
  1050  		ptr := v_0
  1051  		val := v_1
  1052  		mem := v_2
  1053  		v.reset(OpPPC64LoweredAtomicStore32)
  1054  		v.AuxInt = int64ToAuxInt(1)
  1055  		v.AddArg3(ptr, val, mem)
  1056  		return true
  1057  	}
  1058  }
  1059  func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
  1060  	v_2 := v.Args[2]
  1061  	v_1 := v.Args[1]
  1062  	v_0 := v.Args[0]
  1063  	// match: (AtomicStore64 ptr val mem)
  1064  	// result: (LoweredAtomicStore64 [1] ptr val mem)
  1065  	for {
  1066  		ptr := v_0
  1067  		val := v_1
  1068  		mem := v_2
  1069  		v.reset(OpPPC64LoweredAtomicStore64)
  1070  		v.AuxInt = int64ToAuxInt(1)
  1071  		v.AddArg3(ptr, val, mem)
  1072  		return true
  1073  	}
  1074  }
  1075  func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
  1076  	v_2 := v.Args[2]
  1077  	v_1 := v.Args[1]
  1078  	v_0 := v.Args[0]
  1079  	// match: (AtomicStore8 ptr val mem)
  1080  	// result: (LoweredAtomicStore8 [1] ptr val mem)
  1081  	for {
  1082  		ptr := v_0
  1083  		val := v_1
  1084  		mem := v_2
  1085  		v.reset(OpPPC64LoweredAtomicStore8)
  1086  		v.AuxInt = int64ToAuxInt(1)
  1087  		v.AddArg3(ptr, val, mem)
  1088  		return true
  1089  	}
  1090  }
  1091  func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
  1092  	v_2 := v.Args[2]
  1093  	v_1 := v.Args[1]
  1094  	v_0 := v.Args[0]
  1095  	// match: (AtomicStoreRel32 ptr val mem)
  1096  	// result: (LoweredAtomicStore32 [0] ptr val mem)
  1097  	for {
  1098  		ptr := v_0
  1099  		val := v_1
  1100  		mem := v_2
  1101  		v.reset(OpPPC64LoweredAtomicStore32)
  1102  		v.AuxInt = int64ToAuxInt(0)
  1103  		v.AddArg3(ptr, val, mem)
  1104  		return true
  1105  	}
  1106  }
  1107  func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
  1108  	v_2 := v.Args[2]
  1109  	v_1 := v.Args[1]
  1110  	v_0 := v.Args[0]
  1111  	// match: (AtomicStoreRel64 ptr val mem)
  1112  	// result: (LoweredAtomicStore64 [0] ptr val mem)
  1113  	for {
  1114  		ptr := v_0
  1115  		val := v_1
  1116  		mem := v_2
  1117  		v.reset(OpPPC64LoweredAtomicStore64)
  1118  		v.AuxInt = int64ToAuxInt(0)
  1119  		v.AddArg3(ptr, val, mem)
  1120  		return true
  1121  	}
  1122  }
  1123  func rewriteValuePPC64_OpAvg64u(v *Value) bool {
  1124  	v_1 := v.Args[1]
  1125  	v_0 := v.Args[0]
  1126  	b := v.Block
  1127  	// match: (Avg64u <t> x y)
  1128  	// result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y)
  1129  	for {
  1130  		t := v.Type
  1131  		x := v_0
  1132  		y := v_1
  1133  		v.reset(OpPPC64ADD)
  1134  		v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
  1135  		v0.AuxInt = int64ToAuxInt(1)
  1136  		v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
  1137  		v1.AddArg2(x, y)
  1138  		v0.AddArg(v1)
  1139  		v.AddArg2(v0, y)
  1140  		return true
  1141  	}
  1142  }
  1143  func rewriteValuePPC64_OpBitLen16(v *Value) bool {
  1144  	v_0 := v.Args[0]
  1145  	b := v.Block
  1146  	typ := &b.Func.Config.Types
  1147  	// match: (BitLen16 x)
  1148  	// result: (BitLen64 (ZeroExt16to64 x))
  1149  	for {
  1150  		x := v_0
  1151  		v.reset(OpBitLen64)
  1152  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1153  		v0.AddArg(x)
  1154  		v.AddArg(v0)
  1155  		return true
  1156  	}
  1157  }
  1158  func rewriteValuePPC64_OpBitLen32(v *Value) bool {
  1159  	v_0 := v.Args[0]
  1160  	b := v.Block
  1161  	typ := &b.Func.Config.Types
  1162  	// match: (BitLen32 x)
  1163  	// result: (SUBFCconst [32] (CNTLZW <typ.Int> x))
  1164  	for {
  1165  		x := v_0
  1166  		v.reset(OpPPC64SUBFCconst)
  1167  		v.AuxInt = int64ToAuxInt(32)
  1168  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
  1169  		v0.AddArg(x)
  1170  		v.AddArg(v0)
  1171  		return true
  1172  	}
  1173  }
  1174  func rewriteValuePPC64_OpBitLen64(v *Value) bool {
  1175  	v_0 := v.Args[0]
  1176  	b := v.Block
  1177  	typ := &b.Func.Config.Types
  1178  	// match: (BitLen64 x)
  1179  	// result: (SUBFCconst [64] (CNTLZD <typ.Int> x))
  1180  	for {
  1181  		x := v_0
  1182  		v.reset(OpPPC64SUBFCconst)
  1183  		v.AuxInt = int64ToAuxInt(64)
  1184  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
  1185  		v0.AddArg(x)
  1186  		v.AddArg(v0)
  1187  		return true
  1188  	}
  1189  }
  1190  func rewriteValuePPC64_OpBitLen8(v *Value) bool {
  1191  	v_0 := v.Args[0]
  1192  	b := v.Block
  1193  	typ := &b.Func.Config.Types
  1194  	// match: (BitLen8 x)
  1195  	// result: (BitLen64 (ZeroExt8to64 x))
  1196  	for {
  1197  		x := v_0
  1198  		v.reset(OpBitLen64)
  1199  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1200  		v0.AddArg(x)
  1201  		v.AddArg(v0)
  1202  		return true
  1203  	}
  1204  }
  1205  func rewriteValuePPC64_OpBswap16(v *Value) bool {
  1206  	v_0 := v.Args[0]
  1207  	b := v.Block
  1208  	typ := &b.Func.Config.Types
  1209  	// match: (Bswap16 x)
  1210  	// cond: buildcfg.GOPPC64>=10
  1211  	// result: (BRH x)
  1212  	for {
  1213  		x := v_0
  1214  		if !(buildcfg.GOPPC64 >= 10) {
  1215  			break
  1216  		}
  1217  		v.reset(OpPPC64BRH)
  1218  		v.AddArg(x)
  1219  		return true
  1220  	}
  1221  	// match: (Bswap16 x:(MOVHZload [off] {sym} ptr mem))
  1222  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1223  	for {
  1224  		x := v_0
  1225  		if x.Op != OpPPC64MOVHZload {
  1226  			break
  1227  		}
  1228  		off := auxIntToInt32(x.AuxInt)
  1229  		sym := auxToSym(x.Aux)
  1230  		mem := x.Args[1]
  1231  		ptr := x.Args[0]
  1232  		b = x.Block
  1233  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  1234  		v.copyOf(v0)
  1235  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1236  		v1.AuxInt = int32ToAuxInt(off)
  1237  		v1.Aux = symToAux(sym)
  1238  		v1.AddArg(ptr)
  1239  		v0.AddArg2(v1, mem)
  1240  		return true
  1241  	}
  1242  	// match: (Bswap16 x:(MOVHZloadidx ptr idx mem))
  1243  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  1244  	for {
  1245  		x := v_0
  1246  		if x.Op != OpPPC64MOVHZloadidx {
  1247  			break
  1248  		}
  1249  		mem := x.Args[2]
  1250  		ptr := x.Args[0]
  1251  		idx := x.Args[1]
  1252  		b = x.Block
  1253  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  1254  		v.copyOf(v0)
  1255  		v0.AddArg3(ptr, idx, mem)
  1256  		return true
  1257  	}
  1258  	return false
  1259  }
  1260  func rewriteValuePPC64_OpBswap32(v *Value) bool {
  1261  	v_0 := v.Args[0]
  1262  	b := v.Block
  1263  	typ := &b.Func.Config.Types
  1264  	// match: (Bswap32 x)
  1265  	// cond: buildcfg.GOPPC64>=10
  1266  	// result: (BRW x)
  1267  	for {
  1268  		x := v_0
  1269  		if !(buildcfg.GOPPC64 >= 10) {
  1270  			break
  1271  		}
  1272  		v.reset(OpPPC64BRW)
  1273  		v.AddArg(x)
  1274  		return true
  1275  	}
  1276  	// match: (Bswap32 x:(MOVWZload [off] {sym} ptr mem))
  1277  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1278  	for {
  1279  		x := v_0
  1280  		if x.Op != OpPPC64MOVWZload {
  1281  			break
  1282  		}
  1283  		off := auxIntToInt32(x.AuxInt)
  1284  		sym := auxToSym(x.Aux)
  1285  		mem := x.Args[1]
  1286  		ptr := x.Args[0]
  1287  		b = x.Block
  1288  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  1289  		v.copyOf(v0)
  1290  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1291  		v1.AuxInt = int32ToAuxInt(off)
  1292  		v1.Aux = symToAux(sym)
  1293  		v1.AddArg(ptr)
  1294  		v0.AddArg2(v1, mem)
  1295  		return true
  1296  	}
  1297  	// match: (Bswap32 x:(MOVWZloadidx ptr idx mem))
  1298  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  1299  	for {
  1300  		x := v_0
  1301  		if x.Op != OpPPC64MOVWZloadidx {
  1302  			break
  1303  		}
  1304  		mem := x.Args[2]
  1305  		ptr := x.Args[0]
  1306  		idx := x.Args[1]
  1307  		b = x.Block
  1308  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  1309  		v.copyOf(v0)
  1310  		v0.AddArg3(ptr, idx, mem)
  1311  		return true
  1312  	}
  1313  	return false
  1314  }
  1315  func rewriteValuePPC64_OpBswap64(v *Value) bool {
  1316  	v_0 := v.Args[0]
  1317  	b := v.Block
  1318  	typ := &b.Func.Config.Types
  1319  	// match: (Bswap64 x)
  1320  	// cond: buildcfg.GOPPC64>=10
  1321  	// result: (BRD x)
  1322  	for {
  1323  		x := v_0
  1324  		if !(buildcfg.GOPPC64 >= 10) {
  1325  			break
  1326  		}
  1327  		v.reset(OpPPC64BRD)
  1328  		v.AddArg(x)
  1329  		return true
  1330  	}
  1331  	// match: (Bswap64 x:(MOVDload [off] {sym} ptr mem))
  1332  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1333  	for {
  1334  		x := v_0
  1335  		if x.Op != OpPPC64MOVDload {
  1336  			break
  1337  		}
  1338  		off := auxIntToInt32(x.AuxInt)
  1339  		sym := auxToSym(x.Aux)
  1340  		mem := x.Args[1]
  1341  		ptr := x.Args[0]
  1342  		b = x.Block
  1343  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  1344  		v.copyOf(v0)
  1345  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1346  		v1.AuxInt = int32ToAuxInt(off)
  1347  		v1.Aux = symToAux(sym)
  1348  		v1.AddArg(ptr)
  1349  		v0.AddArg2(v1, mem)
  1350  		return true
  1351  	}
  1352  	// match: (Bswap64 x:(MOVDloadidx ptr idx mem))
  1353  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  1354  	for {
  1355  		x := v_0
  1356  		if x.Op != OpPPC64MOVDloadidx {
  1357  			break
  1358  		}
  1359  		mem := x.Args[2]
  1360  		ptr := x.Args[0]
  1361  		idx := x.Args[1]
  1362  		b = x.Block
  1363  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  1364  		v.copyOf(v0)
  1365  		v0.AddArg3(ptr, idx, mem)
  1366  		return true
  1367  	}
  1368  	return false
  1369  }
  1370  func rewriteValuePPC64_OpCom16(v *Value) bool {
  1371  	v_0 := v.Args[0]
  1372  	// match: (Com16 x)
  1373  	// result: (NOR x x)
  1374  	for {
  1375  		x := v_0
  1376  		v.reset(OpPPC64NOR)
  1377  		v.AddArg2(x, x)
  1378  		return true
  1379  	}
  1380  }
  1381  func rewriteValuePPC64_OpCom32(v *Value) bool {
  1382  	v_0 := v.Args[0]
  1383  	// match: (Com32 x)
  1384  	// result: (NOR x x)
  1385  	for {
  1386  		x := v_0
  1387  		v.reset(OpPPC64NOR)
  1388  		v.AddArg2(x, x)
  1389  		return true
  1390  	}
  1391  }
  1392  func rewriteValuePPC64_OpCom64(v *Value) bool {
  1393  	v_0 := v.Args[0]
  1394  	// match: (Com64 x)
  1395  	// result: (NOR x x)
  1396  	for {
  1397  		x := v_0
  1398  		v.reset(OpPPC64NOR)
  1399  		v.AddArg2(x, x)
  1400  		return true
  1401  	}
  1402  }
  1403  func rewriteValuePPC64_OpCom8(v *Value) bool {
  1404  	v_0 := v.Args[0]
  1405  	// match: (Com8 x)
  1406  	// result: (NOR x x)
  1407  	for {
  1408  		x := v_0
  1409  		v.reset(OpPPC64NOR)
  1410  		v.AddArg2(x, x)
  1411  		return true
  1412  	}
  1413  }
  1414  func rewriteValuePPC64_OpCondSelect(v *Value) bool {
  1415  	v_2 := v.Args[2]
  1416  	v_1 := v.Args[1]
  1417  	v_0 := v.Args[0]
  1418  	b := v.Block
  1419  	typ := &b.Func.Config.Types
  1420  	// match: (CondSelect x y (SETBC [a] cmp))
  1421  	// result: (ISEL [a] x y cmp)
  1422  	for {
  1423  		x := v_0
  1424  		y := v_1
  1425  		if v_2.Op != OpPPC64SETBC {
  1426  			break
  1427  		}
  1428  		a := auxIntToInt32(v_2.AuxInt)
  1429  		cmp := v_2.Args[0]
  1430  		v.reset(OpPPC64ISEL)
  1431  		v.AuxInt = int32ToAuxInt(a)
  1432  		v.AddArg3(x, y, cmp)
  1433  		return true
  1434  	}
  1435  	// match: (CondSelect x y (SETBCR [a] cmp))
  1436  	// result: (ISEL [a+4] x y cmp)
  1437  	for {
  1438  		x := v_0
  1439  		y := v_1
  1440  		if v_2.Op != OpPPC64SETBCR {
  1441  			break
  1442  		}
  1443  		a := auxIntToInt32(v_2.AuxInt)
  1444  		cmp := v_2.Args[0]
  1445  		v.reset(OpPPC64ISEL)
  1446  		v.AuxInt = int32ToAuxInt(a + 4)
  1447  		v.AddArg3(x, y, cmp)
  1448  		return true
  1449  	}
  1450  	// match: (CondSelect x y bool)
  1451  	// cond: flagArg(bool) == nil
  1452  	// result: (ISEL [6] x y (CMPconst [0] (ANDconst [1] bool)))
  1453  	for {
  1454  		x := v_0
  1455  		y := v_1
  1456  		bool := v_2
  1457  		if !(flagArg(bool) == nil) {
  1458  			break
  1459  		}
  1460  		v.reset(OpPPC64ISEL)
  1461  		v.AuxInt = int32ToAuxInt(6)
  1462  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  1463  		v0.AuxInt = int64ToAuxInt(0)
  1464  		v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  1465  		v1.AuxInt = int64ToAuxInt(1)
  1466  		v1.AddArg(bool)
  1467  		v0.AddArg(v1)
  1468  		v.AddArg3(x, y, v0)
  1469  		return true
  1470  	}
  1471  	return false
  1472  }
  1473  func rewriteValuePPC64_OpConst16(v *Value) bool {
  1474  	// match: (Const16 [val])
  1475  	// result: (MOVDconst [int64(val)])
  1476  	for {
  1477  		val := auxIntToInt16(v.AuxInt)
  1478  		v.reset(OpPPC64MOVDconst)
  1479  		v.AuxInt = int64ToAuxInt(int64(val))
  1480  		return true
  1481  	}
  1482  }
  1483  func rewriteValuePPC64_OpConst32(v *Value) bool {
  1484  	// match: (Const32 [val])
  1485  	// result: (MOVDconst [int64(val)])
  1486  	for {
  1487  		val := auxIntToInt32(v.AuxInt)
  1488  		v.reset(OpPPC64MOVDconst)
  1489  		v.AuxInt = int64ToAuxInt(int64(val))
  1490  		return true
  1491  	}
  1492  }
  1493  func rewriteValuePPC64_OpConst64(v *Value) bool {
  1494  	// match: (Const64 [val])
  1495  	// result: (MOVDconst [int64(val)])
  1496  	for {
  1497  		val := auxIntToInt64(v.AuxInt)
  1498  		v.reset(OpPPC64MOVDconst)
  1499  		v.AuxInt = int64ToAuxInt(int64(val))
  1500  		return true
  1501  	}
  1502  }
  1503  func rewriteValuePPC64_OpConst8(v *Value) bool {
  1504  	// match: (Const8 [val])
  1505  	// result: (MOVDconst [int64(val)])
  1506  	for {
  1507  		val := auxIntToInt8(v.AuxInt)
  1508  		v.reset(OpPPC64MOVDconst)
  1509  		v.AuxInt = int64ToAuxInt(int64(val))
  1510  		return true
  1511  	}
  1512  }
  1513  func rewriteValuePPC64_OpConstBool(v *Value) bool {
  1514  	// match: (ConstBool [t])
  1515  	// result: (MOVDconst [b2i(t)])
  1516  	for {
  1517  		t := auxIntToBool(v.AuxInt)
  1518  		v.reset(OpPPC64MOVDconst)
  1519  		v.AuxInt = int64ToAuxInt(b2i(t))
  1520  		return true
  1521  	}
  1522  }
  1523  func rewriteValuePPC64_OpConstNil(v *Value) bool {
  1524  	// match: (ConstNil)
  1525  	// result: (MOVDconst [0])
  1526  	for {
  1527  		v.reset(OpPPC64MOVDconst)
  1528  		v.AuxInt = int64ToAuxInt(0)
  1529  		return true
  1530  	}
  1531  }
  1532  func rewriteValuePPC64_OpCopysign(v *Value) bool {
  1533  	v_1 := v.Args[1]
  1534  	v_0 := v.Args[0]
  1535  	// match: (Copysign x y)
  1536  	// result: (FCPSGN y x)
  1537  	for {
  1538  		x := v_0
  1539  		y := v_1
  1540  		v.reset(OpPPC64FCPSGN)
  1541  		v.AddArg2(y, x)
  1542  		return true
  1543  	}
  1544  }
  1545  func rewriteValuePPC64_OpCtz16(v *Value) bool {
  1546  	v_0 := v.Args[0]
  1547  	b := v.Block
  1548  	typ := &b.Func.Config.Types
  1549  	// match: (Ctz16 x)
  1550  	// cond: buildcfg.GOPPC64 <= 8
  1551  	// result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x)))
  1552  	for {
  1553  		x := v_0
  1554  		if !(buildcfg.GOPPC64 <= 8) {
  1555  			break
  1556  		}
  1557  		v.reset(OpPPC64POPCNTW)
  1558  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  1559  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
  1560  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
  1561  		v2.AuxInt = int64ToAuxInt(-1)
  1562  		v2.AddArg(x)
  1563  		v1.AddArg2(v2, x)
  1564  		v0.AddArg(v1)
  1565  		v.AddArg(v0)
  1566  		return true
  1567  	}
  1568  	// match: (Ctz16 x)
  1569  	// cond: buildcfg.GOPPC64 >= 9
  1570  	// result: (CNTTZD (OR <typ.UInt64> x (MOVDconst [1<<16])))
  1571  	for {
  1572  		x := v_0
  1573  		if !(buildcfg.GOPPC64 >= 9) {
  1574  			break
  1575  		}
  1576  		v.reset(OpPPC64CNTTZD)
  1577  		v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
  1578  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  1579  		v1.AuxInt = int64ToAuxInt(1 << 16)
  1580  		v0.AddArg2(x, v1)
  1581  		v.AddArg(v0)
  1582  		return true
  1583  	}
  1584  	return false
  1585  }
  1586  func rewriteValuePPC64_OpCtz32(v *Value) bool {
  1587  	v_0 := v.Args[0]
  1588  	b := v.Block
  1589  	typ := &b.Func.Config.Types
  1590  	// match: (Ctz32 x)
  1591  	// cond: buildcfg.GOPPC64 <= 8
  1592  	// result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x)))
  1593  	for {
  1594  		x := v_0
  1595  		if !(buildcfg.GOPPC64 <= 8) {
  1596  			break
  1597  		}
  1598  		v.reset(OpPPC64POPCNTW)
  1599  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1600  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
  1601  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
  1602  		v2.AuxInt = int64ToAuxInt(-1)
  1603  		v2.AddArg(x)
  1604  		v1.AddArg2(v2, x)
  1605  		v0.AddArg(v1)
  1606  		v.AddArg(v0)
  1607  		return true
  1608  	}
  1609  	// match: (Ctz32 x)
  1610  	// cond: buildcfg.GOPPC64 >= 9
  1611  	// result: (CNTTZW (MOVWZreg x))
  1612  	for {
  1613  		x := v_0
  1614  		if !(buildcfg.GOPPC64 >= 9) {
  1615  			break
  1616  		}
  1617  		v.reset(OpPPC64CNTTZW)
  1618  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1619  		v0.AddArg(x)
  1620  		v.AddArg(v0)
  1621  		return true
  1622  	}
  1623  	return false
  1624  }
  1625  func rewriteValuePPC64_OpCtz64(v *Value) bool {
  1626  	v_0 := v.Args[0]
  1627  	b := v.Block
  1628  	typ := &b.Func.Config.Types
  1629  	// match: (Ctz64 x)
  1630  	// cond: buildcfg.GOPPC64 <= 8
  1631  	// result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x))
  1632  	for {
  1633  		x := v_0
  1634  		if !(buildcfg.GOPPC64 <= 8) {
  1635  			break
  1636  		}
  1637  		v.reset(OpPPC64POPCNTD)
  1638  		v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
  1639  		v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
  1640  		v1.AuxInt = int64ToAuxInt(-1)
  1641  		v1.AddArg(x)
  1642  		v0.AddArg2(v1, x)
  1643  		v.AddArg(v0)
  1644  		return true
  1645  	}
  1646  	// match: (Ctz64 x)
  1647  	// cond: buildcfg.GOPPC64 >= 9
  1648  	// result: (CNTTZD x)
  1649  	for {
  1650  		x := v_0
  1651  		if !(buildcfg.GOPPC64 >= 9) {
  1652  			break
  1653  		}
  1654  		v.reset(OpPPC64CNTTZD)
  1655  		v.AddArg(x)
  1656  		return true
  1657  	}
  1658  	return false
  1659  }
  1660  func rewriteValuePPC64_OpCtz8(v *Value) bool {
  1661  	v_0 := v.Args[0]
  1662  	b := v.Block
  1663  	typ := &b.Func.Config.Types
  1664  	// match: (Ctz8 x)
  1665  	// cond: buildcfg.GOPPC64 <= 8
  1666  	// result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x)))
  1667  	for {
  1668  		x := v_0
  1669  		if !(buildcfg.GOPPC64 <= 8) {
  1670  			break
  1671  		}
  1672  		v.reset(OpPPC64POPCNTB)
  1673  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  1674  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
  1675  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
  1676  		v2.AuxInt = int64ToAuxInt(-1)
  1677  		v2.AddArg(x)
  1678  		v1.AddArg2(v2, x)
  1679  		v0.AddArg(v1)
  1680  		v.AddArg(v0)
  1681  		return true
  1682  	}
  1683  	// match: (Ctz8 x)
  1684  	// cond: buildcfg.GOPPC64 >= 9
  1685  	// result: (CNTTZD (OR <typ.UInt64> x (MOVDconst [1<<8])))
  1686  	for {
  1687  		x := v_0
  1688  		if !(buildcfg.GOPPC64 >= 9) {
  1689  			break
  1690  		}
  1691  		v.reset(OpPPC64CNTTZD)
  1692  		v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
  1693  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  1694  		v1.AuxInt = int64ToAuxInt(1 << 8)
  1695  		v0.AddArg2(x, v1)
  1696  		v.AddArg(v0)
  1697  		return true
  1698  	}
  1699  	return false
  1700  }
  1701  func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
  1702  	v_0 := v.Args[0]
  1703  	b := v.Block
  1704  	typ := &b.Func.Config.Types
  1705  	// match: (Cvt32Fto32 x)
  1706  	// result: (MFVSRD (FCTIWZ x))
  1707  	for {
  1708  		x := v_0
  1709  		v.reset(OpPPC64MFVSRD)
  1710  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1711  		v0.AddArg(x)
  1712  		v.AddArg(v0)
  1713  		return true
  1714  	}
  1715  }
  1716  func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
  1717  	v_0 := v.Args[0]
  1718  	b := v.Block
  1719  	typ := &b.Func.Config.Types
  1720  	// match: (Cvt32Fto64 x)
  1721  	// result: (MFVSRD (FCTIDZ x))
  1722  	for {
  1723  		x := v_0
  1724  		v.reset(OpPPC64MFVSRD)
  1725  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1726  		v0.AddArg(x)
  1727  		v.AddArg(v0)
  1728  		return true
  1729  	}
  1730  }
  1731  func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
  1732  	v_0 := v.Args[0]
  1733  	b := v.Block
  1734  	typ := &b.Func.Config.Types
  1735  	// match: (Cvt32to32F x)
  1736  	// result: (FCFIDS (MTVSRD (SignExt32to64 x)))
  1737  	for {
  1738  		x := v_0
  1739  		v.reset(OpPPC64FCFIDS)
  1740  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1741  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1742  		v1.AddArg(x)
  1743  		v0.AddArg(v1)
  1744  		v.AddArg(v0)
  1745  		return true
  1746  	}
  1747  }
  1748  func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
  1749  	v_0 := v.Args[0]
  1750  	b := v.Block
  1751  	typ := &b.Func.Config.Types
  1752  	// match: (Cvt32to64F x)
  1753  	// result: (FCFID (MTVSRD (SignExt32to64 x)))
  1754  	for {
  1755  		x := v_0
  1756  		v.reset(OpPPC64FCFID)
  1757  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1758  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1759  		v1.AddArg(x)
  1760  		v0.AddArg(v1)
  1761  		v.AddArg(v0)
  1762  		return true
  1763  	}
  1764  }
  1765  func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
  1766  	v_0 := v.Args[0]
  1767  	b := v.Block
  1768  	typ := &b.Func.Config.Types
  1769  	// match: (Cvt64Fto32 x)
  1770  	// result: (MFVSRD (FCTIWZ x))
  1771  	for {
  1772  		x := v_0
  1773  		v.reset(OpPPC64MFVSRD)
  1774  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1775  		v0.AddArg(x)
  1776  		v.AddArg(v0)
  1777  		return true
  1778  	}
  1779  }
  1780  func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
  1781  	v_0 := v.Args[0]
  1782  	b := v.Block
  1783  	typ := &b.Func.Config.Types
  1784  	// match: (Cvt64Fto64 x)
  1785  	// result: (MFVSRD (FCTIDZ x))
  1786  	for {
  1787  		x := v_0
  1788  		v.reset(OpPPC64MFVSRD)
  1789  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1790  		v0.AddArg(x)
  1791  		v.AddArg(v0)
  1792  		return true
  1793  	}
  1794  }
  1795  func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
  1796  	v_0 := v.Args[0]
  1797  	b := v.Block
  1798  	typ := &b.Func.Config.Types
  1799  	// match: (Cvt64to32F x)
  1800  	// result: (FCFIDS (MTVSRD x))
  1801  	for {
  1802  		x := v_0
  1803  		v.reset(OpPPC64FCFIDS)
  1804  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1805  		v0.AddArg(x)
  1806  		v.AddArg(v0)
  1807  		return true
  1808  	}
  1809  }
  1810  func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
  1811  	v_0 := v.Args[0]
  1812  	b := v.Block
  1813  	typ := &b.Func.Config.Types
  1814  	// match: (Cvt64to64F x)
  1815  	// result: (FCFID (MTVSRD x))
  1816  	for {
  1817  		x := v_0
  1818  		v.reset(OpPPC64FCFID)
  1819  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1820  		v0.AddArg(x)
  1821  		v.AddArg(v0)
  1822  		return true
  1823  	}
  1824  }
  1825  func rewriteValuePPC64_OpDiv16(v *Value) bool {
  1826  	v_1 := v.Args[1]
  1827  	v_0 := v.Args[0]
  1828  	b := v.Block
  1829  	typ := &b.Func.Config.Types
  1830  	// match: (Div16 [false] x y)
  1831  	// result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
  1832  	for {
  1833  		if auxIntToBool(v.AuxInt) != false {
  1834  			break
  1835  		}
  1836  		x := v_0
  1837  		y := v_1
  1838  		v.reset(OpPPC64DIVW)
  1839  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1840  		v0.AddArg(x)
  1841  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1842  		v1.AddArg(y)
  1843  		v.AddArg2(v0, v1)
  1844  		return true
  1845  	}
  1846  	return false
  1847  }
  1848  func rewriteValuePPC64_OpDiv16u(v *Value) bool {
  1849  	v_1 := v.Args[1]
  1850  	v_0 := v.Args[0]
  1851  	b := v.Block
  1852  	typ := &b.Func.Config.Types
  1853  	// match: (Div16u x y)
  1854  	// result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
  1855  	for {
  1856  		x := v_0
  1857  		y := v_1
  1858  		v.reset(OpPPC64DIVWU)
  1859  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1860  		v0.AddArg(x)
  1861  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1862  		v1.AddArg(y)
  1863  		v.AddArg2(v0, v1)
  1864  		return true
  1865  	}
  1866  }
  1867  func rewriteValuePPC64_OpDiv32(v *Value) bool {
  1868  	v_1 := v.Args[1]
  1869  	v_0 := v.Args[0]
  1870  	// match: (Div32 [false] x y)
  1871  	// result: (DIVW x y)
  1872  	for {
  1873  		if auxIntToBool(v.AuxInt) != false {
  1874  			break
  1875  		}
  1876  		x := v_0
  1877  		y := v_1
  1878  		v.reset(OpPPC64DIVW)
  1879  		v.AddArg2(x, y)
  1880  		return true
  1881  	}
  1882  	return false
  1883  }
  1884  func rewriteValuePPC64_OpDiv64(v *Value) bool {
  1885  	v_1 := v.Args[1]
  1886  	v_0 := v.Args[0]
  1887  	// match: (Div64 [false] x y)
  1888  	// result: (DIVD x y)
  1889  	for {
  1890  		if auxIntToBool(v.AuxInt) != false {
  1891  			break
  1892  		}
  1893  		x := v_0
  1894  		y := v_1
  1895  		v.reset(OpPPC64DIVD)
  1896  		v.AddArg2(x, y)
  1897  		return true
  1898  	}
  1899  	return false
  1900  }
  1901  func rewriteValuePPC64_OpDiv8(v *Value) bool {
  1902  	v_1 := v.Args[1]
  1903  	v_0 := v.Args[0]
  1904  	b := v.Block
  1905  	typ := &b.Func.Config.Types
  1906  	// match: (Div8 x y)
  1907  	// result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
  1908  	for {
  1909  		x := v_0
  1910  		y := v_1
  1911  		v.reset(OpPPC64DIVW)
  1912  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1913  		v0.AddArg(x)
  1914  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1915  		v1.AddArg(y)
  1916  		v.AddArg2(v0, v1)
  1917  		return true
  1918  	}
  1919  }
  1920  func rewriteValuePPC64_OpDiv8u(v *Value) bool {
  1921  	v_1 := v.Args[1]
  1922  	v_0 := v.Args[0]
  1923  	b := v.Block
  1924  	typ := &b.Func.Config.Types
  1925  	// match: (Div8u x y)
  1926  	// result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
  1927  	for {
  1928  		x := v_0
  1929  		y := v_1
  1930  		v.reset(OpPPC64DIVWU)
  1931  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1932  		v0.AddArg(x)
  1933  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1934  		v1.AddArg(y)
  1935  		v.AddArg2(v0, v1)
  1936  		return true
  1937  	}
  1938  }
  1939  func rewriteValuePPC64_OpEq16(v *Value) bool {
  1940  	v_1 := v.Args[1]
  1941  	v_0 := v.Args[0]
  1942  	b := v.Block
  1943  	typ := &b.Func.Config.Types
  1944  	// match: (Eq16 x y)
  1945  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  1946  	// result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  1947  	for {
  1948  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1949  			x := v_0
  1950  			y := v_1
  1951  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  1952  				continue
  1953  			}
  1954  			v.reset(OpPPC64Equal)
  1955  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1956  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1957  			v1.AddArg(x)
  1958  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1959  			v2.AddArg(y)
  1960  			v0.AddArg2(v1, v2)
  1961  			v.AddArg(v0)
  1962  			return true
  1963  		}
  1964  		break
  1965  	}
  1966  	// match: (Eq16 x y)
  1967  	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1968  	for {
  1969  		x := v_0
  1970  		y := v_1
  1971  		v.reset(OpPPC64Equal)
  1972  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1973  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1974  		v1.AddArg(x)
  1975  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1976  		v2.AddArg(y)
  1977  		v0.AddArg2(v1, v2)
  1978  		v.AddArg(v0)
  1979  		return true
  1980  	}
  1981  }
  1982  func rewriteValuePPC64_OpEq32(v *Value) bool {
  1983  	v_1 := v.Args[1]
  1984  	v_0 := v.Args[0]
  1985  	b := v.Block
  1986  	// match: (Eq32 x y)
  1987  	// result: (Equal (CMPW x y))
  1988  	for {
  1989  		x := v_0
  1990  		y := v_1
  1991  		v.reset(OpPPC64Equal)
  1992  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1993  		v0.AddArg2(x, y)
  1994  		v.AddArg(v0)
  1995  		return true
  1996  	}
  1997  }
  1998  func rewriteValuePPC64_OpEq32F(v *Value) bool {
  1999  	v_1 := v.Args[1]
  2000  	v_0 := v.Args[0]
  2001  	b := v.Block
  2002  	// match: (Eq32F x y)
  2003  	// result: (Equal (FCMPU x y))
  2004  	for {
  2005  		x := v_0
  2006  		y := v_1
  2007  		v.reset(OpPPC64Equal)
  2008  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2009  		v0.AddArg2(x, y)
  2010  		v.AddArg(v0)
  2011  		return true
  2012  	}
  2013  }
  2014  func rewriteValuePPC64_OpEq64(v *Value) bool {
  2015  	v_1 := v.Args[1]
  2016  	v_0 := v.Args[0]
  2017  	b := v.Block
  2018  	// match: (Eq64 x y)
  2019  	// result: (Equal (CMP x y))
  2020  	for {
  2021  		x := v_0
  2022  		y := v_1
  2023  		v.reset(OpPPC64Equal)
  2024  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2025  		v0.AddArg2(x, y)
  2026  		v.AddArg(v0)
  2027  		return true
  2028  	}
  2029  }
  2030  func rewriteValuePPC64_OpEq64F(v *Value) bool {
  2031  	v_1 := v.Args[1]
  2032  	v_0 := v.Args[0]
  2033  	b := v.Block
  2034  	// match: (Eq64F x y)
  2035  	// result: (Equal (FCMPU x y))
  2036  	for {
  2037  		x := v_0
  2038  		y := v_1
  2039  		v.reset(OpPPC64Equal)
  2040  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2041  		v0.AddArg2(x, y)
  2042  		v.AddArg(v0)
  2043  		return true
  2044  	}
  2045  }
  2046  func rewriteValuePPC64_OpEq8(v *Value) bool {
  2047  	v_1 := v.Args[1]
  2048  	v_0 := v.Args[0]
  2049  	b := v.Block
  2050  	typ := &b.Func.Config.Types
  2051  	// match: (Eq8 x y)
  2052  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  2053  	// result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2054  	for {
  2055  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2056  			x := v_0
  2057  			y := v_1
  2058  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  2059  				continue
  2060  			}
  2061  			v.reset(OpPPC64Equal)
  2062  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2063  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2064  			v1.AddArg(x)
  2065  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2066  			v2.AddArg(y)
  2067  			v0.AddArg2(v1, v2)
  2068  			v.AddArg(v0)
  2069  			return true
  2070  		}
  2071  		break
  2072  	}
  2073  	// match: (Eq8 x y)
  2074  	// result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2075  	for {
  2076  		x := v_0
  2077  		y := v_1
  2078  		v.reset(OpPPC64Equal)
  2079  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2080  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2081  		v1.AddArg(x)
  2082  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2083  		v2.AddArg(y)
  2084  		v0.AddArg2(v1, v2)
  2085  		v.AddArg(v0)
  2086  		return true
  2087  	}
  2088  }
  2089  func rewriteValuePPC64_OpEqB(v *Value) bool {
  2090  	v_1 := v.Args[1]
  2091  	v_0 := v.Args[0]
  2092  	b := v.Block
  2093  	typ := &b.Func.Config.Types
  2094  	// match: (EqB x y)
  2095  	// result: (ANDconst [1] (EQV x y))
  2096  	for {
  2097  		x := v_0
  2098  		y := v_1
  2099  		v.reset(OpPPC64ANDconst)
  2100  		v.AuxInt = int64ToAuxInt(1)
  2101  		v0 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
  2102  		v0.AddArg2(x, y)
  2103  		v.AddArg(v0)
  2104  		return true
  2105  	}
  2106  }
  2107  func rewriteValuePPC64_OpEqPtr(v *Value) bool {
  2108  	v_1 := v.Args[1]
  2109  	v_0 := v.Args[0]
  2110  	b := v.Block
  2111  	// match: (EqPtr x y)
  2112  	// result: (Equal (CMP x y))
  2113  	for {
  2114  		x := v_0
  2115  		y := v_1
  2116  		v.reset(OpPPC64Equal)
  2117  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2118  		v0.AddArg2(x, y)
  2119  		v.AddArg(v0)
  2120  		return true
  2121  	}
  2122  }
  2123  func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
  2124  	v_1 := v.Args[1]
  2125  	v_0 := v.Args[0]
  2126  	b := v.Block
  2127  	// match: (IsInBounds idx len)
  2128  	// result: (LessThan (CMPU idx len))
  2129  	for {
  2130  		idx := v_0
  2131  		len := v_1
  2132  		v.reset(OpPPC64LessThan)
  2133  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2134  		v0.AddArg2(idx, len)
  2135  		v.AddArg(v0)
  2136  		return true
  2137  	}
  2138  }
  2139  func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
  2140  	v_0 := v.Args[0]
  2141  	b := v.Block
  2142  	// match: (IsNonNil ptr)
  2143  	// result: (NotEqual (CMPconst [0] ptr))
  2144  	for {
  2145  		ptr := v_0
  2146  		v.reset(OpPPC64NotEqual)
  2147  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2148  		v0.AuxInt = int64ToAuxInt(0)
  2149  		v0.AddArg(ptr)
  2150  		v.AddArg(v0)
  2151  		return true
  2152  	}
  2153  }
  2154  func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
  2155  	v_1 := v.Args[1]
  2156  	v_0 := v.Args[0]
  2157  	b := v.Block
  2158  	// match: (IsSliceInBounds idx len)
  2159  	// result: (LessEqual (CMPU idx len))
  2160  	for {
  2161  		idx := v_0
  2162  		len := v_1
  2163  		v.reset(OpPPC64LessEqual)
  2164  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2165  		v0.AddArg2(idx, len)
  2166  		v.AddArg(v0)
  2167  		return true
  2168  	}
  2169  }
  2170  func rewriteValuePPC64_OpLeq16(v *Value) bool {
  2171  	v_1 := v.Args[1]
  2172  	v_0 := v.Args[0]
  2173  	b := v.Block
  2174  	typ := &b.Func.Config.Types
  2175  	// match: (Leq16 x y)
  2176  	// result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2177  	for {
  2178  		x := v_0
  2179  		y := v_1
  2180  		v.reset(OpPPC64LessEqual)
  2181  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2182  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2183  		v1.AddArg(x)
  2184  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2185  		v2.AddArg(y)
  2186  		v0.AddArg2(v1, v2)
  2187  		v.AddArg(v0)
  2188  		return true
  2189  	}
  2190  }
  2191  func rewriteValuePPC64_OpLeq16U(v *Value) bool {
  2192  	v_1 := v.Args[1]
  2193  	v_0 := v.Args[0]
  2194  	b := v.Block
  2195  	typ := &b.Func.Config.Types
  2196  	// match: (Leq16U x y)
  2197  	// result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2198  	for {
  2199  		x := v_0
  2200  		y := v_1
  2201  		v.reset(OpPPC64LessEqual)
  2202  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2203  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2204  		v1.AddArg(x)
  2205  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2206  		v2.AddArg(y)
  2207  		v0.AddArg2(v1, v2)
  2208  		v.AddArg(v0)
  2209  		return true
  2210  	}
  2211  }
  2212  func rewriteValuePPC64_OpLeq32(v *Value) bool {
  2213  	v_1 := v.Args[1]
  2214  	v_0 := v.Args[0]
  2215  	b := v.Block
  2216  	// match: (Leq32 x y)
  2217  	// result: (LessEqual (CMPW x y))
  2218  	for {
  2219  		x := v_0
  2220  		y := v_1
  2221  		v.reset(OpPPC64LessEqual)
  2222  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2223  		v0.AddArg2(x, y)
  2224  		v.AddArg(v0)
  2225  		return true
  2226  	}
  2227  }
  2228  func rewriteValuePPC64_OpLeq32F(v *Value) bool {
  2229  	v_1 := v.Args[1]
  2230  	v_0 := v.Args[0]
  2231  	b := v.Block
  2232  	// match: (Leq32F x y)
  2233  	// result: (FLessEqual (FCMPU x y))
  2234  	for {
  2235  		x := v_0
  2236  		y := v_1
  2237  		v.reset(OpPPC64FLessEqual)
  2238  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2239  		v0.AddArg2(x, y)
  2240  		v.AddArg(v0)
  2241  		return true
  2242  	}
  2243  }
  2244  func rewriteValuePPC64_OpLeq32U(v *Value) bool {
  2245  	v_1 := v.Args[1]
  2246  	v_0 := v.Args[0]
  2247  	b := v.Block
  2248  	// match: (Leq32U x y)
  2249  	// result: (LessEqual (CMPWU x y))
  2250  	for {
  2251  		x := v_0
  2252  		y := v_1
  2253  		v.reset(OpPPC64LessEqual)
  2254  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2255  		v0.AddArg2(x, y)
  2256  		v.AddArg(v0)
  2257  		return true
  2258  	}
  2259  }
  2260  func rewriteValuePPC64_OpLeq64(v *Value) bool {
  2261  	v_1 := v.Args[1]
  2262  	v_0 := v.Args[0]
  2263  	b := v.Block
  2264  	// match: (Leq64 x y)
  2265  	// result: (LessEqual (CMP x y))
  2266  	for {
  2267  		x := v_0
  2268  		y := v_1
  2269  		v.reset(OpPPC64LessEqual)
  2270  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2271  		v0.AddArg2(x, y)
  2272  		v.AddArg(v0)
  2273  		return true
  2274  	}
  2275  }
  2276  func rewriteValuePPC64_OpLeq64F(v *Value) bool {
  2277  	v_1 := v.Args[1]
  2278  	v_0 := v.Args[0]
  2279  	b := v.Block
  2280  	// match: (Leq64F x y)
  2281  	// result: (FLessEqual (FCMPU x y))
  2282  	for {
  2283  		x := v_0
  2284  		y := v_1
  2285  		v.reset(OpPPC64FLessEqual)
  2286  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2287  		v0.AddArg2(x, y)
  2288  		v.AddArg(v0)
  2289  		return true
  2290  	}
  2291  }
  2292  func rewriteValuePPC64_OpLeq64U(v *Value) bool {
  2293  	v_1 := v.Args[1]
  2294  	v_0 := v.Args[0]
  2295  	b := v.Block
  2296  	// match: (Leq64U x y)
  2297  	// result: (LessEqual (CMPU x y))
  2298  	for {
  2299  		x := v_0
  2300  		y := v_1
  2301  		v.reset(OpPPC64LessEqual)
  2302  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2303  		v0.AddArg2(x, y)
  2304  		v.AddArg(v0)
  2305  		return true
  2306  	}
  2307  }
  2308  func rewriteValuePPC64_OpLeq8(v *Value) bool {
  2309  	v_1 := v.Args[1]
  2310  	v_0 := v.Args[0]
  2311  	b := v.Block
  2312  	typ := &b.Func.Config.Types
  2313  	// match: (Leq8 x y)
  2314  	// result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2315  	for {
  2316  		x := v_0
  2317  		y := v_1
  2318  		v.reset(OpPPC64LessEqual)
  2319  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2320  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2321  		v1.AddArg(x)
  2322  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2323  		v2.AddArg(y)
  2324  		v0.AddArg2(v1, v2)
  2325  		v.AddArg(v0)
  2326  		return true
  2327  	}
  2328  }
  2329  func rewriteValuePPC64_OpLeq8U(v *Value) bool {
  2330  	v_1 := v.Args[1]
  2331  	v_0 := v.Args[0]
  2332  	b := v.Block
  2333  	typ := &b.Func.Config.Types
  2334  	// match: (Leq8U x y)
  2335  	// result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2336  	for {
  2337  		x := v_0
  2338  		y := v_1
  2339  		v.reset(OpPPC64LessEqual)
  2340  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2341  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2342  		v1.AddArg(x)
  2343  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2344  		v2.AddArg(y)
  2345  		v0.AddArg2(v1, v2)
  2346  		v.AddArg(v0)
  2347  		return true
  2348  	}
  2349  }
  2350  func rewriteValuePPC64_OpLess16(v *Value) bool {
  2351  	v_1 := v.Args[1]
  2352  	v_0 := v.Args[0]
  2353  	b := v.Block
  2354  	typ := &b.Func.Config.Types
  2355  	// match: (Less16 x y)
  2356  	// result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2357  	for {
  2358  		x := v_0
  2359  		y := v_1
  2360  		v.reset(OpPPC64LessThan)
  2361  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2362  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2363  		v1.AddArg(x)
  2364  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2365  		v2.AddArg(y)
  2366  		v0.AddArg2(v1, v2)
  2367  		v.AddArg(v0)
  2368  		return true
  2369  	}
  2370  }
  2371  func rewriteValuePPC64_OpLess16U(v *Value) bool {
  2372  	v_1 := v.Args[1]
  2373  	v_0 := v.Args[0]
  2374  	b := v.Block
  2375  	typ := &b.Func.Config.Types
  2376  	// match: (Less16U x y)
  2377  	// result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2378  	for {
  2379  		x := v_0
  2380  		y := v_1
  2381  		v.reset(OpPPC64LessThan)
  2382  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2383  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2384  		v1.AddArg(x)
  2385  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2386  		v2.AddArg(y)
  2387  		v0.AddArg2(v1, v2)
  2388  		v.AddArg(v0)
  2389  		return true
  2390  	}
  2391  }
  2392  func rewriteValuePPC64_OpLess32(v *Value) bool {
  2393  	v_1 := v.Args[1]
  2394  	v_0 := v.Args[0]
  2395  	b := v.Block
  2396  	// match: (Less32 x y)
  2397  	// result: (LessThan (CMPW x y))
  2398  	for {
  2399  		x := v_0
  2400  		y := v_1
  2401  		v.reset(OpPPC64LessThan)
  2402  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2403  		v0.AddArg2(x, y)
  2404  		v.AddArg(v0)
  2405  		return true
  2406  	}
  2407  }
  2408  func rewriteValuePPC64_OpLess32F(v *Value) bool {
  2409  	v_1 := v.Args[1]
  2410  	v_0 := v.Args[0]
  2411  	b := v.Block
  2412  	// match: (Less32F x y)
  2413  	// result: (FLessThan (FCMPU x y))
  2414  	for {
  2415  		x := v_0
  2416  		y := v_1
  2417  		v.reset(OpPPC64FLessThan)
  2418  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2419  		v0.AddArg2(x, y)
  2420  		v.AddArg(v0)
  2421  		return true
  2422  	}
  2423  }
  2424  func rewriteValuePPC64_OpLess32U(v *Value) bool {
  2425  	v_1 := v.Args[1]
  2426  	v_0 := v.Args[0]
  2427  	b := v.Block
  2428  	// match: (Less32U x y)
  2429  	// result: (LessThan (CMPWU x y))
  2430  	for {
  2431  		x := v_0
  2432  		y := v_1
  2433  		v.reset(OpPPC64LessThan)
  2434  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2435  		v0.AddArg2(x, y)
  2436  		v.AddArg(v0)
  2437  		return true
  2438  	}
  2439  }
  2440  func rewriteValuePPC64_OpLess64(v *Value) bool {
  2441  	v_1 := v.Args[1]
  2442  	v_0 := v.Args[0]
  2443  	b := v.Block
  2444  	// match: (Less64 x y)
  2445  	// result: (LessThan (CMP x y))
  2446  	for {
  2447  		x := v_0
  2448  		y := v_1
  2449  		v.reset(OpPPC64LessThan)
  2450  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2451  		v0.AddArg2(x, y)
  2452  		v.AddArg(v0)
  2453  		return true
  2454  	}
  2455  }
  2456  func rewriteValuePPC64_OpLess64F(v *Value) bool {
  2457  	v_1 := v.Args[1]
  2458  	v_0 := v.Args[0]
  2459  	b := v.Block
  2460  	// match: (Less64F x y)
  2461  	// result: (FLessThan (FCMPU x y))
  2462  	for {
  2463  		x := v_0
  2464  		y := v_1
  2465  		v.reset(OpPPC64FLessThan)
  2466  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2467  		v0.AddArg2(x, y)
  2468  		v.AddArg(v0)
  2469  		return true
  2470  	}
  2471  }
  2472  func rewriteValuePPC64_OpLess64U(v *Value) bool {
  2473  	v_1 := v.Args[1]
  2474  	v_0 := v.Args[0]
  2475  	b := v.Block
  2476  	// match: (Less64U x y)
  2477  	// result: (LessThan (CMPU x y))
  2478  	for {
  2479  		x := v_0
  2480  		y := v_1
  2481  		v.reset(OpPPC64LessThan)
  2482  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2483  		v0.AddArg2(x, y)
  2484  		v.AddArg(v0)
  2485  		return true
  2486  	}
  2487  }
  2488  func rewriteValuePPC64_OpLess8(v *Value) bool {
  2489  	v_1 := v.Args[1]
  2490  	v_0 := v.Args[0]
  2491  	b := v.Block
  2492  	typ := &b.Func.Config.Types
  2493  	// match: (Less8 x y)
  2494  	// result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2495  	for {
  2496  		x := v_0
  2497  		y := v_1
  2498  		v.reset(OpPPC64LessThan)
  2499  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2500  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2501  		v1.AddArg(x)
  2502  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2503  		v2.AddArg(y)
  2504  		v0.AddArg2(v1, v2)
  2505  		v.AddArg(v0)
  2506  		return true
  2507  	}
  2508  }
  2509  func rewriteValuePPC64_OpLess8U(v *Value) bool {
  2510  	v_1 := v.Args[1]
  2511  	v_0 := v.Args[0]
  2512  	b := v.Block
  2513  	typ := &b.Func.Config.Types
  2514  	// match: (Less8U x y)
  2515  	// result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2516  	for {
  2517  		x := v_0
  2518  		y := v_1
  2519  		v.reset(OpPPC64LessThan)
  2520  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2521  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2522  		v1.AddArg(x)
  2523  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2524  		v2.AddArg(y)
  2525  		v0.AddArg2(v1, v2)
  2526  		v.AddArg(v0)
  2527  		return true
  2528  	}
  2529  }
  2530  func rewriteValuePPC64_OpLoad(v *Value) bool {
  2531  	v_1 := v.Args[1]
  2532  	v_0 := v.Args[0]
  2533  	b := v.Block
  2534  	typ := &b.Func.Config.Types
  2535  	// match: (Load <t> ptr mem)
  2536  	// cond: (is64BitInt(t) || isPtr(t))
  2537  	// result: (MOVDload ptr mem)
  2538  	for {
  2539  		t := v.Type
  2540  		ptr := v_0
  2541  		mem := v_1
  2542  		if !(is64BitInt(t) || isPtr(t)) {
  2543  			break
  2544  		}
  2545  		v.reset(OpPPC64MOVDload)
  2546  		v.AddArg2(ptr, mem)
  2547  		return true
  2548  	}
  2549  	// match: (Load <t> ptr mem)
  2550  	// cond: is32BitInt(t) && t.IsSigned()
  2551  	// result: (MOVWload ptr mem)
  2552  	for {
  2553  		t := v.Type
  2554  		ptr := v_0
  2555  		mem := v_1
  2556  		if !(is32BitInt(t) && t.IsSigned()) {
  2557  			break
  2558  		}
  2559  		v.reset(OpPPC64MOVWload)
  2560  		v.AddArg2(ptr, mem)
  2561  		return true
  2562  	}
  2563  	// match: (Load <t> ptr mem)
  2564  	// cond: is32BitInt(t) && !t.IsSigned()
  2565  	// result: (MOVWZload ptr mem)
  2566  	for {
  2567  		t := v.Type
  2568  		ptr := v_0
  2569  		mem := v_1
  2570  		if !(is32BitInt(t) && !t.IsSigned()) {
  2571  			break
  2572  		}
  2573  		v.reset(OpPPC64MOVWZload)
  2574  		v.AddArg2(ptr, mem)
  2575  		return true
  2576  	}
  2577  	// match: (Load <t> ptr mem)
  2578  	// cond: is16BitInt(t) && t.IsSigned()
  2579  	// result: (MOVHload ptr mem)
  2580  	for {
  2581  		t := v.Type
  2582  		ptr := v_0
  2583  		mem := v_1
  2584  		if !(is16BitInt(t) && t.IsSigned()) {
  2585  			break
  2586  		}
  2587  		v.reset(OpPPC64MOVHload)
  2588  		v.AddArg2(ptr, mem)
  2589  		return true
  2590  	}
  2591  	// match: (Load <t> ptr mem)
  2592  	// cond: is16BitInt(t) && !t.IsSigned()
  2593  	// result: (MOVHZload ptr mem)
  2594  	for {
  2595  		t := v.Type
  2596  		ptr := v_0
  2597  		mem := v_1
  2598  		if !(is16BitInt(t) && !t.IsSigned()) {
  2599  			break
  2600  		}
  2601  		v.reset(OpPPC64MOVHZload)
  2602  		v.AddArg2(ptr, mem)
  2603  		return true
  2604  	}
  2605  	// match: (Load <t> ptr mem)
  2606  	// cond: t.IsBoolean()
  2607  	// result: (MOVBZload ptr mem)
  2608  	for {
  2609  		t := v.Type
  2610  		ptr := v_0
  2611  		mem := v_1
  2612  		if !(t.IsBoolean()) {
  2613  			break
  2614  		}
  2615  		v.reset(OpPPC64MOVBZload)
  2616  		v.AddArg2(ptr, mem)
  2617  		return true
  2618  	}
  2619  	// match: (Load <t> ptr mem)
  2620  	// cond: is8BitInt(t) && t.IsSigned()
  2621  	// result: (MOVBreg (MOVBZload ptr mem))
  2622  	for {
  2623  		t := v.Type
  2624  		ptr := v_0
  2625  		mem := v_1
  2626  		if !(is8BitInt(t) && t.IsSigned()) {
  2627  			break
  2628  		}
  2629  		v.reset(OpPPC64MOVBreg)
  2630  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  2631  		v0.AddArg2(ptr, mem)
  2632  		v.AddArg(v0)
  2633  		return true
  2634  	}
  2635  	// match: (Load <t> ptr mem)
  2636  	// cond: is8BitInt(t) && !t.IsSigned()
  2637  	// result: (MOVBZload ptr mem)
  2638  	for {
  2639  		t := v.Type
  2640  		ptr := v_0
  2641  		mem := v_1
  2642  		if !(is8BitInt(t) && !t.IsSigned()) {
  2643  			break
  2644  		}
  2645  		v.reset(OpPPC64MOVBZload)
  2646  		v.AddArg2(ptr, mem)
  2647  		return true
  2648  	}
  2649  	// match: (Load <t> ptr mem)
  2650  	// cond: is32BitFloat(t)
  2651  	// result: (FMOVSload ptr mem)
  2652  	for {
  2653  		t := v.Type
  2654  		ptr := v_0
  2655  		mem := v_1
  2656  		if !(is32BitFloat(t)) {
  2657  			break
  2658  		}
  2659  		v.reset(OpPPC64FMOVSload)
  2660  		v.AddArg2(ptr, mem)
  2661  		return true
  2662  	}
  2663  	// match: (Load <t> ptr mem)
  2664  	// cond: is64BitFloat(t)
  2665  	// result: (FMOVDload ptr mem)
  2666  	for {
  2667  		t := v.Type
  2668  		ptr := v_0
  2669  		mem := v_1
  2670  		if !(is64BitFloat(t)) {
  2671  			break
  2672  		}
  2673  		v.reset(OpPPC64FMOVDload)
  2674  		v.AddArg2(ptr, mem)
  2675  		return true
  2676  	}
  2677  	return false
  2678  }
  2679  func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
  2680  	v_1 := v.Args[1]
  2681  	v_0 := v.Args[0]
  2682  	b := v.Block
  2683  	typ := &b.Func.Config.Types
  2684  	// match: (LocalAddr <t> {sym} base mem)
  2685  	// cond: t.Elem().HasPointers()
  2686  	// result: (MOVDaddr {sym} (SPanchored base mem))
  2687  	for {
  2688  		t := v.Type
  2689  		sym := auxToSym(v.Aux)
  2690  		base := v_0
  2691  		mem := v_1
  2692  		if !(t.Elem().HasPointers()) {
  2693  			break
  2694  		}
  2695  		v.reset(OpPPC64MOVDaddr)
  2696  		v.Aux = symToAux(sym)
  2697  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  2698  		v0.AddArg2(base, mem)
  2699  		v.AddArg(v0)
  2700  		return true
  2701  	}
  2702  	// match: (LocalAddr <t> {sym} base _)
  2703  	// cond: !t.Elem().HasPointers()
  2704  	// result: (MOVDaddr {sym} base)
  2705  	for {
  2706  		t := v.Type
  2707  		sym := auxToSym(v.Aux)
  2708  		base := v_0
  2709  		if !(!t.Elem().HasPointers()) {
  2710  			break
  2711  		}
  2712  		v.reset(OpPPC64MOVDaddr)
  2713  		v.Aux = symToAux(sym)
  2714  		v.AddArg(base)
  2715  		return true
  2716  	}
  2717  	return false
  2718  }
  2719  func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
  2720  	v_1 := v.Args[1]
  2721  	v_0 := v.Args[0]
  2722  	b := v.Block
  2723  	typ := &b.Func.Config.Types
  2724  	// match: (Lsh16x16 x y)
  2725  	// cond: shiftIsBounded(v)
  2726  	// result: (SLD x y)
  2727  	for {
  2728  		x := v_0
  2729  		y := v_1
  2730  		if !(shiftIsBounded(v)) {
  2731  			break
  2732  		}
  2733  		v.reset(OpPPC64SLD)
  2734  		v.AddArg2(x, y)
  2735  		return true
  2736  	}
  2737  	// match: (Lsh16x16 <t> x y)
  2738  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF0] y)))
  2739  	for {
  2740  		t := v.Type
  2741  		x := v_0
  2742  		y := v_1
  2743  		v.reset(OpPPC64ISEL)
  2744  		v.AuxInt = int32ToAuxInt(2)
  2745  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2746  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2747  		v1.AddArg(x)
  2748  		v0.AddArg2(v1, y)
  2749  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2750  		v2.AuxInt = int64ToAuxInt(0)
  2751  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2752  		v3.AuxInt = int64ToAuxInt(0)
  2753  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2754  		v4.AuxInt = int64ToAuxInt(0xFFF0)
  2755  		v4.AddArg(y)
  2756  		v3.AddArg(v4)
  2757  		v.AddArg3(v0, v2, v3)
  2758  		return true
  2759  	}
  2760  }
  2761  func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
  2762  	v_1 := v.Args[1]
  2763  	v_0 := v.Args[0]
  2764  	b := v.Block
  2765  	typ := &b.Func.Config.Types
  2766  	// match: (Lsh16x32 x y)
  2767  	// cond: shiftIsBounded(v)
  2768  	// result: (SLD x y)
  2769  	for {
  2770  		x := v_0
  2771  		y := v_1
  2772  		if !(shiftIsBounded(v)) {
  2773  			break
  2774  		}
  2775  		v.reset(OpPPC64SLD)
  2776  		v.AddArg2(x, y)
  2777  		return true
  2778  	}
  2779  	// match: (Lsh16x32 <t> x y)
  2780  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
  2781  	for {
  2782  		t := v.Type
  2783  		x := v_0
  2784  		y := v_1
  2785  		v.reset(OpPPC64ISEL)
  2786  		v.AuxInt = int32ToAuxInt(0)
  2787  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2788  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2789  		v1.AddArg(x)
  2790  		v0.AddArg2(v1, y)
  2791  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2792  		v2.AuxInt = int64ToAuxInt(0)
  2793  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2794  		v3.AuxInt = int32ToAuxInt(16)
  2795  		v3.AddArg(y)
  2796  		v.AddArg3(v0, v2, v3)
  2797  		return true
  2798  	}
  2799  }
  2800  func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
  2801  	v_1 := v.Args[1]
  2802  	v_0 := v.Args[0]
  2803  	b := v.Block
  2804  	typ := &b.Func.Config.Types
  2805  	// match: (Lsh16x64 x (MOVDconst [c]))
  2806  	// cond: uint64(c) < 16
  2807  	// result: (SLWconst x [c])
  2808  	for {
  2809  		x := v_0
  2810  		if v_1.Op != OpPPC64MOVDconst {
  2811  			break
  2812  		}
  2813  		c := auxIntToInt64(v_1.AuxInt)
  2814  		if !(uint64(c) < 16) {
  2815  			break
  2816  		}
  2817  		v.reset(OpPPC64SLWconst)
  2818  		v.AuxInt = int64ToAuxInt(c)
  2819  		v.AddArg(x)
  2820  		return true
  2821  	}
  2822  	// match: (Lsh16x64 x y)
  2823  	// cond: shiftIsBounded(v)
  2824  	// result: (SLD x y)
  2825  	for {
  2826  		x := v_0
  2827  		y := v_1
  2828  		if !(shiftIsBounded(v)) {
  2829  			break
  2830  		}
  2831  		v.reset(OpPPC64SLD)
  2832  		v.AddArg2(x, y)
  2833  		return true
  2834  	}
  2835  	// match: (Lsh16x64 <t> x y)
  2836  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
  2837  	for {
  2838  		t := v.Type
  2839  		x := v_0
  2840  		y := v_1
  2841  		v.reset(OpPPC64ISEL)
  2842  		v.AuxInt = int32ToAuxInt(0)
  2843  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2844  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2845  		v1.AddArg(x)
  2846  		v0.AddArg2(v1, y)
  2847  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2848  		v2.AuxInt = int64ToAuxInt(0)
  2849  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  2850  		v3.AuxInt = int64ToAuxInt(16)
  2851  		v3.AddArg(y)
  2852  		v.AddArg3(v0, v2, v3)
  2853  		return true
  2854  	}
  2855  }
  2856  func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
  2857  	v_1 := v.Args[1]
  2858  	v_0 := v.Args[0]
  2859  	b := v.Block
  2860  	typ := &b.Func.Config.Types
  2861  	// match: (Lsh16x8 x y)
  2862  	// cond: shiftIsBounded(v)
  2863  	// result: (SLD x y)
  2864  	for {
  2865  		x := v_0
  2866  		y := v_1
  2867  		if !(shiftIsBounded(v)) {
  2868  			break
  2869  		}
  2870  		v.reset(OpPPC64SLD)
  2871  		v.AddArg2(x, y)
  2872  		return true
  2873  	}
  2874  	// match: (Lsh16x8 <t> x y)
  2875  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F0] y)))
  2876  	for {
  2877  		t := v.Type
  2878  		x := v_0
  2879  		y := v_1
  2880  		v.reset(OpPPC64ISEL)
  2881  		v.AuxInt = int32ToAuxInt(2)
  2882  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2883  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2884  		v1.AddArg(x)
  2885  		v0.AddArg2(v1, y)
  2886  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2887  		v2.AuxInt = int64ToAuxInt(0)
  2888  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2889  		v3.AuxInt = int64ToAuxInt(0)
  2890  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2891  		v4.AuxInt = int64ToAuxInt(0x00F0)
  2892  		v4.AddArg(y)
  2893  		v3.AddArg(v4)
  2894  		v.AddArg3(v0, v2, v3)
  2895  		return true
  2896  	}
  2897  }
  2898  func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
  2899  	v_1 := v.Args[1]
  2900  	v_0 := v.Args[0]
  2901  	b := v.Block
  2902  	typ := &b.Func.Config.Types
  2903  	// match: (Lsh32x16 x y)
  2904  	// cond: shiftIsBounded(v)
  2905  	// result: (SLW x y)
  2906  	for {
  2907  		x := v_0
  2908  		y := v_1
  2909  		if !(shiftIsBounded(v)) {
  2910  			break
  2911  		}
  2912  		v.reset(OpPPC64SLW)
  2913  		v.AddArg2(x, y)
  2914  		return true
  2915  	}
  2916  	// match: (Lsh32x16 <t> x y)
  2917  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFE0] y)))
  2918  	for {
  2919  		t := v.Type
  2920  		x := v_0
  2921  		y := v_1
  2922  		v.reset(OpPPC64ISEL)
  2923  		v.AuxInt = int32ToAuxInt(2)
  2924  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2925  		v0.AddArg2(x, y)
  2926  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2927  		v1.AuxInt = int64ToAuxInt(0)
  2928  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2929  		v2.AuxInt = int64ToAuxInt(0)
  2930  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2931  		v3.AuxInt = int64ToAuxInt(0xFFE0)
  2932  		v3.AddArg(y)
  2933  		v2.AddArg(v3)
  2934  		v.AddArg3(v0, v1, v2)
  2935  		return true
  2936  	}
  2937  }
  2938  func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
  2939  	v_1 := v.Args[1]
  2940  	v_0 := v.Args[0]
  2941  	b := v.Block
  2942  	typ := &b.Func.Config.Types
  2943  	// match: (Lsh32x32 x y)
  2944  	// cond: shiftIsBounded(v)
  2945  	// result: (SLW x y)
  2946  	for {
  2947  		x := v_0
  2948  		y := v_1
  2949  		if !(shiftIsBounded(v)) {
  2950  			break
  2951  		}
  2952  		v.reset(OpPPC64SLW)
  2953  		v.AddArg2(x, y)
  2954  		return true
  2955  	}
  2956  	// match: (Lsh32x32 <t> x y)
  2957  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
  2958  	for {
  2959  		t := v.Type
  2960  		x := v_0
  2961  		y := v_1
  2962  		v.reset(OpPPC64ISEL)
  2963  		v.AuxInt = int32ToAuxInt(0)
  2964  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2965  		v0.AddArg2(x, y)
  2966  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2967  		v1.AuxInt = int64ToAuxInt(0)
  2968  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2969  		v2.AuxInt = int32ToAuxInt(32)
  2970  		v2.AddArg(y)
  2971  		v.AddArg3(v0, v1, v2)
  2972  		return true
  2973  	}
  2974  }
  2975  func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
  2976  	v_1 := v.Args[1]
  2977  	v_0 := v.Args[0]
  2978  	b := v.Block
  2979  	typ := &b.Func.Config.Types
  2980  	// match: (Lsh32x64 x (MOVDconst [c]))
  2981  	// cond: uint64(c) < 32
  2982  	// result: (SLWconst x [c])
  2983  	for {
  2984  		x := v_0
  2985  		if v_1.Op != OpPPC64MOVDconst {
  2986  			break
  2987  		}
  2988  		c := auxIntToInt64(v_1.AuxInt)
  2989  		if !(uint64(c) < 32) {
  2990  			break
  2991  		}
  2992  		v.reset(OpPPC64SLWconst)
  2993  		v.AuxInt = int64ToAuxInt(c)
  2994  		v.AddArg(x)
  2995  		return true
  2996  	}
  2997  	// match: (Lsh32x64 x y)
  2998  	// cond: shiftIsBounded(v)
  2999  	// result: (SLW x y)
  3000  	for {
  3001  		x := v_0
  3002  		y := v_1
  3003  		if !(shiftIsBounded(v)) {
  3004  			break
  3005  		}
  3006  		v.reset(OpPPC64SLW)
  3007  		v.AddArg2(x, y)
  3008  		return true
  3009  	}
  3010  	// match: (Lsh32x64 <t> x y)
  3011  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
  3012  	for {
  3013  		t := v.Type
  3014  		x := v_0
  3015  		y := v_1
  3016  		v.reset(OpPPC64ISEL)
  3017  		v.AuxInt = int32ToAuxInt(0)
  3018  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  3019  		v0.AddArg2(x, y)
  3020  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3021  		v1.AuxInt = int64ToAuxInt(0)
  3022  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3023  		v2.AuxInt = int64ToAuxInt(32)
  3024  		v2.AddArg(y)
  3025  		v.AddArg3(v0, v1, v2)
  3026  		return true
  3027  	}
  3028  }
  3029  func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
  3030  	v_1 := v.Args[1]
  3031  	v_0 := v.Args[0]
  3032  	b := v.Block
  3033  	typ := &b.Func.Config.Types
  3034  	// match: (Lsh32x8 x y)
  3035  	// cond: shiftIsBounded(v)
  3036  	// result: (SLW x y)
  3037  	for {
  3038  		x := v_0
  3039  		y := v_1
  3040  		if !(shiftIsBounded(v)) {
  3041  			break
  3042  		}
  3043  		v.reset(OpPPC64SLW)
  3044  		v.AddArg2(x, y)
  3045  		return true
  3046  	}
  3047  	// match: (Lsh32x8 <t> x y)
  3048  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00E0] y)))
  3049  	for {
  3050  		t := v.Type
  3051  		x := v_0
  3052  		y := v_1
  3053  		v.reset(OpPPC64ISEL)
  3054  		v.AuxInt = int32ToAuxInt(2)
  3055  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  3056  		v0.AddArg2(x, y)
  3057  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3058  		v1.AuxInt = int64ToAuxInt(0)
  3059  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3060  		v2.AuxInt = int64ToAuxInt(0)
  3061  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3062  		v3.AuxInt = int64ToAuxInt(0x00E0)
  3063  		v3.AddArg(y)
  3064  		v2.AddArg(v3)
  3065  		v.AddArg3(v0, v1, v2)
  3066  		return true
  3067  	}
  3068  }
  3069  func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
  3070  	v_1 := v.Args[1]
  3071  	v_0 := v.Args[0]
  3072  	b := v.Block
  3073  	typ := &b.Func.Config.Types
  3074  	// match: (Lsh64x16 x y)
  3075  	// cond: shiftIsBounded(v)
  3076  	// result: (SLD x y)
  3077  	for {
  3078  		x := v_0
  3079  		y := v_1
  3080  		if !(shiftIsBounded(v)) {
  3081  			break
  3082  		}
  3083  		v.reset(OpPPC64SLD)
  3084  		v.AddArg2(x, y)
  3085  		return true
  3086  	}
  3087  	// match: (Lsh64x16 <t> x y)
  3088  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFC0] y)))
  3089  	for {
  3090  		t := v.Type
  3091  		x := v_0
  3092  		y := v_1
  3093  		v.reset(OpPPC64ISEL)
  3094  		v.AuxInt = int32ToAuxInt(2)
  3095  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3096  		v0.AddArg2(x, y)
  3097  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3098  		v1.AuxInt = int64ToAuxInt(0)
  3099  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3100  		v2.AuxInt = int64ToAuxInt(0)
  3101  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3102  		v3.AuxInt = int64ToAuxInt(0xFFC0)
  3103  		v3.AddArg(y)
  3104  		v2.AddArg(v3)
  3105  		v.AddArg3(v0, v1, v2)
  3106  		return true
  3107  	}
  3108  }
  3109  func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
  3110  	v_1 := v.Args[1]
  3111  	v_0 := v.Args[0]
  3112  	b := v.Block
  3113  	typ := &b.Func.Config.Types
  3114  	// match: (Lsh64x32 x y)
  3115  	// cond: shiftIsBounded(v)
  3116  	// result: (SLD x y)
  3117  	for {
  3118  		x := v_0
  3119  		y := v_1
  3120  		if !(shiftIsBounded(v)) {
  3121  			break
  3122  		}
  3123  		v.reset(OpPPC64SLD)
  3124  		v.AddArg2(x, y)
  3125  		return true
  3126  	}
  3127  	// match: (Lsh64x32 <t> x y)
  3128  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
  3129  	for {
  3130  		t := v.Type
  3131  		x := v_0
  3132  		y := v_1
  3133  		v.reset(OpPPC64ISEL)
  3134  		v.AuxInt = int32ToAuxInt(0)
  3135  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3136  		v0.AddArg2(x, y)
  3137  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3138  		v1.AuxInt = int64ToAuxInt(0)
  3139  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3140  		v2.AuxInt = int32ToAuxInt(64)
  3141  		v2.AddArg(y)
  3142  		v.AddArg3(v0, v1, v2)
  3143  		return true
  3144  	}
  3145  }
  3146  func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
  3147  	v_1 := v.Args[1]
  3148  	v_0 := v.Args[0]
  3149  	b := v.Block
  3150  	typ := &b.Func.Config.Types
  3151  	// match: (Lsh64x64 x (MOVDconst [c]))
  3152  	// cond: uint64(c) < 64
  3153  	// result: (SLDconst x [c])
  3154  	for {
  3155  		x := v_0
  3156  		if v_1.Op != OpPPC64MOVDconst {
  3157  			break
  3158  		}
  3159  		c := auxIntToInt64(v_1.AuxInt)
  3160  		if !(uint64(c) < 64) {
  3161  			break
  3162  		}
  3163  		v.reset(OpPPC64SLDconst)
  3164  		v.AuxInt = int64ToAuxInt(c)
  3165  		v.AddArg(x)
  3166  		return true
  3167  	}
  3168  	// match: (Lsh64x64 x y)
  3169  	// cond: shiftIsBounded(v)
  3170  	// result: (SLD x y)
  3171  	for {
  3172  		x := v_0
  3173  		y := v_1
  3174  		if !(shiftIsBounded(v)) {
  3175  			break
  3176  		}
  3177  		v.reset(OpPPC64SLD)
  3178  		v.AddArg2(x, y)
  3179  		return true
  3180  	}
  3181  	// match: (Lsh64x64 <t> x y)
  3182  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
  3183  	for {
  3184  		t := v.Type
  3185  		x := v_0
  3186  		y := v_1
  3187  		v.reset(OpPPC64ISEL)
  3188  		v.AuxInt = int32ToAuxInt(0)
  3189  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3190  		v0.AddArg2(x, y)
  3191  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3192  		v1.AuxInt = int64ToAuxInt(0)
  3193  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3194  		v2.AuxInt = int64ToAuxInt(64)
  3195  		v2.AddArg(y)
  3196  		v.AddArg3(v0, v1, v2)
  3197  		return true
  3198  	}
  3199  }
  3200  func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
  3201  	v_1 := v.Args[1]
  3202  	v_0 := v.Args[0]
  3203  	b := v.Block
  3204  	typ := &b.Func.Config.Types
  3205  	// match: (Lsh64x8 x y)
  3206  	// cond: shiftIsBounded(v)
  3207  	// result: (SLD x y)
  3208  	for {
  3209  		x := v_0
  3210  		y := v_1
  3211  		if !(shiftIsBounded(v)) {
  3212  			break
  3213  		}
  3214  		v.reset(OpPPC64SLD)
  3215  		v.AddArg2(x, y)
  3216  		return true
  3217  	}
  3218  	// match: (Lsh64x8 <t> x y)
  3219  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00C0] y)))
  3220  	for {
  3221  		t := v.Type
  3222  		x := v_0
  3223  		y := v_1
  3224  		v.reset(OpPPC64ISEL)
  3225  		v.AuxInt = int32ToAuxInt(2)
  3226  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3227  		v0.AddArg2(x, y)
  3228  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3229  		v1.AuxInt = int64ToAuxInt(0)
  3230  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3231  		v2.AuxInt = int64ToAuxInt(0)
  3232  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3233  		v3.AuxInt = int64ToAuxInt(0x00C0)
  3234  		v3.AddArg(y)
  3235  		v2.AddArg(v3)
  3236  		v.AddArg3(v0, v1, v2)
  3237  		return true
  3238  	}
  3239  }
  3240  func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
  3241  	v_1 := v.Args[1]
  3242  	v_0 := v.Args[0]
  3243  	b := v.Block
  3244  	typ := &b.Func.Config.Types
  3245  	// match: (Lsh8x16 x y)
  3246  	// cond: shiftIsBounded(v)
  3247  	// result: (SLD x y)
  3248  	for {
  3249  		x := v_0
  3250  		y := v_1
  3251  		if !(shiftIsBounded(v)) {
  3252  			break
  3253  		}
  3254  		v.reset(OpPPC64SLD)
  3255  		v.AddArg2(x, y)
  3256  		return true
  3257  	}
  3258  	// match: (Lsh8x16 <t> x y)
  3259  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF8] y)))
  3260  	for {
  3261  		t := v.Type
  3262  		x := v_0
  3263  		y := v_1
  3264  		v.reset(OpPPC64ISEL)
  3265  		v.AuxInt = int32ToAuxInt(2)
  3266  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3267  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3268  		v1.AddArg(x)
  3269  		v0.AddArg2(v1, y)
  3270  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3271  		v2.AuxInt = int64ToAuxInt(0)
  3272  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3273  		v3.AuxInt = int64ToAuxInt(0)
  3274  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3275  		v4.AuxInt = int64ToAuxInt(0xFFF8)
  3276  		v4.AddArg(y)
  3277  		v3.AddArg(v4)
  3278  		v.AddArg3(v0, v2, v3)
  3279  		return true
  3280  	}
  3281  }
  3282  func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
  3283  	v_1 := v.Args[1]
  3284  	v_0 := v.Args[0]
  3285  	b := v.Block
  3286  	typ := &b.Func.Config.Types
  3287  	// match: (Lsh8x32 x y)
  3288  	// cond: shiftIsBounded(v)
  3289  	// result: (SLD x y)
  3290  	for {
  3291  		x := v_0
  3292  		y := v_1
  3293  		if !(shiftIsBounded(v)) {
  3294  			break
  3295  		}
  3296  		v.reset(OpPPC64SLD)
  3297  		v.AddArg2(x, y)
  3298  		return true
  3299  	}
  3300  	// match: (Lsh8x32 <t> x y)
  3301  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
  3302  	for {
  3303  		t := v.Type
  3304  		x := v_0
  3305  		y := v_1
  3306  		v.reset(OpPPC64ISEL)
  3307  		v.AuxInt = int32ToAuxInt(0)
  3308  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3309  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3310  		v1.AddArg(x)
  3311  		v0.AddArg2(v1, y)
  3312  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3313  		v2.AuxInt = int64ToAuxInt(0)
  3314  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3315  		v3.AuxInt = int32ToAuxInt(8)
  3316  		v3.AddArg(y)
  3317  		v.AddArg3(v0, v2, v3)
  3318  		return true
  3319  	}
  3320  }
  3321  func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
  3322  	v_1 := v.Args[1]
  3323  	v_0 := v.Args[0]
  3324  	b := v.Block
  3325  	typ := &b.Func.Config.Types
  3326  	// match: (Lsh8x64 x (MOVDconst [c]))
  3327  	// cond: uint64(c) < 8
  3328  	// result: (SLWconst x [c])
  3329  	for {
  3330  		x := v_0
  3331  		if v_1.Op != OpPPC64MOVDconst {
  3332  			break
  3333  		}
  3334  		c := auxIntToInt64(v_1.AuxInt)
  3335  		if !(uint64(c) < 8) {
  3336  			break
  3337  		}
  3338  		v.reset(OpPPC64SLWconst)
  3339  		v.AuxInt = int64ToAuxInt(c)
  3340  		v.AddArg(x)
  3341  		return true
  3342  	}
  3343  	// match: (Lsh8x64 x y)
  3344  	// cond: shiftIsBounded(v)
  3345  	// result: (SLD x y)
  3346  	for {
  3347  		x := v_0
  3348  		y := v_1
  3349  		if !(shiftIsBounded(v)) {
  3350  			break
  3351  		}
  3352  		v.reset(OpPPC64SLD)
  3353  		v.AddArg2(x, y)
  3354  		return true
  3355  	}
  3356  	// match: (Lsh8x64 <t> x y)
  3357  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
  3358  	for {
  3359  		t := v.Type
  3360  		x := v_0
  3361  		y := v_1
  3362  		v.reset(OpPPC64ISEL)
  3363  		v.AuxInt = int32ToAuxInt(0)
  3364  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3365  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3366  		v1.AddArg(x)
  3367  		v0.AddArg2(v1, y)
  3368  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3369  		v2.AuxInt = int64ToAuxInt(0)
  3370  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3371  		v3.AuxInt = int64ToAuxInt(8)
  3372  		v3.AddArg(y)
  3373  		v.AddArg3(v0, v2, v3)
  3374  		return true
  3375  	}
  3376  }
  3377  func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
  3378  	v_1 := v.Args[1]
  3379  	v_0 := v.Args[0]
  3380  	b := v.Block
  3381  	typ := &b.Func.Config.Types
  3382  	// match: (Lsh8x8 x y)
  3383  	// cond: shiftIsBounded(v)
  3384  	// result: (SLD x y)
  3385  	for {
  3386  		x := v_0
  3387  		y := v_1
  3388  		if !(shiftIsBounded(v)) {
  3389  			break
  3390  		}
  3391  		v.reset(OpPPC64SLD)
  3392  		v.AddArg2(x, y)
  3393  		return true
  3394  	}
  3395  	// match: (Lsh8x8 <t> x y)
  3396  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F8] y)))
  3397  	for {
  3398  		t := v.Type
  3399  		x := v_0
  3400  		y := v_1
  3401  		v.reset(OpPPC64ISEL)
  3402  		v.AuxInt = int32ToAuxInt(2)
  3403  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3404  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3405  		v1.AddArg(x)
  3406  		v0.AddArg2(v1, y)
  3407  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3408  		v2.AuxInt = int64ToAuxInt(0)
  3409  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3410  		v3.AuxInt = int64ToAuxInt(0)
  3411  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3412  		v4.AuxInt = int64ToAuxInt(0x00F8)
  3413  		v4.AddArg(y)
  3414  		v3.AddArg(v4)
  3415  		v.AddArg3(v0, v2, v3)
  3416  		return true
  3417  	}
  3418  }
  3419  func rewriteValuePPC64_OpMax32F(v *Value) bool {
  3420  	v_1 := v.Args[1]
  3421  	v_0 := v.Args[0]
  3422  	// match: (Max32F x y)
  3423  	// cond: buildcfg.GOPPC64 >= 9
  3424  	// result: (XSMAXJDP x y)
  3425  	for {
  3426  		x := v_0
  3427  		y := v_1
  3428  		if !(buildcfg.GOPPC64 >= 9) {
  3429  			break
  3430  		}
  3431  		v.reset(OpPPC64XSMAXJDP)
  3432  		v.AddArg2(x, y)
  3433  		return true
  3434  	}
  3435  	return false
  3436  }
  3437  func rewriteValuePPC64_OpMax64F(v *Value) bool {
  3438  	v_1 := v.Args[1]
  3439  	v_0 := v.Args[0]
  3440  	// match: (Max64F x y)
  3441  	// cond: buildcfg.GOPPC64 >= 9
  3442  	// result: (XSMAXJDP x y)
  3443  	for {
  3444  		x := v_0
  3445  		y := v_1
  3446  		if !(buildcfg.GOPPC64 >= 9) {
  3447  			break
  3448  		}
  3449  		v.reset(OpPPC64XSMAXJDP)
  3450  		v.AddArg2(x, y)
  3451  		return true
  3452  	}
  3453  	return false
  3454  }
  3455  func rewriteValuePPC64_OpMin32F(v *Value) bool {
  3456  	v_1 := v.Args[1]
  3457  	v_0 := v.Args[0]
  3458  	// match: (Min32F x y)
  3459  	// cond: buildcfg.GOPPC64 >= 9
  3460  	// result: (XSMINJDP x y)
  3461  	for {
  3462  		x := v_0
  3463  		y := v_1
  3464  		if !(buildcfg.GOPPC64 >= 9) {
  3465  			break
  3466  		}
  3467  		v.reset(OpPPC64XSMINJDP)
  3468  		v.AddArg2(x, y)
  3469  		return true
  3470  	}
  3471  	return false
  3472  }
  3473  func rewriteValuePPC64_OpMin64F(v *Value) bool {
  3474  	v_1 := v.Args[1]
  3475  	v_0 := v.Args[0]
  3476  	// match: (Min64F x y)
  3477  	// cond: buildcfg.GOPPC64 >= 9
  3478  	// result: (XSMINJDP x y)
  3479  	for {
  3480  		x := v_0
  3481  		y := v_1
  3482  		if !(buildcfg.GOPPC64 >= 9) {
  3483  			break
  3484  		}
  3485  		v.reset(OpPPC64XSMINJDP)
  3486  		v.AddArg2(x, y)
  3487  		return true
  3488  	}
  3489  	return false
  3490  }
  3491  func rewriteValuePPC64_OpMod16(v *Value) bool {
  3492  	v_1 := v.Args[1]
  3493  	v_0 := v.Args[0]
  3494  	b := v.Block
  3495  	typ := &b.Func.Config.Types
  3496  	// match: (Mod16 x y)
  3497  	// result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
  3498  	for {
  3499  		x := v_0
  3500  		y := v_1
  3501  		v.reset(OpMod32)
  3502  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3503  		v0.AddArg(x)
  3504  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3505  		v1.AddArg(y)
  3506  		v.AddArg2(v0, v1)
  3507  		return true
  3508  	}
  3509  }
  3510  func rewriteValuePPC64_OpMod16u(v *Value) bool {
  3511  	v_1 := v.Args[1]
  3512  	v_0 := v.Args[0]
  3513  	b := v.Block
  3514  	typ := &b.Func.Config.Types
  3515  	// match: (Mod16u x y)
  3516  	// result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
  3517  	for {
  3518  		x := v_0
  3519  		y := v_1
  3520  		v.reset(OpMod32u)
  3521  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3522  		v0.AddArg(x)
  3523  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3524  		v1.AddArg(y)
  3525  		v.AddArg2(v0, v1)
  3526  		return true
  3527  	}
  3528  }
  3529  func rewriteValuePPC64_OpMod32(v *Value) bool {
  3530  	v_1 := v.Args[1]
  3531  	v_0 := v.Args[0]
  3532  	b := v.Block
  3533  	typ := &b.Func.Config.Types
  3534  	// match: (Mod32 x y)
  3535  	// cond: buildcfg.GOPPC64 >= 9
  3536  	// result: (MODSW x y)
  3537  	for {
  3538  		x := v_0
  3539  		y := v_1
  3540  		if !(buildcfg.GOPPC64 >= 9) {
  3541  			break
  3542  		}
  3543  		v.reset(OpPPC64MODSW)
  3544  		v.AddArg2(x, y)
  3545  		return true
  3546  	}
  3547  	// match: (Mod32 x y)
  3548  	// cond: buildcfg.GOPPC64 <= 8
  3549  	// result: (SUB x (MULLW y (DIVW x y)))
  3550  	for {
  3551  		x := v_0
  3552  		y := v_1
  3553  		if !(buildcfg.GOPPC64 <= 8) {
  3554  			break
  3555  		}
  3556  		v.reset(OpPPC64SUB)
  3557  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3558  		v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
  3559  		v1.AddArg2(x, y)
  3560  		v0.AddArg2(y, v1)
  3561  		v.AddArg2(x, v0)
  3562  		return true
  3563  	}
  3564  	return false
  3565  }
  3566  func rewriteValuePPC64_OpMod32u(v *Value) bool {
  3567  	v_1 := v.Args[1]
  3568  	v_0 := v.Args[0]
  3569  	b := v.Block
  3570  	typ := &b.Func.Config.Types
  3571  	// match: (Mod32u x y)
  3572  	// cond: buildcfg.GOPPC64 >= 9
  3573  	// result: (MODUW x y)
  3574  	for {
  3575  		x := v_0
  3576  		y := v_1
  3577  		if !(buildcfg.GOPPC64 >= 9) {
  3578  			break
  3579  		}
  3580  		v.reset(OpPPC64MODUW)
  3581  		v.AddArg2(x, y)
  3582  		return true
  3583  	}
  3584  	// match: (Mod32u x y)
  3585  	// cond: buildcfg.GOPPC64 <= 8
  3586  	// result: (SUB x (MULLW y (DIVWU x y)))
  3587  	for {
  3588  		x := v_0
  3589  		y := v_1
  3590  		if !(buildcfg.GOPPC64 <= 8) {
  3591  			break
  3592  		}
  3593  		v.reset(OpPPC64SUB)
  3594  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3595  		v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
  3596  		v1.AddArg2(x, y)
  3597  		v0.AddArg2(y, v1)
  3598  		v.AddArg2(x, v0)
  3599  		return true
  3600  	}
  3601  	return false
  3602  }
  3603  func rewriteValuePPC64_OpMod64(v *Value) bool {
  3604  	v_1 := v.Args[1]
  3605  	v_0 := v.Args[0]
  3606  	b := v.Block
  3607  	typ := &b.Func.Config.Types
  3608  	// match: (Mod64 x y)
  3609  	// cond: buildcfg.GOPPC64 >=9
  3610  	// result: (MODSD x y)
  3611  	for {
  3612  		x := v_0
  3613  		y := v_1
  3614  		if !(buildcfg.GOPPC64 >= 9) {
  3615  			break
  3616  		}
  3617  		v.reset(OpPPC64MODSD)
  3618  		v.AddArg2(x, y)
  3619  		return true
  3620  	}
  3621  	// match: (Mod64 x y)
  3622  	// cond: buildcfg.GOPPC64 <=8
  3623  	// result: (SUB x (MULLD y (DIVD x y)))
  3624  	for {
  3625  		x := v_0
  3626  		y := v_1
  3627  		if !(buildcfg.GOPPC64 <= 8) {
  3628  			break
  3629  		}
  3630  		v.reset(OpPPC64SUB)
  3631  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3632  		v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
  3633  		v1.AddArg2(x, y)
  3634  		v0.AddArg2(y, v1)
  3635  		v.AddArg2(x, v0)
  3636  		return true
  3637  	}
  3638  	return false
  3639  }
  3640  func rewriteValuePPC64_OpMod64u(v *Value) bool {
  3641  	v_1 := v.Args[1]
  3642  	v_0 := v.Args[0]
  3643  	b := v.Block
  3644  	typ := &b.Func.Config.Types
  3645  	// match: (Mod64u x y)
  3646  	// cond: buildcfg.GOPPC64 >= 9
  3647  	// result: (MODUD x y)
  3648  	for {
  3649  		x := v_0
  3650  		y := v_1
  3651  		if !(buildcfg.GOPPC64 >= 9) {
  3652  			break
  3653  		}
  3654  		v.reset(OpPPC64MODUD)
  3655  		v.AddArg2(x, y)
  3656  		return true
  3657  	}
  3658  	// match: (Mod64u x y)
  3659  	// cond: buildcfg.GOPPC64 <= 8
  3660  	// result: (SUB x (MULLD y (DIVDU x y)))
  3661  	for {
  3662  		x := v_0
  3663  		y := v_1
  3664  		if !(buildcfg.GOPPC64 <= 8) {
  3665  			break
  3666  		}
  3667  		v.reset(OpPPC64SUB)
  3668  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3669  		v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
  3670  		v1.AddArg2(x, y)
  3671  		v0.AddArg2(y, v1)
  3672  		v.AddArg2(x, v0)
  3673  		return true
  3674  	}
  3675  	return false
  3676  }
  3677  func rewriteValuePPC64_OpMod8(v *Value) bool {
  3678  	v_1 := v.Args[1]
  3679  	v_0 := v.Args[0]
  3680  	b := v.Block
  3681  	typ := &b.Func.Config.Types
  3682  	// match: (Mod8 x y)
  3683  	// result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
  3684  	for {
  3685  		x := v_0
  3686  		y := v_1
  3687  		v.reset(OpMod32)
  3688  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3689  		v0.AddArg(x)
  3690  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3691  		v1.AddArg(y)
  3692  		v.AddArg2(v0, v1)
  3693  		return true
  3694  	}
  3695  }
  3696  func rewriteValuePPC64_OpMod8u(v *Value) bool {
  3697  	v_1 := v.Args[1]
  3698  	v_0 := v.Args[0]
  3699  	b := v.Block
  3700  	typ := &b.Func.Config.Types
  3701  	// match: (Mod8u x y)
  3702  	// result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
  3703  	for {
  3704  		x := v_0
  3705  		y := v_1
  3706  		v.reset(OpMod32u)
  3707  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3708  		v0.AddArg(x)
  3709  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3710  		v1.AddArg(y)
  3711  		v.AddArg2(v0, v1)
  3712  		return true
  3713  	}
  3714  }
  3715  func rewriteValuePPC64_OpMove(v *Value) bool {
  3716  	v_2 := v.Args[2]
  3717  	v_1 := v.Args[1]
  3718  	v_0 := v.Args[0]
  3719  	b := v.Block
  3720  	typ := &b.Func.Config.Types
  3721  	// match: (Move [0] _ _ mem)
  3722  	// result: mem
  3723  	for {
  3724  		if auxIntToInt64(v.AuxInt) != 0 {
  3725  			break
  3726  		}
  3727  		mem := v_2
  3728  		v.copyOf(mem)
  3729  		return true
  3730  	}
  3731  	// match: (Move [1] dst src mem)
  3732  	// result: (MOVBstore dst (MOVBZload src mem) mem)
  3733  	for {
  3734  		if auxIntToInt64(v.AuxInt) != 1 {
  3735  			break
  3736  		}
  3737  		dst := v_0
  3738  		src := v_1
  3739  		mem := v_2
  3740  		v.reset(OpPPC64MOVBstore)
  3741  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3742  		v0.AddArg2(src, mem)
  3743  		v.AddArg3(dst, v0, mem)
  3744  		return true
  3745  	}
  3746  	// match: (Move [2] dst src mem)
  3747  	// result: (MOVHstore dst (MOVHZload src mem) mem)
  3748  	for {
  3749  		if auxIntToInt64(v.AuxInt) != 2 {
  3750  			break
  3751  		}
  3752  		dst := v_0
  3753  		src := v_1
  3754  		mem := v_2
  3755  		v.reset(OpPPC64MOVHstore)
  3756  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3757  		v0.AddArg2(src, mem)
  3758  		v.AddArg3(dst, v0, mem)
  3759  		return true
  3760  	}
  3761  	// match: (Move [4] dst src mem)
  3762  	// result: (MOVWstore dst (MOVWZload src mem) mem)
  3763  	for {
  3764  		if auxIntToInt64(v.AuxInt) != 4 {
  3765  			break
  3766  		}
  3767  		dst := v_0
  3768  		src := v_1
  3769  		mem := v_2
  3770  		v.reset(OpPPC64MOVWstore)
  3771  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3772  		v0.AddArg2(src, mem)
  3773  		v.AddArg3(dst, v0, mem)
  3774  		return true
  3775  	}
  3776  	// match: (Move [8] {t} dst src mem)
  3777  	// result: (MOVDstore dst (MOVDload src mem) mem)
  3778  	for {
  3779  		if auxIntToInt64(v.AuxInt) != 8 {
  3780  			break
  3781  		}
  3782  		dst := v_0
  3783  		src := v_1
  3784  		mem := v_2
  3785  		v.reset(OpPPC64MOVDstore)
  3786  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
  3787  		v0.AddArg2(src, mem)
  3788  		v.AddArg3(dst, v0, mem)
  3789  		return true
  3790  	}
  3791  	// match: (Move [3] dst src mem)
  3792  	// result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
  3793  	for {
  3794  		if auxIntToInt64(v.AuxInt) != 3 {
  3795  			break
  3796  		}
  3797  		dst := v_0
  3798  		src := v_1
  3799  		mem := v_2
  3800  		v.reset(OpPPC64MOVBstore)
  3801  		v.AuxInt = int32ToAuxInt(2)
  3802  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3803  		v0.AuxInt = int32ToAuxInt(2)
  3804  		v0.AddArg2(src, mem)
  3805  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3806  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
  3807  		v2.AddArg2(src, mem)
  3808  		v1.AddArg3(dst, v2, mem)
  3809  		v.AddArg3(dst, v0, v1)
  3810  		return true
  3811  	}
  3812  	// match: (Move [5] dst src mem)
  3813  	// result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3814  	for {
  3815  		if auxIntToInt64(v.AuxInt) != 5 {
  3816  			break
  3817  		}
  3818  		dst := v_0
  3819  		src := v_1
  3820  		mem := v_2
  3821  		v.reset(OpPPC64MOVBstore)
  3822  		v.AuxInt = int32ToAuxInt(4)
  3823  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3824  		v0.AuxInt = int32ToAuxInt(4)
  3825  		v0.AddArg2(src, mem)
  3826  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3827  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3828  		v2.AddArg2(src, mem)
  3829  		v1.AddArg3(dst, v2, mem)
  3830  		v.AddArg3(dst, v0, v1)
  3831  		return true
  3832  	}
  3833  	// match: (Move [6] dst src mem)
  3834  	// result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3835  	for {
  3836  		if auxIntToInt64(v.AuxInt) != 6 {
  3837  			break
  3838  		}
  3839  		dst := v_0
  3840  		src := v_1
  3841  		mem := v_2
  3842  		v.reset(OpPPC64MOVHstore)
  3843  		v.AuxInt = int32ToAuxInt(4)
  3844  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3845  		v0.AuxInt = int32ToAuxInt(4)
  3846  		v0.AddArg2(src, mem)
  3847  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3848  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3849  		v2.AddArg2(src, mem)
  3850  		v1.AddArg3(dst, v2, mem)
  3851  		v.AddArg3(dst, v0, v1)
  3852  		return true
  3853  	}
  3854  	// match: (Move [7] dst src mem)
  3855  	// result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)))
  3856  	for {
  3857  		if auxIntToInt64(v.AuxInt) != 7 {
  3858  			break
  3859  		}
  3860  		dst := v_0
  3861  		src := v_1
  3862  		mem := v_2
  3863  		v.reset(OpPPC64MOVBstore)
  3864  		v.AuxInt = int32ToAuxInt(6)
  3865  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3866  		v0.AuxInt = int32ToAuxInt(6)
  3867  		v0.AddArg2(src, mem)
  3868  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3869  		v1.AuxInt = int32ToAuxInt(4)
  3870  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3871  		v2.AuxInt = int32ToAuxInt(4)
  3872  		v2.AddArg2(src, mem)
  3873  		v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3874  		v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3875  		v4.AddArg2(src, mem)
  3876  		v3.AddArg3(dst, v4, mem)
  3877  		v1.AddArg3(dst, v2, v3)
  3878  		v.AddArg3(dst, v0, v1)
  3879  		return true
  3880  	}
  3881  	// match: (Move [s] dst src mem)
  3882  	// cond: s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)
  3883  	// result: (LoweredMove [s] dst src mem)
  3884  	for {
  3885  		s := auxIntToInt64(v.AuxInt)
  3886  		dst := v_0
  3887  		src := v_1
  3888  		mem := v_2
  3889  		if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) {
  3890  			break
  3891  		}
  3892  		v.reset(OpPPC64LoweredMove)
  3893  		v.AuxInt = int64ToAuxInt(s)
  3894  		v.AddArg3(dst, src, mem)
  3895  		return true
  3896  	}
  3897  	// match: (Move [s] dst src mem)
  3898  	// cond: s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9
  3899  	// result: (LoweredQuadMoveShort [s] dst src mem)
  3900  	for {
  3901  		s := auxIntToInt64(v.AuxInt)
  3902  		dst := v_0
  3903  		src := v_1
  3904  		mem := v_2
  3905  		if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) {
  3906  			break
  3907  		}
  3908  		v.reset(OpPPC64LoweredQuadMoveShort)
  3909  		v.AuxInt = int64ToAuxInt(s)
  3910  		v.AddArg3(dst, src, mem)
  3911  		return true
  3912  	}
  3913  	// match: (Move [s] dst src mem)
  3914  	// cond: s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)
  3915  	// result: (LoweredQuadMove [s] dst src mem)
  3916  	for {
  3917  		s := auxIntToInt64(v.AuxInt)
  3918  		dst := v_0
  3919  		src := v_1
  3920  		mem := v_2
  3921  		if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) {
  3922  			break
  3923  		}
  3924  		v.reset(OpPPC64LoweredQuadMove)
  3925  		v.AuxInt = int64ToAuxInt(s)
  3926  		v.AddArg3(dst, src, mem)
  3927  		return true
  3928  	}
  3929  	return false
  3930  }
  3931  func rewriteValuePPC64_OpNeq16(v *Value) bool {
  3932  	v_1 := v.Args[1]
  3933  	v_0 := v.Args[0]
  3934  	b := v.Block
  3935  	typ := &b.Func.Config.Types
  3936  	// match: (Neq16 x y)
  3937  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  3938  	// result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  3939  	for {
  3940  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3941  			x := v_0
  3942  			y := v_1
  3943  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  3944  				continue
  3945  			}
  3946  			v.reset(OpPPC64NotEqual)
  3947  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3948  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3949  			v1.AddArg(x)
  3950  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3951  			v2.AddArg(y)
  3952  			v0.AddArg2(v1, v2)
  3953  			v.AddArg(v0)
  3954  			return true
  3955  		}
  3956  		break
  3957  	}
  3958  	// match: (Neq16 x y)
  3959  	// result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  3960  	for {
  3961  		x := v_0
  3962  		y := v_1
  3963  		v.reset(OpPPC64NotEqual)
  3964  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3965  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3966  		v1.AddArg(x)
  3967  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3968  		v2.AddArg(y)
  3969  		v0.AddArg2(v1, v2)
  3970  		v.AddArg(v0)
  3971  		return true
  3972  	}
  3973  }
  3974  func rewriteValuePPC64_OpNeq32(v *Value) bool {
  3975  	v_1 := v.Args[1]
  3976  	v_0 := v.Args[0]
  3977  	b := v.Block
  3978  	// match: (Neq32 x y)
  3979  	// result: (NotEqual (CMPW x y))
  3980  	for {
  3981  		x := v_0
  3982  		y := v_1
  3983  		v.reset(OpPPC64NotEqual)
  3984  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3985  		v0.AddArg2(x, y)
  3986  		v.AddArg(v0)
  3987  		return true
  3988  	}
  3989  }
  3990  func rewriteValuePPC64_OpNeq32F(v *Value) bool {
  3991  	v_1 := v.Args[1]
  3992  	v_0 := v.Args[0]
  3993  	b := v.Block
  3994  	// match: (Neq32F x y)
  3995  	// result: (NotEqual (FCMPU x y))
  3996  	for {
  3997  		x := v_0
  3998  		y := v_1
  3999  		v.reset(OpPPC64NotEqual)
  4000  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  4001  		v0.AddArg2(x, y)
  4002  		v.AddArg(v0)
  4003  		return true
  4004  	}
  4005  }
  4006  func rewriteValuePPC64_OpNeq64(v *Value) bool {
  4007  	v_1 := v.Args[1]
  4008  	v_0 := v.Args[0]
  4009  	b := v.Block
  4010  	// match: (Neq64 x y)
  4011  	// result: (NotEqual (CMP x y))
  4012  	for {
  4013  		x := v_0
  4014  		y := v_1
  4015  		v.reset(OpPPC64NotEqual)
  4016  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  4017  		v0.AddArg2(x, y)
  4018  		v.AddArg(v0)
  4019  		return true
  4020  	}
  4021  }
  4022  func rewriteValuePPC64_OpNeq64F(v *Value) bool {
  4023  	v_1 := v.Args[1]
  4024  	v_0 := v.Args[0]
  4025  	b := v.Block
  4026  	// match: (Neq64F x y)
  4027  	// result: (NotEqual (FCMPU x y))
  4028  	for {
  4029  		x := v_0
  4030  		y := v_1
  4031  		v.reset(OpPPC64NotEqual)
  4032  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  4033  		v0.AddArg2(x, y)
  4034  		v.AddArg(v0)
  4035  		return true
  4036  	}
  4037  }
  4038  func rewriteValuePPC64_OpNeq8(v *Value) bool {
  4039  	v_1 := v.Args[1]
  4040  	v_0 := v.Args[0]
  4041  	b := v.Block
  4042  	typ := &b.Func.Config.Types
  4043  	// match: (Neq8 x y)
  4044  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  4045  	// result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  4046  	for {
  4047  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4048  			x := v_0
  4049  			y := v_1
  4050  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  4051  				continue
  4052  			}
  4053  			v.reset(OpPPC64NotEqual)
  4054  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  4055  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  4056  			v1.AddArg(x)
  4057  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  4058  			v2.AddArg(y)
  4059  			v0.AddArg2(v1, v2)
  4060  			v.AddArg(v0)
  4061  			return true
  4062  		}
  4063  		break
  4064  	}
  4065  	// match: (Neq8 x y)
  4066  	// result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  4067  	for {
  4068  		x := v_0
  4069  		y := v_1
  4070  		v.reset(OpPPC64NotEqual)
  4071  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  4072  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  4073  		v1.AddArg(x)
  4074  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  4075  		v2.AddArg(y)
  4076  		v0.AddArg2(v1, v2)
  4077  		v.AddArg(v0)
  4078  		return true
  4079  	}
  4080  }
  4081  func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
  4082  	v_1 := v.Args[1]
  4083  	v_0 := v.Args[0]
  4084  	b := v.Block
  4085  	// match: (NeqPtr x y)
  4086  	// result: (NotEqual (CMP x y))
  4087  	for {
  4088  		x := v_0
  4089  		y := v_1
  4090  		v.reset(OpPPC64NotEqual)
  4091  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  4092  		v0.AddArg2(x, y)
  4093  		v.AddArg(v0)
  4094  		return true
  4095  	}
  4096  }
  4097  func rewriteValuePPC64_OpNot(v *Value) bool {
  4098  	v_0 := v.Args[0]
  4099  	// match: (Not x)
  4100  	// result: (XORconst [1] x)
  4101  	for {
  4102  		x := v_0
  4103  		v.reset(OpPPC64XORconst)
  4104  		v.AuxInt = int64ToAuxInt(1)
  4105  		v.AddArg(x)
  4106  		return true
  4107  	}
  4108  }
  4109  func rewriteValuePPC64_OpOffPtr(v *Value) bool {
  4110  	v_0 := v.Args[0]
  4111  	b := v.Block
  4112  	typ := &b.Func.Config.Types
  4113  	// match: (OffPtr [off] ptr)
  4114  	// result: (ADD (MOVDconst <typ.Int64> [off]) ptr)
  4115  	for {
  4116  		off := auxIntToInt64(v.AuxInt)
  4117  		ptr := v_0
  4118  		v.reset(OpPPC64ADD)
  4119  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  4120  		v0.AuxInt = int64ToAuxInt(off)
  4121  		v.AddArg2(v0, ptr)
  4122  		return true
  4123  	}
  4124  }
  4125  func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
  4126  	v_1 := v.Args[1]
  4127  	v_0 := v.Args[0]
  4128  	// match: (ADD l:(MULLD x y) z)
  4129  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4130  	// result: (MADDLD x y z)
  4131  	for {
  4132  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4133  			l := v_0
  4134  			if l.Op != OpPPC64MULLD {
  4135  				continue
  4136  			}
  4137  			y := l.Args[1]
  4138  			x := l.Args[0]
  4139  			z := v_1
  4140  			if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4141  				continue
  4142  			}
  4143  			v.reset(OpPPC64MADDLD)
  4144  			v.AddArg3(x, y, z)
  4145  			return true
  4146  		}
  4147  		break
  4148  	}
  4149  	// match: (ADD x (MOVDconst <t> [c]))
  4150  	// cond: is32Bit(c) && !t.IsPtr()
  4151  	// result: (ADDconst [c] x)
  4152  	for {
  4153  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4154  			x := v_0
  4155  			if v_1.Op != OpPPC64MOVDconst {
  4156  				continue
  4157  			}
  4158  			t := v_1.Type
  4159  			c := auxIntToInt64(v_1.AuxInt)
  4160  			if !(is32Bit(c) && !t.IsPtr()) {
  4161  				continue
  4162  			}
  4163  			v.reset(OpPPC64ADDconst)
  4164  			v.AuxInt = int64ToAuxInt(c)
  4165  			v.AddArg(x)
  4166  			return true
  4167  		}
  4168  		break
  4169  	}
  4170  	return false
  4171  }
  4172  func rewriteValuePPC64_OpPPC64ADDC(v *Value) bool {
  4173  	v_1 := v.Args[1]
  4174  	v_0 := v.Args[0]
  4175  	// match: (ADDC x (MOVDconst [y]))
  4176  	// cond: is16Bit(y)
  4177  	// result: (ADDCconst [y] x)
  4178  	for {
  4179  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4180  			x := v_0
  4181  			if v_1.Op != OpPPC64MOVDconst {
  4182  				continue
  4183  			}
  4184  			y := auxIntToInt64(v_1.AuxInt)
  4185  			if !(is16Bit(y)) {
  4186  				continue
  4187  			}
  4188  			v.reset(OpPPC64ADDCconst)
  4189  			v.AuxInt = int64ToAuxInt(y)
  4190  			v.AddArg(x)
  4191  			return true
  4192  		}
  4193  		break
  4194  	}
  4195  	return false
  4196  }
  4197  func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool {
  4198  	v_2 := v.Args[2]
  4199  	v_1 := v.Args[1]
  4200  	v_0 := v.Args[0]
  4201  	b := v.Block
  4202  	typ := &b.Func.Config.Types
  4203  	// match: (ADDE x y (Select1 <typ.UInt64> (ADDCconst (MOVDconst [0]) [-1])))
  4204  	// result: (ADDC x y)
  4205  	for {
  4206  		x := v_0
  4207  		y := v_1
  4208  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
  4209  			break
  4210  		}
  4211  		v_2_0 := v_2.Args[0]
  4212  		if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 {
  4213  			break
  4214  		}
  4215  		v_2_0_0 := v_2_0.Args[0]
  4216  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
  4217  			break
  4218  		}
  4219  		v.reset(OpPPC64ADDC)
  4220  		v.AddArg2(x, y)
  4221  		return true
  4222  	}
  4223  	// match: (ADDE (MOVDconst [0]) y c)
  4224  	// result: (ADDZE y c)
  4225  	for {
  4226  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4227  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4228  				continue
  4229  			}
  4230  			y := v_1
  4231  			c := v_2
  4232  			v.reset(OpPPC64ADDZE)
  4233  			v.AddArg2(y, c)
  4234  			return true
  4235  		}
  4236  		break
  4237  	}
  4238  	return false
  4239  }
  4240  func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
  4241  	v_0 := v.Args[0]
  4242  	// match: (ADDconst [c] (ADDconst [d] x))
  4243  	// cond: is32Bit(c+d)
  4244  	// result: (ADDconst [c+d] x)
  4245  	for {
  4246  		c := auxIntToInt64(v.AuxInt)
  4247  		if v_0.Op != OpPPC64ADDconst {
  4248  			break
  4249  		}
  4250  		d := auxIntToInt64(v_0.AuxInt)
  4251  		x := v_0.Args[0]
  4252  		if !(is32Bit(c + d)) {
  4253  			break
  4254  		}
  4255  		v.reset(OpPPC64ADDconst)
  4256  		v.AuxInt = int64ToAuxInt(c + d)
  4257  		v.AddArg(x)
  4258  		return true
  4259  	}
  4260  	// match: (ADDconst [0] x)
  4261  	// result: x
  4262  	for {
  4263  		if auxIntToInt64(v.AuxInt) != 0 {
  4264  			break
  4265  		}
  4266  		x := v_0
  4267  		v.copyOf(x)
  4268  		return true
  4269  	}
  4270  	// match: (ADDconst [c] (MOVDaddr [d] {sym} x))
  4271  	// cond: is32Bit(c+int64(d))
  4272  	// result: (MOVDaddr [int32(c+int64(d))] {sym} x)
  4273  	for {
  4274  		c := auxIntToInt64(v.AuxInt)
  4275  		if v_0.Op != OpPPC64MOVDaddr {
  4276  			break
  4277  		}
  4278  		d := auxIntToInt32(v_0.AuxInt)
  4279  		sym := auxToSym(v_0.Aux)
  4280  		x := v_0.Args[0]
  4281  		if !(is32Bit(c + int64(d))) {
  4282  			break
  4283  		}
  4284  		v.reset(OpPPC64MOVDaddr)
  4285  		v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
  4286  		v.Aux = symToAux(sym)
  4287  		v.AddArg(x)
  4288  		return true
  4289  	}
  4290  	// match: (ADDconst [c] x:(SP))
  4291  	// cond: is32Bit(c)
  4292  	// result: (MOVDaddr [int32(c)] x)
  4293  	for {
  4294  		c := auxIntToInt64(v.AuxInt)
  4295  		x := v_0
  4296  		if x.Op != OpSP || !(is32Bit(c)) {
  4297  			break
  4298  		}
  4299  		v.reset(OpPPC64MOVDaddr)
  4300  		v.AuxInt = int32ToAuxInt(int32(c))
  4301  		v.AddArg(x)
  4302  		return true
  4303  	}
  4304  	// match: (ADDconst [c] (SUBFCconst [d] x))
  4305  	// cond: is32Bit(c+d)
  4306  	// result: (SUBFCconst [c+d] x)
  4307  	for {
  4308  		c := auxIntToInt64(v.AuxInt)
  4309  		if v_0.Op != OpPPC64SUBFCconst {
  4310  			break
  4311  		}
  4312  		d := auxIntToInt64(v_0.AuxInt)
  4313  		x := v_0.Args[0]
  4314  		if !(is32Bit(c + d)) {
  4315  			break
  4316  		}
  4317  		v.reset(OpPPC64SUBFCconst)
  4318  		v.AuxInt = int64ToAuxInt(c + d)
  4319  		v.AddArg(x)
  4320  		return true
  4321  	}
  4322  	return false
  4323  }
  4324  func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
  4325  	v_1 := v.Args[1]
  4326  	v_0 := v.Args[0]
  4327  	// match: (AND (MOVDconst [m]) (ROTLWconst [r] x))
  4328  	// cond: isPPC64WordRotateMask(m)
  4329  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4330  	for {
  4331  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4332  			if v_0.Op != OpPPC64MOVDconst {
  4333  				continue
  4334  			}
  4335  			m := auxIntToInt64(v_0.AuxInt)
  4336  			if v_1.Op != OpPPC64ROTLWconst {
  4337  				continue
  4338  			}
  4339  			r := auxIntToInt64(v_1.AuxInt)
  4340  			x := v_1.Args[0]
  4341  			if !(isPPC64WordRotateMask(m)) {
  4342  				continue
  4343  			}
  4344  			v.reset(OpPPC64RLWINM)
  4345  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4346  			v.AddArg(x)
  4347  			return true
  4348  		}
  4349  		break
  4350  	}
  4351  	// match: (AND (MOVDconst [m]) (ROTLW x r))
  4352  	// cond: isPPC64WordRotateMask(m)
  4353  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4354  	for {
  4355  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4356  			if v_0.Op != OpPPC64MOVDconst {
  4357  				continue
  4358  			}
  4359  			m := auxIntToInt64(v_0.AuxInt)
  4360  			if v_1.Op != OpPPC64ROTLW {
  4361  				continue
  4362  			}
  4363  			r := v_1.Args[1]
  4364  			x := v_1.Args[0]
  4365  			if !(isPPC64WordRotateMask(m)) {
  4366  				continue
  4367  			}
  4368  			v.reset(OpPPC64RLWNM)
  4369  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4370  			v.AddArg2(x, r)
  4371  			return true
  4372  		}
  4373  		break
  4374  	}
  4375  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4376  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4377  	// result: (MOVDconst [0])
  4378  	for {
  4379  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4380  			if v_0.Op != OpPPC64MOVDconst {
  4381  				continue
  4382  			}
  4383  			m := auxIntToInt64(v_0.AuxInt)
  4384  			if v_1.Op != OpPPC64SRWconst {
  4385  				continue
  4386  			}
  4387  			s := auxIntToInt64(v_1.AuxInt)
  4388  			if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4389  				continue
  4390  			}
  4391  			v.reset(OpPPC64MOVDconst)
  4392  			v.AuxInt = int64ToAuxInt(0)
  4393  			return true
  4394  		}
  4395  		break
  4396  	}
  4397  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4398  	// cond: mergePPC64AndSrwi(m,s) != 0
  4399  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4400  	for {
  4401  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4402  			if v_0.Op != OpPPC64MOVDconst {
  4403  				continue
  4404  			}
  4405  			m := auxIntToInt64(v_0.AuxInt)
  4406  			if v_1.Op != OpPPC64SRWconst {
  4407  				continue
  4408  			}
  4409  			s := auxIntToInt64(v_1.AuxInt)
  4410  			x := v_1.Args[0]
  4411  			if !(mergePPC64AndSrwi(m, s) != 0) {
  4412  				continue
  4413  			}
  4414  			v.reset(OpPPC64RLWINM)
  4415  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4416  			v.AddArg(x)
  4417  			return true
  4418  		}
  4419  		break
  4420  	}
  4421  	// match: (AND (MOVDconst [m]) (SRDconst x [s]))
  4422  	// cond: mergePPC64AndSrdi(m,s) != 0
  4423  	// result: (RLWINM [mergePPC64AndSrdi(m,s)] x)
  4424  	for {
  4425  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4426  			if v_0.Op != OpPPC64MOVDconst {
  4427  				continue
  4428  			}
  4429  			m := auxIntToInt64(v_0.AuxInt)
  4430  			if v_1.Op != OpPPC64SRDconst {
  4431  				continue
  4432  			}
  4433  			s := auxIntToInt64(v_1.AuxInt)
  4434  			x := v_1.Args[0]
  4435  			if !(mergePPC64AndSrdi(m, s) != 0) {
  4436  				continue
  4437  			}
  4438  			v.reset(OpPPC64RLWINM)
  4439  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
  4440  			v.AddArg(x)
  4441  			return true
  4442  		}
  4443  		break
  4444  	}
  4445  	// match: (AND (MOVDconst [m]) (SLDconst x [s]))
  4446  	// cond: mergePPC64AndSldi(m,s) != 0
  4447  	// result: (RLWINM [mergePPC64AndSldi(m,s)] x)
  4448  	for {
  4449  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4450  			if v_0.Op != OpPPC64MOVDconst {
  4451  				continue
  4452  			}
  4453  			m := auxIntToInt64(v_0.AuxInt)
  4454  			if v_1.Op != OpPPC64SLDconst {
  4455  				continue
  4456  			}
  4457  			s := auxIntToInt64(v_1.AuxInt)
  4458  			x := v_1.Args[0]
  4459  			if !(mergePPC64AndSldi(m, s) != 0) {
  4460  				continue
  4461  			}
  4462  			v.reset(OpPPC64RLWINM)
  4463  			v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
  4464  			v.AddArg(x)
  4465  			return true
  4466  		}
  4467  		break
  4468  	}
  4469  	// match: (AND x (NOR y y))
  4470  	// result: (ANDN x y)
  4471  	for {
  4472  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4473  			x := v_0
  4474  			if v_1.Op != OpPPC64NOR {
  4475  				continue
  4476  			}
  4477  			y := v_1.Args[1]
  4478  			if y != v_1.Args[0] {
  4479  				continue
  4480  			}
  4481  			v.reset(OpPPC64ANDN)
  4482  			v.AddArg2(x, y)
  4483  			return true
  4484  		}
  4485  		break
  4486  	}
  4487  	// match: (AND (MOVDconst [c]) (MOVDconst [d]))
  4488  	// result: (MOVDconst [c&d])
  4489  	for {
  4490  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4491  			if v_0.Op != OpPPC64MOVDconst {
  4492  				continue
  4493  			}
  4494  			c := auxIntToInt64(v_0.AuxInt)
  4495  			if v_1.Op != OpPPC64MOVDconst {
  4496  				continue
  4497  			}
  4498  			d := auxIntToInt64(v_1.AuxInt)
  4499  			v.reset(OpPPC64MOVDconst)
  4500  			v.AuxInt = int64ToAuxInt(c & d)
  4501  			return true
  4502  		}
  4503  		break
  4504  	}
  4505  	// match: (AND x (MOVDconst [-1]))
  4506  	// result: x
  4507  	for {
  4508  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4509  			x := v_0
  4510  			if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  4511  				continue
  4512  			}
  4513  			v.copyOf(x)
  4514  			return true
  4515  		}
  4516  		break
  4517  	}
  4518  	// match: (AND x (MOVDconst [c]))
  4519  	// cond: isU16Bit(c)
  4520  	// result: (ANDconst [c] x)
  4521  	for {
  4522  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4523  			x := v_0
  4524  			if v_1.Op != OpPPC64MOVDconst {
  4525  				continue
  4526  			}
  4527  			c := auxIntToInt64(v_1.AuxInt)
  4528  			if !(isU16Bit(c)) {
  4529  				continue
  4530  			}
  4531  			v.reset(OpPPC64ANDconst)
  4532  			v.AuxInt = int64ToAuxInt(c)
  4533  			v.AddArg(x)
  4534  			return true
  4535  		}
  4536  		break
  4537  	}
  4538  	// match: (AND (MOVDconst [c]) y:(MOVWZreg _))
  4539  	// cond: c&0xFFFFFFFF == 0xFFFFFFFF
  4540  	// result: y
  4541  	for {
  4542  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4543  			if v_0.Op != OpPPC64MOVDconst {
  4544  				continue
  4545  			}
  4546  			c := auxIntToInt64(v_0.AuxInt)
  4547  			y := v_1
  4548  			if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
  4549  				continue
  4550  			}
  4551  			v.copyOf(y)
  4552  			return true
  4553  		}
  4554  		break
  4555  	}
  4556  	// match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x))
  4557  	// result: (MOVWZreg x)
  4558  	for {
  4559  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4560  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
  4561  				continue
  4562  			}
  4563  			y := v_1
  4564  			if y.Op != OpPPC64MOVWreg {
  4565  				continue
  4566  			}
  4567  			x := y.Args[0]
  4568  			v.reset(OpPPC64MOVWZreg)
  4569  			v.AddArg(x)
  4570  			return true
  4571  		}
  4572  		break
  4573  	}
  4574  	// match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
  4575  	// result: (ANDconst [c&0xFF] x)
  4576  	for {
  4577  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4578  			if v_0.Op != OpPPC64MOVDconst {
  4579  				continue
  4580  			}
  4581  			c := auxIntToInt64(v_0.AuxInt)
  4582  			x := v_1
  4583  			if x.Op != OpPPC64MOVBZload {
  4584  				continue
  4585  			}
  4586  			v.reset(OpPPC64ANDconst)
  4587  			v.AuxInt = int64ToAuxInt(c & 0xFF)
  4588  			v.AddArg(x)
  4589  			return true
  4590  		}
  4591  		break
  4592  	}
  4593  	return false
  4594  }
  4595  func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
  4596  	v_1 := v.Args[1]
  4597  	v_0 := v.Args[0]
  4598  	// match: (ANDN (MOVDconst [c]) (MOVDconst [d]))
  4599  	// result: (MOVDconst [c&^d])
  4600  	for {
  4601  		if v_0.Op != OpPPC64MOVDconst {
  4602  			break
  4603  		}
  4604  		c := auxIntToInt64(v_0.AuxInt)
  4605  		if v_1.Op != OpPPC64MOVDconst {
  4606  			break
  4607  		}
  4608  		d := auxIntToInt64(v_1.AuxInt)
  4609  		v.reset(OpPPC64MOVDconst)
  4610  		v.AuxInt = int64ToAuxInt(c &^ d)
  4611  		return true
  4612  	}
  4613  	return false
  4614  }
  4615  func rewriteValuePPC64_OpPPC64ANDconst(v *Value) bool {
  4616  	v_0 := v.Args[0]
  4617  	// match: (ANDconst [m] (ROTLWconst [r] x))
  4618  	// cond: isPPC64WordRotateMask(m)
  4619  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4620  	for {
  4621  		m := auxIntToInt64(v.AuxInt)
  4622  		if v_0.Op != OpPPC64ROTLWconst {
  4623  			break
  4624  		}
  4625  		r := auxIntToInt64(v_0.AuxInt)
  4626  		x := v_0.Args[0]
  4627  		if !(isPPC64WordRotateMask(m)) {
  4628  			break
  4629  		}
  4630  		v.reset(OpPPC64RLWINM)
  4631  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4632  		v.AddArg(x)
  4633  		return true
  4634  	}
  4635  	// match: (ANDconst [m] (ROTLW x r))
  4636  	// cond: isPPC64WordRotateMask(m)
  4637  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4638  	for {
  4639  		m := auxIntToInt64(v.AuxInt)
  4640  		if v_0.Op != OpPPC64ROTLW {
  4641  			break
  4642  		}
  4643  		r := v_0.Args[1]
  4644  		x := v_0.Args[0]
  4645  		if !(isPPC64WordRotateMask(m)) {
  4646  			break
  4647  		}
  4648  		v.reset(OpPPC64RLWNM)
  4649  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4650  		v.AddArg2(x, r)
  4651  		return true
  4652  	}
  4653  	// match: (ANDconst [m] (SRWconst x [s]))
  4654  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4655  	// result: (MOVDconst [0])
  4656  	for {
  4657  		m := auxIntToInt64(v.AuxInt)
  4658  		if v_0.Op != OpPPC64SRWconst {
  4659  			break
  4660  		}
  4661  		s := auxIntToInt64(v_0.AuxInt)
  4662  		if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4663  			break
  4664  		}
  4665  		v.reset(OpPPC64MOVDconst)
  4666  		v.AuxInt = int64ToAuxInt(0)
  4667  		return true
  4668  	}
  4669  	// match: (ANDconst [m] (SRWconst x [s]))
  4670  	// cond: mergePPC64AndSrwi(m,s) != 0
  4671  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4672  	for {
  4673  		m := auxIntToInt64(v.AuxInt)
  4674  		if v_0.Op != OpPPC64SRWconst {
  4675  			break
  4676  		}
  4677  		s := auxIntToInt64(v_0.AuxInt)
  4678  		x := v_0.Args[0]
  4679  		if !(mergePPC64AndSrwi(m, s) != 0) {
  4680  			break
  4681  		}
  4682  		v.reset(OpPPC64RLWINM)
  4683  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4684  		v.AddArg(x)
  4685  		return true
  4686  	}
  4687  	// match: (ANDconst [m] (SRDconst x [s]))
  4688  	// cond: mergePPC64AndSrdi(m,s) != 0
  4689  	// result: (RLWINM [mergePPC64AndSrdi(m,s)] x)
  4690  	for {
  4691  		m := auxIntToInt64(v.AuxInt)
  4692  		if v_0.Op != OpPPC64SRDconst {
  4693  			break
  4694  		}
  4695  		s := auxIntToInt64(v_0.AuxInt)
  4696  		x := v_0.Args[0]
  4697  		if !(mergePPC64AndSrdi(m, s) != 0) {
  4698  			break
  4699  		}
  4700  		v.reset(OpPPC64RLWINM)
  4701  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
  4702  		v.AddArg(x)
  4703  		return true
  4704  	}
  4705  	// match: (ANDconst [m] (SLDconst x [s]))
  4706  	// cond: mergePPC64AndSldi(m,s) != 0
  4707  	// result: (RLWINM [mergePPC64AndSldi(m,s)] x)
  4708  	for {
  4709  		m := auxIntToInt64(v.AuxInt)
  4710  		if v_0.Op != OpPPC64SLDconst {
  4711  			break
  4712  		}
  4713  		s := auxIntToInt64(v_0.AuxInt)
  4714  		x := v_0.Args[0]
  4715  		if !(mergePPC64AndSldi(m, s) != 0) {
  4716  			break
  4717  		}
  4718  		v.reset(OpPPC64RLWINM)
  4719  		v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
  4720  		v.AddArg(x)
  4721  		return true
  4722  	}
  4723  	// match: (ANDconst [c] (ANDconst [d] x))
  4724  	// result: (ANDconst [c&d] x)
  4725  	for {
  4726  		c := auxIntToInt64(v.AuxInt)
  4727  		if v_0.Op != OpPPC64ANDconst {
  4728  			break
  4729  		}
  4730  		d := auxIntToInt64(v_0.AuxInt)
  4731  		x := v_0.Args[0]
  4732  		v.reset(OpPPC64ANDconst)
  4733  		v.AuxInt = int64ToAuxInt(c & d)
  4734  		v.AddArg(x)
  4735  		return true
  4736  	}
  4737  	// match: (ANDconst [-1] x)
  4738  	// result: x
  4739  	for {
  4740  		if auxIntToInt64(v.AuxInt) != -1 {
  4741  			break
  4742  		}
  4743  		x := v_0
  4744  		v.copyOf(x)
  4745  		return true
  4746  	}
  4747  	// match: (ANDconst [0] _)
  4748  	// result: (MOVDconst [0])
  4749  	for {
  4750  		if auxIntToInt64(v.AuxInt) != 0 {
  4751  			break
  4752  		}
  4753  		v.reset(OpPPC64MOVDconst)
  4754  		v.AuxInt = int64ToAuxInt(0)
  4755  		return true
  4756  	}
  4757  	// match: (ANDconst [c] y:(MOVBZreg _))
  4758  	// cond: c&0xFF == 0xFF
  4759  	// result: y
  4760  	for {
  4761  		c := auxIntToInt64(v.AuxInt)
  4762  		y := v_0
  4763  		if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
  4764  			break
  4765  		}
  4766  		v.copyOf(y)
  4767  		return true
  4768  	}
  4769  	// match: (ANDconst [0xFF] (MOVBreg x))
  4770  	// result: (MOVBZreg x)
  4771  	for {
  4772  		if auxIntToInt64(v.AuxInt) != 0xFF || v_0.Op != OpPPC64MOVBreg {
  4773  			break
  4774  		}
  4775  		x := v_0.Args[0]
  4776  		v.reset(OpPPC64MOVBZreg)
  4777  		v.AddArg(x)
  4778  		return true
  4779  	}
  4780  	// match: (ANDconst [c] y:(MOVHZreg _))
  4781  	// cond: c&0xFFFF == 0xFFFF
  4782  	// result: y
  4783  	for {
  4784  		c := auxIntToInt64(v.AuxInt)
  4785  		y := v_0
  4786  		if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
  4787  			break
  4788  		}
  4789  		v.copyOf(y)
  4790  		return true
  4791  	}
  4792  	// match: (ANDconst [0xFFFF] (MOVHreg x))
  4793  	// result: (MOVHZreg x)
  4794  	for {
  4795  		if auxIntToInt64(v.AuxInt) != 0xFFFF || v_0.Op != OpPPC64MOVHreg {
  4796  			break
  4797  		}
  4798  		x := v_0.Args[0]
  4799  		v.reset(OpPPC64MOVHZreg)
  4800  		v.AddArg(x)
  4801  		return true
  4802  	}
  4803  	// match: (ANDconst [c] (MOVBZreg x))
  4804  	// result: (ANDconst [c&0xFF] x)
  4805  	for {
  4806  		c := auxIntToInt64(v.AuxInt)
  4807  		if v_0.Op != OpPPC64MOVBZreg {
  4808  			break
  4809  		}
  4810  		x := v_0.Args[0]
  4811  		v.reset(OpPPC64ANDconst)
  4812  		v.AuxInt = int64ToAuxInt(c & 0xFF)
  4813  		v.AddArg(x)
  4814  		return true
  4815  	}
  4816  	// match: (ANDconst [c] (MOVHZreg x))
  4817  	// result: (ANDconst [c&0xFFFF] x)
  4818  	for {
  4819  		c := auxIntToInt64(v.AuxInt)
  4820  		if v_0.Op != OpPPC64MOVHZreg {
  4821  			break
  4822  		}
  4823  		x := v_0.Args[0]
  4824  		v.reset(OpPPC64ANDconst)
  4825  		v.AuxInt = int64ToAuxInt(c & 0xFFFF)
  4826  		v.AddArg(x)
  4827  		return true
  4828  	}
  4829  	// match: (ANDconst [c] (MOVWZreg x))
  4830  	// result: (ANDconst [c&0xFFFFFFFF] x)
  4831  	for {
  4832  		c := auxIntToInt64(v.AuxInt)
  4833  		if v_0.Op != OpPPC64MOVWZreg {
  4834  			break
  4835  		}
  4836  		x := v_0.Args[0]
  4837  		v.reset(OpPPC64ANDconst)
  4838  		v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
  4839  		v.AddArg(x)
  4840  		return true
  4841  	}
  4842  	// match: (ANDconst [m] (RLWINM [r] y))
  4843  	// cond: mergePPC64AndRlwinm(uint32(m),r) != 0
  4844  	// result: (RLWINM [mergePPC64AndRlwinm(uint32(m),r)] y)
  4845  	for {
  4846  		m := auxIntToInt64(v.AuxInt)
  4847  		if v_0.Op != OpPPC64RLWINM {
  4848  			break
  4849  		}
  4850  		r := auxIntToInt64(v_0.AuxInt)
  4851  		y := v_0.Args[0]
  4852  		if !(mergePPC64AndRlwinm(uint32(m), r) != 0) {
  4853  			break
  4854  		}
  4855  		v.reset(OpPPC64RLWINM)
  4856  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(uint32(m), r))
  4857  		v.AddArg(y)
  4858  		return true
  4859  	}
  4860  	// match: (ANDconst [1] z:(SRADconst [63] x))
  4861  	// cond: z.Uses == 1
  4862  	// result: (SRDconst [63] x)
  4863  	for {
  4864  		if auxIntToInt64(v.AuxInt) != 1 {
  4865  			break
  4866  		}
  4867  		z := v_0
  4868  		if z.Op != OpPPC64SRADconst || auxIntToInt64(z.AuxInt) != 63 {
  4869  			break
  4870  		}
  4871  		x := z.Args[0]
  4872  		if !(z.Uses == 1) {
  4873  			break
  4874  		}
  4875  		v.reset(OpPPC64SRDconst)
  4876  		v.AuxInt = int64ToAuxInt(63)
  4877  		v.AddArg(x)
  4878  		return true
  4879  	}
  4880  	return false
  4881  }
  4882  func rewriteValuePPC64_OpPPC64BRD(v *Value) bool {
  4883  	v_0 := v.Args[0]
  4884  	b := v.Block
  4885  	typ := &b.Func.Config.Types
  4886  	// match: (BRD x:(MOVDload [off] {sym} ptr mem))
  4887  	// cond: x.Uses == 1
  4888  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4889  	for {
  4890  		x := v_0
  4891  		if x.Op != OpPPC64MOVDload {
  4892  			break
  4893  		}
  4894  		off := auxIntToInt32(x.AuxInt)
  4895  		sym := auxToSym(x.Aux)
  4896  		mem := x.Args[1]
  4897  		ptr := x.Args[0]
  4898  		if !(x.Uses == 1) {
  4899  			break
  4900  		}
  4901  		b = x.Block
  4902  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  4903  		v.copyOf(v0)
  4904  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  4905  		v1.AuxInt = int32ToAuxInt(off)
  4906  		v1.Aux = symToAux(sym)
  4907  		v1.AddArg(ptr)
  4908  		v0.AddArg2(v1, mem)
  4909  		return true
  4910  	}
  4911  	// match: (BRD x:(MOVDloadidx ptr idx mem))
  4912  	// cond: x.Uses == 1
  4913  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  4914  	for {
  4915  		x := v_0
  4916  		if x.Op != OpPPC64MOVDloadidx {
  4917  			break
  4918  		}
  4919  		mem := x.Args[2]
  4920  		ptr := x.Args[0]
  4921  		idx := x.Args[1]
  4922  		if !(x.Uses == 1) {
  4923  			break
  4924  		}
  4925  		b = x.Block
  4926  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  4927  		v.copyOf(v0)
  4928  		v0.AddArg3(ptr, idx, mem)
  4929  		return true
  4930  	}
  4931  	return false
  4932  }
  4933  func rewriteValuePPC64_OpPPC64BRH(v *Value) bool {
  4934  	v_0 := v.Args[0]
  4935  	b := v.Block
  4936  	typ := &b.Func.Config.Types
  4937  	// match: (BRH x:(MOVHZload [off] {sym} ptr mem))
  4938  	// cond: x.Uses == 1
  4939  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4940  	for {
  4941  		x := v_0
  4942  		if x.Op != OpPPC64MOVHZload {
  4943  			break
  4944  		}
  4945  		off := auxIntToInt32(x.AuxInt)
  4946  		sym := auxToSym(x.Aux)
  4947  		mem := x.Args[1]
  4948  		ptr := x.Args[0]
  4949  		if !(x.Uses == 1) {
  4950  			break
  4951  		}
  4952  		b = x.Block
  4953  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  4954  		v.copyOf(v0)
  4955  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  4956  		v1.AuxInt = int32ToAuxInt(off)
  4957  		v1.Aux = symToAux(sym)
  4958  		v1.AddArg(ptr)
  4959  		v0.AddArg2(v1, mem)
  4960  		return true
  4961  	}
  4962  	// match: (BRH x:(MOVHZloadidx ptr idx mem))
  4963  	// cond: x.Uses == 1
  4964  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  4965  	for {
  4966  		x := v_0
  4967  		if x.Op != OpPPC64MOVHZloadidx {
  4968  			break
  4969  		}
  4970  		mem := x.Args[2]
  4971  		ptr := x.Args[0]
  4972  		idx := x.Args[1]
  4973  		if !(x.Uses == 1) {
  4974  			break
  4975  		}
  4976  		b = x.Block
  4977  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  4978  		v.copyOf(v0)
  4979  		v0.AddArg3(ptr, idx, mem)
  4980  		return true
  4981  	}
  4982  	return false
  4983  }
  4984  func rewriteValuePPC64_OpPPC64BRW(v *Value) bool {
  4985  	v_0 := v.Args[0]
  4986  	b := v.Block
  4987  	typ := &b.Func.Config.Types
  4988  	// match: (BRW x:(MOVWZload [off] {sym} ptr mem))
  4989  	// cond: x.Uses == 1
  4990  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4991  	for {
  4992  		x := v_0
  4993  		if x.Op != OpPPC64MOVWZload {
  4994  			break
  4995  		}
  4996  		off := auxIntToInt32(x.AuxInt)
  4997  		sym := auxToSym(x.Aux)
  4998  		mem := x.Args[1]
  4999  		ptr := x.Args[0]
  5000  		if !(x.Uses == 1) {
  5001  			break
  5002  		}
  5003  		b = x.Block
  5004  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  5005  		v.copyOf(v0)
  5006  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  5007  		v1.AuxInt = int32ToAuxInt(off)
  5008  		v1.Aux = symToAux(sym)
  5009  		v1.AddArg(ptr)
  5010  		v0.AddArg2(v1, mem)
  5011  		return true
  5012  	}
  5013  	// match: (BRW x:(MOVWZloadidx ptr idx mem))
  5014  	// cond: x.Uses == 1
  5015  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  5016  	for {
  5017  		x := v_0
  5018  		if x.Op != OpPPC64MOVWZloadidx {
  5019  			break
  5020  		}
  5021  		mem := x.Args[2]
  5022  		ptr := x.Args[0]
  5023  		idx := x.Args[1]
  5024  		if !(x.Uses == 1) {
  5025  			break
  5026  		}
  5027  		b = x.Block
  5028  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  5029  		v.copyOf(v0)
  5030  		v0.AddArg3(ptr, idx, mem)
  5031  		return true
  5032  	}
  5033  	return false
  5034  }
  5035  func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
  5036  	v_0 := v.Args[0]
  5037  	// match: (CLRLSLDI [c] (SRWconst [s] x))
  5038  	// cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0
  5039  	// result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x)
  5040  	for {
  5041  		c := auxIntToInt32(v.AuxInt)
  5042  		if v_0.Op != OpPPC64SRWconst {
  5043  			break
  5044  		}
  5045  		s := auxIntToInt64(v_0.AuxInt)
  5046  		x := v_0.Args[0]
  5047  		if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
  5048  			break
  5049  		}
  5050  		v.reset(OpPPC64RLWINM)
  5051  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
  5052  		v.AddArg(x)
  5053  		return true
  5054  	}
  5055  	// match: (CLRLSLDI [c] (SRDconst [s] x))
  5056  	// cond: mergePPC64ClrlsldiSrd(int64(c),s) != 0
  5057  	// result: (RLWINM [mergePPC64ClrlsldiSrd(int64(c),s)] x)
  5058  	for {
  5059  		c := auxIntToInt32(v.AuxInt)
  5060  		if v_0.Op != OpPPC64SRDconst {
  5061  			break
  5062  		}
  5063  		s := auxIntToInt64(v_0.AuxInt)
  5064  		x := v_0.Args[0]
  5065  		if !(mergePPC64ClrlsldiSrd(int64(c), s) != 0) {
  5066  			break
  5067  		}
  5068  		v.reset(OpPPC64RLWINM)
  5069  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrd(int64(c), s))
  5070  		v.AddArg(x)
  5071  		return true
  5072  	}
  5073  	// match: (CLRLSLDI [c] i:(RLWINM [s] x))
  5074  	// cond: mergePPC64ClrlsldiRlwinm(c,s) != 0
  5075  	// result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x)
  5076  	for {
  5077  		c := auxIntToInt32(v.AuxInt)
  5078  		i := v_0
  5079  		if i.Op != OpPPC64RLWINM {
  5080  			break
  5081  		}
  5082  		s := auxIntToInt64(i.AuxInt)
  5083  		x := i.Args[0]
  5084  		if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
  5085  			break
  5086  		}
  5087  		v.reset(OpPPC64RLWINM)
  5088  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
  5089  		v.AddArg(x)
  5090  		return true
  5091  	}
  5092  	return false
  5093  }
  5094  func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
  5095  	v_1 := v.Args[1]
  5096  	v_0 := v.Args[0]
  5097  	b := v.Block
  5098  	// match: (CMP x (MOVDconst [c]))
  5099  	// cond: is16Bit(c)
  5100  	// result: (CMPconst x [c])
  5101  	for {
  5102  		x := v_0
  5103  		if v_1.Op != OpPPC64MOVDconst {
  5104  			break
  5105  		}
  5106  		c := auxIntToInt64(v_1.AuxInt)
  5107  		if !(is16Bit(c)) {
  5108  			break
  5109  		}
  5110  		v.reset(OpPPC64CMPconst)
  5111  		v.AuxInt = int64ToAuxInt(c)
  5112  		v.AddArg(x)
  5113  		return true
  5114  	}
  5115  	// match: (CMP (MOVDconst [c]) y)
  5116  	// cond: is16Bit(c)
  5117  	// result: (InvertFlags (CMPconst y [c]))
  5118  	for {
  5119  		if v_0.Op != OpPPC64MOVDconst {
  5120  			break
  5121  		}
  5122  		c := auxIntToInt64(v_0.AuxInt)
  5123  		y := v_1
  5124  		if !(is16Bit(c)) {
  5125  			break
  5126  		}
  5127  		v.reset(OpPPC64InvertFlags)
  5128  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  5129  		v0.AuxInt = int64ToAuxInt(c)
  5130  		v0.AddArg(y)
  5131  		v.AddArg(v0)
  5132  		return true
  5133  	}
  5134  	// match: (CMP x y)
  5135  	// cond: canonLessThan(x,y)
  5136  	// result: (InvertFlags (CMP y x))
  5137  	for {
  5138  		x := v_0
  5139  		y := v_1
  5140  		if !(canonLessThan(x, y)) {
  5141  			break
  5142  		}
  5143  		v.reset(OpPPC64InvertFlags)
  5144  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  5145  		v0.AddArg2(y, x)
  5146  		v.AddArg(v0)
  5147  		return true
  5148  	}
  5149  	return false
  5150  }
  5151  func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
  5152  	v_1 := v.Args[1]
  5153  	v_0 := v.Args[0]
  5154  	b := v.Block
  5155  	// match: (CMPU x (MOVDconst [c]))
  5156  	// cond: isU16Bit(c)
  5157  	// result: (CMPUconst x [c])
  5158  	for {
  5159  		x := v_0
  5160  		if v_1.Op != OpPPC64MOVDconst {
  5161  			break
  5162  		}
  5163  		c := auxIntToInt64(v_1.AuxInt)
  5164  		if !(isU16Bit(c)) {
  5165  			break
  5166  		}
  5167  		v.reset(OpPPC64CMPUconst)
  5168  		v.AuxInt = int64ToAuxInt(c)
  5169  		v.AddArg(x)
  5170  		return true
  5171  	}
  5172  	// match: (CMPU (MOVDconst [c]) y)
  5173  	// cond: isU16Bit(c)
  5174  	// result: (InvertFlags (CMPUconst y [c]))
  5175  	for {
  5176  		if v_0.Op != OpPPC64MOVDconst {
  5177  			break
  5178  		}
  5179  		c := auxIntToInt64(v_0.AuxInt)
  5180  		y := v_1
  5181  		if !(isU16Bit(c)) {
  5182  			break
  5183  		}
  5184  		v.reset(OpPPC64InvertFlags)
  5185  		v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  5186  		v0.AuxInt = int64ToAuxInt(c)
  5187  		v0.AddArg(y)
  5188  		v.AddArg(v0)
  5189  		return true
  5190  	}
  5191  	// match: (CMPU x y)
  5192  	// cond: canonLessThan(x,y)
  5193  	// result: (InvertFlags (CMPU y x))
  5194  	for {
  5195  		x := v_0
  5196  		y := v_1
  5197  		if !(canonLessThan(x, y)) {
  5198  			break
  5199  		}
  5200  		v.reset(OpPPC64InvertFlags)
  5201  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  5202  		v0.AddArg2(y, x)
  5203  		v.AddArg(v0)
  5204  		return true
  5205  	}
  5206  	return false
  5207  }
  5208  func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
  5209  	v_0 := v.Args[0]
  5210  	// match: (CMPUconst [d] (ANDconst z [c]))
  5211  	// cond: uint64(d) > uint64(c)
  5212  	// result: (FlagLT)
  5213  	for {
  5214  		d := auxIntToInt64(v.AuxInt)
  5215  		if v_0.Op != OpPPC64ANDconst {
  5216  			break
  5217  		}
  5218  		c := auxIntToInt64(v_0.AuxInt)
  5219  		if !(uint64(d) > uint64(c)) {
  5220  			break
  5221  		}
  5222  		v.reset(OpPPC64FlagLT)
  5223  		return true
  5224  	}
  5225  	// match: (CMPUconst (MOVDconst [x]) [y])
  5226  	// cond: x==y
  5227  	// result: (FlagEQ)
  5228  	for {
  5229  		y := auxIntToInt64(v.AuxInt)
  5230  		if v_0.Op != OpPPC64MOVDconst {
  5231  			break
  5232  		}
  5233  		x := auxIntToInt64(v_0.AuxInt)
  5234  		if !(x == y) {
  5235  			break
  5236  		}
  5237  		v.reset(OpPPC64FlagEQ)
  5238  		return true
  5239  	}
  5240  	// match: (CMPUconst (MOVDconst [x]) [y])
  5241  	// cond: uint64(x)<uint64(y)
  5242  	// result: (FlagLT)
  5243  	for {
  5244  		y := auxIntToInt64(v.AuxInt)
  5245  		if v_0.Op != OpPPC64MOVDconst {
  5246  			break
  5247  		}
  5248  		x := auxIntToInt64(v_0.AuxInt)
  5249  		if !(uint64(x) < uint64(y)) {
  5250  			break
  5251  		}
  5252  		v.reset(OpPPC64FlagLT)
  5253  		return true
  5254  	}
  5255  	// match: (CMPUconst (MOVDconst [x]) [y])
  5256  	// cond: uint64(x)>uint64(y)
  5257  	// result: (FlagGT)
  5258  	for {
  5259  		y := auxIntToInt64(v.AuxInt)
  5260  		if v_0.Op != OpPPC64MOVDconst {
  5261  			break
  5262  		}
  5263  		x := auxIntToInt64(v_0.AuxInt)
  5264  		if !(uint64(x) > uint64(y)) {
  5265  			break
  5266  		}
  5267  		v.reset(OpPPC64FlagGT)
  5268  		return true
  5269  	}
  5270  	// match: (CMPUconst [0] a:(ANDconst [n] z))
  5271  	// result: (CMPconst [0] a)
  5272  	for {
  5273  		if auxIntToInt64(v.AuxInt) != 0 {
  5274  			break
  5275  		}
  5276  		a := v_0
  5277  		if a.Op != OpPPC64ANDconst {
  5278  			break
  5279  		}
  5280  		v.reset(OpPPC64CMPconst)
  5281  		v.AuxInt = int64ToAuxInt(0)
  5282  		v.AddArg(a)
  5283  		return true
  5284  	}
  5285  	return false
  5286  }
  5287  func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
  5288  	v_1 := v.Args[1]
  5289  	v_0 := v.Args[0]
  5290  	b := v.Block
  5291  	// match: (CMPW x (MOVWreg y))
  5292  	// result: (CMPW x y)
  5293  	for {
  5294  		x := v_0
  5295  		if v_1.Op != OpPPC64MOVWreg {
  5296  			break
  5297  		}
  5298  		y := v_1.Args[0]
  5299  		v.reset(OpPPC64CMPW)
  5300  		v.AddArg2(x, y)
  5301  		return true
  5302  	}
  5303  	// match: (CMPW (MOVWreg x) y)
  5304  	// result: (CMPW x y)
  5305  	for {
  5306  		if v_0.Op != OpPPC64MOVWreg {
  5307  			break
  5308  		}
  5309  		x := v_0.Args[0]
  5310  		y := v_1
  5311  		v.reset(OpPPC64CMPW)
  5312  		v.AddArg2(x, y)
  5313  		return true
  5314  	}
  5315  	// match: (CMPW x (MOVDconst [c]))
  5316  	// cond: is16Bit(c)
  5317  	// result: (CMPWconst x [int32(c)])
  5318  	for {
  5319  		x := v_0
  5320  		if v_1.Op != OpPPC64MOVDconst {
  5321  			break
  5322  		}
  5323  		c := auxIntToInt64(v_1.AuxInt)
  5324  		if !(is16Bit(c)) {
  5325  			break
  5326  		}
  5327  		v.reset(OpPPC64CMPWconst)
  5328  		v.AuxInt = int32ToAuxInt(int32(c))
  5329  		v.AddArg(x)
  5330  		return true
  5331  	}
  5332  	// match: (CMPW (MOVDconst [c]) y)
  5333  	// cond: is16Bit(c)
  5334  	// result: (InvertFlags (CMPWconst y [int32(c)]))
  5335  	for {
  5336  		if v_0.Op != OpPPC64MOVDconst {
  5337  			break
  5338  		}
  5339  		c := auxIntToInt64(v_0.AuxInt)
  5340  		y := v_1
  5341  		if !(is16Bit(c)) {
  5342  			break
  5343  		}
  5344  		v.reset(OpPPC64InvertFlags)
  5345  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
  5346  		v0.AuxInt = int32ToAuxInt(int32(c))
  5347  		v0.AddArg(y)
  5348  		v.AddArg(v0)
  5349  		return true
  5350  	}
  5351  	// match: (CMPW x y)
  5352  	// cond: canonLessThan(x,y)
  5353  	// result: (InvertFlags (CMPW y x))
  5354  	for {
  5355  		x := v_0
  5356  		y := v_1
  5357  		if !(canonLessThan(x, y)) {
  5358  			break
  5359  		}
  5360  		v.reset(OpPPC64InvertFlags)
  5361  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  5362  		v0.AddArg2(y, x)
  5363  		v.AddArg(v0)
  5364  		return true
  5365  	}
  5366  	return false
  5367  }
  5368  func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
  5369  	v_1 := v.Args[1]
  5370  	v_0 := v.Args[0]
  5371  	b := v.Block
  5372  	// match: (CMPWU x (MOVWZreg y))
  5373  	// result: (CMPWU x y)
  5374  	for {
  5375  		x := v_0
  5376  		if v_1.Op != OpPPC64MOVWZreg {
  5377  			break
  5378  		}
  5379  		y := v_1.Args[0]
  5380  		v.reset(OpPPC64CMPWU)
  5381  		v.AddArg2(x, y)
  5382  		return true
  5383  	}
  5384  	// match: (CMPWU (MOVWZreg x) y)
  5385  	// result: (CMPWU x y)
  5386  	for {
  5387  		if v_0.Op != OpPPC64MOVWZreg {
  5388  			break
  5389  		}
  5390  		x := v_0.Args[0]
  5391  		y := v_1
  5392  		v.reset(OpPPC64CMPWU)
  5393  		v.AddArg2(x, y)
  5394  		return true
  5395  	}
  5396  	// match: (CMPWU x (MOVDconst [c]))
  5397  	// cond: isU16Bit(c)
  5398  	// result: (CMPWUconst x [int32(c)])
  5399  	for {
  5400  		x := v_0
  5401  		if v_1.Op != OpPPC64MOVDconst {
  5402  			break
  5403  		}
  5404  		c := auxIntToInt64(v_1.AuxInt)
  5405  		if !(isU16Bit(c)) {
  5406  			break
  5407  		}
  5408  		v.reset(OpPPC64CMPWUconst)
  5409  		v.AuxInt = int32ToAuxInt(int32(c))
  5410  		v.AddArg(x)
  5411  		return true
  5412  	}
  5413  	// match: (CMPWU (MOVDconst [c]) y)
  5414  	// cond: isU16Bit(c)
  5415  	// result: (InvertFlags (CMPWUconst y [int32(c)]))
  5416  	for {
  5417  		if v_0.Op != OpPPC64MOVDconst {
  5418  			break
  5419  		}
  5420  		c := auxIntToInt64(v_0.AuxInt)
  5421  		y := v_1
  5422  		if !(isU16Bit(c)) {
  5423  			break
  5424  		}
  5425  		v.reset(OpPPC64InvertFlags)
  5426  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  5427  		v0.AuxInt = int32ToAuxInt(int32(c))
  5428  		v0.AddArg(y)
  5429  		v.AddArg(v0)
  5430  		return true
  5431  	}
  5432  	// match: (CMPWU x y)
  5433  	// cond: canonLessThan(x,y)
  5434  	// result: (InvertFlags (CMPWU y x))
  5435  	for {
  5436  		x := v_0
  5437  		y := v_1
  5438  		if !(canonLessThan(x, y)) {
  5439  			break
  5440  		}
  5441  		v.reset(OpPPC64InvertFlags)
  5442  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  5443  		v0.AddArg2(y, x)
  5444  		v.AddArg(v0)
  5445  		return true
  5446  	}
  5447  	return false
  5448  }
  5449  func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
  5450  	v_0 := v.Args[0]
  5451  	// match: (CMPWUconst [d] (ANDconst z [c]))
  5452  	// cond: uint64(d) > uint64(c)
  5453  	// result: (FlagLT)
  5454  	for {
  5455  		d := auxIntToInt32(v.AuxInt)
  5456  		if v_0.Op != OpPPC64ANDconst {
  5457  			break
  5458  		}
  5459  		c := auxIntToInt64(v_0.AuxInt)
  5460  		if !(uint64(d) > uint64(c)) {
  5461  			break
  5462  		}
  5463  		v.reset(OpPPC64FlagLT)
  5464  		return true
  5465  	}
  5466  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5467  	// cond: int32(x)==int32(y)
  5468  	// result: (FlagEQ)
  5469  	for {
  5470  		y := auxIntToInt32(v.AuxInt)
  5471  		if v_0.Op != OpPPC64MOVDconst {
  5472  			break
  5473  		}
  5474  		x := auxIntToInt64(v_0.AuxInt)
  5475  		if !(int32(x) == int32(y)) {
  5476  			break
  5477  		}
  5478  		v.reset(OpPPC64FlagEQ)
  5479  		return true
  5480  	}
  5481  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5482  	// cond: uint32(x)<uint32(y)
  5483  	// result: (FlagLT)
  5484  	for {
  5485  		y := auxIntToInt32(v.AuxInt)
  5486  		if v_0.Op != OpPPC64MOVDconst {
  5487  			break
  5488  		}
  5489  		x := auxIntToInt64(v_0.AuxInt)
  5490  		if !(uint32(x) < uint32(y)) {
  5491  			break
  5492  		}
  5493  		v.reset(OpPPC64FlagLT)
  5494  		return true
  5495  	}
  5496  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5497  	// cond: uint32(x)>uint32(y)
  5498  	// result: (FlagGT)
  5499  	for {
  5500  		y := auxIntToInt32(v.AuxInt)
  5501  		if v_0.Op != OpPPC64MOVDconst {
  5502  			break
  5503  		}
  5504  		x := auxIntToInt64(v_0.AuxInt)
  5505  		if !(uint32(x) > uint32(y)) {
  5506  			break
  5507  		}
  5508  		v.reset(OpPPC64FlagGT)
  5509  		return true
  5510  	}
  5511  	// match: (CMPWUconst [0] a:(ANDconst [n] z))
  5512  	// result: (CMPconst [0] a)
  5513  	for {
  5514  		if auxIntToInt32(v.AuxInt) != 0 {
  5515  			break
  5516  		}
  5517  		a := v_0
  5518  		if a.Op != OpPPC64ANDconst {
  5519  			break
  5520  		}
  5521  		v.reset(OpPPC64CMPconst)
  5522  		v.AuxInt = int64ToAuxInt(0)
  5523  		v.AddArg(a)
  5524  		return true
  5525  	}
  5526  	return false
  5527  }
  5528  func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
  5529  	v_0 := v.Args[0]
  5530  	// match: (CMPWconst (MOVDconst [x]) [y])
  5531  	// cond: int32(x)==int32(y)
  5532  	// result: (FlagEQ)
  5533  	for {
  5534  		y := auxIntToInt32(v.AuxInt)
  5535  		if v_0.Op != OpPPC64MOVDconst {
  5536  			break
  5537  		}
  5538  		x := auxIntToInt64(v_0.AuxInt)
  5539  		if !(int32(x) == int32(y)) {
  5540  			break
  5541  		}
  5542  		v.reset(OpPPC64FlagEQ)
  5543  		return true
  5544  	}
  5545  	// match: (CMPWconst (MOVDconst [x]) [y])
  5546  	// cond: int32(x)<int32(y)
  5547  	// result: (FlagLT)
  5548  	for {
  5549  		y := auxIntToInt32(v.AuxInt)
  5550  		if v_0.Op != OpPPC64MOVDconst {
  5551  			break
  5552  		}
  5553  		x := auxIntToInt64(v_0.AuxInt)
  5554  		if !(int32(x) < int32(y)) {
  5555  			break
  5556  		}
  5557  		v.reset(OpPPC64FlagLT)
  5558  		return true
  5559  	}
  5560  	// match: (CMPWconst (MOVDconst [x]) [y])
  5561  	// cond: int32(x)>int32(y)
  5562  	// result: (FlagGT)
  5563  	for {
  5564  		y := auxIntToInt32(v.AuxInt)
  5565  		if v_0.Op != OpPPC64MOVDconst {
  5566  			break
  5567  		}
  5568  		x := auxIntToInt64(v_0.AuxInt)
  5569  		if !(int32(x) > int32(y)) {
  5570  			break
  5571  		}
  5572  		v.reset(OpPPC64FlagGT)
  5573  		return true
  5574  	}
  5575  	// match: (CMPWconst [0] a:(ANDconst [n] z))
  5576  	// result: (CMPconst [0] a)
  5577  	for {
  5578  		if auxIntToInt32(v.AuxInt) != 0 {
  5579  			break
  5580  		}
  5581  		a := v_0
  5582  		if a.Op != OpPPC64ANDconst {
  5583  			break
  5584  		}
  5585  		v.reset(OpPPC64CMPconst)
  5586  		v.AuxInt = int64ToAuxInt(0)
  5587  		v.AddArg(a)
  5588  		return true
  5589  	}
  5590  	return false
  5591  }
  5592  func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
  5593  	v_0 := v.Args[0]
  5594  	// match: (CMPconst (MOVDconst [x]) [y])
  5595  	// cond: x==y
  5596  	// result: (FlagEQ)
  5597  	for {
  5598  		y := auxIntToInt64(v.AuxInt)
  5599  		if v_0.Op != OpPPC64MOVDconst {
  5600  			break
  5601  		}
  5602  		x := auxIntToInt64(v_0.AuxInt)
  5603  		if !(x == y) {
  5604  			break
  5605  		}
  5606  		v.reset(OpPPC64FlagEQ)
  5607  		return true
  5608  	}
  5609  	// match: (CMPconst (MOVDconst [x]) [y])
  5610  	// cond: x<y
  5611  	// result: (FlagLT)
  5612  	for {
  5613  		y := auxIntToInt64(v.AuxInt)
  5614  		if v_0.Op != OpPPC64MOVDconst {
  5615  			break
  5616  		}
  5617  		x := auxIntToInt64(v_0.AuxInt)
  5618  		if !(x < y) {
  5619  			break
  5620  		}
  5621  		v.reset(OpPPC64FlagLT)
  5622  		return true
  5623  	}
  5624  	// match: (CMPconst (MOVDconst [x]) [y])
  5625  	// cond: x>y
  5626  	// result: (FlagGT)
  5627  	for {
  5628  		y := auxIntToInt64(v.AuxInt)
  5629  		if v_0.Op != OpPPC64MOVDconst {
  5630  			break
  5631  		}
  5632  		x := auxIntToInt64(v_0.AuxInt)
  5633  		if !(x > y) {
  5634  			break
  5635  		}
  5636  		v.reset(OpPPC64FlagGT)
  5637  		return true
  5638  	}
  5639  	return false
  5640  }
  5641  func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
  5642  	v_0 := v.Args[0]
  5643  	// match: (Equal (FlagEQ))
  5644  	// result: (MOVDconst [1])
  5645  	for {
  5646  		if v_0.Op != OpPPC64FlagEQ {
  5647  			break
  5648  		}
  5649  		v.reset(OpPPC64MOVDconst)
  5650  		v.AuxInt = int64ToAuxInt(1)
  5651  		return true
  5652  	}
  5653  	// match: (Equal (FlagLT))
  5654  	// result: (MOVDconst [0])
  5655  	for {
  5656  		if v_0.Op != OpPPC64FlagLT {
  5657  			break
  5658  		}
  5659  		v.reset(OpPPC64MOVDconst)
  5660  		v.AuxInt = int64ToAuxInt(0)
  5661  		return true
  5662  	}
  5663  	// match: (Equal (FlagGT))
  5664  	// result: (MOVDconst [0])
  5665  	for {
  5666  		if v_0.Op != OpPPC64FlagGT {
  5667  			break
  5668  		}
  5669  		v.reset(OpPPC64MOVDconst)
  5670  		v.AuxInt = int64ToAuxInt(0)
  5671  		return true
  5672  	}
  5673  	// match: (Equal (InvertFlags x))
  5674  	// result: (Equal x)
  5675  	for {
  5676  		if v_0.Op != OpPPC64InvertFlags {
  5677  			break
  5678  		}
  5679  		x := v_0.Args[0]
  5680  		v.reset(OpPPC64Equal)
  5681  		v.AddArg(x)
  5682  		return true
  5683  	}
  5684  	// match: (Equal cmp)
  5685  	// result: (SETBC [2] cmp)
  5686  	for {
  5687  		cmp := v_0
  5688  		v.reset(OpPPC64SETBC)
  5689  		v.AuxInt = int32ToAuxInt(2)
  5690  		v.AddArg(cmp)
  5691  		return true
  5692  	}
  5693  }
  5694  func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
  5695  	v_0 := v.Args[0]
  5696  	// match: (FABS (FMOVDconst [x]))
  5697  	// result: (FMOVDconst [math.Abs(x)])
  5698  	for {
  5699  		if v_0.Op != OpPPC64FMOVDconst {
  5700  			break
  5701  		}
  5702  		x := auxIntToFloat64(v_0.AuxInt)
  5703  		v.reset(OpPPC64FMOVDconst)
  5704  		v.AuxInt = float64ToAuxInt(math.Abs(x))
  5705  		return true
  5706  	}
  5707  	return false
  5708  }
  5709  func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
  5710  	v_1 := v.Args[1]
  5711  	v_0 := v.Args[0]
  5712  	// match: (FADD (FMUL x y) z)
  5713  	// cond: x.Block.Func.useFMA(v)
  5714  	// result: (FMADD x y z)
  5715  	for {
  5716  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5717  			if v_0.Op != OpPPC64FMUL {
  5718  				continue
  5719  			}
  5720  			_ = v_0.Args[1]
  5721  			v_0_0 := v_0.Args[0]
  5722  			v_0_1 := v_0.Args[1]
  5723  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5724  				x := v_0_0
  5725  				y := v_0_1
  5726  				z := v_1
  5727  				if !(x.Block.Func.useFMA(v)) {
  5728  					continue
  5729  				}
  5730  				v.reset(OpPPC64FMADD)
  5731  				v.AddArg3(x, y, z)
  5732  				return true
  5733  			}
  5734  		}
  5735  		break
  5736  	}
  5737  	return false
  5738  }
  5739  func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
  5740  	v_1 := v.Args[1]
  5741  	v_0 := v.Args[0]
  5742  	// match: (FADDS (FMULS x y) z)
  5743  	// cond: x.Block.Func.useFMA(v)
  5744  	// result: (FMADDS x y z)
  5745  	for {
  5746  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5747  			if v_0.Op != OpPPC64FMULS {
  5748  				continue
  5749  			}
  5750  			_ = v_0.Args[1]
  5751  			v_0_0 := v_0.Args[0]
  5752  			v_0_1 := v_0.Args[1]
  5753  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5754  				x := v_0_0
  5755  				y := v_0_1
  5756  				z := v_1
  5757  				if !(x.Block.Func.useFMA(v)) {
  5758  					continue
  5759  				}
  5760  				v.reset(OpPPC64FMADDS)
  5761  				v.AddArg3(x, y, z)
  5762  				return true
  5763  			}
  5764  		}
  5765  		break
  5766  	}
  5767  	return false
  5768  }
  5769  func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
  5770  	v_0 := v.Args[0]
  5771  	// match: (FCEIL (FMOVDconst [x]))
  5772  	// result: (FMOVDconst [math.Ceil(x)])
  5773  	for {
  5774  		if v_0.Op != OpPPC64FMOVDconst {
  5775  			break
  5776  		}
  5777  		x := auxIntToFloat64(v_0.AuxInt)
  5778  		v.reset(OpPPC64FMOVDconst)
  5779  		v.AuxInt = float64ToAuxInt(math.Ceil(x))
  5780  		return true
  5781  	}
  5782  	return false
  5783  }
  5784  func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
  5785  	v_0 := v.Args[0]
  5786  	// match: (FFLOOR (FMOVDconst [x]))
  5787  	// result: (FMOVDconst [math.Floor(x)])
  5788  	for {
  5789  		if v_0.Op != OpPPC64FMOVDconst {
  5790  			break
  5791  		}
  5792  		x := auxIntToFloat64(v_0.AuxInt)
  5793  		v.reset(OpPPC64FMOVDconst)
  5794  		v.AuxInt = float64ToAuxInt(math.Floor(x))
  5795  		return true
  5796  	}
  5797  	return false
  5798  }
  5799  func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
  5800  	v_0 := v.Args[0]
  5801  	b := v.Block
  5802  	typ := &b.Func.Config.Types
  5803  	// match: (FGreaterEqual cmp)
  5804  	// result: (OR (SETBC [2] cmp) (SETBC [1] cmp))
  5805  	for {
  5806  		cmp := v_0
  5807  		v.reset(OpPPC64OR)
  5808  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5809  		v0.AuxInt = int32ToAuxInt(2)
  5810  		v0.AddArg(cmp)
  5811  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5812  		v1.AuxInt = int32ToAuxInt(1)
  5813  		v1.AddArg(cmp)
  5814  		v.AddArg2(v0, v1)
  5815  		return true
  5816  	}
  5817  }
  5818  func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
  5819  	v_0 := v.Args[0]
  5820  	// match: (FGreaterThan cmp)
  5821  	// result: (SETBC [1] cmp)
  5822  	for {
  5823  		cmp := v_0
  5824  		v.reset(OpPPC64SETBC)
  5825  		v.AuxInt = int32ToAuxInt(1)
  5826  		v.AddArg(cmp)
  5827  		return true
  5828  	}
  5829  }
  5830  func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
  5831  	v_0 := v.Args[0]
  5832  	b := v.Block
  5833  	typ := &b.Func.Config.Types
  5834  	// match: (FLessEqual cmp)
  5835  	// result: (OR (SETBC [2] cmp) (SETBC [0] cmp))
  5836  	for {
  5837  		cmp := v_0
  5838  		v.reset(OpPPC64OR)
  5839  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5840  		v0.AuxInt = int32ToAuxInt(2)
  5841  		v0.AddArg(cmp)
  5842  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5843  		v1.AuxInt = int32ToAuxInt(0)
  5844  		v1.AddArg(cmp)
  5845  		v.AddArg2(v0, v1)
  5846  		return true
  5847  	}
  5848  }
  5849  func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
  5850  	v_0 := v.Args[0]
  5851  	// match: (FLessThan cmp)
  5852  	// result: (SETBC [0] cmp)
  5853  	for {
  5854  		cmp := v_0
  5855  		v.reset(OpPPC64SETBC)
  5856  		v.AuxInt = int32ToAuxInt(0)
  5857  		v.AddArg(cmp)
  5858  		return true
  5859  	}
  5860  }
  5861  func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
  5862  	v_1 := v.Args[1]
  5863  	v_0 := v.Args[0]
  5864  	// match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _))
  5865  	// result: (MTVSRD x)
  5866  	for {
  5867  		off := auxIntToInt32(v.AuxInt)
  5868  		sym := auxToSym(v.Aux)
  5869  		ptr := v_0
  5870  		if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5871  			break
  5872  		}
  5873  		x := v_1.Args[1]
  5874  		if ptr != v_1.Args[0] {
  5875  			break
  5876  		}
  5877  		v.reset(OpPPC64MTVSRD)
  5878  		v.AddArg(x)
  5879  		return true
  5880  	}
  5881  	// match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5882  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5883  	// result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5884  	for {
  5885  		off1 := auxIntToInt32(v.AuxInt)
  5886  		sym1 := auxToSym(v.Aux)
  5887  		p := v_0
  5888  		if p.Op != OpPPC64MOVDaddr {
  5889  			break
  5890  		}
  5891  		off2 := auxIntToInt32(p.AuxInt)
  5892  		sym2 := auxToSym(p.Aux)
  5893  		ptr := p.Args[0]
  5894  		mem := v_1
  5895  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5896  			break
  5897  		}
  5898  		v.reset(OpPPC64FMOVDload)
  5899  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5900  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5901  		v.AddArg2(ptr, mem)
  5902  		return true
  5903  	}
  5904  	// match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  5905  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5906  	// result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
  5907  	for {
  5908  		off1 := auxIntToInt32(v.AuxInt)
  5909  		sym := auxToSym(v.Aux)
  5910  		if v_0.Op != OpPPC64ADDconst {
  5911  			break
  5912  		}
  5913  		off2 := auxIntToInt64(v_0.AuxInt)
  5914  		ptr := v_0.Args[0]
  5915  		mem := v_1
  5916  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5917  			break
  5918  		}
  5919  		v.reset(OpPPC64FMOVDload)
  5920  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5921  		v.Aux = symToAux(sym)
  5922  		v.AddArg2(ptr, mem)
  5923  		return true
  5924  	}
  5925  	return false
  5926  }
  5927  func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
  5928  	v_2 := v.Args[2]
  5929  	v_1 := v.Args[1]
  5930  	v_0 := v.Args[0]
  5931  	// match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem)
  5932  	// result: (MOVDstore [off] {sym} ptr x mem)
  5933  	for {
  5934  		off := auxIntToInt32(v.AuxInt)
  5935  		sym := auxToSym(v.Aux)
  5936  		ptr := v_0
  5937  		if v_1.Op != OpPPC64MTVSRD {
  5938  			break
  5939  		}
  5940  		x := v_1.Args[0]
  5941  		mem := v_2
  5942  		v.reset(OpPPC64MOVDstore)
  5943  		v.AuxInt = int32ToAuxInt(off)
  5944  		v.Aux = symToAux(sym)
  5945  		v.AddArg3(ptr, x, mem)
  5946  		return true
  5947  	}
  5948  	// match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5949  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5950  	// result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
  5951  	for {
  5952  		off1 := auxIntToInt32(v.AuxInt)
  5953  		sym := auxToSym(v.Aux)
  5954  		if v_0.Op != OpPPC64ADDconst {
  5955  			break
  5956  		}
  5957  		off2 := auxIntToInt64(v_0.AuxInt)
  5958  		ptr := v_0.Args[0]
  5959  		val := v_1
  5960  		mem := v_2
  5961  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5962  			break
  5963  		}
  5964  		v.reset(OpPPC64FMOVDstore)
  5965  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5966  		v.Aux = symToAux(sym)
  5967  		v.AddArg3(ptr, val, mem)
  5968  		return true
  5969  	}
  5970  	// match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  5971  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5972  	// result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5973  	for {
  5974  		off1 := auxIntToInt32(v.AuxInt)
  5975  		sym1 := auxToSym(v.Aux)
  5976  		p := v_0
  5977  		if p.Op != OpPPC64MOVDaddr {
  5978  			break
  5979  		}
  5980  		off2 := auxIntToInt32(p.AuxInt)
  5981  		sym2 := auxToSym(p.Aux)
  5982  		ptr := p.Args[0]
  5983  		val := v_1
  5984  		mem := v_2
  5985  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5986  			break
  5987  		}
  5988  		v.reset(OpPPC64FMOVDstore)
  5989  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5990  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5991  		v.AddArg3(ptr, val, mem)
  5992  		return true
  5993  	}
  5994  	return false
  5995  }
  5996  func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
  5997  	v_1 := v.Args[1]
  5998  	v_0 := v.Args[0]
  5999  	// match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  6000  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6001  	// result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6002  	for {
  6003  		off1 := auxIntToInt32(v.AuxInt)
  6004  		sym1 := auxToSym(v.Aux)
  6005  		p := v_0
  6006  		if p.Op != OpPPC64MOVDaddr {
  6007  			break
  6008  		}
  6009  		off2 := auxIntToInt32(p.AuxInt)
  6010  		sym2 := auxToSym(p.Aux)
  6011  		ptr := p.Args[0]
  6012  		mem := v_1
  6013  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6014  			break
  6015  		}
  6016  		v.reset(OpPPC64FMOVSload)
  6017  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6018  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6019  		v.AddArg2(ptr, mem)
  6020  		return true
  6021  	}
  6022  	// match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
  6023  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6024  	// result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
  6025  	for {
  6026  		off1 := auxIntToInt32(v.AuxInt)
  6027  		sym := auxToSym(v.Aux)
  6028  		if v_0.Op != OpPPC64ADDconst {
  6029  			break
  6030  		}
  6031  		off2 := auxIntToInt64(v_0.AuxInt)
  6032  		ptr := v_0.Args[0]
  6033  		mem := v_1
  6034  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6035  			break
  6036  		}
  6037  		v.reset(OpPPC64FMOVSload)
  6038  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6039  		v.Aux = symToAux(sym)
  6040  		v.AddArg2(ptr, mem)
  6041  		return true
  6042  	}
  6043  	return false
  6044  }
  6045  func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
  6046  	v_2 := v.Args[2]
  6047  	v_1 := v.Args[1]
  6048  	v_0 := v.Args[0]
  6049  	// match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  6050  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6051  	// result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
  6052  	for {
  6053  		off1 := auxIntToInt32(v.AuxInt)
  6054  		sym := auxToSym(v.Aux)
  6055  		if v_0.Op != OpPPC64ADDconst {
  6056  			break
  6057  		}
  6058  		off2 := auxIntToInt64(v_0.AuxInt)
  6059  		ptr := v_0.Args[0]
  6060  		val := v_1
  6061  		mem := v_2
  6062  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6063  			break
  6064  		}
  6065  		v.reset(OpPPC64FMOVSstore)
  6066  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6067  		v.Aux = symToAux(sym)
  6068  		v.AddArg3(ptr, val, mem)
  6069  		return true
  6070  	}
  6071  	// match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  6072  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6073  	// result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  6074  	for {
  6075  		off1 := auxIntToInt32(v.AuxInt)
  6076  		sym1 := auxToSym(v.Aux)
  6077  		p := v_0
  6078  		if p.Op != OpPPC64MOVDaddr {
  6079  			break
  6080  		}
  6081  		off2 := auxIntToInt32(p.AuxInt)
  6082  		sym2 := auxToSym(p.Aux)
  6083  		ptr := p.Args[0]
  6084  		val := v_1
  6085  		mem := v_2
  6086  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6087  			break
  6088  		}
  6089  		v.reset(OpPPC64FMOVSstore)
  6090  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6091  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6092  		v.AddArg3(ptr, val, mem)
  6093  		return true
  6094  	}
  6095  	return false
  6096  }
  6097  func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
  6098  	v_0 := v.Args[0]
  6099  	// match: (FNEG (FABS x))
  6100  	// result: (FNABS x)
  6101  	for {
  6102  		if v_0.Op != OpPPC64FABS {
  6103  			break
  6104  		}
  6105  		x := v_0.Args[0]
  6106  		v.reset(OpPPC64FNABS)
  6107  		v.AddArg(x)
  6108  		return true
  6109  	}
  6110  	// match: (FNEG (FNABS x))
  6111  	// result: (FABS x)
  6112  	for {
  6113  		if v_0.Op != OpPPC64FNABS {
  6114  			break
  6115  		}
  6116  		x := v_0.Args[0]
  6117  		v.reset(OpPPC64FABS)
  6118  		v.AddArg(x)
  6119  		return true
  6120  	}
  6121  	return false
  6122  }
  6123  func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
  6124  	v_0 := v.Args[0]
  6125  	// match: (FSQRT (FMOVDconst [x]))
  6126  	// cond: x >= 0
  6127  	// result: (FMOVDconst [math.Sqrt(x)])
  6128  	for {
  6129  		if v_0.Op != OpPPC64FMOVDconst {
  6130  			break
  6131  		}
  6132  		x := auxIntToFloat64(v_0.AuxInt)
  6133  		if !(x >= 0) {
  6134  			break
  6135  		}
  6136  		v.reset(OpPPC64FMOVDconst)
  6137  		v.AuxInt = float64ToAuxInt(math.Sqrt(x))
  6138  		return true
  6139  	}
  6140  	return false
  6141  }
  6142  func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
  6143  	v_1 := v.Args[1]
  6144  	v_0 := v.Args[0]
  6145  	// match: (FSUB (FMUL x y) z)
  6146  	// cond: x.Block.Func.useFMA(v)
  6147  	// result: (FMSUB x y z)
  6148  	for {
  6149  		if v_0.Op != OpPPC64FMUL {
  6150  			break
  6151  		}
  6152  		_ = v_0.Args[1]
  6153  		v_0_0 := v_0.Args[0]
  6154  		v_0_1 := v_0.Args[1]
  6155  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6156  			x := v_0_0
  6157  			y := v_0_1
  6158  			z := v_1
  6159  			if !(x.Block.Func.useFMA(v)) {
  6160  				continue
  6161  			}
  6162  			v.reset(OpPPC64FMSUB)
  6163  			v.AddArg3(x, y, z)
  6164  			return true
  6165  		}
  6166  		break
  6167  	}
  6168  	return false
  6169  }
  6170  func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
  6171  	v_1 := v.Args[1]
  6172  	v_0 := v.Args[0]
  6173  	// match: (FSUBS (FMULS x y) z)
  6174  	// cond: x.Block.Func.useFMA(v)
  6175  	// result: (FMSUBS x y z)
  6176  	for {
  6177  		if v_0.Op != OpPPC64FMULS {
  6178  			break
  6179  		}
  6180  		_ = v_0.Args[1]
  6181  		v_0_0 := v_0.Args[0]
  6182  		v_0_1 := v_0.Args[1]
  6183  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6184  			x := v_0_0
  6185  			y := v_0_1
  6186  			z := v_1
  6187  			if !(x.Block.Func.useFMA(v)) {
  6188  				continue
  6189  			}
  6190  			v.reset(OpPPC64FMSUBS)
  6191  			v.AddArg3(x, y, z)
  6192  			return true
  6193  		}
  6194  		break
  6195  	}
  6196  	return false
  6197  }
  6198  func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
  6199  	v_0 := v.Args[0]
  6200  	// match: (FTRUNC (FMOVDconst [x]))
  6201  	// result: (FMOVDconst [math.Trunc(x)])
  6202  	for {
  6203  		if v_0.Op != OpPPC64FMOVDconst {
  6204  			break
  6205  		}
  6206  		x := auxIntToFloat64(v_0.AuxInt)
  6207  		v.reset(OpPPC64FMOVDconst)
  6208  		v.AuxInt = float64ToAuxInt(math.Trunc(x))
  6209  		return true
  6210  	}
  6211  	return false
  6212  }
  6213  func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
  6214  	v_0 := v.Args[0]
  6215  	// match: (GreaterEqual (FlagEQ))
  6216  	// result: (MOVDconst [1])
  6217  	for {
  6218  		if v_0.Op != OpPPC64FlagEQ {
  6219  			break
  6220  		}
  6221  		v.reset(OpPPC64MOVDconst)
  6222  		v.AuxInt = int64ToAuxInt(1)
  6223  		return true
  6224  	}
  6225  	// match: (GreaterEqual (FlagLT))
  6226  	// result: (MOVDconst [0])
  6227  	for {
  6228  		if v_0.Op != OpPPC64FlagLT {
  6229  			break
  6230  		}
  6231  		v.reset(OpPPC64MOVDconst)
  6232  		v.AuxInt = int64ToAuxInt(0)
  6233  		return true
  6234  	}
  6235  	// match: (GreaterEqual (FlagGT))
  6236  	// result: (MOVDconst [1])
  6237  	for {
  6238  		if v_0.Op != OpPPC64FlagGT {
  6239  			break
  6240  		}
  6241  		v.reset(OpPPC64MOVDconst)
  6242  		v.AuxInt = int64ToAuxInt(1)
  6243  		return true
  6244  	}
  6245  	// match: (GreaterEqual (InvertFlags x))
  6246  	// result: (LessEqual x)
  6247  	for {
  6248  		if v_0.Op != OpPPC64InvertFlags {
  6249  			break
  6250  		}
  6251  		x := v_0.Args[0]
  6252  		v.reset(OpPPC64LessEqual)
  6253  		v.AddArg(x)
  6254  		return true
  6255  	}
  6256  	// match: (GreaterEqual cmp)
  6257  	// result: (SETBCR [0] cmp)
  6258  	for {
  6259  		cmp := v_0
  6260  		v.reset(OpPPC64SETBCR)
  6261  		v.AuxInt = int32ToAuxInt(0)
  6262  		v.AddArg(cmp)
  6263  		return true
  6264  	}
  6265  }
  6266  func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
  6267  	v_0 := v.Args[0]
  6268  	// match: (GreaterThan (FlagEQ))
  6269  	// result: (MOVDconst [0])
  6270  	for {
  6271  		if v_0.Op != OpPPC64FlagEQ {
  6272  			break
  6273  		}
  6274  		v.reset(OpPPC64MOVDconst)
  6275  		v.AuxInt = int64ToAuxInt(0)
  6276  		return true
  6277  	}
  6278  	// match: (GreaterThan (FlagLT))
  6279  	// result: (MOVDconst [0])
  6280  	for {
  6281  		if v_0.Op != OpPPC64FlagLT {
  6282  			break
  6283  		}
  6284  		v.reset(OpPPC64MOVDconst)
  6285  		v.AuxInt = int64ToAuxInt(0)
  6286  		return true
  6287  	}
  6288  	// match: (GreaterThan (FlagGT))
  6289  	// result: (MOVDconst [1])
  6290  	for {
  6291  		if v_0.Op != OpPPC64FlagGT {
  6292  			break
  6293  		}
  6294  		v.reset(OpPPC64MOVDconst)
  6295  		v.AuxInt = int64ToAuxInt(1)
  6296  		return true
  6297  	}
  6298  	// match: (GreaterThan (InvertFlags x))
  6299  	// result: (LessThan x)
  6300  	for {
  6301  		if v_0.Op != OpPPC64InvertFlags {
  6302  			break
  6303  		}
  6304  		x := v_0.Args[0]
  6305  		v.reset(OpPPC64LessThan)
  6306  		v.AddArg(x)
  6307  		return true
  6308  	}
  6309  	// match: (GreaterThan cmp)
  6310  	// result: (SETBC [1] cmp)
  6311  	for {
  6312  		cmp := v_0
  6313  		v.reset(OpPPC64SETBC)
  6314  		v.AuxInt = int32ToAuxInt(1)
  6315  		v.AddArg(cmp)
  6316  		return true
  6317  	}
  6318  }
  6319  func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
  6320  	v_2 := v.Args[2]
  6321  	v_1 := v.Args[1]
  6322  	v_0 := v.Args[0]
  6323  	// match: (ISEL [6] x y (CMPconst [0] (ANDconst [1] (SETBC [c] cmp))))
  6324  	// result: (ISEL [c] x y cmp)
  6325  	for {
  6326  		if auxIntToInt32(v.AuxInt) != 6 {
  6327  			break
  6328  		}
  6329  		x := v_0
  6330  		y := v_1
  6331  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6332  			break
  6333  		}
  6334  		v_2_0 := v_2.Args[0]
  6335  		if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != 1 {
  6336  			break
  6337  		}
  6338  		v_2_0_0 := v_2_0.Args[0]
  6339  		if v_2_0_0.Op != OpPPC64SETBC {
  6340  			break
  6341  		}
  6342  		c := auxIntToInt32(v_2_0_0.AuxInt)
  6343  		cmp := v_2_0_0.Args[0]
  6344  		v.reset(OpPPC64ISEL)
  6345  		v.AuxInt = int32ToAuxInt(c)
  6346  		v.AddArg3(x, y, cmp)
  6347  		return true
  6348  	}
  6349  	// match: (ISEL [6] x y (CMPconst [0] (SETBC [c] cmp)))
  6350  	// result: (ISEL [c] x y cmp)
  6351  	for {
  6352  		if auxIntToInt32(v.AuxInt) != 6 {
  6353  			break
  6354  		}
  6355  		x := v_0
  6356  		y := v_1
  6357  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6358  			break
  6359  		}
  6360  		v_2_0 := v_2.Args[0]
  6361  		if v_2_0.Op != OpPPC64SETBC {
  6362  			break
  6363  		}
  6364  		c := auxIntToInt32(v_2_0.AuxInt)
  6365  		cmp := v_2_0.Args[0]
  6366  		v.reset(OpPPC64ISEL)
  6367  		v.AuxInt = int32ToAuxInt(c)
  6368  		v.AddArg3(x, y, cmp)
  6369  		return true
  6370  	}
  6371  	// match: (ISEL [6] x y (CMPWconst [0] (SETBC [c] cmp)))
  6372  	// result: (ISEL [c] x y cmp)
  6373  	for {
  6374  		if auxIntToInt32(v.AuxInt) != 6 {
  6375  			break
  6376  		}
  6377  		x := v_0
  6378  		y := v_1
  6379  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6380  			break
  6381  		}
  6382  		v_2_0 := v_2.Args[0]
  6383  		if v_2_0.Op != OpPPC64SETBC {
  6384  			break
  6385  		}
  6386  		c := auxIntToInt32(v_2_0.AuxInt)
  6387  		cmp := v_2_0.Args[0]
  6388  		v.reset(OpPPC64ISEL)
  6389  		v.AuxInt = int32ToAuxInt(c)
  6390  		v.AddArg3(x, y, cmp)
  6391  		return true
  6392  	}
  6393  	// match: (ISEL [6] x y (CMPconst [0] (SETBCR [c] cmp)))
  6394  	// result: (ISEL [c+4] x y cmp)
  6395  	for {
  6396  		if auxIntToInt32(v.AuxInt) != 6 {
  6397  			break
  6398  		}
  6399  		x := v_0
  6400  		y := v_1
  6401  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6402  			break
  6403  		}
  6404  		v_2_0 := v_2.Args[0]
  6405  		if v_2_0.Op != OpPPC64SETBCR {
  6406  			break
  6407  		}
  6408  		c := auxIntToInt32(v_2_0.AuxInt)
  6409  		cmp := v_2_0.Args[0]
  6410  		v.reset(OpPPC64ISEL)
  6411  		v.AuxInt = int32ToAuxInt(c + 4)
  6412  		v.AddArg3(x, y, cmp)
  6413  		return true
  6414  	}
  6415  	// match: (ISEL [6] x y (CMPWconst [0] (SETBCR [c] cmp)))
  6416  	// result: (ISEL [c+4] x y cmp)
  6417  	for {
  6418  		if auxIntToInt32(v.AuxInt) != 6 {
  6419  			break
  6420  		}
  6421  		x := v_0
  6422  		y := v_1
  6423  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6424  			break
  6425  		}
  6426  		v_2_0 := v_2.Args[0]
  6427  		if v_2_0.Op != OpPPC64SETBCR {
  6428  			break
  6429  		}
  6430  		c := auxIntToInt32(v_2_0.AuxInt)
  6431  		cmp := v_2_0.Args[0]
  6432  		v.reset(OpPPC64ISEL)
  6433  		v.AuxInt = int32ToAuxInt(c + 4)
  6434  		v.AddArg3(x, y, cmp)
  6435  		return true
  6436  	}
  6437  	// match: (ISEL [2] x _ (FlagEQ))
  6438  	// result: x
  6439  	for {
  6440  		if auxIntToInt32(v.AuxInt) != 2 {
  6441  			break
  6442  		}
  6443  		x := v_0
  6444  		if v_2.Op != OpPPC64FlagEQ {
  6445  			break
  6446  		}
  6447  		v.copyOf(x)
  6448  		return true
  6449  	}
  6450  	// match: (ISEL [2] _ y (FlagLT))
  6451  	// result: y
  6452  	for {
  6453  		if auxIntToInt32(v.AuxInt) != 2 {
  6454  			break
  6455  		}
  6456  		y := v_1
  6457  		if v_2.Op != OpPPC64FlagLT {
  6458  			break
  6459  		}
  6460  		v.copyOf(y)
  6461  		return true
  6462  	}
  6463  	// match: (ISEL [2] _ y (FlagGT))
  6464  	// result: y
  6465  	for {
  6466  		if auxIntToInt32(v.AuxInt) != 2 {
  6467  			break
  6468  		}
  6469  		y := v_1
  6470  		if v_2.Op != OpPPC64FlagGT {
  6471  			break
  6472  		}
  6473  		v.copyOf(y)
  6474  		return true
  6475  	}
  6476  	// match: (ISEL [6] _ y (FlagEQ))
  6477  	// result: y
  6478  	for {
  6479  		if auxIntToInt32(v.AuxInt) != 6 {
  6480  			break
  6481  		}
  6482  		y := v_1
  6483  		if v_2.Op != OpPPC64FlagEQ {
  6484  			break
  6485  		}
  6486  		v.copyOf(y)
  6487  		return true
  6488  	}
  6489  	// match: (ISEL [6] x _ (FlagLT))
  6490  	// result: x
  6491  	for {
  6492  		if auxIntToInt32(v.AuxInt) != 6 {
  6493  			break
  6494  		}
  6495  		x := v_0
  6496  		if v_2.Op != OpPPC64FlagLT {
  6497  			break
  6498  		}
  6499  		v.copyOf(x)
  6500  		return true
  6501  	}
  6502  	// match: (ISEL [6] x _ (FlagGT))
  6503  	// result: x
  6504  	for {
  6505  		if auxIntToInt32(v.AuxInt) != 6 {
  6506  			break
  6507  		}
  6508  		x := v_0
  6509  		if v_2.Op != OpPPC64FlagGT {
  6510  			break
  6511  		}
  6512  		v.copyOf(x)
  6513  		return true
  6514  	}
  6515  	// match: (ISEL [0] _ y (FlagEQ))
  6516  	// result: y
  6517  	for {
  6518  		if auxIntToInt32(v.AuxInt) != 0 {
  6519  			break
  6520  		}
  6521  		y := v_1
  6522  		if v_2.Op != OpPPC64FlagEQ {
  6523  			break
  6524  		}
  6525  		v.copyOf(y)
  6526  		return true
  6527  	}
  6528  	// match: (ISEL [0] _ y (FlagGT))
  6529  	// result: y
  6530  	for {
  6531  		if auxIntToInt32(v.AuxInt) != 0 {
  6532  			break
  6533  		}
  6534  		y := v_1
  6535  		if v_2.Op != OpPPC64FlagGT {
  6536  			break
  6537  		}
  6538  		v.copyOf(y)
  6539  		return true
  6540  	}
  6541  	// match: (ISEL [0] x _ (FlagLT))
  6542  	// result: x
  6543  	for {
  6544  		if auxIntToInt32(v.AuxInt) != 0 {
  6545  			break
  6546  		}
  6547  		x := v_0
  6548  		if v_2.Op != OpPPC64FlagLT {
  6549  			break
  6550  		}
  6551  		v.copyOf(x)
  6552  		return true
  6553  	}
  6554  	// match: (ISEL [5] _ x (FlagEQ))
  6555  	// result: x
  6556  	for {
  6557  		if auxIntToInt32(v.AuxInt) != 5 {
  6558  			break
  6559  		}
  6560  		x := v_1
  6561  		if v_2.Op != OpPPC64FlagEQ {
  6562  			break
  6563  		}
  6564  		v.copyOf(x)
  6565  		return true
  6566  	}
  6567  	// match: (ISEL [5] _ x (FlagLT))
  6568  	// result: x
  6569  	for {
  6570  		if auxIntToInt32(v.AuxInt) != 5 {
  6571  			break
  6572  		}
  6573  		x := v_1
  6574  		if v_2.Op != OpPPC64FlagLT {
  6575  			break
  6576  		}
  6577  		v.copyOf(x)
  6578  		return true
  6579  	}
  6580  	// match: (ISEL [5] y _ (FlagGT))
  6581  	// result: y
  6582  	for {
  6583  		if auxIntToInt32(v.AuxInt) != 5 {
  6584  			break
  6585  		}
  6586  		y := v_0
  6587  		if v_2.Op != OpPPC64FlagGT {
  6588  			break
  6589  		}
  6590  		v.copyOf(y)
  6591  		return true
  6592  	}
  6593  	// match: (ISEL [1] _ y (FlagEQ))
  6594  	// result: y
  6595  	for {
  6596  		if auxIntToInt32(v.AuxInt) != 1 {
  6597  			break
  6598  		}
  6599  		y := v_1
  6600  		if v_2.Op != OpPPC64FlagEQ {
  6601  			break
  6602  		}
  6603  		v.copyOf(y)
  6604  		return true
  6605  	}
  6606  	// match: (ISEL [1] _ y (FlagLT))
  6607  	// result: y
  6608  	for {
  6609  		if auxIntToInt32(v.AuxInt) != 1 {
  6610  			break
  6611  		}
  6612  		y := v_1
  6613  		if v_2.Op != OpPPC64FlagLT {
  6614  			break
  6615  		}
  6616  		v.copyOf(y)
  6617  		return true
  6618  	}
  6619  	// match: (ISEL [1] x _ (FlagGT))
  6620  	// result: x
  6621  	for {
  6622  		if auxIntToInt32(v.AuxInt) != 1 {
  6623  			break
  6624  		}
  6625  		x := v_0
  6626  		if v_2.Op != OpPPC64FlagGT {
  6627  			break
  6628  		}
  6629  		v.copyOf(x)
  6630  		return true
  6631  	}
  6632  	// match: (ISEL [4] x _ (FlagEQ))
  6633  	// result: x
  6634  	for {
  6635  		if auxIntToInt32(v.AuxInt) != 4 {
  6636  			break
  6637  		}
  6638  		x := v_0
  6639  		if v_2.Op != OpPPC64FlagEQ {
  6640  			break
  6641  		}
  6642  		v.copyOf(x)
  6643  		return true
  6644  	}
  6645  	// match: (ISEL [4] x _ (FlagGT))
  6646  	// result: x
  6647  	for {
  6648  		if auxIntToInt32(v.AuxInt) != 4 {
  6649  			break
  6650  		}
  6651  		x := v_0
  6652  		if v_2.Op != OpPPC64FlagGT {
  6653  			break
  6654  		}
  6655  		v.copyOf(x)
  6656  		return true
  6657  	}
  6658  	// match: (ISEL [4] _ y (FlagLT))
  6659  	// result: y
  6660  	for {
  6661  		if auxIntToInt32(v.AuxInt) != 4 {
  6662  			break
  6663  		}
  6664  		y := v_1
  6665  		if v_2.Op != OpPPC64FlagLT {
  6666  			break
  6667  		}
  6668  		v.copyOf(y)
  6669  		return true
  6670  	}
  6671  	// match: (ISEL [n] x y (InvertFlags bool))
  6672  	// cond: n%4 == 0
  6673  	// result: (ISEL [n+1] x y bool)
  6674  	for {
  6675  		n := auxIntToInt32(v.AuxInt)
  6676  		x := v_0
  6677  		y := v_1
  6678  		if v_2.Op != OpPPC64InvertFlags {
  6679  			break
  6680  		}
  6681  		bool := v_2.Args[0]
  6682  		if !(n%4 == 0) {
  6683  			break
  6684  		}
  6685  		v.reset(OpPPC64ISEL)
  6686  		v.AuxInt = int32ToAuxInt(n + 1)
  6687  		v.AddArg3(x, y, bool)
  6688  		return true
  6689  	}
  6690  	// match: (ISEL [n] x y (InvertFlags bool))
  6691  	// cond: n%4 == 1
  6692  	// result: (ISEL [n-1] x y bool)
  6693  	for {
  6694  		n := auxIntToInt32(v.AuxInt)
  6695  		x := v_0
  6696  		y := v_1
  6697  		if v_2.Op != OpPPC64InvertFlags {
  6698  			break
  6699  		}
  6700  		bool := v_2.Args[0]
  6701  		if !(n%4 == 1) {
  6702  			break
  6703  		}
  6704  		v.reset(OpPPC64ISEL)
  6705  		v.AuxInt = int32ToAuxInt(n - 1)
  6706  		v.AddArg3(x, y, bool)
  6707  		return true
  6708  	}
  6709  	// match: (ISEL [n] x y (InvertFlags bool))
  6710  	// cond: n%4 == 2
  6711  	// result: (ISEL [n] x y bool)
  6712  	for {
  6713  		n := auxIntToInt32(v.AuxInt)
  6714  		x := v_0
  6715  		y := v_1
  6716  		if v_2.Op != OpPPC64InvertFlags {
  6717  			break
  6718  		}
  6719  		bool := v_2.Args[0]
  6720  		if !(n%4 == 2) {
  6721  			break
  6722  		}
  6723  		v.reset(OpPPC64ISEL)
  6724  		v.AuxInt = int32ToAuxInt(n)
  6725  		v.AddArg3(x, y, bool)
  6726  		return true
  6727  	}
  6728  	return false
  6729  }
  6730  func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
  6731  	v_0 := v.Args[0]
  6732  	// match: (LessEqual (FlagEQ))
  6733  	// result: (MOVDconst [1])
  6734  	for {
  6735  		if v_0.Op != OpPPC64FlagEQ {
  6736  			break
  6737  		}
  6738  		v.reset(OpPPC64MOVDconst)
  6739  		v.AuxInt = int64ToAuxInt(1)
  6740  		return true
  6741  	}
  6742  	// match: (LessEqual (FlagLT))
  6743  	// result: (MOVDconst [1])
  6744  	for {
  6745  		if v_0.Op != OpPPC64FlagLT {
  6746  			break
  6747  		}
  6748  		v.reset(OpPPC64MOVDconst)
  6749  		v.AuxInt = int64ToAuxInt(1)
  6750  		return true
  6751  	}
  6752  	// match: (LessEqual (FlagGT))
  6753  	// result: (MOVDconst [0])
  6754  	for {
  6755  		if v_0.Op != OpPPC64FlagGT {
  6756  			break
  6757  		}
  6758  		v.reset(OpPPC64MOVDconst)
  6759  		v.AuxInt = int64ToAuxInt(0)
  6760  		return true
  6761  	}
  6762  	// match: (LessEqual (InvertFlags x))
  6763  	// result: (GreaterEqual x)
  6764  	for {
  6765  		if v_0.Op != OpPPC64InvertFlags {
  6766  			break
  6767  		}
  6768  		x := v_0.Args[0]
  6769  		v.reset(OpPPC64GreaterEqual)
  6770  		v.AddArg(x)
  6771  		return true
  6772  	}
  6773  	// match: (LessEqual cmp)
  6774  	// result: (SETBCR [1] cmp)
  6775  	for {
  6776  		cmp := v_0
  6777  		v.reset(OpPPC64SETBCR)
  6778  		v.AuxInt = int32ToAuxInt(1)
  6779  		v.AddArg(cmp)
  6780  		return true
  6781  	}
  6782  }
  6783  func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
  6784  	v_0 := v.Args[0]
  6785  	// match: (LessThan (FlagEQ))
  6786  	// result: (MOVDconst [0])
  6787  	for {
  6788  		if v_0.Op != OpPPC64FlagEQ {
  6789  			break
  6790  		}
  6791  		v.reset(OpPPC64MOVDconst)
  6792  		v.AuxInt = int64ToAuxInt(0)
  6793  		return true
  6794  	}
  6795  	// match: (LessThan (FlagLT))
  6796  	// result: (MOVDconst [1])
  6797  	for {
  6798  		if v_0.Op != OpPPC64FlagLT {
  6799  			break
  6800  		}
  6801  		v.reset(OpPPC64MOVDconst)
  6802  		v.AuxInt = int64ToAuxInt(1)
  6803  		return true
  6804  	}
  6805  	// match: (LessThan (FlagGT))
  6806  	// result: (MOVDconst [0])
  6807  	for {
  6808  		if v_0.Op != OpPPC64FlagGT {
  6809  			break
  6810  		}
  6811  		v.reset(OpPPC64MOVDconst)
  6812  		v.AuxInt = int64ToAuxInt(0)
  6813  		return true
  6814  	}
  6815  	// match: (LessThan (InvertFlags x))
  6816  	// result: (GreaterThan x)
  6817  	for {
  6818  		if v_0.Op != OpPPC64InvertFlags {
  6819  			break
  6820  		}
  6821  		x := v_0.Args[0]
  6822  		v.reset(OpPPC64GreaterThan)
  6823  		v.AddArg(x)
  6824  		return true
  6825  	}
  6826  	// match: (LessThan cmp)
  6827  	// result: (SETBC [0] cmp)
  6828  	for {
  6829  		cmp := v_0
  6830  		v.reset(OpPPC64SETBC)
  6831  		v.AuxInt = int32ToAuxInt(0)
  6832  		v.AddArg(cmp)
  6833  		return true
  6834  	}
  6835  }
  6836  func rewriteValuePPC64_OpPPC64LoweredPanicBoundsCR(v *Value) bool {
  6837  	v_1 := v.Args[1]
  6838  	v_0 := v.Args[0]
  6839  	// match: (LoweredPanicBoundsCR [kind] {p} (MOVDconst [c]) mem)
  6840  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:p.C, Cy:c}} mem)
  6841  	for {
  6842  		kind := auxIntToInt64(v.AuxInt)
  6843  		p := auxToPanicBoundsC(v.Aux)
  6844  		if v_0.Op != OpPPC64MOVDconst {
  6845  			break
  6846  		}
  6847  		c := auxIntToInt64(v_0.AuxInt)
  6848  		mem := v_1
  6849  		v.reset(OpPPC64LoweredPanicBoundsCC)
  6850  		v.AuxInt = int64ToAuxInt(kind)
  6851  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: p.C, Cy: c})
  6852  		v.AddArg(mem)
  6853  		return true
  6854  	}
  6855  	return false
  6856  }
  6857  func rewriteValuePPC64_OpPPC64LoweredPanicBoundsRC(v *Value) bool {
  6858  	v_1 := v.Args[1]
  6859  	v_0 := v.Args[0]
  6860  	// match: (LoweredPanicBoundsRC [kind] {p} (MOVDconst [c]) mem)
  6861  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:c, Cy:p.C}} mem)
  6862  	for {
  6863  		kind := auxIntToInt64(v.AuxInt)
  6864  		p := auxToPanicBoundsC(v.Aux)
  6865  		if v_0.Op != OpPPC64MOVDconst {
  6866  			break
  6867  		}
  6868  		c := auxIntToInt64(v_0.AuxInt)
  6869  		mem := v_1
  6870  		v.reset(OpPPC64LoweredPanicBoundsCC)
  6871  		v.AuxInt = int64ToAuxInt(kind)
  6872  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: c, Cy: p.C})
  6873  		v.AddArg(mem)
  6874  		return true
  6875  	}
  6876  	return false
  6877  }
  6878  func rewriteValuePPC64_OpPPC64LoweredPanicBoundsRR(v *Value) bool {
  6879  	v_2 := v.Args[2]
  6880  	v_1 := v.Args[1]
  6881  	v_0 := v.Args[0]
  6882  	// match: (LoweredPanicBoundsRR [kind] x (MOVDconst [c]) mem)
  6883  	// result: (LoweredPanicBoundsRC [kind] x {PanicBoundsC{C:c}} mem)
  6884  	for {
  6885  		kind := auxIntToInt64(v.AuxInt)
  6886  		x := v_0
  6887  		if v_1.Op != OpPPC64MOVDconst {
  6888  			break
  6889  		}
  6890  		c := auxIntToInt64(v_1.AuxInt)
  6891  		mem := v_2
  6892  		v.reset(OpPPC64LoweredPanicBoundsRC)
  6893  		v.AuxInt = int64ToAuxInt(kind)
  6894  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  6895  		v.AddArg2(x, mem)
  6896  		return true
  6897  	}
  6898  	// match: (LoweredPanicBoundsRR [kind] (MOVDconst [c]) y mem)
  6899  	// result: (LoweredPanicBoundsCR [kind] {PanicBoundsC{C:c}} y mem)
  6900  	for {
  6901  		kind := auxIntToInt64(v.AuxInt)
  6902  		if v_0.Op != OpPPC64MOVDconst {
  6903  			break
  6904  		}
  6905  		c := auxIntToInt64(v_0.AuxInt)
  6906  		y := v_1
  6907  		mem := v_2
  6908  		v.reset(OpPPC64LoweredPanicBoundsCR)
  6909  		v.AuxInt = int64ToAuxInt(kind)
  6910  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  6911  		v.AddArg2(y, mem)
  6912  		return true
  6913  	}
  6914  	return false
  6915  }
  6916  func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
  6917  	v_0 := v.Args[0]
  6918  	b := v.Block
  6919  	typ := &b.Func.Config.Types
  6920  	// match: (MFVSRD (FMOVDconst [c]))
  6921  	// result: (MOVDconst [int64(math.Float64bits(c))])
  6922  	for {
  6923  		if v_0.Op != OpPPC64FMOVDconst {
  6924  			break
  6925  		}
  6926  		c := auxIntToFloat64(v_0.AuxInt)
  6927  		v.reset(OpPPC64MOVDconst)
  6928  		v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
  6929  		return true
  6930  	}
  6931  	// match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem))
  6932  	// cond: x.Uses == 1 && clobber(x)
  6933  	// result: @x.Block (MOVDload [off] {sym} ptr mem)
  6934  	for {
  6935  		x := v_0
  6936  		if x.Op != OpPPC64FMOVDload {
  6937  			break
  6938  		}
  6939  		off := auxIntToInt32(x.AuxInt)
  6940  		sym := auxToSym(x.Aux)
  6941  		mem := x.Args[1]
  6942  		ptr := x.Args[0]
  6943  		if !(x.Uses == 1 && clobber(x)) {
  6944  			break
  6945  		}
  6946  		b = x.Block
  6947  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
  6948  		v.copyOf(v0)
  6949  		v0.AuxInt = int32ToAuxInt(off)
  6950  		v0.Aux = symToAux(sym)
  6951  		v0.AddArg2(ptr, mem)
  6952  		return true
  6953  	}
  6954  	return false
  6955  }
  6956  func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
  6957  	v_1 := v.Args[1]
  6958  	v_0 := v.Args[0]
  6959  	// match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  6960  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6961  	// result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6962  	for {
  6963  		off1 := auxIntToInt32(v.AuxInt)
  6964  		sym1 := auxToSym(v.Aux)
  6965  		p := v_0
  6966  		if p.Op != OpPPC64MOVDaddr {
  6967  			break
  6968  		}
  6969  		off2 := auxIntToInt32(p.AuxInt)
  6970  		sym2 := auxToSym(p.Aux)
  6971  		ptr := p.Args[0]
  6972  		mem := v_1
  6973  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6974  			break
  6975  		}
  6976  		v.reset(OpPPC64MOVBZload)
  6977  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6978  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6979  		v.AddArg2(ptr, mem)
  6980  		return true
  6981  	}
  6982  	// match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
  6983  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6984  	// result: (MOVBZload [off1+int32(off2)] {sym} x mem)
  6985  	for {
  6986  		off1 := auxIntToInt32(v.AuxInt)
  6987  		sym := auxToSym(v.Aux)
  6988  		if v_0.Op != OpPPC64ADDconst {
  6989  			break
  6990  		}
  6991  		off2 := auxIntToInt64(v_0.AuxInt)
  6992  		x := v_0.Args[0]
  6993  		mem := v_1
  6994  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6995  			break
  6996  		}
  6997  		v.reset(OpPPC64MOVBZload)
  6998  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6999  		v.Aux = symToAux(sym)
  7000  		v.AddArg2(x, mem)
  7001  		return true
  7002  	}
  7003  	// match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem)
  7004  	// cond: sym == nil && p.Uses == 1
  7005  	// result: (MOVBZloadidx ptr idx mem)
  7006  	for {
  7007  		if auxIntToInt32(v.AuxInt) != 0 {
  7008  			break
  7009  		}
  7010  		sym := auxToSym(v.Aux)
  7011  		p := v_0
  7012  		if p.Op != OpPPC64ADD {
  7013  			break
  7014  		}
  7015  		idx := p.Args[1]
  7016  		ptr := p.Args[0]
  7017  		mem := v_1
  7018  		if !(sym == nil && p.Uses == 1) {
  7019  			break
  7020  		}
  7021  		v.reset(OpPPC64MOVBZloadidx)
  7022  		v.AddArg3(ptr, idx, mem)
  7023  		return true
  7024  	}
  7025  	return false
  7026  }
  7027  func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
  7028  	v_2 := v.Args[2]
  7029  	v_1 := v.Args[1]
  7030  	v_0 := v.Args[0]
  7031  	// match: (MOVBZloadidx ptr (MOVDconst [c]) mem)
  7032  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7033  	// result: (MOVBZload [int32(c)] ptr mem)
  7034  	for {
  7035  		ptr := v_0
  7036  		if v_1.Op != OpPPC64MOVDconst {
  7037  			break
  7038  		}
  7039  		c := auxIntToInt64(v_1.AuxInt)
  7040  		mem := v_2
  7041  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7042  			break
  7043  		}
  7044  		v.reset(OpPPC64MOVBZload)
  7045  		v.AuxInt = int32ToAuxInt(int32(c))
  7046  		v.AddArg2(ptr, mem)
  7047  		return true
  7048  	}
  7049  	// match: (MOVBZloadidx (MOVDconst [c]) ptr mem)
  7050  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7051  	// result: (MOVBZload [int32(c)] ptr mem)
  7052  	for {
  7053  		if v_0.Op != OpPPC64MOVDconst {
  7054  			break
  7055  		}
  7056  		c := auxIntToInt64(v_0.AuxInt)
  7057  		ptr := v_1
  7058  		mem := v_2
  7059  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7060  			break
  7061  		}
  7062  		v.reset(OpPPC64MOVBZload)
  7063  		v.AuxInt = int32ToAuxInt(int32(c))
  7064  		v.AddArg2(ptr, mem)
  7065  		return true
  7066  	}
  7067  	return false
  7068  }
  7069  func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
  7070  	v_0 := v.Args[0]
  7071  	b := v.Block
  7072  	typ := &b.Func.Config.Types
  7073  	// match: (MOVBZreg y:(ANDconst [c] _))
  7074  	// cond: uint64(c) <= 0xFF
  7075  	// result: y
  7076  	for {
  7077  		y := v_0
  7078  		if y.Op != OpPPC64ANDconst {
  7079  			break
  7080  		}
  7081  		c := auxIntToInt64(y.AuxInt)
  7082  		if !(uint64(c) <= 0xFF) {
  7083  			break
  7084  		}
  7085  		v.copyOf(y)
  7086  		return true
  7087  	}
  7088  	// match: (MOVBZreg (SRWconst [c] (MOVBZreg x)))
  7089  	// result: (SRWconst [c] (MOVBZreg x))
  7090  	for {
  7091  		if v_0.Op != OpPPC64SRWconst {
  7092  			break
  7093  		}
  7094  		c := auxIntToInt64(v_0.AuxInt)
  7095  		v_0_0 := v_0.Args[0]
  7096  		if v_0_0.Op != OpPPC64MOVBZreg {
  7097  			break
  7098  		}
  7099  		x := v_0_0.Args[0]
  7100  		v.reset(OpPPC64SRWconst)
  7101  		v.AuxInt = int64ToAuxInt(c)
  7102  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  7103  		v0.AddArg(x)
  7104  		v.AddArg(v0)
  7105  		return true
  7106  	}
  7107  	// match: (MOVBZreg (SRWconst [c] x))
  7108  	// cond: x.Type.Size() == 8
  7109  	// result: (SRWconst [c] x)
  7110  	for {
  7111  		if v_0.Op != OpPPC64SRWconst {
  7112  			break
  7113  		}
  7114  		c := auxIntToInt64(v_0.AuxInt)
  7115  		x := v_0.Args[0]
  7116  		if !(x.Type.Size() == 8) {
  7117  			break
  7118  		}
  7119  		v.reset(OpPPC64SRWconst)
  7120  		v.AuxInt = int64ToAuxInt(c)
  7121  		v.AddArg(x)
  7122  		return true
  7123  	}
  7124  	// match: (MOVBZreg (SRDconst [c] x))
  7125  	// cond: c>=56
  7126  	// result: (SRDconst [c] x)
  7127  	for {
  7128  		if v_0.Op != OpPPC64SRDconst {
  7129  			break
  7130  		}
  7131  		c := auxIntToInt64(v_0.AuxInt)
  7132  		x := v_0.Args[0]
  7133  		if !(c >= 56) {
  7134  			break
  7135  		}
  7136  		v.reset(OpPPC64SRDconst)
  7137  		v.AuxInt = int64ToAuxInt(c)
  7138  		v.AddArg(x)
  7139  		return true
  7140  	}
  7141  	// match: (MOVBZreg (SRWconst [c] x))
  7142  	// cond: c>=24
  7143  	// result: (SRWconst [c] x)
  7144  	for {
  7145  		if v_0.Op != OpPPC64SRWconst {
  7146  			break
  7147  		}
  7148  		c := auxIntToInt64(v_0.AuxInt)
  7149  		x := v_0.Args[0]
  7150  		if !(c >= 24) {
  7151  			break
  7152  		}
  7153  		v.reset(OpPPC64SRWconst)
  7154  		v.AuxInt = int64ToAuxInt(c)
  7155  		v.AddArg(x)
  7156  		return true
  7157  	}
  7158  	// match: (MOVBZreg y:(MOVBZreg _))
  7159  	// result: y
  7160  	for {
  7161  		y := v_0
  7162  		if y.Op != OpPPC64MOVBZreg {
  7163  			break
  7164  		}
  7165  		v.copyOf(y)
  7166  		return true
  7167  	}
  7168  	// match: (MOVBZreg (MOVBreg x))
  7169  	// result: (MOVBZreg x)
  7170  	for {
  7171  		if v_0.Op != OpPPC64MOVBreg {
  7172  			break
  7173  		}
  7174  		x := v_0.Args[0]
  7175  		v.reset(OpPPC64MOVBZreg)
  7176  		v.AddArg(x)
  7177  		return true
  7178  	}
  7179  	// match: (MOVBZreg (SRWconst x [s]))
  7180  	// cond: mergePPC64AndSrwi(0xFF,s) != 0
  7181  	// result: (RLWINM [mergePPC64AndSrwi(0xFF,s)] x)
  7182  	for {
  7183  		if v_0.Op != OpPPC64SRWconst {
  7184  			break
  7185  		}
  7186  		s := auxIntToInt64(v_0.AuxInt)
  7187  		x := v_0.Args[0]
  7188  		if !(mergePPC64AndSrwi(0xFF, s) != 0) {
  7189  			break
  7190  		}
  7191  		v.reset(OpPPC64RLWINM)
  7192  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(0xFF, s))
  7193  		v.AddArg(x)
  7194  		return true
  7195  	}
  7196  	// match: (MOVBZreg (RLWINM [r] y))
  7197  	// cond: mergePPC64AndRlwinm(0xFF,r) != 0
  7198  	// result: (RLWINM [mergePPC64AndRlwinm(0xFF,r)] y)
  7199  	for {
  7200  		if v_0.Op != OpPPC64RLWINM {
  7201  			break
  7202  		}
  7203  		r := auxIntToInt64(v_0.AuxInt)
  7204  		y := v_0.Args[0]
  7205  		if !(mergePPC64AndRlwinm(0xFF, r) != 0) {
  7206  			break
  7207  		}
  7208  		v.reset(OpPPC64RLWINM)
  7209  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFF, r))
  7210  		v.AddArg(y)
  7211  		return true
  7212  	}
  7213  	// match: (MOVBZreg (OR <t> x (MOVWZreg y)))
  7214  	// result: (MOVBZreg (OR <t> x y))
  7215  	for {
  7216  		if v_0.Op != OpPPC64OR {
  7217  			break
  7218  		}
  7219  		t := v_0.Type
  7220  		_ = v_0.Args[1]
  7221  		v_0_0 := v_0.Args[0]
  7222  		v_0_1 := v_0.Args[1]
  7223  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7224  			x := v_0_0
  7225  			if v_0_1.Op != OpPPC64MOVWZreg {
  7226  				continue
  7227  			}
  7228  			y := v_0_1.Args[0]
  7229  			v.reset(OpPPC64MOVBZreg)
  7230  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7231  			v0.AddArg2(x, y)
  7232  			v.AddArg(v0)
  7233  			return true
  7234  		}
  7235  		break
  7236  	}
  7237  	// match: (MOVBZreg (XOR <t> x (MOVWZreg y)))
  7238  	// result: (MOVBZreg (XOR <t> x y))
  7239  	for {
  7240  		if v_0.Op != OpPPC64XOR {
  7241  			break
  7242  		}
  7243  		t := v_0.Type
  7244  		_ = v_0.Args[1]
  7245  		v_0_0 := v_0.Args[0]
  7246  		v_0_1 := v_0.Args[1]
  7247  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7248  			x := v_0_0
  7249  			if v_0_1.Op != OpPPC64MOVWZreg {
  7250  				continue
  7251  			}
  7252  			y := v_0_1.Args[0]
  7253  			v.reset(OpPPC64MOVBZreg)
  7254  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7255  			v0.AddArg2(x, y)
  7256  			v.AddArg(v0)
  7257  			return true
  7258  		}
  7259  		break
  7260  	}
  7261  	// match: (MOVBZreg (AND <t> x (MOVWZreg y)))
  7262  	// result: (MOVBZreg (AND <t> x y))
  7263  	for {
  7264  		if v_0.Op != OpPPC64AND {
  7265  			break
  7266  		}
  7267  		t := v_0.Type
  7268  		_ = v_0.Args[1]
  7269  		v_0_0 := v_0.Args[0]
  7270  		v_0_1 := v_0.Args[1]
  7271  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7272  			x := v_0_0
  7273  			if v_0_1.Op != OpPPC64MOVWZreg {
  7274  				continue
  7275  			}
  7276  			y := v_0_1.Args[0]
  7277  			v.reset(OpPPC64MOVBZreg)
  7278  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7279  			v0.AddArg2(x, y)
  7280  			v.AddArg(v0)
  7281  			return true
  7282  		}
  7283  		break
  7284  	}
  7285  	// match: (MOVBZreg (OR <t> x (MOVHZreg y)))
  7286  	// result: (MOVBZreg (OR <t> x y))
  7287  	for {
  7288  		if v_0.Op != OpPPC64OR {
  7289  			break
  7290  		}
  7291  		t := v_0.Type
  7292  		_ = v_0.Args[1]
  7293  		v_0_0 := v_0.Args[0]
  7294  		v_0_1 := v_0.Args[1]
  7295  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7296  			x := v_0_0
  7297  			if v_0_1.Op != OpPPC64MOVHZreg {
  7298  				continue
  7299  			}
  7300  			y := v_0_1.Args[0]
  7301  			v.reset(OpPPC64MOVBZreg)
  7302  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7303  			v0.AddArg2(x, y)
  7304  			v.AddArg(v0)
  7305  			return true
  7306  		}
  7307  		break
  7308  	}
  7309  	// match: (MOVBZreg (XOR <t> x (MOVHZreg y)))
  7310  	// result: (MOVBZreg (XOR <t> x y))
  7311  	for {
  7312  		if v_0.Op != OpPPC64XOR {
  7313  			break
  7314  		}
  7315  		t := v_0.Type
  7316  		_ = v_0.Args[1]
  7317  		v_0_0 := v_0.Args[0]
  7318  		v_0_1 := v_0.Args[1]
  7319  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7320  			x := v_0_0
  7321  			if v_0_1.Op != OpPPC64MOVHZreg {
  7322  				continue
  7323  			}
  7324  			y := v_0_1.Args[0]
  7325  			v.reset(OpPPC64MOVBZreg)
  7326  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7327  			v0.AddArg2(x, y)
  7328  			v.AddArg(v0)
  7329  			return true
  7330  		}
  7331  		break
  7332  	}
  7333  	// match: (MOVBZreg (AND <t> x (MOVHZreg y)))
  7334  	// result: (MOVBZreg (AND <t> x y))
  7335  	for {
  7336  		if v_0.Op != OpPPC64AND {
  7337  			break
  7338  		}
  7339  		t := v_0.Type
  7340  		_ = v_0.Args[1]
  7341  		v_0_0 := v_0.Args[0]
  7342  		v_0_1 := v_0.Args[1]
  7343  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7344  			x := v_0_0
  7345  			if v_0_1.Op != OpPPC64MOVHZreg {
  7346  				continue
  7347  			}
  7348  			y := v_0_1.Args[0]
  7349  			v.reset(OpPPC64MOVBZreg)
  7350  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7351  			v0.AddArg2(x, y)
  7352  			v.AddArg(v0)
  7353  			return true
  7354  		}
  7355  		break
  7356  	}
  7357  	// match: (MOVBZreg (OR <t> x (MOVBZreg y)))
  7358  	// result: (MOVBZreg (OR <t> x y))
  7359  	for {
  7360  		if v_0.Op != OpPPC64OR {
  7361  			break
  7362  		}
  7363  		t := v_0.Type
  7364  		_ = v_0.Args[1]
  7365  		v_0_0 := v_0.Args[0]
  7366  		v_0_1 := v_0.Args[1]
  7367  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7368  			x := v_0_0
  7369  			if v_0_1.Op != OpPPC64MOVBZreg {
  7370  				continue
  7371  			}
  7372  			y := v_0_1.Args[0]
  7373  			v.reset(OpPPC64MOVBZreg)
  7374  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7375  			v0.AddArg2(x, y)
  7376  			v.AddArg(v0)
  7377  			return true
  7378  		}
  7379  		break
  7380  	}
  7381  	// match: (MOVBZreg (XOR <t> x (MOVBZreg y)))
  7382  	// result: (MOVBZreg (XOR <t> x y))
  7383  	for {
  7384  		if v_0.Op != OpPPC64XOR {
  7385  			break
  7386  		}
  7387  		t := v_0.Type
  7388  		_ = v_0.Args[1]
  7389  		v_0_0 := v_0.Args[0]
  7390  		v_0_1 := v_0.Args[1]
  7391  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7392  			x := v_0_0
  7393  			if v_0_1.Op != OpPPC64MOVBZreg {
  7394  				continue
  7395  			}
  7396  			y := v_0_1.Args[0]
  7397  			v.reset(OpPPC64MOVBZreg)
  7398  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7399  			v0.AddArg2(x, y)
  7400  			v.AddArg(v0)
  7401  			return true
  7402  		}
  7403  		break
  7404  	}
  7405  	// match: (MOVBZreg (AND <t> x (MOVBZreg y)))
  7406  	// result: (MOVBZreg (AND <t> x y))
  7407  	for {
  7408  		if v_0.Op != OpPPC64AND {
  7409  			break
  7410  		}
  7411  		t := v_0.Type
  7412  		_ = v_0.Args[1]
  7413  		v_0_0 := v_0.Args[0]
  7414  		v_0_1 := v_0.Args[1]
  7415  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7416  			x := v_0_0
  7417  			if v_0_1.Op != OpPPC64MOVBZreg {
  7418  				continue
  7419  			}
  7420  			y := v_0_1.Args[0]
  7421  			v.reset(OpPPC64MOVBZreg)
  7422  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7423  			v0.AddArg2(x, y)
  7424  			v.AddArg(v0)
  7425  			return true
  7426  		}
  7427  		break
  7428  	}
  7429  	// match: (MOVBZreg z:(ANDconst [c] (MOVBZload ptr x)))
  7430  	// result: z
  7431  	for {
  7432  		z := v_0
  7433  		if z.Op != OpPPC64ANDconst {
  7434  			break
  7435  		}
  7436  		z_0 := z.Args[0]
  7437  		if z_0.Op != OpPPC64MOVBZload {
  7438  			break
  7439  		}
  7440  		v.copyOf(z)
  7441  		return true
  7442  	}
  7443  	// match: (MOVBZreg z:(AND y (MOVBZload ptr x)))
  7444  	// result: z
  7445  	for {
  7446  		z := v_0
  7447  		if z.Op != OpPPC64AND {
  7448  			break
  7449  		}
  7450  		_ = z.Args[1]
  7451  		z_0 := z.Args[0]
  7452  		z_1 := z.Args[1]
  7453  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  7454  			if z_1.Op != OpPPC64MOVBZload {
  7455  				continue
  7456  			}
  7457  			v.copyOf(z)
  7458  			return true
  7459  		}
  7460  		break
  7461  	}
  7462  	// match: (MOVBZreg x:(MOVBZload _ _))
  7463  	// result: x
  7464  	for {
  7465  		x := v_0
  7466  		if x.Op != OpPPC64MOVBZload {
  7467  			break
  7468  		}
  7469  		v.copyOf(x)
  7470  		return true
  7471  	}
  7472  	// match: (MOVBZreg x:(MOVBZloadidx _ _ _))
  7473  	// result: x
  7474  	for {
  7475  		x := v_0
  7476  		if x.Op != OpPPC64MOVBZloadidx {
  7477  			break
  7478  		}
  7479  		v.copyOf(x)
  7480  		return true
  7481  	}
  7482  	// match: (MOVBZreg x:(Select0 (LoweredAtomicLoad8 _ _)))
  7483  	// result: x
  7484  	for {
  7485  		x := v_0
  7486  		if x.Op != OpSelect0 {
  7487  			break
  7488  		}
  7489  		x_0 := x.Args[0]
  7490  		if x_0.Op != OpPPC64LoweredAtomicLoad8 {
  7491  			break
  7492  		}
  7493  		v.copyOf(x)
  7494  		return true
  7495  	}
  7496  	// match: (MOVBZreg x:(Arg <t>))
  7497  	// cond: is8BitInt(t) && !t.IsSigned()
  7498  	// result: x
  7499  	for {
  7500  		x := v_0
  7501  		if x.Op != OpArg {
  7502  			break
  7503  		}
  7504  		t := x.Type
  7505  		if !(is8BitInt(t) && !t.IsSigned()) {
  7506  			break
  7507  		}
  7508  		v.copyOf(x)
  7509  		return true
  7510  	}
  7511  	// match: (MOVBZreg (MOVDconst [c]))
  7512  	// result: (MOVDconst [int64(uint8(c))])
  7513  	for {
  7514  		if v_0.Op != OpPPC64MOVDconst {
  7515  			break
  7516  		}
  7517  		c := auxIntToInt64(v_0.AuxInt)
  7518  		v.reset(OpPPC64MOVDconst)
  7519  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  7520  		return true
  7521  	}
  7522  	return false
  7523  }
  7524  func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
  7525  	v_0 := v.Args[0]
  7526  	b := v.Block
  7527  	typ := &b.Func.Config.Types
  7528  	// match: (MOVBreg y:(ANDconst [c] _))
  7529  	// cond: uint64(c) <= 0x7F
  7530  	// result: y
  7531  	for {
  7532  		y := v_0
  7533  		if y.Op != OpPPC64ANDconst {
  7534  			break
  7535  		}
  7536  		c := auxIntToInt64(y.AuxInt)
  7537  		if !(uint64(c) <= 0x7F) {
  7538  			break
  7539  		}
  7540  		v.copyOf(y)
  7541  		return true
  7542  	}
  7543  	// match: (MOVBreg (SRAWconst [c] (MOVBreg x)))
  7544  	// result: (SRAWconst [c] (MOVBreg x))
  7545  	for {
  7546  		if v_0.Op != OpPPC64SRAWconst {
  7547  			break
  7548  		}
  7549  		c := auxIntToInt64(v_0.AuxInt)
  7550  		v_0_0 := v_0.Args[0]
  7551  		if v_0_0.Op != OpPPC64MOVBreg {
  7552  			break
  7553  		}
  7554  		x := v_0_0.Args[0]
  7555  		v.reset(OpPPC64SRAWconst)
  7556  		v.AuxInt = int64ToAuxInt(c)
  7557  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  7558  		v0.AddArg(x)
  7559  		v.AddArg(v0)
  7560  		return true
  7561  	}
  7562  	// match: (MOVBreg (SRAWconst [c] x))
  7563  	// cond: x.Type.Size() == 8
  7564  	// result: (SRAWconst [c] x)
  7565  	for {
  7566  		if v_0.Op != OpPPC64SRAWconst {
  7567  			break
  7568  		}
  7569  		c := auxIntToInt64(v_0.AuxInt)
  7570  		x := v_0.Args[0]
  7571  		if !(x.Type.Size() == 8) {
  7572  			break
  7573  		}
  7574  		v.reset(OpPPC64SRAWconst)
  7575  		v.AuxInt = int64ToAuxInt(c)
  7576  		v.AddArg(x)
  7577  		return true
  7578  	}
  7579  	// match: (MOVBreg (SRDconst [c] x))
  7580  	// cond: c>56
  7581  	// result: (SRDconst [c] x)
  7582  	for {
  7583  		if v_0.Op != OpPPC64SRDconst {
  7584  			break
  7585  		}
  7586  		c := auxIntToInt64(v_0.AuxInt)
  7587  		x := v_0.Args[0]
  7588  		if !(c > 56) {
  7589  			break
  7590  		}
  7591  		v.reset(OpPPC64SRDconst)
  7592  		v.AuxInt = int64ToAuxInt(c)
  7593  		v.AddArg(x)
  7594  		return true
  7595  	}
  7596  	// match: (MOVBreg (SRDconst [c] x))
  7597  	// cond: c==56
  7598  	// result: (SRADconst [c] x)
  7599  	for {
  7600  		if v_0.Op != OpPPC64SRDconst {
  7601  			break
  7602  		}
  7603  		c := auxIntToInt64(v_0.AuxInt)
  7604  		x := v_0.Args[0]
  7605  		if !(c == 56) {
  7606  			break
  7607  		}
  7608  		v.reset(OpPPC64SRADconst)
  7609  		v.AuxInt = int64ToAuxInt(c)
  7610  		v.AddArg(x)
  7611  		return true
  7612  	}
  7613  	// match: (MOVBreg (SRADconst [c] x))
  7614  	// cond: c>=56
  7615  	// result: (SRADconst [c] x)
  7616  	for {
  7617  		if v_0.Op != OpPPC64SRADconst {
  7618  			break
  7619  		}
  7620  		c := auxIntToInt64(v_0.AuxInt)
  7621  		x := v_0.Args[0]
  7622  		if !(c >= 56) {
  7623  			break
  7624  		}
  7625  		v.reset(OpPPC64SRADconst)
  7626  		v.AuxInt = int64ToAuxInt(c)
  7627  		v.AddArg(x)
  7628  		return true
  7629  	}
  7630  	// match: (MOVBreg (SRWconst [c] x))
  7631  	// cond: c>24
  7632  	// result: (SRWconst [c] x)
  7633  	for {
  7634  		if v_0.Op != OpPPC64SRWconst {
  7635  			break
  7636  		}
  7637  		c := auxIntToInt64(v_0.AuxInt)
  7638  		x := v_0.Args[0]
  7639  		if !(c > 24) {
  7640  			break
  7641  		}
  7642  		v.reset(OpPPC64SRWconst)
  7643  		v.AuxInt = int64ToAuxInt(c)
  7644  		v.AddArg(x)
  7645  		return true
  7646  	}
  7647  	// match: (MOVBreg (SRWconst [c] x))
  7648  	// cond: c==24
  7649  	// result: (SRAWconst [c] x)
  7650  	for {
  7651  		if v_0.Op != OpPPC64SRWconst {
  7652  			break
  7653  		}
  7654  		c := auxIntToInt64(v_0.AuxInt)
  7655  		x := v_0.Args[0]
  7656  		if !(c == 24) {
  7657  			break
  7658  		}
  7659  		v.reset(OpPPC64SRAWconst)
  7660  		v.AuxInt = int64ToAuxInt(c)
  7661  		v.AddArg(x)
  7662  		return true
  7663  	}
  7664  	// match: (MOVBreg (SRAWconst [c] x))
  7665  	// cond: c>=24
  7666  	// result: (SRAWconst [c] x)
  7667  	for {
  7668  		if v_0.Op != OpPPC64SRAWconst {
  7669  			break
  7670  		}
  7671  		c := auxIntToInt64(v_0.AuxInt)
  7672  		x := v_0.Args[0]
  7673  		if !(c >= 24) {
  7674  			break
  7675  		}
  7676  		v.reset(OpPPC64SRAWconst)
  7677  		v.AuxInt = int64ToAuxInt(c)
  7678  		v.AddArg(x)
  7679  		return true
  7680  	}
  7681  	// match: (MOVBreg y:(MOVBreg _))
  7682  	// result: y
  7683  	for {
  7684  		y := v_0
  7685  		if y.Op != OpPPC64MOVBreg {
  7686  			break
  7687  		}
  7688  		v.copyOf(y)
  7689  		return true
  7690  	}
  7691  	// match: (MOVBreg (MOVBZreg x))
  7692  	// result: (MOVBreg x)
  7693  	for {
  7694  		if v_0.Op != OpPPC64MOVBZreg {
  7695  			break
  7696  		}
  7697  		x := v_0.Args[0]
  7698  		v.reset(OpPPC64MOVBreg)
  7699  		v.AddArg(x)
  7700  		return true
  7701  	}
  7702  	// match: (MOVBreg x:(Arg <t>))
  7703  	// cond: is8BitInt(t) && t.IsSigned()
  7704  	// result: x
  7705  	for {
  7706  		x := v_0
  7707  		if x.Op != OpArg {
  7708  			break
  7709  		}
  7710  		t := x.Type
  7711  		if !(is8BitInt(t) && t.IsSigned()) {
  7712  			break
  7713  		}
  7714  		v.copyOf(x)
  7715  		return true
  7716  	}
  7717  	// match: (MOVBreg (MOVDconst [c]))
  7718  	// result: (MOVDconst [int64(int8(c))])
  7719  	for {
  7720  		if v_0.Op != OpPPC64MOVDconst {
  7721  			break
  7722  		}
  7723  		c := auxIntToInt64(v_0.AuxInt)
  7724  		v.reset(OpPPC64MOVDconst)
  7725  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  7726  		return true
  7727  	}
  7728  	return false
  7729  }
  7730  func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
  7731  	v_2 := v.Args[2]
  7732  	v_1 := v.Args[1]
  7733  	v_0 := v.Args[0]
  7734  	b := v.Block
  7735  	typ := &b.Func.Config.Types
  7736  	// match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
  7737  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  7738  	// result: (MOVBstore [off1+int32(off2)] {sym} x val mem)
  7739  	for {
  7740  		off1 := auxIntToInt32(v.AuxInt)
  7741  		sym := auxToSym(v.Aux)
  7742  		if v_0.Op != OpPPC64ADDconst {
  7743  			break
  7744  		}
  7745  		off2 := auxIntToInt64(v_0.AuxInt)
  7746  		x := v_0.Args[0]
  7747  		val := v_1
  7748  		mem := v_2
  7749  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  7750  			break
  7751  		}
  7752  		v.reset(OpPPC64MOVBstore)
  7753  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7754  		v.Aux = symToAux(sym)
  7755  		v.AddArg3(x, val, mem)
  7756  		return true
  7757  	}
  7758  	// match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  7759  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  7760  	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  7761  	for {
  7762  		off1 := auxIntToInt32(v.AuxInt)
  7763  		sym1 := auxToSym(v.Aux)
  7764  		p := v_0
  7765  		if p.Op != OpPPC64MOVDaddr {
  7766  			break
  7767  		}
  7768  		off2 := auxIntToInt32(p.AuxInt)
  7769  		sym2 := auxToSym(p.Aux)
  7770  		ptr := p.Args[0]
  7771  		val := v_1
  7772  		mem := v_2
  7773  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  7774  			break
  7775  		}
  7776  		v.reset(OpPPC64MOVBstore)
  7777  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7778  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7779  		v.AddArg3(ptr, val, mem)
  7780  		return true
  7781  	}
  7782  	// match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
  7783  	// result: (MOVBstorezero [off] {sym} ptr mem)
  7784  	for {
  7785  		off := auxIntToInt32(v.AuxInt)
  7786  		sym := auxToSym(v.Aux)
  7787  		ptr := v_0
  7788  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7789  			break
  7790  		}
  7791  		mem := v_2
  7792  		v.reset(OpPPC64MOVBstorezero)
  7793  		v.AuxInt = int32ToAuxInt(off)
  7794  		v.Aux = symToAux(sym)
  7795  		v.AddArg2(ptr, mem)
  7796  		return true
  7797  	}
  7798  	// match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem)
  7799  	// cond: sym == nil && p.Uses == 1
  7800  	// result: (MOVBstoreidx ptr idx val mem)
  7801  	for {
  7802  		if auxIntToInt32(v.AuxInt) != 0 {
  7803  			break
  7804  		}
  7805  		sym := auxToSym(v.Aux)
  7806  		p := v_0
  7807  		if p.Op != OpPPC64ADD {
  7808  			break
  7809  		}
  7810  		idx := p.Args[1]
  7811  		ptr := p.Args[0]
  7812  		val := v_1
  7813  		mem := v_2
  7814  		if !(sym == nil && p.Uses == 1) {
  7815  			break
  7816  		}
  7817  		v.reset(OpPPC64MOVBstoreidx)
  7818  		v.AddArg4(ptr, idx, val, mem)
  7819  		return true
  7820  	}
  7821  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  7822  	// result: (MOVBstore [off] {sym} ptr x mem)
  7823  	for {
  7824  		off := auxIntToInt32(v.AuxInt)
  7825  		sym := auxToSym(v.Aux)
  7826  		ptr := v_0
  7827  		if v_1.Op != OpPPC64MOVBreg {
  7828  			break
  7829  		}
  7830  		x := v_1.Args[0]
  7831  		mem := v_2
  7832  		v.reset(OpPPC64MOVBstore)
  7833  		v.AuxInt = int32ToAuxInt(off)
  7834  		v.Aux = symToAux(sym)
  7835  		v.AddArg3(ptr, x, mem)
  7836  		return true
  7837  	}
  7838  	// match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
  7839  	// result: (MOVBstore [off] {sym} ptr x mem)
  7840  	for {
  7841  		off := auxIntToInt32(v.AuxInt)
  7842  		sym := auxToSym(v.Aux)
  7843  		ptr := v_0
  7844  		if v_1.Op != OpPPC64MOVBZreg {
  7845  			break
  7846  		}
  7847  		x := v_1.Args[0]
  7848  		mem := v_2
  7849  		v.reset(OpPPC64MOVBstore)
  7850  		v.AuxInt = int32ToAuxInt(off)
  7851  		v.Aux = symToAux(sym)
  7852  		v.AddArg3(ptr, x, mem)
  7853  		return true
  7854  	}
  7855  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  7856  	// result: (MOVBstore [off] {sym} ptr x mem)
  7857  	for {
  7858  		off := auxIntToInt32(v.AuxInt)
  7859  		sym := auxToSym(v.Aux)
  7860  		ptr := v_0
  7861  		if v_1.Op != OpPPC64MOVHreg {
  7862  			break
  7863  		}
  7864  		x := v_1.Args[0]
  7865  		mem := v_2
  7866  		v.reset(OpPPC64MOVBstore)
  7867  		v.AuxInt = int32ToAuxInt(off)
  7868  		v.Aux = symToAux(sym)
  7869  		v.AddArg3(ptr, x, mem)
  7870  		return true
  7871  	}
  7872  	// match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem)
  7873  	// result: (MOVBstore [off] {sym} ptr x mem)
  7874  	for {
  7875  		off := auxIntToInt32(v.AuxInt)
  7876  		sym := auxToSym(v.Aux)
  7877  		ptr := v_0
  7878  		if v_1.Op != OpPPC64MOVHZreg {
  7879  			break
  7880  		}
  7881  		x := v_1.Args[0]
  7882  		mem := v_2
  7883  		v.reset(OpPPC64MOVBstore)
  7884  		v.AuxInt = int32ToAuxInt(off)
  7885  		v.Aux = symToAux(sym)
  7886  		v.AddArg3(ptr, x, mem)
  7887  		return true
  7888  	}
  7889  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  7890  	// result: (MOVBstore [off] {sym} ptr x mem)
  7891  	for {
  7892  		off := auxIntToInt32(v.AuxInt)
  7893  		sym := auxToSym(v.Aux)
  7894  		ptr := v_0
  7895  		if v_1.Op != OpPPC64MOVWreg {
  7896  			break
  7897  		}
  7898  		x := v_1.Args[0]
  7899  		mem := v_2
  7900  		v.reset(OpPPC64MOVBstore)
  7901  		v.AuxInt = int32ToAuxInt(off)
  7902  		v.Aux = symToAux(sym)
  7903  		v.AddArg3(ptr, x, mem)
  7904  		return true
  7905  	}
  7906  	// match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem)
  7907  	// result: (MOVBstore [off] {sym} ptr x mem)
  7908  	for {
  7909  		off := auxIntToInt32(v.AuxInt)
  7910  		sym := auxToSym(v.Aux)
  7911  		ptr := v_0
  7912  		if v_1.Op != OpPPC64MOVWZreg {
  7913  			break
  7914  		}
  7915  		x := v_1.Args[0]
  7916  		mem := v_2
  7917  		v.reset(OpPPC64MOVBstore)
  7918  		v.AuxInt = int32ToAuxInt(off)
  7919  		v.Aux = symToAux(sym)
  7920  		v.AddArg3(ptr, x, mem)
  7921  		return true
  7922  	}
  7923  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem)
  7924  	// cond: c <= 8
  7925  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7926  	for {
  7927  		off := auxIntToInt32(v.AuxInt)
  7928  		sym := auxToSym(v.Aux)
  7929  		ptr := v_0
  7930  		if v_1.Op != OpPPC64SRWconst {
  7931  			break
  7932  		}
  7933  		c := auxIntToInt64(v_1.AuxInt)
  7934  		v_1_0 := v_1.Args[0]
  7935  		if v_1_0.Op != OpPPC64MOVHreg {
  7936  			break
  7937  		}
  7938  		x := v_1_0.Args[0]
  7939  		mem := v_2
  7940  		if !(c <= 8) {
  7941  			break
  7942  		}
  7943  		v.reset(OpPPC64MOVBstore)
  7944  		v.AuxInt = int32ToAuxInt(off)
  7945  		v.Aux = symToAux(sym)
  7946  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7947  		v0.AuxInt = int64ToAuxInt(c)
  7948  		v0.AddArg(x)
  7949  		v.AddArg3(ptr, v0, mem)
  7950  		return true
  7951  	}
  7952  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem)
  7953  	// cond: c <= 8
  7954  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7955  	for {
  7956  		off := auxIntToInt32(v.AuxInt)
  7957  		sym := auxToSym(v.Aux)
  7958  		ptr := v_0
  7959  		if v_1.Op != OpPPC64SRWconst {
  7960  			break
  7961  		}
  7962  		c := auxIntToInt64(v_1.AuxInt)
  7963  		v_1_0 := v_1.Args[0]
  7964  		if v_1_0.Op != OpPPC64MOVHZreg {
  7965  			break
  7966  		}
  7967  		x := v_1_0.Args[0]
  7968  		mem := v_2
  7969  		if !(c <= 8) {
  7970  			break
  7971  		}
  7972  		v.reset(OpPPC64MOVBstore)
  7973  		v.AuxInt = int32ToAuxInt(off)
  7974  		v.Aux = symToAux(sym)
  7975  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7976  		v0.AuxInt = int64ToAuxInt(c)
  7977  		v0.AddArg(x)
  7978  		v.AddArg3(ptr, v0, mem)
  7979  		return true
  7980  	}
  7981  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem)
  7982  	// cond: c <= 24
  7983  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7984  	for {
  7985  		off := auxIntToInt32(v.AuxInt)
  7986  		sym := auxToSym(v.Aux)
  7987  		ptr := v_0
  7988  		if v_1.Op != OpPPC64SRWconst {
  7989  			break
  7990  		}
  7991  		c := auxIntToInt64(v_1.AuxInt)
  7992  		v_1_0 := v_1.Args[0]
  7993  		if v_1_0.Op != OpPPC64MOVWreg {
  7994  			break
  7995  		}
  7996  		x := v_1_0.Args[0]
  7997  		mem := v_2
  7998  		if !(c <= 24) {
  7999  			break
  8000  		}
  8001  		v.reset(OpPPC64MOVBstore)
  8002  		v.AuxInt = int32ToAuxInt(off)
  8003  		v.Aux = symToAux(sym)
  8004  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8005  		v0.AuxInt = int64ToAuxInt(c)
  8006  		v0.AddArg(x)
  8007  		v.AddArg3(ptr, v0, mem)
  8008  		return true
  8009  	}
  8010  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem)
  8011  	// cond: c <= 24
  8012  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  8013  	for {
  8014  		off := auxIntToInt32(v.AuxInt)
  8015  		sym := auxToSym(v.Aux)
  8016  		ptr := v_0
  8017  		if v_1.Op != OpPPC64SRWconst {
  8018  			break
  8019  		}
  8020  		c := auxIntToInt64(v_1.AuxInt)
  8021  		v_1_0 := v_1.Args[0]
  8022  		if v_1_0.Op != OpPPC64MOVWZreg {
  8023  			break
  8024  		}
  8025  		x := v_1_0.Args[0]
  8026  		mem := v_2
  8027  		if !(c <= 24) {
  8028  			break
  8029  		}
  8030  		v.reset(OpPPC64MOVBstore)
  8031  		v.AuxInt = int32ToAuxInt(off)
  8032  		v.Aux = symToAux(sym)
  8033  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8034  		v0.AuxInt = int64ToAuxInt(c)
  8035  		v0.AddArg(x)
  8036  		v.AddArg3(ptr, v0, mem)
  8037  		return true
  8038  	}
  8039  	return false
  8040  }
  8041  func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
  8042  	v_3 := v.Args[3]
  8043  	v_2 := v.Args[2]
  8044  	v_1 := v.Args[1]
  8045  	v_0 := v.Args[0]
  8046  	b := v.Block
  8047  	typ := &b.Func.Config.Types
  8048  	// match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
  8049  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8050  	// result: (MOVBstore [int32(c)] ptr val mem)
  8051  	for {
  8052  		ptr := v_0
  8053  		if v_1.Op != OpPPC64MOVDconst {
  8054  			break
  8055  		}
  8056  		c := auxIntToInt64(v_1.AuxInt)
  8057  		val := v_2
  8058  		mem := v_3
  8059  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8060  			break
  8061  		}
  8062  		v.reset(OpPPC64MOVBstore)
  8063  		v.AuxInt = int32ToAuxInt(int32(c))
  8064  		v.AddArg3(ptr, val, mem)
  8065  		return true
  8066  	}
  8067  	// match: (MOVBstoreidx (MOVDconst [c]) ptr val mem)
  8068  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8069  	// result: (MOVBstore [int32(c)] ptr val mem)
  8070  	for {
  8071  		if v_0.Op != OpPPC64MOVDconst {
  8072  			break
  8073  		}
  8074  		c := auxIntToInt64(v_0.AuxInt)
  8075  		ptr := v_1
  8076  		val := v_2
  8077  		mem := v_3
  8078  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8079  			break
  8080  		}
  8081  		v.reset(OpPPC64MOVBstore)
  8082  		v.AuxInt = int32ToAuxInt(int32(c))
  8083  		v.AddArg3(ptr, val, mem)
  8084  		return true
  8085  	}
  8086  	// match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
  8087  	// result: (MOVBstoreidx ptr idx x mem)
  8088  	for {
  8089  		ptr := v_0
  8090  		idx := v_1
  8091  		if v_2.Op != OpPPC64MOVBreg {
  8092  			break
  8093  		}
  8094  		x := v_2.Args[0]
  8095  		mem := v_3
  8096  		v.reset(OpPPC64MOVBstoreidx)
  8097  		v.AddArg4(ptr, idx, x, mem)
  8098  		return true
  8099  	}
  8100  	// match: (MOVBstoreidx ptr idx (MOVBZreg x) mem)
  8101  	// result: (MOVBstoreidx ptr idx x mem)
  8102  	for {
  8103  		ptr := v_0
  8104  		idx := v_1
  8105  		if v_2.Op != OpPPC64MOVBZreg {
  8106  			break
  8107  		}
  8108  		x := v_2.Args[0]
  8109  		mem := v_3
  8110  		v.reset(OpPPC64MOVBstoreidx)
  8111  		v.AddArg4(ptr, idx, x, mem)
  8112  		return true
  8113  	}
  8114  	// match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
  8115  	// result: (MOVBstoreidx ptr idx x mem)
  8116  	for {
  8117  		ptr := v_0
  8118  		idx := v_1
  8119  		if v_2.Op != OpPPC64MOVHreg {
  8120  			break
  8121  		}
  8122  		x := v_2.Args[0]
  8123  		mem := v_3
  8124  		v.reset(OpPPC64MOVBstoreidx)
  8125  		v.AddArg4(ptr, idx, x, mem)
  8126  		return true
  8127  	}
  8128  	// match: (MOVBstoreidx ptr idx (MOVHZreg x) mem)
  8129  	// result: (MOVBstoreidx ptr idx x mem)
  8130  	for {
  8131  		ptr := v_0
  8132  		idx := v_1
  8133  		if v_2.Op != OpPPC64MOVHZreg {
  8134  			break
  8135  		}
  8136  		x := v_2.Args[0]
  8137  		mem := v_3
  8138  		v.reset(OpPPC64MOVBstoreidx)
  8139  		v.AddArg4(ptr, idx, x, mem)
  8140  		return true
  8141  	}
  8142  	// match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
  8143  	// result: (MOVBstoreidx ptr idx x mem)
  8144  	for {
  8145  		ptr := v_0
  8146  		idx := v_1
  8147  		if v_2.Op != OpPPC64MOVWreg {
  8148  			break
  8149  		}
  8150  		x := v_2.Args[0]
  8151  		mem := v_3
  8152  		v.reset(OpPPC64MOVBstoreidx)
  8153  		v.AddArg4(ptr, idx, x, mem)
  8154  		return true
  8155  	}
  8156  	// match: (MOVBstoreidx ptr idx (MOVWZreg x) mem)
  8157  	// result: (MOVBstoreidx ptr idx x mem)
  8158  	for {
  8159  		ptr := v_0
  8160  		idx := v_1
  8161  		if v_2.Op != OpPPC64MOVWZreg {
  8162  			break
  8163  		}
  8164  		x := v_2.Args[0]
  8165  		mem := v_3
  8166  		v.reset(OpPPC64MOVBstoreidx)
  8167  		v.AddArg4(ptr, idx, x, mem)
  8168  		return true
  8169  	}
  8170  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem)
  8171  	// cond: c <= 8
  8172  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8173  	for {
  8174  		ptr := v_0
  8175  		idx := v_1
  8176  		if v_2.Op != OpPPC64SRWconst {
  8177  			break
  8178  		}
  8179  		c := auxIntToInt64(v_2.AuxInt)
  8180  		v_2_0 := v_2.Args[0]
  8181  		if v_2_0.Op != OpPPC64MOVHreg {
  8182  			break
  8183  		}
  8184  		x := v_2_0.Args[0]
  8185  		mem := v_3
  8186  		if !(c <= 8) {
  8187  			break
  8188  		}
  8189  		v.reset(OpPPC64MOVBstoreidx)
  8190  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8191  		v0.AuxInt = int64ToAuxInt(c)
  8192  		v0.AddArg(x)
  8193  		v.AddArg4(ptr, idx, v0, mem)
  8194  		return true
  8195  	}
  8196  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem)
  8197  	// cond: c <= 8
  8198  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8199  	for {
  8200  		ptr := v_0
  8201  		idx := v_1
  8202  		if v_2.Op != OpPPC64SRWconst {
  8203  			break
  8204  		}
  8205  		c := auxIntToInt64(v_2.AuxInt)
  8206  		v_2_0 := v_2.Args[0]
  8207  		if v_2_0.Op != OpPPC64MOVHZreg {
  8208  			break
  8209  		}
  8210  		x := v_2_0.Args[0]
  8211  		mem := v_3
  8212  		if !(c <= 8) {
  8213  			break
  8214  		}
  8215  		v.reset(OpPPC64MOVBstoreidx)
  8216  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8217  		v0.AuxInt = int64ToAuxInt(c)
  8218  		v0.AddArg(x)
  8219  		v.AddArg4(ptr, idx, v0, mem)
  8220  		return true
  8221  	}
  8222  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem)
  8223  	// cond: c <= 24
  8224  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8225  	for {
  8226  		ptr := v_0
  8227  		idx := v_1
  8228  		if v_2.Op != OpPPC64SRWconst {
  8229  			break
  8230  		}
  8231  		c := auxIntToInt64(v_2.AuxInt)
  8232  		v_2_0 := v_2.Args[0]
  8233  		if v_2_0.Op != OpPPC64MOVWreg {
  8234  			break
  8235  		}
  8236  		x := v_2_0.Args[0]
  8237  		mem := v_3
  8238  		if !(c <= 24) {
  8239  			break
  8240  		}
  8241  		v.reset(OpPPC64MOVBstoreidx)
  8242  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8243  		v0.AuxInt = int64ToAuxInt(c)
  8244  		v0.AddArg(x)
  8245  		v.AddArg4(ptr, idx, v0, mem)
  8246  		return true
  8247  	}
  8248  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem)
  8249  	// cond: c <= 24
  8250  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8251  	for {
  8252  		ptr := v_0
  8253  		idx := v_1
  8254  		if v_2.Op != OpPPC64SRWconst {
  8255  			break
  8256  		}
  8257  		c := auxIntToInt64(v_2.AuxInt)
  8258  		v_2_0 := v_2.Args[0]
  8259  		if v_2_0.Op != OpPPC64MOVWZreg {
  8260  			break
  8261  		}
  8262  		x := v_2_0.Args[0]
  8263  		mem := v_3
  8264  		if !(c <= 24) {
  8265  			break
  8266  		}
  8267  		v.reset(OpPPC64MOVBstoreidx)
  8268  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8269  		v0.AuxInt = int64ToAuxInt(c)
  8270  		v0.AddArg(x)
  8271  		v.AddArg4(ptr, idx, v0, mem)
  8272  		return true
  8273  	}
  8274  	return false
  8275  }
  8276  func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
  8277  	v_1 := v.Args[1]
  8278  	v_0 := v.Args[0]
  8279  	// match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8280  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8281  	// result: (MOVBstorezero [off1+int32(off2)] {sym} x mem)
  8282  	for {
  8283  		off1 := auxIntToInt32(v.AuxInt)
  8284  		sym := auxToSym(v.Aux)
  8285  		if v_0.Op != OpPPC64ADDconst {
  8286  			break
  8287  		}
  8288  		off2 := auxIntToInt64(v_0.AuxInt)
  8289  		x := v_0.Args[0]
  8290  		mem := v_1
  8291  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8292  			break
  8293  		}
  8294  		v.reset(OpPPC64MOVBstorezero)
  8295  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8296  		v.Aux = symToAux(sym)
  8297  		v.AddArg2(x, mem)
  8298  		return true
  8299  	}
  8300  	// match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8301  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8302  	// result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8303  	for {
  8304  		off1 := auxIntToInt32(v.AuxInt)
  8305  		sym1 := auxToSym(v.Aux)
  8306  		p := v_0
  8307  		if p.Op != OpPPC64MOVDaddr {
  8308  			break
  8309  		}
  8310  		off2 := auxIntToInt32(p.AuxInt)
  8311  		sym2 := auxToSym(p.Aux)
  8312  		x := p.Args[0]
  8313  		mem := v_1
  8314  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8315  			break
  8316  		}
  8317  		v.reset(OpPPC64MOVBstorezero)
  8318  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8319  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8320  		v.AddArg2(x, mem)
  8321  		return true
  8322  	}
  8323  	return false
  8324  }
  8325  func rewriteValuePPC64_OpPPC64MOVDaddr(v *Value) bool {
  8326  	v_0 := v.Args[0]
  8327  	// match: (MOVDaddr {sym} [n] p:(ADD x y))
  8328  	// cond: sym == nil && n == 0
  8329  	// result: p
  8330  	for {
  8331  		n := auxIntToInt32(v.AuxInt)
  8332  		sym := auxToSym(v.Aux)
  8333  		p := v_0
  8334  		if p.Op != OpPPC64ADD {
  8335  			break
  8336  		}
  8337  		if !(sym == nil && n == 0) {
  8338  			break
  8339  		}
  8340  		v.copyOf(p)
  8341  		return true
  8342  	}
  8343  	// match: (MOVDaddr {sym} [n] ptr)
  8344  	// cond: sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)
  8345  	// result: ptr
  8346  	for {
  8347  		n := auxIntToInt32(v.AuxInt)
  8348  		sym := auxToSym(v.Aux)
  8349  		ptr := v_0
  8350  		if !(sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)) {
  8351  			break
  8352  		}
  8353  		v.copyOf(ptr)
  8354  		return true
  8355  	}
  8356  	return false
  8357  }
  8358  func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
  8359  	v_1 := v.Args[1]
  8360  	v_0 := v.Args[0]
  8361  	// match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _))
  8362  	// result: (MFVSRD x)
  8363  	for {
  8364  		off := auxIntToInt32(v.AuxInt)
  8365  		sym := auxToSym(v.Aux)
  8366  		ptr := v_0
  8367  		if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  8368  			break
  8369  		}
  8370  		x := v_1.Args[1]
  8371  		if ptr != v_1.Args[0] {
  8372  			break
  8373  		}
  8374  		v.reset(OpPPC64MFVSRD)
  8375  		v.AddArg(x)
  8376  		return true
  8377  	}
  8378  	// match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8379  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8380  	// result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8381  	for {
  8382  		off1 := auxIntToInt32(v.AuxInt)
  8383  		sym1 := auxToSym(v.Aux)
  8384  		p := v_0
  8385  		if p.Op != OpPPC64MOVDaddr {
  8386  			break
  8387  		}
  8388  		off2 := auxIntToInt32(p.AuxInt)
  8389  		sym2 := auxToSym(p.Aux)
  8390  		ptr := p.Args[0]
  8391  		mem := v_1
  8392  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8393  			break
  8394  		}
  8395  		v.reset(OpPPC64MOVDload)
  8396  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8397  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8398  		v.AddArg2(ptr, mem)
  8399  		return true
  8400  	}
  8401  	// match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
  8402  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8403  	// result: (MOVDload [off1+int32(off2)] {sym} x mem)
  8404  	for {
  8405  		off1 := auxIntToInt32(v.AuxInt)
  8406  		sym := auxToSym(v.Aux)
  8407  		if v_0.Op != OpPPC64ADDconst {
  8408  			break
  8409  		}
  8410  		off2 := auxIntToInt64(v_0.AuxInt)
  8411  		x := v_0.Args[0]
  8412  		mem := v_1
  8413  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8414  			break
  8415  		}
  8416  		v.reset(OpPPC64MOVDload)
  8417  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8418  		v.Aux = symToAux(sym)
  8419  		v.AddArg2(x, mem)
  8420  		return true
  8421  	}
  8422  	// match: (MOVDload [0] {sym} p:(ADD ptr idx) mem)
  8423  	// cond: sym == nil && p.Uses == 1
  8424  	// result: (MOVDloadidx ptr idx mem)
  8425  	for {
  8426  		if auxIntToInt32(v.AuxInt) != 0 {
  8427  			break
  8428  		}
  8429  		sym := auxToSym(v.Aux)
  8430  		p := v_0
  8431  		if p.Op != OpPPC64ADD {
  8432  			break
  8433  		}
  8434  		idx := p.Args[1]
  8435  		ptr := p.Args[0]
  8436  		mem := v_1
  8437  		if !(sym == nil && p.Uses == 1) {
  8438  			break
  8439  		}
  8440  		v.reset(OpPPC64MOVDloadidx)
  8441  		v.AddArg3(ptr, idx, mem)
  8442  		return true
  8443  	}
  8444  	return false
  8445  }
  8446  func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
  8447  	v_2 := v.Args[2]
  8448  	v_1 := v.Args[1]
  8449  	v_0 := v.Args[0]
  8450  	// match: (MOVDloadidx ptr (MOVDconst [c]) mem)
  8451  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8452  	// result: (MOVDload [int32(c)] ptr mem)
  8453  	for {
  8454  		ptr := v_0
  8455  		if v_1.Op != OpPPC64MOVDconst {
  8456  			break
  8457  		}
  8458  		c := auxIntToInt64(v_1.AuxInt)
  8459  		mem := v_2
  8460  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8461  			break
  8462  		}
  8463  		v.reset(OpPPC64MOVDload)
  8464  		v.AuxInt = int32ToAuxInt(int32(c))
  8465  		v.AddArg2(ptr, mem)
  8466  		return true
  8467  	}
  8468  	// match: (MOVDloadidx (MOVDconst [c]) ptr mem)
  8469  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8470  	// result: (MOVDload [int32(c)] ptr mem)
  8471  	for {
  8472  		if v_0.Op != OpPPC64MOVDconst {
  8473  			break
  8474  		}
  8475  		c := auxIntToInt64(v_0.AuxInt)
  8476  		ptr := v_1
  8477  		mem := v_2
  8478  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8479  			break
  8480  		}
  8481  		v.reset(OpPPC64MOVDload)
  8482  		v.AuxInt = int32ToAuxInt(int32(c))
  8483  		v.AddArg2(ptr, mem)
  8484  		return true
  8485  	}
  8486  	return false
  8487  }
  8488  func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
  8489  	v_2 := v.Args[2]
  8490  	v_1 := v.Args[1]
  8491  	v_0 := v.Args[0]
  8492  	b := v.Block
  8493  	// match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem)
  8494  	// result: (FMOVDstore [off] {sym} ptr x mem)
  8495  	for {
  8496  		off := auxIntToInt32(v.AuxInt)
  8497  		sym := auxToSym(v.Aux)
  8498  		ptr := v_0
  8499  		if v_1.Op != OpPPC64MFVSRD {
  8500  			break
  8501  		}
  8502  		x := v_1.Args[0]
  8503  		mem := v_2
  8504  		v.reset(OpPPC64FMOVDstore)
  8505  		v.AuxInt = int32ToAuxInt(off)
  8506  		v.Aux = symToAux(sym)
  8507  		v.AddArg3(ptr, x, mem)
  8508  		return true
  8509  	}
  8510  	// match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
  8511  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8512  	// result: (MOVDstore [off1+int32(off2)] {sym} x val mem)
  8513  	for {
  8514  		off1 := auxIntToInt32(v.AuxInt)
  8515  		sym := auxToSym(v.Aux)
  8516  		if v_0.Op != OpPPC64ADDconst {
  8517  			break
  8518  		}
  8519  		off2 := auxIntToInt64(v_0.AuxInt)
  8520  		x := v_0.Args[0]
  8521  		val := v_1
  8522  		mem := v_2
  8523  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8524  			break
  8525  		}
  8526  		v.reset(OpPPC64MOVDstore)
  8527  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8528  		v.Aux = symToAux(sym)
  8529  		v.AddArg3(x, val, mem)
  8530  		return true
  8531  	}
  8532  	// match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  8533  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8534  	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  8535  	for {
  8536  		off1 := auxIntToInt32(v.AuxInt)
  8537  		sym1 := auxToSym(v.Aux)
  8538  		p := v_0
  8539  		if p.Op != OpPPC64MOVDaddr {
  8540  			break
  8541  		}
  8542  		off2 := auxIntToInt32(p.AuxInt)
  8543  		sym2 := auxToSym(p.Aux)
  8544  		ptr := p.Args[0]
  8545  		val := v_1
  8546  		mem := v_2
  8547  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8548  			break
  8549  		}
  8550  		v.reset(OpPPC64MOVDstore)
  8551  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8552  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8553  		v.AddArg3(ptr, val, mem)
  8554  		return true
  8555  	}
  8556  	// match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
  8557  	// result: (MOVDstorezero [off] {sym} ptr mem)
  8558  	for {
  8559  		off := auxIntToInt32(v.AuxInt)
  8560  		sym := auxToSym(v.Aux)
  8561  		ptr := v_0
  8562  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  8563  			break
  8564  		}
  8565  		mem := v_2
  8566  		v.reset(OpPPC64MOVDstorezero)
  8567  		v.AuxInt = int32ToAuxInt(off)
  8568  		v.Aux = symToAux(sym)
  8569  		v.AddArg2(ptr, mem)
  8570  		return true
  8571  	}
  8572  	// match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem)
  8573  	// cond: sym == nil && p.Uses == 1
  8574  	// result: (MOVDstoreidx ptr idx val mem)
  8575  	for {
  8576  		if auxIntToInt32(v.AuxInt) != 0 {
  8577  			break
  8578  		}
  8579  		sym := auxToSym(v.Aux)
  8580  		p := v_0
  8581  		if p.Op != OpPPC64ADD {
  8582  			break
  8583  		}
  8584  		idx := p.Args[1]
  8585  		ptr := p.Args[0]
  8586  		val := v_1
  8587  		mem := v_2
  8588  		if !(sym == nil && p.Uses == 1) {
  8589  			break
  8590  		}
  8591  		v.reset(OpPPC64MOVDstoreidx)
  8592  		v.AddArg4(ptr, idx, val, mem)
  8593  		return true
  8594  	}
  8595  	// match: (MOVDstore [off] {sym} ptr r:(BRD val) mem)
  8596  	// cond: r.Uses == 1
  8597  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8598  	for {
  8599  		off := auxIntToInt32(v.AuxInt)
  8600  		sym := auxToSym(v.Aux)
  8601  		ptr := v_0
  8602  		r := v_1
  8603  		if r.Op != OpPPC64BRD {
  8604  			break
  8605  		}
  8606  		val := r.Args[0]
  8607  		mem := v_2
  8608  		if !(r.Uses == 1) {
  8609  			break
  8610  		}
  8611  		v.reset(OpPPC64MOVDBRstore)
  8612  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8613  		v0.AuxInt = int32ToAuxInt(off)
  8614  		v0.Aux = symToAux(sym)
  8615  		v0.AddArg(ptr)
  8616  		v.AddArg3(v0, val, mem)
  8617  		return true
  8618  	}
  8619  	// match: (MOVDstore [off] {sym} ptr (Bswap64 val) mem)
  8620  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8621  	for {
  8622  		off := auxIntToInt32(v.AuxInt)
  8623  		sym := auxToSym(v.Aux)
  8624  		ptr := v_0
  8625  		if v_1.Op != OpBswap64 {
  8626  			break
  8627  		}
  8628  		val := v_1.Args[0]
  8629  		mem := v_2
  8630  		v.reset(OpPPC64MOVDBRstore)
  8631  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8632  		v0.AuxInt = int32ToAuxInt(off)
  8633  		v0.Aux = symToAux(sym)
  8634  		v0.AddArg(ptr)
  8635  		v.AddArg3(v0, val, mem)
  8636  		return true
  8637  	}
  8638  	return false
  8639  }
  8640  func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
  8641  	v_3 := v.Args[3]
  8642  	v_2 := v.Args[2]
  8643  	v_1 := v.Args[1]
  8644  	v_0 := v.Args[0]
  8645  	// match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
  8646  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8647  	// result: (MOVDstore [int32(c)] ptr val mem)
  8648  	for {
  8649  		ptr := v_0
  8650  		if v_1.Op != OpPPC64MOVDconst {
  8651  			break
  8652  		}
  8653  		c := auxIntToInt64(v_1.AuxInt)
  8654  		val := v_2
  8655  		mem := v_3
  8656  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8657  			break
  8658  		}
  8659  		v.reset(OpPPC64MOVDstore)
  8660  		v.AuxInt = int32ToAuxInt(int32(c))
  8661  		v.AddArg3(ptr, val, mem)
  8662  		return true
  8663  	}
  8664  	// match: (MOVDstoreidx (MOVDconst [c]) ptr val mem)
  8665  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8666  	// result: (MOVDstore [int32(c)] ptr val mem)
  8667  	for {
  8668  		if v_0.Op != OpPPC64MOVDconst {
  8669  			break
  8670  		}
  8671  		c := auxIntToInt64(v_0.AuxInt)
  8672  		ptr := v_1
  8673  		val := v_2
  8674  		mem := v_3
  8675  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8676  			break
  8677  		}
  8678  		v.reset(OpPPC64MOVDstore)
  8679  		v.AuxInt = int32ToAuxInt(int32(c))
  8680  		v.AddArg3(ptr, val, mem)
  8681  		return true
  8682  	}
  8683  	// match: (MOVDstoreidx ptr idx r:(BRD val) mem)
  8684  	// cond: r.Uses == 1
  8685  	// result: (MOVDBRstoreidx ptr idx val mem)
  8686  	for {
  8687  		ptr := v_0
  8688  		idx := v_1
  8689  		r := v_2
  8690  		if r.Op != OpPPC64BRD {
  8691  			break
  8692  		}
  8693  		val := r.Args[0]
  8694  		mem := v_3
  8695  		if !(r.Uses == 1) {
  8696  			break
  8697  		}
  8698  		v.reset(OpPPC64MOVDBRstoreidx)
  8699  		v.AddArg4(ptr, idx, val, mem)
  8700  		return true
  8701  	}
  8702  	// match: (MOVDstoreidx ptr idx (Bswap64 val) mem)
  8703  	// result: (MOVDBRstoreidx ptr idx val mem)
  8704  	for {
  8705  		ptr := v_0
  8706  		idx := v_1
  8707  		if v_2.Op != OpBswap64 {
  8708  			break
  8709  		}
  8710  		val := v_2.Args[0]
  8711  		mem := v_3
  8712  		v.reset(OpPPC64MOVDBRstoreidx)
  8713  		v.AddArg4(ptr, idx, val, mem)
  8714  		return true
  8715  	}
  8716  	return false
  8717  }
  8718  func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
  8719  	v_1 := v.Args[1]
  8720  	v_0 := v.Args[0]
  8721  	// match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8722  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8723  	// result: (MOVDstorezero [off1+int32(off2)] {sym} x mem)
  8724  	for {
  8725  		off1 := auxIntToInt32(v.AuxInt)
  8726  		sym := auxToSym(v.Aux)
  8727  		if v_0.Op != OpPPC64ADDconst {
  8728  			break
  8729  		}
  8730  		off2 := auxIntToInt64(v_0.AuxInt)
  8731  		x := v_0.Args[0]
  8732  		mem := v_1
  8733  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8734  			break
  8735  		}
  8736  		v.reset(OpPPC64MOVDstorezero)
  8737  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8738  		v.Aux = symToAux(sym)
  8739  		v.AddArg2(x, mem)
  8740  		return true
  8741  	}
  8742  	// match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8743  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8744  	// result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8745  	for {
  8746  		off1 := auxIntToInt32(v.AuxInt)
  8747  		sym1 := auxToSym(v.Aux)
  8748  		p := v_0
  8749  		if p.Op != OpPPC64MOVDaddr {
  8750  			break
  8751  		}
  8752  		off2 := auxIntToInt32(p.AuxInt)
  8753  		sym2 := auxToSym(p.Aux)
  8754  		x := p.Args[0]
  8755  		mem := v_1
  8756  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8757  			break
  8758  		}
  8759  		v.reset(OpPPC64MOVDstorezero)
  8760  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8761  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8762  		v.AddArg2(x, mem)
  8763  		return true
  8764  	}
  8765  	return false
  8766  }
  8767  func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
  8768  	v_2 := v.Args[2]
  8769  	v_1 := v.Args[1]
  8770  	v_0 := v.Args[0]
  8771  	// match: (MOVHBRstore ptr (MOVHreg x) mem)
  8772  	// result: (MOVHBRstore ptr x mem)
  8773  	for {
  8774  		ptr := v_0
  8775  		if v_1.Op != OpPPC64MOVHreg {
  8776  			break
  8777  		}
  8778  		x := v_1.Args[0]
  8779  		mem := v_2
  8780  		v.reset(OpPPC64MOVHBRstore)
  8781  		v.AddArg3(ptr, x, mem)
  8782  		return true
  8783  	}
  8784  	// match: (MOVHBRstore ptr (MOVHZreg x) mem)
  8785  	// result: (MOVHBRstore ptr x mem)
  8786  	for {
  8787  		ptr := v_0
  8788  		if v_1.Op != OpPPC64MOVHZreg {
  8789  			break
  8790  		}
  8791  		x := v_1.Args[0]
  8792  		mem := v_2
  8793  		v.reset(OpPPC64MOVHBRstore)
  8794  		v.AddArg3(ptr, x, mem)
  8795  		return true
  8796  	}
  8797  	// match: (MOVHBRstore ptr (MOVWreg x) mem)
  8798  	// result: (MOVHBRstore ptr x mem)
  8799  	for {
  8800  		ptr := v_0
  8801  		if v_1.Op != OpPPC64MOVWreg {
  8802  			break
  8803  		}
  8804  		x := v_1.Args[0]
  8805  		mem := v_2
  8806  		v.reset(OpPPC64MOVHBRstore)
  8807  		v.AddArg3(ptr, x, mem)
  8808  		return true
  8809  	}
  8810  	// match: (MOVHBRstore ptr (MOVWZreg x) mem)
  8811  	// result: (MOVHBRstore ptr x mem)
  8812  	for {
  8813  		ptr := v_0
  8814  		if v_1.Op != OpPPC64MOVWZreg {
  8815  			break
  8816  		}
  8817  		x := v_1.Args[0]
  8818  		mem := v_2
  8819  		v.reset(OpPPC64MOVHBRstore)
  8820  		v.AddArg3(ptr, x, mem)
  8821  		return true
  8822  	}
  8823  	return false
  8824  }
  8825  func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
  8826  	v_1 := v.Args[1]
  8827  	v_0 := v.Args[0]
  8828  	// match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8829  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8830  	// result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8831  	for {
  8832  		off1 := auxIntToInt32(v.AuxInt)
  8833  		sym1 := auxToSym(v.Aux)
  8834  		p := v_0
  8835  		if p.Op != OpPPC64MOVDaddr {
  8836  			break
  8837  		}
  8838  		off2 := auxIntToInt32(p.AuxInt)
  8839  		sym2 := auxToSym(p.Aux)
  8840  		ptr := p.Args[0]
  8841  		mem := v_1
  8842  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8843  			break
  8844  		}
  8845  		v.reset(OpPPC64MOVHZload)
  8846  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8847  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8848  		v.AddArg2(ptr, mem)
  8849  		return true
  8850  	}
  8851  	// match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
  8852  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8853  	// result: (MOVHZload [off1+int32(off2)] {sym} x mem)
  8854  	for {
  8855  		off1 := auxIntToInt32(v.AuxInt)
  8856  		sym := auxToSym(v.Aux)
  8857  		if v_0.Op != OpPPC64ADDconst {
  8858  			break
  8859  		}
  8860  		off2 := auxIntToInt64(v_0.AuxInt)
  8861  		x := v_0.Args[0]
  8862  		mem := v_1
  8863  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8864  			break
  8865  		}
  8866  		v.reset(OpPPC64MOVHZload)
  8867  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8868  		v.Aux = symToAux(sym)
  8869  		v.AddArg2(x, mem)
  8870  		return true
  8871  	}
  8872  	// match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem)
  8873  	// cond: sym == nil && p.Uses == 1
  8874  	// result: (MOVHZloadidx ptr idx mem)
  8875  	for {
  8876  		if auxIntToInt32(v.AuxInt) != 0 {
  8877  			break
  8878  		}
  8879  		sym := auxToSym(v.Aux)
  8880  		p := v_0
  8881  		if p.Op != OpPPC64ADD {
  8882  			break
  8883  		}
  8884  		idx := p.Args[1]
  8885  		ptr := p.Args[0]
  8886  		mem := v_1
  8887  		if !(sym == nil && p.Uses == 1) {
  8888  			break
  8889  		}
  8890  		v.reset(OpPPC64MOVHZloadidx)
  8891  		v.AddArg3(ptr, idx, mem)
  8892  		return true
  8893  	}
  8894  	return false
  8895  }
  8896  func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
  8897  	v_2 := v.Args[2]
  8898  	v_1 := v.Args[1]
  8899  	v_0 := v.Args[0]
  8900  	// match: (MOVHZloadidx ptr (MOVDconst [c]) mem)
  8901  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8902  	// result: (MOVHZload [int32(c)] ptr mem)
  8903  	for {
  8904  		ptr := v_0
  8905  		if v_1.Op != OpPPC64MOVDconst {
  8906  			break
  8907  		}
  8908  		c := auxIntToInt64(v_1.AuxInt)
  8909  		mem := v_2
  8910  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8911  			break
  8912  		}
  8913  		v.reset(OpPPC64MOVHZload)
  8914  		v.AuxInt = int32ToAuxInt(int32(c))
  8915  		v.AddArg2(ptr, mem)
  8916  		return true
  8917  	}
  8918  	// match: (MOVHZloadidx (MOVDconst [c]) ptr mem)
  8919  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8920  	// result: (MOVHZload [int32(c)] ptr mem)
  8921  	for {
  8922  		if v_0.Op != OpPPC64MOVDconst {
  8923  			break
  8924  		}
  8925  		c := auxIntToInt64(v_0.AuxInt)
  8926  		ptr := v_1
  8927  		mem := v_2
  8928  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8929  			break
  8930  		}
  8931  		v.reset(OpPPC64MOVHZload)
  8932  		v.AuxInt = int32ToAuxInt(int32(c))
  8933  		v.AddArg2(ptr, mem)
  8934  		return true
  8935  	}
  8936  	return false
  8937  }
  8938  func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
  8939  	v_0 := v.Args[0]
  8940  	b := v.Block
  8941  	typ := &b.Func.Config.Types
  8942  	// match: (MOVHZreg y:(ANDconst [c] _))
  8943  	// cond: uint64(c) <= 0xFFFF
  8944  	// result: y
  8945  	for {
  8946  		y := v_0
  8947  		if y.Op != OpPPC64ANDconst {
  8948  			break
  8949  		}
  8950  		c := auxIntToInt64(y.AuxInt)
  8951  		if !(uint64(c) <= 0xFFFF) {
  8952  			break
  8953  		}
  8954  		v.copyOf(y)
  8955  		return true
  8956  	}
  8957  	// match: (MOVHZreg (SRWconst [c] (MOVBZreg x)))
  8958  	// result: (SRWconst [c] (MOVBZreg x))
  8959  	for {
  8960  		if v_0.Op != OpPPC64SRWconst {
  8961  			break
  8962  		}
  8963  		c := auxIntToInt64(v_0.AuxInt)
  8964  		v_0_0 := v_0.Args[0]
  8965  		if v_0_0.Op != OpPPC64MOVBZreg {
  8966  			break
  8967  		}
  8968  		x := v_0_0.Args[0]
  8969  		v.reset(OpPPC64SRWconst)
  8970  		v.AuxInt = int64ToAuxInt(c)
  8971  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  8972  		v0.AddArg(x)
  8973  		v.AddArg(v0)
  8974  		return true
  8975  	}
  8976  	// match: (MOVHZreg (SRWconst [c] (MOVHZreg x)))
  8977  	// result: (SRWconst [c] (MOVHZreg x))
  8978  	for {
  8979  		if v_0.Op != OpPPC64SRWconst {
  8980  			break
  8981  		}
  8982  		c := auxIntToInt64(v_0.AuxInt)
  8983  		v_0_0 := v_0.Args[0]
  8984  		if v_0_0.Op != OpPPC64MOVHZreg {
  8985  			break
  8986  		}
  8987  		x := v_0_0.Args[0]
  8988  		v.reset(OpPPC64SRWconst)
  8989  		v.AuxInt = int64ToAuxInt(c)
  8990  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  8991  		v0.AddArg(x)
  8992  		v.AddArg(v0)
  8993  		return true
  8994  	}
  8995  	// match: (MOVHZreg (SRWconst [c] x))
  8996  	// cond: x.Type.Size() <= 16
  8997  	// result: (SRWconst [c] x)
  8998  	for {
  8999  		if v_0.Op != OpPPC64SRWconst {
  9000  			break
  9001  		}
  9002  		c := auxIntToInt64(v_0.AuxInt)
  9003  		x := v_0.Args[0]
  9004  		if !(x.Type.Size() <= 16) {
  9005  			break
  9006  		}
  9007  		v.reset(OpPPC64SRWconst)
  9008  		v.AuxInt = int64ToAuxInt(c)
  9009  		v.AddArg(x)
  9010  		return true
  9011  	}
  9012  	// match: (MOVHZreg (SRDconst [c] x))
  9013  	// cond: c>=48
  9014  	// result: (SRDconst [c] x)
  9015  	for {
  9016  		if v_0.Op != OpPPC64SRDconst {
  9017  			break
  9018  		}
  9019  		c := auxIntToInt64(v_0.AuxInt)
  9020  		x := v_0.Args[0]
  9021  		if !(c >= 48) {
  9022  			break
  9023  		}
  9024  		v.reset(OpPPC64SRDconst)
  9025  		v.AuxInt = int64ToAuxInt(c)
  9026  		v.AddArg(x)
  9027  		return true
  9028  	}
  9029  	// match: (MOVHZreg (SRWconst [c] x))
  9030  	// cond: c>=16
  9031  	// result: (SRWconst [c] x)
  9032  	for {
  9033  		if v_0.Op != OpPPC64SRWconst {
  9034  			break
  9035  		}
  9036  		c := auxIntToInt64(v_0.AuxInt)
  9037  		x := v_0.Args[0]
  9038  		if !(c >= 16) {
  9039  			break
  9040  		}
  9041  		v.reset(OpPPC64SRWconst)
  9042  		v.AuxInt = int64ToAuxInt(c)
  9043  		v.AddArg(x)
  9044  		return true
  9045  	}
  9046  	// match: (MOVHZreg (RLWINM [r] y))
  9047  	// cond: mergePPC64AndRlwinm(0xFFFF,r) != 0
  9048  	// result: (RLWINM [mergePPC64AndRlwinm(0xFFFF,r)] y)
  9049  	for {
  9050  		if v_0.Op != OpPPC64RLWINM {
  9051  			break
  9052  		}
  9053  		r := auxIntToInt64(v_0.AuxInt)
  9054  		y := v_0.Args[0]
  9055  		if !(mergePPC64AndRlwinm(0xFFFF, r) != 0) {
  9056  			break
  9057  		}
  9058  		v.reset(OpPPC64RLWINM)
  9059  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFFFF, r))
  9060  		v.AddArg(y)
  9061  		return true
  9062  	}
  9063  	// match: (MOVHZreg y:(MOVHZreg _))
  9064  	// result: y
  9065  	for {
  9066  		y := v_0
  9067  		if y.Op != OpPPC64MOVHZreg {
  9068  			break
  9069  		}
  9070  		v.copyOf(y)
  9071  		return true
  9072  	}
  9073  	// match: (MOVHZreg y:(MOVBZreg _))
  9074  	// result: y
  9075  	for {
  9076  		y := v_0
  9077  		if y.Op != OpPPC64MOVBZreg {
  9078  			break
  9079  		}
  9080  		v.copyOf(y)
  9081  		return true
  9082  	}
  9083  	// match: (MOVHZreg y:(MOVHBRload _ _))
  9084  	// result: y
  9085  	for {
  9086  		y := v_0
  9087  		if y.Op != OpPPC64MOVHBRload {
  9088  			break
  9089  		}
  9090  		v.copyOf(y)
  9091  		return true
  9092  	}
  9093  	// match: (MOVHZreg y:(MOVHreg x))
  9094  	// result: (MOVHZreg x)
  9095  	for {
  9096  		y := v_0
  9097  		if y.Op != OpPPC64MOVHreg {
  9098  			break
  9099  		}
  9100  		x := y.Args[0]
  9101  		v.reset(OpPPC64MOVHZreg)
  9102  		v.AddArg(x)
  9103  		return true
  9104  	}
  9105  	// match: (MOVHZreg (OR <t> x (MOVWZreg y)))
  9106  	// result: (MOVHZreg (OR <t> x y))
  9107  	for {
  9108  		if v_0.Op != OpPPC64OR {
  9109  			break
  9110  		}
  9111  		t := v_0.Type
  9112  		_ = v_0.Args[1]
  9113  		v_0_0 := v_0.Args[0]
  9114  		v_0_1 := v_0.Args[1]
  9115  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9116  			x := v_0_0
  9117  			if v_0_1.Op != OpPPC64MOVWZreg {
  9118  				continue
  9119  			}
  9120  			y := v_0_1.Args[0]
  9121  			v.reset(OpPPC64MOVHZreg)
  9122  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9123  			v0.AddArg2(x, y)
  9124  			v.AddArg(v0)
  9125  			return true
  9126  		}
  9127  		break
  9128  	}
  9129  	// match: (MOVHZreg (XOR <t> x (MOVWZreg y)))
  9130  	// result: (MOVHZreg (XOR <t> x y))
  9131  	for {
  9132  		if v_0.Op != OpPPC64XOR {
  9133  			break
  9134  		}
  9135  		t := v_0.Type
  9136  		_ = v_0.Args[1]
  9137  		v_0_0 := v_0.Args[0]
  9138  		v_0_1 := v_0.Args[1]
  9139  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9140  			x := v_0_0
  9141  			if v_0_1.Op != OpPPC64MOVWZreg {
  9142  				continue
  9143  			}
  9144  			y := v_0_1.Args[0]
  9145  			v.reset(OpPPC64MOVHZreg)
  9146  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9147  			v0.AddArg2(x, y)
  9148  			v.AddArg(v0)
  9149  			return true
  9150  		}
  9151  		break
  9152  	}
  9153  	// match: (MOVHZreg (AND <t> x (MOVWZreg y)))
  9154  	// result: (MOVHZreg (AND <t> x y))
  9155  	for {
  9156  		if v_0.Op != OpPPC64AND {
  9157  			break
  9158  		}
  9159  		t := v_0.Type
  9160  		_ = v_0.Args[1]
  9161  		v_0_0 := v_0.Args[0]
  9162  		v_0_1 := v_0.Args[1]
  9163  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9164  			x := v_0_0
  9165  			if v_0_1.Op != OpPPC64MOVWZreg {
  9166  				continue
  9167  			}
  9168  			y := v_0_1.Args[0]
  9169  			v.reset(OpPPC64MOVHZreg)
  9170  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9171  			v0.AddArg2(x, y)
  9172  			v.AddArg(v0)
  9173  			return true
  9174  		}
  9175  		break
  9176  	}
  9177  	// match: (MOVHZreg (OR <t> x (MOVHZreg y)))
  9178  	// result: (MOVHZreg (OR <t> x y))
  9179  	for {
  9180  		if v_0.Op != OpPPC64OR {
  9181  			break
  9182  		}
  9183  		t := v_0.Type
  9184  		_ = v_0.Args[1]
  9185  		v_0_0 := v_0.Args[0]
  9186  		v_0_1 := v_0.Args[1]
  9187  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9188  			x := v_0_0
  9189  			if v_0_1.Op != OpPPC64MOVHZreg {
  9190  				continue
  9191  			}
  9192  			y := v_0_1.Args[0]
  9193  			v.reset(OpPPC64MOVHZreg)
  9194  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9195  			v0.AddArg2(x, y)
  9196  			v.AddArg(v0)
  9197  			return true
  9198  		}
  9199  		break
  9200  	}
  9201  	// match: (MOVHZreg (XOR <t> x (MOVHZreg y)))
  9202  	// result: (MOVHZreg (XOR <t> x y))
  9203  	for {
  9204  		if v_0.Op != OpPPC64XOR {
  9205  			break
  9206  		}
  9207  		t := v_0.Type
  9208  		_ = v_0.Args[1]
  9209  		v_0_0 := v_0.Args[0]
  9210  		v_0_1 := v_0.Args[1]
  9211  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9212  			x := v_0_0
  9213  			if v_0_1.Op != OpPPC64MOVHZreg {
  9214  				continue
  9215  			}
  9216  			y := v_0_1.Args[0]
  9217  			v.reset(OpPPC64MOVHZreg)
  9218  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9219  			v0.AddArg2(x, y)
  9220  			v.AddArg(v0)
  9221  			return true
  9222  		}
  9223  		break
  9224  	}
  9225  	// match: (MOVHZreg (AND <t> x (MOVHZreg y)))
  9226  	// result: (MOVHZreg (AND <t> x y))
  9227  	for {
  9228  		if v_0.Op != OpPPC64AND {
  9229  			break
  9230  		}
  9231  		t := v_0.Type
  9232  		_ = v_0.Args[1]
  9233  		v_0_0 := v_0.Args[0]
  9234  		v_0_1 := v_0.Args[1]
  9235  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9236  			x := v_0_0
  9237  			if v_0_1.Op != OpPPC64MOVHZreg {
  9238  				continue
  9239  			}
  9240  			y := v_0_1.Args[0]
  9241  			v.reset(OpPPC64MOVHZreg)
  9242  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9243  			v0.AddArg2(x, y)
  9244  			v.AddArg(v0)
  9245  			return true
  9246  		}
  9247  		break
  9248  	}
  9249  	// match: (MOVHZreg z:(ANDconst [c] (MOVBZload ptr x)))
  9250  	// result: z
  9251  	for {
  9252  		z := v_0
  9253  		if z.Op != OpPPC64ANDconst {
  9254  			break
  9255  		}
  9256  		z_0 := z.Args[0]
  9257  		if z_0.Op != OpPPC64MOVBZload {
  9258  			break
  9259  		}
  9260  		v.copyOf(z)
  9261  		return true
  9262  	}
  9263  	// match: (MOVHZreg z:(AND y (MOVHZload ptr x)))
  9264  	// result: z
  9265  	for {
  9266  		z := v_0
  9267  		if z.Op != OpPPC64AND {
  9268  			break
  9269  		}
  9270  		_ = z.Args[1]
  9271  		z_0 := z.Args[0]
  9272  		z_1 := z.Args[1]
  9273  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  9274  			if z_1.Op != OpPPC64MOVHZload {
  9275  				continue
  9276  			}
  9277  			v.copyOf(z)
  9278  			return true
  9279  		}
  9280  		break
  9281  	}
  9282  	// match: (MOVHZreg z:(ANDconst [c] (MOVHZload ptr x)))
  9283  	// result: z
  9284  	for {
  9285  		z := v_0
  9286  		if z.Op != OpPPC64ANDconst {
  9287  			break
  9288  		}
  9289  		z_0 := z.Args[0]
  9290  		if z_0.Op != OpPPC64MOVHZload {
  9291  			break
  9292  		}
  9293  		v.copyOf(z)
  9294  		return true
  9295  	}
  9296  	// match: (MOVHZreg x:(MOVBZload _ _))
  9297  	// result: x
  9298  	for {
  9299  		x := v_0
  9300  		if x.Op != OpPPC64MOVBZload {
  9301  			break
  9302  		}
  9303  		v.copyOf(x)
  9304  		return true
  9305  	}
  9306  	// match: (MOVHZreg x:(MOVBZloadidx _ _ _))
  9307  	// result: x
  9308  	for {
  9309  		x := v_0
  9310  		if x.Op != OpPPC64MOVBZloadidx {
  9311  			break
  9312  		}
  9313  		v.copyOf(x)
  9314  		return true
  9315  	}
  9316  	// match: (MOVHZreg x:(MOVHZload _ _))
  9317  	// result: x
  9318  	for {
  9319  		x := v_0
  9320  		if x.Op != OpPPC64MOVHZload {
  9321  			break
  9322  		}
  9323  		v.copyOf(x)
  9324  		return true
  9325  	}
  9326  	// match: (MOVHZreg x:(MOVHZloadidx _ _ _))
  9327  	// result: x
  9328  	for {
  9329  		x := v_0
  9330  		if x.Op != OpPPC64MOVHZloadidx {
  9331  			break
  9332  		}
  9333  		v.copyOf(x)
  9334  		return true
  9335  	}
  9336  	// match: (MOVHZreg x:(Arg <t>))
  9337  	// cond: (is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()
  9338  	// result: x
  9339  	for {
  9340  		x := v_0
  9341  		if x.Op != OpArg {
  9342  			break
  9343  		}
  9344  		t := x.Type
  9345  		if !((is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()) {
  9346  			break
  9347  		}
  9348  		v.copyOf(x)
  9349  		return true
  9350  	}
  9351  	// match: (MOVHZreg (MOVDconst [c]))
  9352  	// result: (MOVDconst [int64(uint16(c))])
  9353  	for {
  9354  		if v_0.Op != OpPPC64MOVDconst {
  9355  			break
  9356  		}
  9357  		c := auxIntToInt64(v_0.AuxInt)
  9358  		v.reset(OpPPC64MOVDconst)
  9359  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  9360  		return true
  9361  	}
  9362  	return false
  9363  }
  9364  func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
  9365  	v_1 := v.Args[1]
  9366  	v_0 := v.Args[0]
  9367  	// match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  9368  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9369  	// result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9370  	for {
  9371  		off1 := auxIntToInt32(v.AuxInt)
  9372  		sym1 := auxToSym(v.Aux)
  9373  		p := v_0
  9374  		if p.Op != OpPPC64MOVDaddr {
  9375  			break
  9376  		}
  9377  		off2 := auxIntToInt32(p.AuxInt)
  9378  		sym2 := auxToSym(p.Aux)
  9379  		ptr := p.Args[0]
  9380  		mem := v_1
  9381  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9382  			break
  9383  		}
  9384  		v.reset(OpPPC64MOVHload)
  9385  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9386  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9387  		v.AddArg2(ptr, mem)
  9388  		return true
  9389  	}
  9390  	// match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
  9391  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9392  	// result: (MOVHload [off1+int32(off2)] {sym} x mem)
  9393  	for {
  9394  		off1 := auxIntToInt32(v.AuxInt)
  9395  		sym := auxToSym(v.Aux)
  9396  		if v_0.Op != OpPPC64ADDconst {
  9397  			break
  9398  		}
  9399  		off2 := auxIntToInt64(v_0.AuxInt)
  9400  		x := v_0.Args[0]
  9401  		mem := v_1
  9402  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9403  			break
  9404  		}
  9405  		v.reset(OpPPC64MOVHload)
  9406  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9407  		v.Aux = symToAux(sym)
  9408  		v.AddArg2(x, mem)
  9409  		return true
  9410  	}
  9411  	// match: (MOVHload [0] {sym} p:(ADD ptr idx) mem)
  9412  	// cond: sym == nil && p.Uses == 1
  9413  	// result: (MOVHloadidx ptr idx mem)
  9414  	for {
  9415  		if auxIntToInt32(v.AuxInt) != 0 {
  9416  			break
  9417  		}
  9418  		sym := auxToSym(v.Aux)
  9419  		p := v_0
  9420  		if p.Op != OpPPC64ADD {
  9421  			break
  9422  		}
  9423  		idx := p.Args[1]
  9424  		ptr := p.Args[0]
  9425  		mem := v_1
  9426  		if !(sym == nil && p.Uses == 1) {
  9427  			break
  9428  		}
  9429  		v.reset(OpPPC64MOVHloadidx)
  9430  		v.AddArg3(ptr, idx, mem)
  9431  		return true
  9432  	}
  9433  	return false
  9434  }
  9435  func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
  9436  	v_2 := v.Args[2]
  9437  	v_1 := v.Args[1]
  9438  	v_0 := v.Args[0]
  9439  	// match: (MOVHloadidx ptr (MOVDconst [c]) mem)
  9440  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9441  	// result: (MOVHload [int32(c)] ptr mem)
  9442  	for {
  9443  		ptr := v_0
  9444  		if v_1.Op != OpPPC64MOVDconst {
  9445  			break
  9446  		}
  9447  		c := auxIntToInt64(v_1.AuxInt)
  9448  		mem := v_2
  9449  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9450  			break
  9451  		}
  9452  		v.reset(OpPPC64MOVHload)
  9453  		v.AuxInt = int32ToAuxInt(int32(c))
  9454  		v.AddArg2(ptr, mem)
  9455  		return true
  9456  	}
  9457  	// match: (MOVHloadidx (MOVDconst [c]) ptr mem)
  9458  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9459  	// result: (MOVHload [int32(c)] ptr mem)
  9460  	for {
  9461  		if v_0.Op != OpPPC64MOVDconst {
  9462  			break
  9463  		}
  9464  		c := auxIntToInt64(v_0.AuxInt)
  9465  		ptr := v_1
  9466  		mem := v_2
  9467  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9468  			break
  9469  		}
  9470  		v.reset(OpPPC64MOVHload)
  9471  		v.AuxInt = int32ToAuxInt(int32(c))
  9472  		v.AddArg2(ptr, mem)
  9473  		return true
  9474  	}
  9475  	return false
  9476  }
  9477  func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
  9478  	v_0 := v.Args[0]
  9479  	b := v.Block
  9480  	typ := &b.Func.Config.Types
  9481  	// match: (MOVHreg y:(ANDconst [c] _))
  9482  	// cond: uint64(c) <= 0x7FFF
  9483  	// result: y
  9484  	for {
  9485  		y := v_0
  9486  		if y.Op != OpPPC64ANDconst {
  9487  			break
  9488  		}
  9489  		c := auxIntToInt64(y.AuxInt)
  9490  		if !(uint64(c) <= 0x7FFF) {
  9491  			break
  9492  		}
  9493  		v.copyOf(y)
  9494  		return true
  9495  	}
  9496  	// match: (MOVHreg (SRAWconst [c] (MOVBreg x)))
  9497  	// result: (SRAWconst [c] (MOVBreg x))
  9498  	for {
  9499  		if v_0.Op != OpPPC64SRAWconst {
  9500  			break
  9501  		}
  9502  		c := auxIntToInt64(v_0.AuxInt)
  9503  		v_0_0 := v_0.Args[0]
  9504  		if v_0_0.Op != OpPPC64MOVBreg {
  9505  			break
  9506  		}
  9507  		x := v_0_0.Args[0]
  9508  		v.reset(OpPPC64SRAWconst)
  9509  		v.AuxInt = int64ToAuxInt(c)
  9510  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  9511  		v0.AddArg(x)
  9512  		v.AddArg(v0)
  9513  		return true
  9514  	}
  9515  	// match: (MOVHreg (SRAWconst [c] (MOVHreg x)))
  9516  	// result: (SRAWconst [c] (MOVHreg x))
  9517  	for {
  9518  		if v_0.Op != OpPPC64SRAWconst {
  9519  			break
  9520  		}
  9521  		c := auxIntToInt64(v_0.AuxInt)
  9522  		v_0_0 := v_0.Args[0]
  9523  		if v_0_0.Op != OpPPC64MOVHreg {
  9524  			break
  9525  		}
  9526  		x := v_0_0.Args[0]
  9527  		v.reset(OpPPC64SRAWconst)
  9528  		v.AuxInt = int64ToAuxInt(c)
  9529  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
  9530  		v0.AddArg(x)
  9531  		v.AddArg(v0)
  9532  		return true
  9533  	}
  9534  	// match: (MOVHreg (SRAWconst [c] x))
  9535  	// cond: x.Type.Size() <= 16
  9536  	// result: (SRAWconst [c] x)
  9537  	for {
  9538  		if v_0.Op != OpPPC64SRAWconst {
  9539  			break
  9540  		}
  9541  		c := auxIntToInt64(v_0.AuxInt)
  9542  		x := v_0.Args[0]
  9543  		if !(x.Type.Size() <= 16) {
  9544  			break
  9545  		}
  9546  		v.reset(OpPPC64SRAWconst)
  9547  		v.AuxInt = int64ToAuxInt(c)
  9548  		v.AddArg(x)
  9549  		return true
  9550  	}
  9551  	// match: (MOVHreg (SRDconst [c] x))
  9552  	// cond: c>48
  9553  	// result: (SRDconst [c] x)
  9554  	for {
  9555  		if v_0.Op != OpPPC64SRDconst {
  9556  			break
  9557  		}
  9558  		c := auxIntToInt64(v_0.AuxInt)
  9559  		x := v_0.Args[0]
  9560  		if !(c > 48) {
  9561  			break
  9562  		}
  9563  		v.reset(OpPPC64SRDconst)
  9564  		v.AuxInt = int64ToAuxInt(c)
  9565  		v.AddArg(x)
  9566  		return true
  9567  	}
  9568  	// match: (MOVHreg (SRDconst [c] x))
  9569  	// cond: c==48
  9570  	// result: (SRADconst [c] x)
  9571  	for {
  9572  		if v_0.Op != OpPPC64SRDconst {
  9573  			break
  9574  		}
  9575  		c := auxIntToInt64(v_0.AuxInt)
  9576  		x := v_0.Args[0]
  9577  		if !(c == 48) {
  9578  			break
  9579  		}
  9580  		v.reset(OpPPC64SRADconst)
  9581  		v.AuxInt = int64ToAuxInt(c)
  9582  		v.AddArg(x)
  9583  		return true
  9584  	}
  9585  	// match: (MOVHreg (SRADconst [c] x))
  9586  	// cond: c>=48
  9587  	// result: (SRADconst [c] x)
  9588  	for {
  9589  		if v_0.Op != OpPPC64SRADconst {
  9590  			break
  9591  		}
  9592  		c := auxIntToInt64(v_0.AuxInt)
  9593  		x := v_0.Args[0]
  9594  		if !(c >= 48) {
  9595  			break
  9596  		}
  9597  		v.reset(OpPPC64SRADconst)
  9598  		v.AuxInt = int64ToAuxInt(c)
  9599  		v.AddArg(x)
  9600  		return true
  9601  	}
  9602  	// match: (MOVHreg (SRWconst [c] x))
  9603  	// cond: c>16
  9604  	// result: (SRWconst [c] x)
  9605  	for {
  9606  		if v_0.Op != OpPPC64SRWconst {
  9607  			break
  9608  		}
  9609  		c := auxIntToInt64(v_0.AuxInt)
  9610  		x := v_0.Args[0]
  9611  		if !(c > 16) {
  9612  			break
  9613  		}
  9614  		v.reset(OpPPC64SRWconst)
  9615  		v.AuxInt = int64ToAuxInt(c)
  9616  		v.AddArg(x)
  9617  		return true
  9618  	}
  9619  	// match: (MOVHreg (SRAWconst [c] x))
  9620  	// cond: c>=16
  9621  	// result: (SRAWconst [c] x)
  9622  	for {
  9623  		if v_0.Op != OpPPC64SRAWconst {
  9624  			break
  9625  		}
  9626  		c := auxIntToInt64(v_0.AuxInt)
  9627  		x := v_0.Args[0]
  9628  		if !(c >= 16) {
  9629  			break
  9630  		}
  9631  		v.reset(OpPPC64SRAWconst)
  9632  		v.AuxInt = int64ToAuxInt(c)
  9633  		v.AddArg(x)
  9634  		return true
  9635  	}
  9636  	// match: (MOVHreg (SRWconst [c] x))
  9637  	// cond: c==16
  9638  	// result: (SRAWconst [c] x)
  9639  	for {
  9640  		if v_0.Op != OpPPC64SRWconst {
  9641  			break
  9642  		}
  9643  		c := auxIntToInt64(v_0.AuxInt)
  9644  		x := v_0.Args[0]
  9645  		if !(c == 16) {
  9646  			break
  9647  		}
  9648  		v.reset(OpPPC64SRAWconst)
  9649  		v.AuxInt = int64ToAuxInt(c)
  9650  		v.AddArg(x)
  9651  		return true
  9652  	}
  9653  	// match: (MOVHreg y:(MOVHreg _))
  9654  	// result: y
  9655  	for {
  9656  		y := v_0
  9657  		if y.Op != OpPPC64MOVHreg {
  9658  			break
  9659  		}
  9660  		v.copyOf(y)
  9661  		return true
  9662  	}
  9663  	// match: (MOVHreg y:(MOVBreg _))
  9664  	// result: y
  9665  	for {
  9666  		y := v_0
  9667  		if y.Op != OpPPC64MOVBreg {
  9668  			break
  9669  		}
  9670  		v.copyOf(y)
  9671  		return true
  9672  	}
  9673  	// match: (MOVHreg y:(MOVHZreg x))
  9674  	// result: (MOVHreg x)
  9675  	for {
  9676  		y := v_0
  9677  		if y.Op != OpPPC64MOVHZreg {
  9678  			break
  9679  		}
  9680  		x := y.Args[0]
  9681  		v.reset(OpPPC64MOVHreg)
  9682  		v.AddArg(x)
  9683  		return true
  9684  	}
  9685  	// match: (MOVHreg x:(MOVHload _ _))
  9686  	// result: x
  9687  	for {
  9688  		x := v_0
  9689  		if x.Op != OpPPC64MOVHload {
  9690  			break
  9691  		}
  9692  		v.copyOf(x)
  9693  		return true
  9694  	}
  9695  	// match: (MOVHreg x:(MOVHloadidx _ _ _))
  9696  	// result: x
  9697  	for {
  9698  		x := v_0
  9699  		if x.Op != OpPPC64MOVHloadidx {
  9700  			break
  9701  		}
  9702  		v.copyOf(x)
  9703  		return true
  9704  	}
  9705  	// match: (MOVHreg x:(Arg <t>))
  9706  	// cond: (is8BitInt(t) || is16BitInt(t)) && t.IsSigned()
  9707  	// result: x
  9708  	for {
  9709  		x := v_0
  9710  		if x.Op != OpArg {
  9711  			break
  9712  		}
  9713  		t := x.Type
  9714  		if !((is8BitInt(t) || is16BitInt(t)) && t.IsSigned()) {
  9715  			break
  9716  		}
  9717  		v.copyOf(x)
  9718  		return true
  9719  	}
  9720  	// match: (MOVHreg (MOVDconst [c]))
  9721  	// result: (MOVDconst [int64(int16(c))])
  9722  	for {
  9723  		if v_0.Op != OpPPC64MOVDconst {
  9724  			break
  9725  		}
  9726  		c := auxIntToInt64(v_0.AuxInt)
  9727  		v.reset(OpPPC64MOVDconst)
  9728  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  9729  		return true
  9730  	}
  9731  	return false
  9732  }
  9733  func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
  9734  	v_2 := v.Args[2]
  9735  	v_1 := v.Args[1]
  9736  	v_0 := v.Args[0]
  9737  	b := v.Block
  9738  	// match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
  9739  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9740  	// result: (MOVHstore [off1+int32(off2)] {sym} x val mem)
  9741  	for {
  9742  		off1 := auxIntToInt32(v.AuxInt)
  9743  		sym := auxToSym(v.Aux)
  9744  		if v_0.Op != OpPPC64ADDconst {
  9745  			break
  9746  		}
  9747  		off2 := auxIntToInt64(v_0.AuxInt)
  9748  		x := v_0.Args[0]
  9749  		val := v_1
  9750  		mem := v_2
  9751  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9752  			break
  9753  		}
  9754  		v.reset(OpPPC64MOVHstore)
  9755  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9756  		v.Aux = symToAux(sym)
  9757  		v.AddArg3(x, val, mem)
  9758  		return true
  9759  	}
  9760  	// match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  9761  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9762  	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9763  	for {
  9764  		off1 := auxIntToInt32(v.AuxInt)
  9765  		sym1 := auxToSym(v.Aux)
  9766  		p := v_0
  9767  		if p.Op != OpPPC64MOVDaddr {
  9768  			break
  9769  		}
  9770  		off2 := auxIntToInt32(p.AuxInt)
  9771  		sym2 := auxToSym(p.Aux)
  9772  		ptr := p.Args[0]
  9773  		val := v_1
  9774  		mem := v_2
  9775  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9776  			break
  9777  		}
  9778  		v.reset(OpPPC64MOVHstore)
  9779  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9780  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9781  		v.AddArg3(ptr, val, mem)
  9782  		return true
  9783  	}
  9784  	// match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
  9785  	// result: (MOVHstorezero [off] {sym} ptr mem)
  9786  	for {
  9787  		off := auxIntToInt32(v.AuxInt)
  9788  		sym := auxToSym(v.Aux)
  9789  		ptr := v_0
  9790  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  9791  			break
  9792  		}
  9793  		mem := v_2
  9794  		v.reset(OpPPC64MOVHstorezero)
  9795  		v.AuxInt = int32ToAuxInt(off)
  9796  		v.Aux = symToAux(sym)
  9797  		v.AddArg2(ptr, mem)
  9798  		return true
  9799  	}
  9800  	// match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem)
  9801  	// cond: sym == nil && p.Uses == 1
  9802  	// result: (MOVHstoreidx ptr idx val mem)
  9803  	for {
  9804  		if auxIntToInt32(v.AuxInt) != 0 {
  9805  			break
  9806  		}
  9807  		sym := auxToSym(v.Aux)
  9808  		p := v_0
  9809  		if p.Op != OpPPC64ADD {
  9810  			break
  9811  		}
  9812  		idx := p.Args[1]
  9813  		ptr := p.Args[0]
  9814  		val := v_1
  9815  		mem := v_2
  9816  		if !(sym == nil && p.Uses == 1) {
  9817  			break
  9818  		}
  9819  		v.reset(OpPPC64MOVHstoreidx)
  9820  		v.AddArg4(ptr, idx, val, mem)
  9821  		return true
  9822  	}
  9823  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  9824  	// result: (MOVHstore [off] {sym} ptr x mem)
  9825  	for {
  9826  		off := auxIntToInt32(v.AuxInt)
  9827  		sym := auxToSym(v.Aux)
  9828  		ptr := v_0
  9829  		if v_1.Op != OpPPC64MOVHreg {
  9830  			break
  9831  		}
  9832  		x := v_1.Args[0]
  9833  		mem := v_2
  9834  		v.reset(OpPPC64MOVHstore)
  9835  		v.AuxInt = int32ToAuxInt(off)
  9836  		v.Aux = symToAux(sym)
  9837  		v.AddArg3(ptr, x, mem)
  9838  		return true
  9839  	}
  9840  	// match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
  9841  	// result: (MOVHstore [off] {sym} ptr x mem)
  9842  	for {
  9843  		off := auxIntToInt32(v.AuxInt)
  9844  		sym := auxToSym(v.Aux)
  9845  		ptr := v_0
  9846  		if v_1.Op != OpPPC64MOVHZreg {
  9847  			break
  9848  		}
  9849  		x := v_1.Args[0]
  9850  		mem := v_2
  9851  		v.reset(OpPPC64MOVHstore)
  9852  		v.AuxInt = int32ToAuxInt(off)
  9853  		v.Aux = symToAux(sym)
  9854  		v.AddArg3(ptr, x, mem)
  9855  		return true
  9856  	}
  9857  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  9858  	// result: (MOVHstore [off] {sym} ptr x mem)
  9859  	for {
  9860  		off := auxIntToInt32(v.AuxInt)
  9861  		sym := auxToSym(v.Aux)
  9862  		ptr := v_0
  9863  		if v_1.Op != OpPPC64MOVWreg {
  9864  			break
  9865  		}
  9866  		x := v_1.Args[0]
  9867  		mem := v_2
  9868  		v.reset(OpPPC64MOVHstore)
  9869  		v.AuxInt = int32ToAuxInt(off)
  9870  		v.Aux = symToAux(sym)
  9871  		v.AddArg3(ptr, x, mem)
  9872  		return true
  9873  	}
  9874  	// match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem)
  9875  	// result: (MOVHstore [off] {sym} ptr x mem)
  9876  	for {
  9877  		off := auxIntToInt32(v.AuxInt)
  9878  		sym := auxToSym(v.Aux)
  9879  		ptr := v_0
  9880  		if v_1.Op != OpPPC64MOVWZreg {
  9881  			break
  9882  		}
  9883  		x := v_1.Args[0]
  9884  		mem := v_2
  9885  		v.reset(OpPPC64MOVHstore)
  9886  		v.AuxInt = int32ToAuxInt(off)
  9887  		v.Aux = symToAux(sym)
  9888  		v.AddArg3(ptr, x, mem)
  9889  		return true
  9890  	}
  9891  	// match: (MOVHstore [off] {sym} ptr r:(BRH val) mem)
  9892  	// cond: r.Uses == 1
  9893  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  9894  	for {
  9895  		off := auxIntToInt32(v.AuxInt)
  9896  		sym := auxToSym(v.Aux)
  9897  		ptr := v_0
  9898  		r := v_1
  9899  		if r.Op != OpPPC64BRH {
  9900  			break
  9901  		}
  9902  		val := r.Args[0]
  9903  		mem := v_2
  9904  		if !(r.Uses == 1) {
  9905  			break
  9906  		}
  9907  		v.reset(OpPPC64MOVHBRstore)
  9908  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  9909  		v0.AuxInt = int32ToAuxInt(off)
  9910  		v0.Aux = symToAux(sym)
  9911  		v0.AddArg(ptr)
  9912  		v.AddArg3(v0, val, mem)
  9913  		return true
  9914  	}
  9915  	// match: (MOVHstore [off] {sym} ptr (Bswap16 val) mem)
  9916  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  9917  	for {
  9918  		off := auxIntToInt32(v.AuxInt)
  9919  		sym := auxToSym(v.Aux)
  9920  		ptr := v_0
  9921  		if v_1.Op != OpBswap16 {
  9922  			break
  9923  		}
  9924  		val := v_1.Args[0]
  9925  		mem := v_2
  9926  		v.reset(OpPPC64MOVHBRstore)
  9927  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  9928  		v0.AuxInt = int32ToAuxInt(off)
  9929  		v0.Aux = symToAux(sym)
  9930  		v0.AddArg(ptr)
  9931  		v.AddArg3(v0, val, mem)
  9932  		return true
  9933  	}
  9934  	return false
  9935  }
  9936  func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
  9937  	v_3 := v.Args[3]
  9938  	v_2 := v.Args[2]
  9939  	v_1 := v.Args[1]
  9940  	v_0 := v.Args[0]
  9941  	// match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
  9942  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9943  	// result: (MOVHstore [int32(c)] ptr val mem)
  9944  	for {
  9945  		ptr := v_0
  9946  		if v_1.Op != OpPPC64MOVDconst {
  9947  			break
  9948  		}
  9949  		c := auxIntToInt64(v_1.AuxInt)
  9950  		val := v_2
  9951  		mem := v_3
  9952  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9953  			break
  9954  		}
  9955  		v.reset(OpPPC64MOVHstore)
  9956  		v.AuxInt = int32ToAuxInt(int32(c))
  9957  		v.AddArg3(ptr, val, mem)
  9958  		return true
  9959  	}
  9960  	// match: (MOVHstoreidx (MOVDconst [c]) ptr val mem)
  9961  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9962  	// result: (MOVHstore [int32(c)] ptr val mem)
  9963  	for {
  9964  		if v_0.Op != OpPPC64MOVDconst {
  9965  			break
  9966  		}
  9967  		c := auxIntToInt64(v_0.AuxInt)
  9968  		ptr := v_1
  9969  		val := v_2
  9970  		mem := v_3
  9971  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9972  			break
  9973  		}
  9974  		v.reset(OpPPC64MOVHstore)
  9975  		v.AuxInt = int32ToAuxInt(int32(c))
  9976  		v.AddArg3(ptr, val, mem)
  9977  		return true
  9978  	}
  9979  	// match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
  9980  	// result: (MOVHstoreidx ptr idx x mem)
  9981  	for {
  9982  		ptr := v_0
  9983  		idx := v_1
  9984  		if v_2.Op != OpPPC64MOVHreg {
  9985  			break
  9986  		}
  9987  		x := v_2.Args[0]
  9988  		mem := v_3
  9989  		v.reset(OpPPC64MOVHstoreidx)
  9990  		v.AddArg4(ptr, idx, x, mem)
  9991  		return true
  9992  	}
  9993  	// match: (MOVHstoreidx ptr idx (MOVHZreg x) mem)
  9994  	// result: (MOVHstoreidx ptr idx x mem)
  9995  	for {
  9996  		ptr := v_0
  9997  		idx := v_1
  9998  		if v_2.Op != OpPPC64MOVHZreg {
  9999  			break
 10000  		}
 10001  		x := v_2.Args[0]
 10002  		mem := v_3
 10003  		v.reset(OpPPC64MOVHstoreidx)
 10004  		v.AddArg4(ptr, idx, x, mem)
 10005  		return true
 10006  	}
 10007  	// match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
 10008  	// result: (MOVHstoreidx ptr idx x mem)
 10009  	for {
 10010  		ptr := v_0
 10011  		idx := v_1
 10012  		if v_2.Op != OpPPC64MOVWreg {
 10013  			break
 10014  		}
 10015  		x := v_2.Args[0]
 10016  		mem := v_3
 10017  		v.reset(OpPPC64MOVHstoreidx)
 10018  		v.AddArg4(ptr, idx, x, mem)
 10019  		return true
 10020  	}
 10021  	// match: (MOVHstoreidx ptr idx (MOVWZreg x) mem)
 10022  	// result: (MOVHstoreidx ptr idx x mem)
 10023  	for {
 10024  		ptr := v_0
 10025  		idx := v_1
 10026  		if v_2.Op != OpPPC64MOVWZreg {
 10027  			break
 10028  		}
 10029  		x := v_2.Args[0]
 10030  		mem := v_3
 10031  		v.reset(OpPPC64MOVHstoreidx)
 10032  		v.AddArg4(ptr, idx, x, mem)
 10033  		return true
 10034  	}
 10035  	// match: (MOVHstoreidx ptr idx r:(BRH val) mem)
 10036  	// cond: r.Uses == 1
 10037  	// result: (MOVHBRstoreidx ptr idx val mem)
 10038  	for {
 10039  		ptr := v_0
 10040  		idx := v_1
 10041  		r := v_2
 10042  		if r.Op != OpPPC64BRH {
 10043  			break
 10044  		}
 10045  		val := r.Args[0]
 10046  		mem := v_3
 10047  		if !(r.Uses == 1) {
 10048  			break
 10049  		}
 10050  		v.reset(OpPPC64MOVHBRstoreidx)
 10051  		v.AddArg4(ptr, idx, val, mem)
 10052  		return true
 10053  	}
 10054  	// match: (MOVHstoreidx ptr idx (Bswap16 val) mem)
 10055  	// result: (MOVHBRstoreidx ptr idx val mem)
 10056  	for {
 10057  		ptr := v_0
 10058  		idx := v_1
 10059  		if v_2.Op != OpBswap16 {
 10060  			break
 10061  		}
 10062  		val := v_2.Args[0]
 10063  		mem := v_3
 10064  		v.reset(OpPPC64MOVHBRstoreidx)
 10065  		v.AddArg4(ptr, idx, val, mem)
 10066  		return true
 10067  	}
 10068  	return false
 10069  }
 10070  func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
 10071  	v_1 := v.Args[1]
 10072  	v_0 := v.Args[0]
 10073  	// match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
 10074  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
 10075  	// result: (MOVHstorezero [off1+int32(off2)] {sym} x mem)
 10076  	for {
 10077  		off1 := auxIntToInt32(v.AuxInt)
 10078  		sym := auxToSym(v.Aux)
 10079  		if v_0.Op != OpPPC64ADDconst {
 10080  			break
 10081  		}
 10082  		off2 := auxIntToInt64(v_0.AuxInt)
 10083  		x := v_0.Args[0]
 10084  		mem := v_1
 10085  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
 10086  			break
 10087  		}
 10088  		v.reset(OpPPC64MOVHstorezero)
 10089  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10090  		v.Aux = symToAux(sym)
 10091  		v.AddArg2(x, mem)
 10092  		return true
 10093  	}
 10094  	// match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 10095  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10096  	// result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 10097  	for {
 10098  		off1 := auxIntToInt32(v.AuxInt)
 10099  		sym1 := auxToSym(v.Aux)
 10100  		p := v_0
 10101  		if p.Op != OpPPC64MOVDaddr {
 10102  			break
 10103  		}
 10104  		off2 := auxIntToInt32(p.AuxInt)
 10105  		sym2 := auxToSym(p.Aux)
 10106  		x := p.Args[0]
 10107  		mem := v_1
 10108  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10109  			break
 10110  		}
 10111  		v.reset(OpPPC64MOVHstorezero)
 10112  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10113  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10114  		v.AddArg2(x, mem)
 10115  		return true
 10116  	}
 10117  	return false
 10118  }
 10119  func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
 10120  	v_2 := v.Args[2]
 10121  	v_1 := v.Args[1]
 10122  	v_0 := v.Args[0]
 10123  	// match: (MOVWBRstore ptr (MOVWreg x) mem)
 10124  	// result: (MOVWBRstore ptr x mem)
 10125  	for {
 10126  		ptr := v_0
 10127  		if v_1.Op != OpPPC64MOVWreg {
 10128  			break
 10129  		}
 10130  		x := v_1.Args[0]
 10131  		mem := v_2
 10132  		v.reset(OpPPC64MOVWBRstore)
 10133  		v.AddArg3(ptr, x, mem)
 10134  		return true
 10135  	}
 10136  	// match: (MOVWBRstore ptr (MOVWZreg x) mem)
 10137  	// result: (MOVWBRstore ptr x mem)
 10138  	for {
 10139  		ptr := v_0
 10140  		if v_1.Op != OpPPC64MOVWZreg {
 10141  			break
 10142  		}
 10143  		x := v_1.Args[0]
 10144  		mem := v_2
 10145  		v.reset(OpPPC64MOVWBRstore)
 10146  		v.AddArg3(ptr, x, mem)
 10147  		return true
 10148  	}
 10149  	return false
 10150  }
 10151  func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
 10152  	v_1 := v.Args[1]
 10153  	v_0 := v.Args[0]
 10154  	// match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10155  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10156  	// result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10157  	for {
 10158  		off1 := auxIntToInt32(v.AuxInt)
 10159  		sym1 := auxToSym(v.Aux)
 10160  		p := v_0
 10161  		if p.Op != OpPPC64MOVDaddr {
 10162  			break
 10163  		}
 10164  		off2 := auxIntToInt32(p.AuxInt)
 10165  		sym2 := auxToSym(p.Aux)
 10166  		ptr := p.Args[0]
 10167  		mem := v_1
 10168  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10169  			break
 10170  		}
 10171  		v.reset(OpPPC64MOVWZload)
 10172  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10173  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10174  		v.AddArg2(ptr, mem)
 10175  		return true
 10176  	}
 10177  	// match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
 10178  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10179  	// result: (MOVWZload [off1+int32(off2)] {sym} x mem)
 10180  	for {
 10181  		off1 := auxIntToInt32(v.AuxInt)
 10182  		sym := auxToSym(v.Aux)
 10183  		if v_0.Op != OpPPC64ADDconst {
 10184  			break
 10185  		}
 10186  		off2 := auxIntToInt64(v_0.AuxInt)
 10187  		x := v_0.Args[0]
 10188  		mem := v_1
 10189  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10190  			break
 10191  		}
 10192  		v.reset(OpPPC64MOVWZload)
 10193  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10194  		v.Aux = symToAux(sym)
 10195  		v.AddArg2(x, mem)
 10196  		return true
 10197  	}
 10198  	// match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem)
 10199  	// cond: sym == nil && p.Uses == 1
 10200  	// result: (MOVWZloadidx ptr idx mem)
 10201  	for {
 10202  		if auxIntToInt32(v.AuxInt) != 0 {
 10203  			break
 10204  		}
 10205  		sym := auxToSym(v.Aux)
 10206  		p := v_0
 10207  		if p.Op != OpPPC64ADD {
 10208  			break
 10209  		}
 10210  		idx := p.Args[1]
 10211  		ptr := p.Args[0]
 10212  		mem := v_1
 10213  		if !(sym == nil && p.Uses == 1) {
 10214  			break
 10215  		}
 10216  		v.reset(OpPPC64MOVWZloadidx)
 10217  		v.AddArg3(ptr, idx, mem)
 10218  		return true
 10219  	}
 10220  	return false
 10221  }
 10222  func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
 10223  	v_2 := v.Args[2]
 10224  	v_1 := v.Args[1]
 10225  	v_0 := v.Args[0]
 10226  	// match: (MOVWZloadidx ptr (MOVDconst [c]) mem)
 10227  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10228  	// result: (MOVWZload [int32(c)] ptr mem)
 10229  	for {
 10230  		ptr := v_0
 10231  		if v_1.Op != OpPPC64MOVDconst {
 10232  			break
 10233  		}
 10234  		c := auxIntToInt64(v_1.AuxInt)
 10235  		mem := v_2
 10236  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10237  			break
 10238  		}
 10239  		v.reset(OpPPC64MOVWZload)
 10240  		v.AuxInt = int32ToAuxInt(int32(c))
 10241  		v.AddArg2(ptr, mem)
 10242  		return true
 10243  	}
 10244  	// match: (MOVWZloadidx (MOVDconst [c]) ptr mem)
 10245  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10246  	// result: (MOVWZload [int32(c)] ptr mem)
 10247  	for {
 10248  		if v_0.Op != OpPPC64MOVDconst {
 10249  			break
 10250  		}
 10251  		c := auxIntToInt64(v_0.AuxInt)
 10252  		ptr := v_1
 10253  		mem := v_2
 10254  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10255  			break
 10256  		}
 10257  		v.reset(OpPPC64MOVWZload)
 10258  		v.AuxInt = int32ToAuxInt(int32(c))
 10259  		v.AddArg2(ptr, mem)
 10260  		return true
 10261  	}
 10262  	return false
 10263  }
 10264  func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
 10265  	v_0 := v.Args[0]
 10266  	b := v.Block
 10267  	typ := &b.Func.Config.Types
 10268  	// match: (MOVWZreg y:(ANDconst [c] _))
 10269  	// cond: uint64(c) <= 0xFFFFFFFF
 10270  	// result: y
 10271  	for {
 10272  		y := v_0
 10273  		if y.Op != OpPPC64ANDconst {
 10274  			break
 10275  		}
 10276  		c := auxIntToInt64(y.AuxInt)
 10277  		if !(uint64(c) <= 0xFFFFFFFF) {
 10278  			break
 10279  		}
 10280  		v.copyOf(y)
 10281  		return true
 10282  	}
 10283  	// match: (MOVWZreg y:(AND (MOVDconst [c]) _))
 10284  	// cond: uint64(c) <= 0xFFFFFFFF
 10285  	// result: y
 10286  	for {
 10287  		y := v_0
 10288  		if y.Op != OpPPC64AND {
 10289  			break
 10290  		}
 10291  		y_0 := y.Args[0]
 10292  		y_1 := y.Args[1]
 10293  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10294  			if y_0.Op != OpPPC64MOVDconst {
 10295  				continue
 10296  			}
 10297  			c := auxIntToInt64(y_0.AuxInt)
 10298  			if !(uint64(c) <= 0xFFFFFFFF) {
 10299  				continue
 10300  			}
 10301  			v.copyOf(y)
 10302  			return true
 10303  		}
 10304  		break
 10305  	}
 10306  	// match: (MOVWZreg (SRWconst [c] (MOVBZreg x)))
 10307  	// result: (SRWconst [c] (MOVBZreg x))
 10308  	for {
 10309  		if v_0.Op != OpPPC64SRWconst {
 10310  			break
 10311  		}
 10312  		c := auxIntToInt64(v_0.AuxInt)
 10313  		v_0_0 := v_0.Args[0]
 10314  		if v_0_0.Op != OpPPC64MOVBZreg {
 10315  			break
 10316  		}
 10317  		x := v_0_0.Args[0]
 10318  		v.reset(OpPPC64SRWconst)
 10319  		v.AuxInt = int64ToAuxInt(c)
 10320  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 10321  		v0.AddArg(x)
 10322  		v.AddArg(v0)
 10323  		return true
 10324  	}
 10325  	// match: (MOVWZreg (SRWconst [c] (MOVHZreg x)))
 10326  	// result: (SRWconst [c] (MOVHZreg x))
 10327  	for {
 10328  		if v_0.Op != OpPPC64SRWconst {
 10329  			break
 10330  		}
 10331  		c := auxIntToInt64(v_0.AuxInt)
 10332  		v_0_0 := v_0.Args[0]
 10333  		if v_0_0.Op != OpPPC64MOVHZreg {
 10334  			break
 10335  		}
 10336  		x := v_0_0.Args[0]
 10337  		v.reset(OpPPC64SRWconst)
 10338  		v.AuxInt = int64ToAuxInt(c)
 10339  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 10340  		v0.AddArg(x)
 10341  		v.AddArg(v0)
 10342  		return true
 10343  	}
 10344  	// match: (MOVWZreg (SRWconst [c] (MOVWZreg x)))
 10345  	// result: (SRWconst [c] (MOVWZreg x))
 10346  	for {
 10347  		if v_0.Op != OpPPC64SRWconst {
 10348  			break
 10349  		}
 10350  		c := auxIntToInt64(v_0.AuxInt)
 10351  		v_0_0 := v_0.Args[0]
 10352  		if v_0_0.Op != OpPPC64MOVWZreg {
 10353  			break
 10354  		}
 10355  		x := v_0_0.Args[0]
 10356  		v.reset(OpPPC64SRWconst)
 10357  		v.AuxInt = int64ToAuxInt(c)
 10358  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 10359  		v0.AddArg(x)
 10360  		v.AddArg(v0)
 10361  		return true
 10362  	}
 10363  	// match: (MOVWZreg (SRWconst [c] x))
 10364  	// cond: x.Type.Size() <= 32
 10365  	// result: (SRWconst [c] x)
 10366  	for {
 10367  		if v_0.Op != OpPPC64SRWconst {
 10368  			break
 10369  		}
 10370  		c := auxIntToInt64(v_0.AuxInt)
 10371  		x := v_0.Args[0]
 10372  		if !(x.Type.Size() <= 32) {
 10373  			break
 10374  		}
 10375  		v.reset(OpPPC64SRWconst)
 10376  		v.AuxInt = int64ToAuxInt(c)
 10377  		v.AddArg(x)
 10378  		return true
 10379  	}
 10380  	// match: (MOVWZreg (SRDconst [c] x))
 10381  	// cond: c>=32
 10382  	// result: (SRDconst [c] x)
 10383  	for {
 10384  		if v_0.Op != OpPPC64SRDconst {
 10385  			break
 10386  		}
 10387  		c := auxIntToInt64(v_0.AuxInt)
 10388  		x := v_0.Args[0]
 10389  		if !(c >= 32) {
 10390  			break
 10391  		}
 10392  		v.reset(OpPPC64SRDconst)
 10393  		v.AuxInt = int64ToAuxInt(c)
 10394  		v.AddArg(x)
 10395  		return true
 10396  	}
 10397  	// match: (MOVWZreg (RLWINM [r] y))
 10398  	// cond: mergePPC64MovwzregRlwinm(r) != 0
 10399  	// result: (RLWINM [mergePPC64MovwzregRlwinm(r)] y)
 10400  	for {
 10401  		if v_0.Op != OpPPC64RLWINM {
 10402  			break
 10403  		}
 10404  		r := auxIntToInt64(v_0.AuxInt)
 10405  		y := v_0.Args[0]
 10406  		if !(mergePPC64MovwzregRlwinm(r) != 0) {
 10407  			break
 10408  		}
 10409  		v.reset(OpPPC64RLWINM)
 10410  		v.AuxInt = int64ToAuxInt(mergePPC64MovwzregRlwinm(r))
 10411  		v.AddArg(y)
 10412  		return true
 10413  	}
 10414  	// match: (MOVWZreg w:(SLWconst u))
 10415  	// result: w
 10416  	for {
 10417  		w := v_0
 10418  		if w.Op != OpPPC64SLWconst {
 10419  			break
 10420  		}
 10421  		v.copyOf(w)
 10422  		return true
 10423  	}
 10424  	// match: (MOVWZreg y:(MOVWZreg _))
 10425  	// result: y
 10426  	for {
 10427  		y := v_0
 10428  		if y.Op != OpPPC64MOVWZreg {
 10429  			break
 10430  		}
 10431  		v.copyOf(y)
 10432  		return true
 10433  	}
 10434  	// match: (MOVWZreg y:(MOVHZreg _))
 10435  	// result: y
 10436  	for {
 10437  		y := v_0
 10438  		if y.Op != OpPPC64MOVHZreg {
 10439  			break
 10440  		}
 10441  		v.copyOf(y)
 10442  		return true
 10443  	}
 10444  	// match: (MOVWZreg y:(MOVBZreg _))
 10445  	// result: y
 10446  	for {
 10447  		y := v_0
 10448  		if y.Op != OpPPC64MOVBZreg {
 10449  			break
 10450  		}
 10451  		v.copyOf(y)
 10452  		return true
 10453  	}
 10454  	// match: (MOVWZreg y:(MOVHBRload _ _))
 10455  	// result: y
 10456  	for {
 10457  		y := v_0
 10458  		if y.Op != OpPPC64MOVHBRload {
 10459  			break
 10460  		}
 10461  		v.copyOf(y)
 10462  		return true
 10463  	}
 10464  	// match: (MOVWZreg y:(MOVWBRload _ _))
 10465  	// result: y
 10466  	for {
 10467  		y := v_0
 10468  		if y.Op != OpPPC64MOVWBRload {
 10469  			break
 10470  		}
 10471  		v.copyOf(y)
 10472  		return true
 10473  	}
 10474  	// match: (MOVWZreg y:(MOVWreg x))
 10475  	// result: (MOVWZreg x)
 10476  	for {
 10477  		y := v_0
 10478  		if y.Op != OpPPC64MOVWreg {
 10479  			break
 10480  		}
 10481  		x := y.Args[0]
 10482  		v.reset(OpPPC64MOVWZreg)
 10483  		v.AddArg(x)
 10484  		return true
 10485  	}
 10486  	// match: (MOVWZreg (OR <t> x (MOVWZreg y)))
 10487  	// result: (MOVWZreg (OR <t> x y))
 10488  	for {
 10489  		if v_0.Op != OpPPC64OR {
 10490  			break
 10491  		}
 10492  		t := v_0.Type
 10493  		_ = v_0.Args[1]
 10494  		v_0_0 := v_0.Args[0]
 10495  		v_0_1 := v_0.Args[1]
 10496  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10497  			x := v_0_0
 10498  			if v_0_1.Op != OpPPC64MOVWZreg {
 10499  				continue
 10500  			}
 10501  			y := v_0_1.Args[0]
 10502  			v.reset(OpPPC64MOVWZreg)
 10503  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
 10504  			v0.AddArg2(x, y)
 10505  			v.AddArg(v0)
 10506  			return true
 10507  		}
 10508  		break
 10509  	}
 10510  	// match: (MOVWZreg (XOR <t> x (MOVWZreg y)))
 10511  	// result: (MOVWZreg (XOR <t> x y))
 10512  	for {
 10513  		if v_0.Op != OpPPC64XOR {
 10514  			break
 10515  		}
 10516  		t := v_0.Type
 10517  		_ = v_0.Args[1]
 10518  		v_0_0 := v_0.Args[0]
 10519  		v_0_1 := v_0.Args[1]
 10520  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10521  			x := v_0_0
 10522  			if v_0_1.Op != OpPPC64MOVWZreg {
 10523  				continue
 10524  			}
 10525  			y := v_0_1.Args[0]
 10526  			v.reset(OpPPC64MOVWZreg)
 10527  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
 10528  			v0.AddArg2(x, y)
 10529  			v.AddArg(v0)
 10530  			return true
 10531  		}
 10532  		break
 10533  	}
 10534  	// match: (MOVWZreg (AND <t> x (MOVWZreg y)))
 10535  	// result: (MOVWZreg (AND <t> x y))
 10536  	for {
 10537  		if v_0.Op != OpPPC64AND {
 10538  			break
 10539  		}
 10540  		t := v_0.Type
 10541  		_ = v_0.Args[1]
 10542  		v_0_0 := v_0.Args[0]
 10543  		v_0_1 := v_0.Args[1]
 10544  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10545  			x := v_0_0
 10546  			if v_0_1.Op != OpPPC64MOVWZreg {
 10547  				continue
 10548  			}
 10549  			y := v_0_1.Args[0]
 10550  			v.reset(OpPPC64MOVWZreg)
 10551  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
 10552  			v0.AddArg2(x, y)
 10553  			v.AddArg(v0)
 10554  			return true
 10555  		}
 10556  		break
 10557  	}
 10558  	// match: (MOVWZreg z:(ANDconst [c] (MOVBZload ptr x)))
 10559  	// result: z
 10560  	for {
 10561  		z := v_0
 10562  		if z.Op != OpPPC64ANDconst {
 10563  			break
 10564  		}
 10565  		z_0 := z.Args[0]
 10566  		if z_0.Op != OpPPC64MOVBZload {
 10567  			break
 10568  		}
 10569  		v.copyOf(z)
 10570  		return true
 10571  	}
 10572  	// match: (MOVWZreg z:(AND y (MOVWZload ptr x)))
 10573  	// result: z
 10574  	for {
 10575  		z := v_0
 10576  		if z.Op != OpPPC64AND {
 10577  			break
 10578  		}
 10579  		_ = z.Args[1]
 10580  		z_0 := z.Args[0]
 10581  		z_1 := z.Args[1]
 10582  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 10583  			if z_1.Op != OpPPC64MOVWZload {
 10584  				continue
 10585  			}
 10586  			v.copyOf(z)
 10587  			return true
 10588  		}
 10589  		break
 10590  	}
 10591  	// match: (MOVWZreg z:(ANDconst [c] (MOVHZload ptr x)))
 10592  	// result: z
 10593  	for {
 10594  		z := v_0
 10595  		if z.Op != OpPPC64ANDconst {
 10596  			break
 10597  		}
 10598  		z_0 := z.Args[0]
 10599  		if z_0.Op != OpPPC64MOVHZload {
 10600  			break
 10601  		}
 10602  		v.copyOf(z)
 10603  		return true
 10604  	}
 10605  	// match: (MOVWZreg z:(ANDconst [c] (MOVWZload ptr x)))
 10606  	// result: z
 10607  	for {
 10608  		z := v_0
 10609  		if z.Op != OpPPC64ANDconst {
 10610  			break
 10611  		}
 10612  		z_0 := z.Args[0]
 10613  		if z_0.Op != OpPPC64MOVWZload {
 10614  			break
 10615  		}
 10616  		v.copyOf(z)
 10617  		return true
 10618  	}
 10619  	// match: (MOVWZreg x:(MOVBZload _ _))
 10620  	// result: x
 10621  	for {
 10622  		x := v_0
 10623  		if x.Op != OpPPC64MOVBZload {
 10624  			break
 10625  		}
 10626  		v.copyOf(x)
 10627  		return true
 10628  	}
 10629  	// match: (MOVWZreg x:(MOVBZloadidx _ _ _))
 10630  	// result: x
 10631  	for {
 10632  		x := v_0
 10633  		if x.Op != OpPPC64MOVBZloadidx {
 10634  			break
 10635  		}
 10636  		v.copyOf(x)
 10637  		return true
 10638  	}
 10639  	// match: (MOVWZreg x:(MOVHZload _ _))
 10640  	// result: x
 10641  	for {
 10642  		x := v_0
 10643  		if x.Op != OpPPC64MOVHZload {
 10644  			break
 10645  		}
 10646  		v.copyOf(x)
 10647  		return true
 10648  	}
 10649  	// match: (MOVWZreg x:(MOVHZloadidx _ _ _))
 10650  	// result: x
 10651  	for {
 10652  		x := v_0
 10653  		if x.Op != OpPPC64MOVHZloadidx {
 10654  			break
 10655  		}
 10656  		v.copyOf(x)
 10657  		return true
 10658  	}
 10659  	// match: (MOVWZreg x:(MOVWZload _ _))
 10660  	// result: x
 10661  	for {
 10662  		x := v_0
 10663  		if x.Op != OpPPC64MOVWZload {
 10664  			break
 10665  		}
 10666  		v.copyOf(x)
 10667  		return true
 10668  	}
 10669  	// match: (MOVWZreg x:(MOVWZloadidx _ _ _))
 10670  	// result: x
 10671  	for {
 10672  		x := v_0
 10673  		if x.Op != OpPPC64MOVWZloadidx {
 10674  			break
 10675  		}
 10676  		v.copyOf(x)
 10677  		return true
 10678  	}
 10679  	// match: (MOVWZreg x:(Select0 (LoweredAtomicLoad32 _ _)))
 10680  	// result: x
 10681  	for {
 10682  		x := v_0
 10683  		if x.Op != OpSelect0 {
 10684  			break
 10685  		}
 10686  		x_0 := x.Args[0]
 10687  		if x_0.Op != OpPPC64LoweredAtomicLoad32 {
 10688  			break
 10689  		}
 10690  		v.copyOf(x)
 10691  		return true
 10692  	}
 10693  	// match: (MOVWZreg x:(Arg <t>))
 10694  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()
 10695  	// result: x
 10696  	for {
 10697  		x := v_0
 10698  		if x.Op != OpArg {
 10699  			break
 10700  		}
 10701  		t := x.Type
 10702  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()) {
 10703  			break
 10704  		}
 10705  		v.copyOf(x)
 10706  		return true
 10707  	}
 10708  	// match: (MOVWZreg (MOVDconst [c]))
 10709  	// result: (MOVDconst [int64(uint32(c))])
 10710  	for {
 10711  		if v_0.Op != OpPPC64MOVDconst {
 10712  			break
 10713  		}
 10714  		c := auxIntToInt64(v_0.AuxInt)
 10715  		v.reset(OpPPC64MOVDconst)
 10716  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
 10717  		return true
 10718  	}
 10719  	return false
 10720  }
 10721  func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
 10722  	v_1 := v.Args[1]
 10723  	v_0 := v.Args[0]
 10724  	// match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10725  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10726  	// result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10727  	for {
 10728  		off1 := auxIntToInt32(v.AuxInt)
 10729  		sym1 := auxToSym(v.Aux)
 10730  		p := v_0
 10731  		if p.Op != OpPPC64MOVDaddr {
 10732  			break
 10733  		}
 10734  		off2 := auxIntToInt32(p.AuxInt)
 10735  		sym2 := auxToSym(p.Aux)
 10736  		ptr := p.Args[0]
 10737  		mem := v_1
 10738  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10739  			break
 10740  		}
 10741  		v.reset(OpPPC64MOVWload)
 10742  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10743  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10744  		v.AddArg2(ptr, mem)
 10745  		return true
 10746  	}
 10747  	// match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
 10748  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10749  	// result: (MOVWload [off1+int32(off2)] {sym} x mem)
 10750  	for {
 10751  		off1 := auxIntToInt32(v.AuxInt)
 10752  		sym := auxToSym(v.Aux)
 10753  		if v_0.Op != OpPPC64ADDconst {
 10754  			break
 10755  		}
 10756  		off2 := auxIntToInt64(v_0.AuxInt)
 10757  		x := v_0.Args[0]
 10758  		mem := v_1
 10759  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10760  			break
 10761  		}
 10762  		v.reset(OpPPC64MOVWload)
 10763  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10764  		v.Aux = symToAux(sym)
 10765  		v.AddArg2(x, mem)
 10766  		return true
 10767  	}
 10768  	// match: (MOVWload [0] {sym} p:(ADD ptr idx) mem)
 10769  	// cond: sym == nil && p.Uses == 1
 10770  	// result: (MOVWloadidx ptr idx mem)
 10771  	for {
 10772  		if auxIntToInt32(v.AuxInt) != 0 {
 10773  			break
 10774  		}
 10775  		sym := auxToSym(v.Aux)
 10776  		p := v_0
 10777  		if p.Op != OpPPC64ADD {
 10778  			break
 10779  		}
 10780  		idx := p.Args[1]
 10781  		ptr := p.Args[0]
 10782  		mem := v_1
 10783  		if !(sym == nil && p.Uses == 1) {
 10784  			break
 10785  		}
 10786  		v.reset(OpPPC64MOVWloadidx)
 10787  		v.AddArg3(ptr, idx, mem)
 10788  		return true
 10789  	}
 10790  	return false
 10791  }
 10792  func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
 10793  	v_2 := v.Args[2]
 10794  	v_1 := v.Args[1]
 10795  	v_0 := v.Args[0]
 10796  	// match: (MOVWloadidx ptr (MOVDconst [c]) mem)
 10797  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10798  	// result: (MOVWload [int32(c)] ptr mem)
 10799  	for {
 10800  		ptr := v_0
 10801  		if v_1.Op != OpPPC64MOVDconst {
 10802  			break
 10803  		}
 10804  		c := auxIntToInt64(v_1.AuxInt)
 10805  		mem := v_2
 10806  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10807  			break
 10808  		}
 10809  		v.reset(OpPPC64MOVWload)
 10810  		v.AuxInt = int32ToAuxInt(int32(c))
 10811  		v.AddArg2(ptr, mem)
 10812  		return true
 10813  	}
 10814  	// match: (MOVWloadidx (MOVDconst [c]) ptr mem)
 10815  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10816  	// result: (MOVWload [int32(c)] ptr mem)
 10817  	for {
 10818  		if v_0.Op != OpPPC64MOVDconst {
 10819  			break
 10820  		}
 10821  		c := auxIntToInt64(v_0.AuxInt)
 10822  		ptr := v_1
 10823  		mem := v_2
 10824  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10825  			break
 10826  		}
 10827  		v.reset(OpPPC64MOVWload)
 10828  		v.AuxInt = int32ToAuxInt(int32(c))
 10829  		v.AddArg2(ptr, mem)
 10830  		return true
 10831  	}
 10832  	return false
 10833  }
 10834  func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
 10835  	v_0 := v.Args[0]
 10836  	b := v.Block
 10837  	typ := &b.Func.Config.Types
 10838  	// match: (MOVWreg y:(ANDconst [c] _))
 10839  	// cond: uint64(c) <= 0xFFFF
 10840  	// result: y
 10841  	for {
 10842  		y := v_0
 10843  		if y.Op != OpPPC64ANDconst {
 10844  			break
 10845  		}
 10846  		c := auxIntToInt64(y.AuxInt)
 10847  		if !(uint64(c) <= 0xFFFF) {
 10848  			break
 10849  		}
 10850  		v.copyOf(y)
 10851  		return true
 10852  	}
 10853  	// match: (MOVWreg y:(AND (MOVDconst [c]) _))
 10854  	// cond: uint64(c) <= 0x7FFFFFFF
 10855  	// result: y
 10856  	for {
 10857  		y := v_0
 10858  		if y.Op != OpPPC64AND {
 10859  			break
 10860  		}
 10861  		y_0 := y.Args[0]
 10862  		y_1 := y.Args[1]
 10863  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10864  			if y_0.Op != OpPPC64MOVDconst {
 10865  				continue
 10866  			}
 10867  			c := auxIntToInt64(y_0.AuxInt)
 10868  			if !(uint64(c) <= 0x7FFFFFFF) {
 10869  				continue
 10870  			}
 10871  			v.copyOf(y)
 10872  			return true
 10873  		}
 10874  		break
 10875  	}
 10876  	// match: (MOVWreg (SRAWconst [c] (MOVBreg x)))
 10877  	// result: (SRAWconst [c] (MOVBreg x))
 10878  	for {
 10879  		if v_0.Op != OpPPC64SRAWconst {
 10880  			break
 10881  		}
 10882  		c := auxIntToInt64(v_0.AuxInt)
 10883  		v_0_0 := v_0.Args[0]
 10884  		if v_0_0.Op != OpPPC64MOVBreg {
 10885  			break
 10886  		}
 10887  		x := v_0_0.Args[0]
 10888  		v.reset(OpPPC64SRAWconst)
 10889  		v.AuxInt = int64ToAuxInt(c)
 10890  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 10891  		v0.AddArg(x)
 10892  		v.AddArg(v0)
 10893  		return true
 10894  	}
 10895  	// match: (MOVWreg (SRAWconst [c] (MOVHreg x)))
 10896  	// result: (SRAWconst [c] (MOVHreg x))
 10897  	for {
 10898  		if v_0.Op != OpPPC64SRAWconst {
 10899  			break
 10900  		}
 10901  		c := auxIntToInt64(v_0.AuxInt)
 10902  		v_0_0 := v_0.Args[0]
 10903  		if v_0_0.Op != OpPPC64MOVHreg {
 10904  			break
 10905  		}
 10906  		x := v_0_0.Args[0]
 10907  		v.reset(OpPPC64SRAWconst)
 10908  		v.AuxInt = int64ToAuxInt(c)
 10909  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 10910  		v0.AddArg(x)
 10911  		v.AddArg(v0)
 10912  		return true
 10913  	}
 10914  	// match: (MOVWreg (SRAWconst [c] (MOVWreg x)))
 10915  	// result: (SRAWconst [c] (MOVWreg x))
 10916  	for {
 10917  		if v_0.Op != OpPPC64SRAWconst {
 10918  			break
 10919  		}
 10920  		c := auxIntToInt64(v_0.AuxInt)
 10921  		v_0_0 := v_0.Args[0]
 10922  		if v_0_0.Op != OpPPC64MOVWreg {
 10923  			break
 10924  		}
 10925  		x := v_0_0.Args[0]
 10926  		v.reset(OpPPC64SRAWconst)
 10927  		v.AuxInt = int64ToAuxInt(c)
 10928  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
 10929  		v0.AddArg(x)
 10930  		v.AddArg(v0)
 10931  		return true
 10932  	}
 10933  	// match: (MOVWreg (SRAWconst [c] x))
 10934  	// cond: x.Type.Size() <= 32
 10935  	// result: (SRAWconst [c] x)
 10936  	for {
 10937  		if v_0.Op != OpPPC64SRAWconst {
 10938  			break
 10939  		}
 10940  		c := auxIntToInt64(v_0.AuxInt)
 10941  		x := v_0.Args[0]
 10942  		if !(x.Type.Size() <= 32) {
 10943  			break
 10944  		}
 10945  		v.reset(OpPPC64SRAWconst)
 10946  		v.AuxInt = int64ToAuxInt(c)
 10947  		v.AddArg(x)
 10948  		return true
 10949  	}
 10950  	// match: (MOVWreg (SRDconst [c] x))
 10951  	// cond: c>32
 10952  	// result: (SRDconst [c] x)
 10953  	for {
 10954  		if v_0.Op != OpPPC64SRDconst {
 10955  			break
 10956  		}
 10957  		c := auxIntToInt64(v_0.AuxInt)
 10958  		x := v_0.Args[0]
 10959  		if !(c > 32) {
 10960  			break
 10961  		}
 10962  		v.reset(OpPPC64SRDconst)
 10963  		v.AuxInt = int64ToAuxInt(c)
 10964  		v.AddArg(x)
 10965  		return true
 10966  	}
 10967  	// match: (MOVWreg (SRADconst [c] x))
 10968  	// cond: c>=32
 10969  	// result: (SRADconst [c] x)
 10970  	for {
 10971  		if v_0.Op != OpPPC64SRADconst {
 10972  			break
 10973  		}
 10974  		c := auxIntToInt64(v_0.AuxInt)
 10975  		x := v_0.Args[0]
 10976  		if !(c >= 32) {
 10977  			break
 10978  		}
 10979  		v.reset(OpPPC64SRADconst)
 10980  		v.AuxInt = int64ToAuxInt(c)
 10981  		v.AddArg(x)
 10982  		return true
 10983  	}
 10984  	// match: (MOVWreg (SRDconst [c] x))
 10985  	// cond: c==32
 10986  	// result: (SRADconst [c] x)
 10987  	for {
 10988  		if v_0.Op != OpPPC64SRDconst {
 10989  			break
 10990  		}
 10991  		c := auxIntToInt64(v_0.AuxInt)
 10992  		x := v_0.Args[0]
 10993  		if !(c == 32) {
 10994  			break
 10995  		}
 10996  		v.reset(OpPPC64SRADconst)
 10997  		v.AuxInt = int64ToAuxInt(c)
 10998  		v.AddArg(x)
 10999  		return true
 11000  	}
 11001  	// match: (MOVWreg y:(MOVWreg _))
 11002  	// result: y
 11003  	for {
 11004  		y := v_0
 11005  		if y.Op != OpPPC64MOVWreg {
 11006  			break
 11007  		}
 11008  		v.copyOf(y)
 11009  		return true
 11010  	}
 11011  	// match: (MOVWreg y:(MOVHreg _))
 11012  	// result: y
 11013  	for {
 11014  		y := v_0
 11015  		if y.Op != OpPPC64MOVHreg {
 11016  			break
 11017  		}
 11018  		v.copyOf(y)
 11019  		return true
 11020  	}
 11021  	// match: (MOVWreg y:(MOVBreg _))
 11022  	// result: y
 11023  	for {
 11024  		y := v_0
 11025  		if y.Op != OpPPC64MOVBreg {
 11026  			break
 11027  		}
 11028  		v.copyOf(y)
 11029  		return true
 11030  	}
 11031  	// match: (MOVWreg y:(MOVWZreg x))
 11032  	// result: (MOVWreg x)
 11033  	for {
 11034  		y := v_0
 11035  		if y.Op != OpPPC64MOVWZreg {
 11036  			break
 11037  		}
 11038  		x := y.Args[0]
 11039  		v.reset(OpPPC64MOVWreg)
 11040  		v.AddArg(x)
 11041  		return true
 11042  	}
 11043  	// match: (MOVWreg x:(MOVHload _ _))
 11044  	// result: x
 11045  	for {
 11046  		x := v_0
 11047  		if x.Op != OpPPC64MOVHload {
 11048  			break
 11049  		}
 11050  		v.copyOf(x)
 11051  		return true
 11052  	}
 11053  	// match: (MOVWreg x:(MOVHloadidx _ _ _))
 11054  	// result: x
 11055  	for {
 11056  		x := v_0
 11057  		if x.Op != OpPPC64MOVHloadidx {
 11058  			break
 11059  		}
 11060  		v.copyOf(x)
 11061  		return true
 11062  	}
 11063  	// match: (MOVWreg x:(MOVWload _ _))
 11064  	// result: x
 11065  	for {
 11066  		x := v_0
 11067  		if x.Op != OpPPC64MOVWload {
 11068  			break
 11069  		}
 11070  		v.copyOf(x)
 11071  		return true
 11072  	}
 11073  	// match: (MOVWreg x:(MOVWloadidx _ _ _))
 11074  	// result: x
 11075  	for {
 11076  		x := v_0
 11077  		if x.Op != OpPPC64MOVWloadidx {
 11078  			break
 11079  		}
 11080  		v.copyOf(x)
 11081  		return true
 11082  	}
 11083  	// match: (MOVWreg x:(Arg <t>))
 11084  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()
 11085  	// result: x
 11086  	for {
 11087  		x := v_0
 11088  		if x.Op != OpArg {
 11089  			break
 11090  		}
 11091  		t := x.Type
 11092  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()) {
 11093  			break
 11094  		}
 11095  		v.copyOf(x)
 11096  		return true
 11097  	}
 11098  	// match: (MOVWreg (MOVDconst [c]))
 11099  	// result: (MOVDconst [int64(int32(c))])
 11100  	for {
 11101  		if v_0.Op != OpPPC64MOVDconst {
 11102  			break
 11103  		}
 11104  		c := auxIntToInt64(v_0.AuxInt)
 11105  		v.reset(OpPPC64MOVDconst)
 11106  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
 11107  		return true
 11108  	}
 11109  	return false
 11110  }
 11111  func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
 11112  	v_2 := v.Args[2]
 11113  	v_1 := v.Args[1]
 11114  	v_0 := v.Args[0]
 11115  	b := v.Block
 11116  	// match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
 11117  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 11118  	// result: (MOVWstore [off1+int32(off2)] {sym} x val mem)
 11119  	for {
 11120  		off1 := auxIntToInt32(v.AuxInt)
 11121  		sym := auxToSym(v.Aux)
 11122  		if v_0.Op != OpPPC64ADDconst {
 11123  			break
 11124  		}
 11125  		off2 := auxIntToInt64(v_0.AuxInt)
 11126  		x := v_0.Args[0]
 11127  		val := v_1
 11128  		mem := v_2
 11129  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 11130  			break
 11131  		}
 11132  		v.reset(OpPPC64MOVWstore)
 11133  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11134  		v.Aux = symToAux(sym)
 11135  		v.AddArg3(x, val, mem)
 11136  		return true
 11137  	}
 11138  	// match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
 11139  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 11140  	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 11141  	for {
 11142  		off1 := auxIntToInt32(v.AuxInt)
 11143  		sym1 := auxToSym(v.Aux)
 11144  		p := v_0
 11145  		if p.Op != OpPPC64MOVDaddr {
 11146  			break
 11147  		}
 11148  		off2 := auxIntToInt32(p.AuxInt)
 11149  		sym2 := auxToSym(p.Aux)
 11150  		ptr := p.Args[0]
 11151  		val := v_1
 11152  		mem := v_2
 11153  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 11154  			break
 11155  		}
 11156  		v.reset(OpPPC64MOVWstore)
 11157  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11158  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11159  		v.AddArg3(ptr, val, mem)
 11160  		return true
 11161  	}
 11162  	// match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
 11163  	// result: (MOVWstorezero [off] {sym} ptr mem)
 11164  	for {
 11165  		off := auxIntToInt32(v.AuxInt)
 11166  		sym := auxToSym(v.Aux)
 11167  		ptr := v_0
 11168  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 11169  			break
 11170  		}
 11171  		mem := v_2
 11172  		v.reset(OpPPC64MOVWstorezero)
 11173  		v.AuxInt = int32ToAuxInt(off)
 11174  		v.Aux = symToAux(sym)
 11175  		v.AddArg2(ptr, mem)
 11176  		return true
 11177  	}
 11178  	// match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem)
 11179  	// cond: sym == nil && p.Uses == 1
 11180  	// result: (MOVWstoreidx ptr idx val mem)
 11181  	for {
 11182  		if auxIntToInt32(v.AuxInt) != 0 {
 11183  			break
 11184  		}
 11185  		sym := auxToSym(v.Aux)
 11186  		p := v_0
 11187  		if p.Op != OpPPC64ADD {
 11188  			break
 11189  		}
 11190  		idx := p.Args[1]
 11191  		ptr := p.Args[0]
 11192  		val := v_1
 11193  		mem := v_2
 11194  		if !(sym == nil && p.Uses == 1) {
 11195  			break
 11196  		}
 11197  		v.reset(OpPPC64MOVWstoreidx)
 11198  		v.AddArg4(ptr, idx, val, mem)
 11199  		return true
 11200  	}
 11201  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
 11202  	// result: (MOVWstore [off] {sym} ptr x mem)
 11203  	for {
 11204  		off := auxIntToInt32(v.AuxInt)
 11205  		sym := auxToSym(v.Aux)
 11206  		ptr := v_0
 11207  		if v_1.Op != OpPPC64MOVWreg {
 11208  			break
 11209  		}
 11210  		x := v_1.Args[0]
 11211  		mem := v_2
 11212  		v.reset(OpPPC64MOVWstore)
 11213  		v.AuxInt = int32ToAuxInt(off)
 11214  		v.Aux = symToAux(sym)
 11215  		v.AddArg3(ptr, x, mem)
 11216  		return true
 11217  	}
 11218  	// match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
 11219  	// result: (MOVWstore [off] {sym} ptr x mem)
 11220  	for {
 11221  		off := auxIntToInt32(v.AuxInt)
 11222  		sym := auxToSym(v.Aux)
 11223  		ptr := v_0
 11224  		if v_1.Op != OpPPC64MOVWZreg {
 11225  			break
 11226  		}
 11227  		x := v_1.Args[0]
 11228  		mem := v_2
 11229  		v.reset(OpPPC64MOVWstore)
 11230  		v.AuxInt = int32ToAuxInt(off)
 11231  		v.Aux = symToAux(sym)
 11232  		v.AddArg3(ptr, x, mem)
 11233  		return true
 11234  	}
 11235  	// match: (MOVWstore [off] {sym} ptr r:(BRW val) mem)
 11236  	// cond: r.Uses == 1
 11237  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 11238  	for {
 11239  		off := auxIntToInt32(v.AuxInt)
 11240  		sym := auxToSym(v.Aux)
 11241  		ptr := v_0
 11242  		r := v_1
 11243  		if r.Op != OpPPC64BRW {
 11244  			break
 11245  		}
 11246  		val := r.Args[0]
 11247  		mem := v_2
 11248  		if !(r.Uses == 1) {
 11249  			break
 11250  		}
 11251  		v.reset(OpPPC64MOVWBRstore)
 11252  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 11253  		v0.AuxInt = int32ToAuxInt(off)
 11254  		v0.Aux = symToAux(sym)
 11255  		v0.AddArg(ptr)
 11256  		v.AddArg3(v0, val, mem)
 11257  		return true
 11258  	}
 11259  	// match: (MOVWstore [off] {sym} ptr (Bswap32 val) mem)
 11260  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 11261  	for {
 11262  		off := auxIntToInt32(v.AuxInt)
 11263  		sym := auxToSym(v.Aux)
 11264  		ptr := v_0
 11265  		if v_1.Op != OpBswap32 {
 11266  			break
 11267  		}
 11268  		val := v_1.Args[0]
 11269  		mem := v_2
 11270  		v.reset(OpPPC64MOVWBRstore)
 11271  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 11272  		v0.AuxInt = int32ToAuxInt(off)
 11273  		v0.Aux = symToAux(sym)
 11274  		v0.AddArg(ptr)
 11275  		v.AddArg3(v0, val, mem)
 11276  		return true
 11277  	}
 11278  	return false
 11279  }
 11280  func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
 11281  	v_3 := v.Args[3]
 11282  	v_2 := v.Args[2]
 11283  	v_1 := v.Args[1]
 11284  	v_0 := v.Args[0]
 11285  	// match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
 11286  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 11287  	// result: (MOVWstore [int32(c)] ptr val mem)
 11288  	for {
 11289  		ptr := v_0
 11290  		if v_1.Op != OpPPC64MOVDconst {
 11291  			break
 11292  		}
 11293  		c := auxIntToInt64(v_1.AuxInt)
 11294  		val := v_2
 11295  		mem := v_3
 11296  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 11297  			break
 11298  		}
 11299  		v.reset(OpPPC64MOVWstore)
 11300  		v.AuxInt = int32ToAuxInt(int32(c))
 11301  		v.AddArg3(ptr, val, mem)
 11302  		return true
 11303  	}
 11304  	// match: (MOVWstoreidx (MOVDconst [c]) ptr val mem)
 11305  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 11306  	// result: (MOVWstore [int32(c)] ptr val mem)
 11307  	for {
 11308  		if v_0.Op != OpPPC64MOVDconst {
 11309  			break
 11310  		}
 11311  		c := auxIntToInt64(v_0.AuxInt)
 11312  		ptr := v_1
 11313  		val := v_2
 11314  		mem := v_3
 11315  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 11316  			break
 11317  		}
 11318  		v.reset(OpPPC64MOVWstore)
 11319  		v.AuxInt = int32ToAuxInt(int32(c))
 11320  		v.AddArg3(ptr, val, mem)
 11321  		return true
 11322  	}
 11323  	// match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
 11324  	// result: (MOVWstoreidx ptr idx x mem)
 11325  	for {
 11326  		ptr := v_0
 11327  		idx := v_1
 11328  		if v_2.Op != OpPPC64MOVWreg {
 11329  			break
 11330  		}
 11331  		x := v_2.Args[0]
 11332  		mem := v_3
 11333  		v.reset(OpPPC64MOVWstoreidx)
 11334  		v.AddArg4(ptr, idx, x, mem)
 11335  		return true
 11336  	}
 11337  	// match: (MOVWstoreidx ptr idx (MOVWZreg x) mem)
 11338  	// result: (MOVWstoreidx ptr idx x mem)
 11339  	for {
 11340  		ptr := v_0
 11341  		idx := v_1
 11342  		if v_2.Op != OpPPC64MOVWZreg {
 11343  			break
 11344  		}
 11345  		x := v_2.Args[0]
 11346  		mem := v_3
 11347  		v.reset(OpPPC64MOVWstoreidx)
 11348  		v.AddArg4(ptr, idx, x, mem)
 11349  		return true
 11350  	}
 11351  	// match: (MOVWstoreidx ptr idx r:(BRW val) mem)
 11352  	// cond: r.Uses == 1
 11353  	// result: (MOVWBRstoreidx ptr idx val mem)
 11354  	for {
 11355  		ptr := v_0
 11356  		idx := v_1
 11357  		r := v_2
 11358  		if r.Op != OpPPC64BRW {
 11359  			break
 11360  		}
 11361  		val := r.Args[0]
 11362  		mem := v_3
 11363  		if !(r.Uses == 1) {
 11364  			break
 11365  		}
 11366  		v.reset(OpPPC64MOVWBRstoreidx)
 11367  		v.AddArg4(ptr, idx, val, mem)
 11368  		return true
 11369  	}
 11370  	// match: (MOVWstoreidx ptr idx (Bswap32 val) mem)
 11371  	// result: (MOVWBRstoreidx ptr idx val mem)
 11372  	for {
 11373  		ptr := v_0
 11374  		idx := v_1
 11375  		if v_2.Op != OpBswap32 {
 11376  			break
 11377  		}
 11378  		val := v_2.Args[0]
 11379  		mem := v_3
 11380  		v.reset(OpPPC64MOVWBRstoreidx)
 11381  		v.AddArg4(ptr, idx, val, mem)
 11382  		return true
 11383  	}
 11384  	return false
 11385  }
 11386  func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
 11387  	v_1 := v.Args[1]
 11388  	v_0 := v.Args[0]
 11389  	// match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
 11390  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
 11391  	// result: (MOVWstorezero [off1+int32(off2)] {sym} x mem)
 11392  	for {
 11393  		off1 := auxIntToInt32(v.AuxInt)
 11394  		sym := auxToSym(v.Aux)
 11395  		if v_0.Op != OpPPC64ADDconst {
 11396  			break
 11397  		}
 11398  		off2 := auxIntToInt64(v_0.AuxInt)
 11399  		x := v_0.Args[0]
 11400  		mem := v_1
 11401  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
 11402  			break
 11403  		}
 11404  		v.reset(OpPPC64MOVWstorezero)
 11405  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11406  		v.Aux = symToAux(sym)
 11407  		v.AddArg2(x, mem)
 11408  		return true
 11409  	}
 11410  	// match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 11411  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 11412  	// result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 11413  	for {
 11414  		off1 := auxIntToInt32(v.AuxInt)
 11415  		sym1 := auxToSym(v.Aux)
 11416  		p := v_0
 11417  		if p.Op != OpPPC64MOVDaddr {
 11418  			break
 11419  		}
 11420  		off2 := auxIntToInt32(p.AuxInt)
 11421  		sym2 := auxToSym(p.Aux)
 11422  		x := p.Args[0]
 11423  		mem := v_1
 11424  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 11425  			break
 11426  		}
 11427  		v.reset(OpPPC64MOVWstorezero)
 11428  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11429  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11430  		v.AddArg2(x, mem)
 11431  		return true
 11432  	}
 11433  	return false
 11434  }
 11435  func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
 11436  	v_0 := v.Args[0]
 11437  	b := v.Block
 11438  	typ := &b.Func.Config.Types
 11439  	// match: (MTVSRD (MOVDconst [c]))
 11440  	// cond: !math.IsNaN(math.Float64frombits(uint64(c)))
 11441  	// result: (FMOVDconst [math.Float64frombits(uint64(c))])
 11442  	for {
 11443  		if v_0.Op != OpPPC64MOVDconst {
 11444  			break
 11445  		}
 11446  		c := auxIntToInt64(v_0.AuxInt)
 11447  		if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
 11448  			break
 11449  		}
 11450  		v.reset(OpPPC64FMOVDconst)
 11451  		v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
 11452  		return true
 11453  	}
 11454  	// match: (MTVSRD x:(MOVDload [off] {sym} ptr mem))
 11455  	// cond: x.Uses == 1 && clobber(x)
 11456  	// result: @x.Block (FMOVDload [off] {sym} ptr mem)
 11457  	for {
 11458  		x := v_0
 11459  		if x.Op != OpPPC64MOVDload {
 11460  			break
 11461  		}
 11462  		off := auxIntToInt32(x.AuxInt)
 11463  		sym := auxToSym(x.Aux)
 11464  		mem := x.Args[1]
 11465  		ptr := x.Args[0]
 11466  		if !(x.Uses == 1 && clobber(x)) {
 11467  			break
 11468  		}
 11469  		b = x.Block
 11470  		v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
 11471  		v.copyOf(v0)
 11472  		v0.AuxInt = int32ToAuxInt(off)
 11473  		v0.Aux = symToAux(sym)
 11474  		v0.AddArg2(ptr, mem)
 11475  		return true
 11476  	}
 11477  	return false
 11478  }
 11479  func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
 11480  	v_1 := v.Args[1]
 11481  	v_0 := v.Args[0]
 11482  	// match: (MULLD x (MOVDconst [c]))
 11483  	// cond: is16Bit(c)
 11484  	// result: (MULLDconst [int32(c)] x)
 11485  	for {
 11486  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11487  			x := v_0
 11488  			if v_1.Op != OpPPC64MOVDconst {
 11489  				continue
 11490  			}
 11491  			c := auxIntToInt64(v_1.AuxInt)
 11492  			if !(is16Bit(c)) {
 11493  				continue
 11494  			}
 11495  			v.reset(OpPPC64MULLDconst)
 11496  			v.AuxInt = int32ToAuxInt(int32(c))
 11497  			v.AddArg(x)
 11498  			return true
 11499  		}
 11500  		break
 11501  	}
 11502  	return false
 11503  }
 11504  func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
 11505  	v_1 := v.Args[1]
 11506  	v_0 := v.Args[0]
 11507  	// match: (MULLW x (MOVDconst [c]))
 11508  	// cond: is16Bit(c)
 11509  	// result: (MULLWconst [int32(c)] x)
 11510  	for {
 11511  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11512  			x := v_0
 11513  			if v_1.Op != OpPPC64MOVDconst {
 11514  				continue
 11515  			}
 11516  			c := auxIntToInt64(v_1.AuxInt)
 11517  			if !(is16Bit(c)) {
 11518  				continue
 11519  			}
 11520  			v.reset(OpPPC64MULLWconst)
 11521  			v.AuxInt = int32ToAuxInt(int32(c))
 11522  			v.AddArg(x)
 11523  			return true
 11524  		}
 11525  		break
 11526  	}
 11527  	return false
 11528  }
 11529  func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
 11530  	v_0 := v.Args[0]
 11531  	// match: (NEG (ADDconst [c] x))
 11532  	// cond: is32Bit(-c)
 11533  	// result: (SUBFCconst [-c] x)
 11534  	for {
 11535  		if v_0.Op != OpPPC64ADDconst {
 11536  			break
 11537  		}
 11538  		c := auxIntToInt64(v_0.AuxInt)
 11539  		x := v_0.Args[0]
 11540  		if !(is32Bit(-c)) {
 11541  			break
 11542  		}
 11543  		v.reset(OpPPC64SUBFCconst)
 11544  		v.AuxInt = int64ToAuxInt(-c)
 11545  		v.AddArg(x)
 11546  		return true
 11547  	}
 11548  	// match: (NEG (SUBFCconst [c] x))
 11549  	// cond: is32Bit(-c)
 11550  	// result: (ADDconst [-c] x)
 11551  	for {
 11552  		if v_0.Op != OpPPC64SUBFCconst {
 11553  			break
 11554  		}
 11555  		c := auxIntToInt64(v_0.AuxInt)
 11556  		x := v_0.Args[0]
 11557  		if !(is32Bit(-c)) {
 11558  			break
 11559  		}
 11560  		v.reset(OpPPC64ADDconst)
 11561  		v.AuxInt = int64ToAuxInt(-c)
 11562  		v.AddArg(x)
 11563  		return true
 11564  	}
 11565  	// match: (NEG (SUB x y))
 11566  	// result: (SUB y x)
 11567  	for {
 11568  		if v_0.Op != OpPPC64SUB {
 11569  			break
 11570  		}
 11571  		y := v_0.Args[1]
 11572  		x := v_0.Args[0]
 11573  		v.reset(OpPPC64SUB)
 11574  		v.AddArg2(y, x)
 11575  		return true
 11576  	}
 11577  	// match: (NEG (NEG x))
 11578  	// result: x
 11579  	for {
 11580  		if v_0.Op != OpPPC64NEG {
 11581  			break
 11582  		}
 11583  		x := v_0.Args[0]
 11584  		v.copyOf(x)
 11585  		return true
 11586  	}
 11587  	return false
 11588  }
 11589  func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
 11590  	v_1 := v.Args[1]
 11591  	v_0 := v.Args[0]
 11592  	// match: (NOR (MOVDconst [c]) (MOVDconst [d]))
 11593  	// result: (MOVDconst [^(c|d)])
 11594  	for {
 11595  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11596  			if v_0.Op != OpPPC64MOVDconst {
 11597  				continue
 11598  			}
 11599  			c := auxIntToInt64(v_0.AuxInt)
 11600  			if v_1.Op != OpPPC64MOVDconst {
 11601  				continue
 11602  			}
 11603  			d := auxIntToInt64(v_1.AuxInt)
 11604  			v.reset(OpPPC64MOVDconst)
 11605  			v.AuxInt = int64ToAuxInt(^(c | d))
 11606  			return true
 11607  		}
 11608  		break
 11609  	}
 11610  	return false
 11611  }
 11612  func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
 11613  	v_0 := v.Args[0]
 11614  	// match: (NotEqual (FlagEQ))
 11615  	// result: (MOVDconst [0])
 11616  	for {
 11617  		if v_0.Op != OpPPC64FlagEQ {
 11618  			break
 11619  		}
 11620  		v.reset(OpPPC64MOVDconst)
 11621  		v.AuxInt = int64ToAuxInt(0)
 11622  		return true
 11623  	}
 11624  	// match: (NotEqual (FlagLT))
 11625  	// result: (MOVDconst [1])
 11626  	for {
 11627  		if v_0.Op != OpPPC64FlagLT {
 11628  			break
 11629  		}
 11630  		v.reset(OpPPC64MOVDconst)
 11631  		v.AuxInt = int64ToAuxInt(1)
 11632  		return true
 11633  	}
 11634  	// match: (NotEqual (FlagGT))
 11635  	// result: (MOVDconst [1])
 11636  	for {
 11637  		if v_0.Op != OpPPC64FlagGT {
 11638  			break
 11639  		}
 11640  		v.reset(OpPPC64MOVDconst)
 11641  		v.AuxInt = int64ToAuxInt(1)
 11642  		return true
 11643  	}
 11644  	// match: (NotEqual (InvertFlags x))
 11645  	// result: (NotEqual x)
 11646  	for {
 11647  		if v_0.Op != OpPPC64InvertFlags {
 11648  			break
 11649  		}
 11650  		x := v_0.Args[0]
 11651  		v.reset(OpPPC64NotEqual)
 11652  		v.AddArg(x)
 11653  		return true
 11654  	}
 11655  	// match: (NotEqual cmp)
 11656  	// result: (SETBCR [2] cmp)
 11657  	for {
 11658  		cmp := v_0
 11659  		v.reset(OpPPC64SETBCR)
 11660  		v.AuxInt = int32ToAuxInt(2)
 11661  		v.AddArg(cmp)
 11662  		return true
 11663  	}
 11664  }
 11665  func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
 11666  	v_1 := v.Args[1]
 11667  	v_0 := v.Args[0]
 11668  	// match: (OR x (NOR y y))
 11669  	// result: (ORN x y)
 11670  	for {
 11671  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11672  			x := v_0
 11673  			if v_1.Op != OpPPC64NOR {
 11674  				continue
 11675  			}
 11676  			y := v_1.Args[1]
 11677  			if y != v_1.Args[0] {
 11678  				continue
 11679  			}
 11680  			v.reset(OpPPC64ORN)
 11681  			v.AddArg2(x, y)
 11682  			return true
 11683  		}
 11684  		break
 11685  	}
 11686  	// match: (OR (MOVDconst [c]) (MOVDconst [d]))
 11687  	// result: (MOVDconst [c|d])
 11688  	for {
 11689  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11690  			if v_0.Op != OpPPC64MOVDconst {
 11691  				continue
 11692  			}
 11693  			c := auxIntToInt64(v_0.AuxInt)
 11694  			if v_1.Op != OpPPC64MOVDconst {
 11695  				continue
 11696  			}
 11697  			d := auxIntToInt64(v_1.AuxInt)
 11698  			v.reset(OpPPC64MOVDconst)
 11699  			v.AuxInt = int64ToAuxInt(c | d)
 11700  			return true
 11701  		}
 11702  		break
 11703  	}
 11704  	// match: (OR x (MOVDconst [c]))
 11705  	// cond: isU32Bit(c)
 11706  	// result: (ORconst [c] x)
 11707  	for {
 11708  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11709  			x := v_0
 11710  			if v_1.Op != OpPPC64MOVDconst {
 11711  				continue
 11712  			}
 11713  			c := auxIntToInt64(v_1.AuxInt)
 11714  			if !(isU32Bit(c)) {
 11715  				continue
 11716  			}
 11717  			v.reset(OpPPC64ORconst)
 11718  			v.AuxInt = int64ToAuxInt(c)
 11719  			v.AddArg(x)
 11720  			return true
 11721  		}
 11722  		break
 11723  	}
 11724  	return false
 11725  }
 11726  func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
 11727  	v_1 := v.Args[1]
 11728  	v_0 := v.Args[0]
 11729  	// match: (ORN x (MOVDconst [-1]))
 11730  	// result: x
 11731  	for {
 11732  		x := v_0
 11733  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
 11734  			break
 11735  		}
 11736  		v.copyOf(x)
 11737  		return true
 11738  	}
 11739  	// match: (ORN (MOVDconst [c]) (MOVDconst [d]))
 11740  	// result: (MOVDconst [c|^d])
 11741  	for {
 11742  		if v_0.Op != OpPPC64MOVDconst {
 11743  			break
 11744  		}
 11745  		c := auxIntToInt64(v_0.AuxInt)
 11746  		if v_1.Op != OpPPC64MOVDconst {
 11747  			break
 11748  		}
 11749  		d := auxIntToInt64(v_1.AuxInt)
 11750  		v.reset(OpPPC64MOVDconst)
 11751  		v.AuxInt = int64ToAuxInt(c | ^d)
 11752  		return true
 11753  	}
 11754  	return false
 11755  }
 11756  func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
 11757  	v_0 := v.Args[0]
 11758  	// match: (ORconst [c] (ORconst [d] x))
 11759  	// result: (ORconst [c|d] x)
 11760  	for {
 11761  		c := auxIntToInt64(v.AuxInt)
 11762  		if v_0.Op != OpPPC64ORconst {
 11763  			break
 11764  		}
 11765  		d := auxIntToInt64(v_0.AuxInt)
 11766  		x := v_0.Args[0]
 11767  		v.reset(OpPPC64ORconst)
 11768  		v.AuxInt = int64ToAuxInt(c | d)
 11769  		v.AddArg(x)
 11770  		return true
 11771  	}
 11772  	// match: (ORconst [-1] _)
 11773  	// result: (MOVDconst [-1])
 11774  	for {
 11775  		if auxIntToInt64(v.AuxInt) != -1 {
 11776  			break
 11777  		}
 11778  		v.reset(OpPPC64MOVDconst)
 11779  		v.AuxInt = int64ToAuxInt(-1)
 11780  		return true
 11781  	}
 11782  	// match: (ORconst [0] x)
 11783  	// result: x
 11784  	for {
 11785  		if auxIntToInt64(v.AuxInt) != 0 {
 11786  			break
 11787  		}
 11788  		x := v_0
 11789  		v.copyOf(x)
 11790  		return true
 11791  	}
 11792  	return false
 11793  }
 11794  func rewriteValuePPC64_OpPPC64RLWINM(v *Value) bool {
 11795  	v_0 := v.Args[0]
 11796  	// match: (RLWINM [r] (MOVHZreg u))
 11797  	// cond: mergePPC64RlwinmAnd(r,0xFFFF) != 0
 11798  	// result: (RLWINM [mergePPC64RlwinmAnd(r,0xFFFF)] u)
 11799  	for {
 11800  		r := auxIntToInt64(v.AuxInt)
 11801  		if v_0.Op != OpPPC64MOVHZreg {
 11802  			break
 11803  		}
 11804  		u := v_0.Args[0]
 11805  		if !(mergePPC64RlwinmAnd(r, 0xFFFF) != 0) {
 11806  			break
 11807  		}
 11808  		v.reset(OpPPC64RLWINM)
 11809  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, 0xFFFF))
 11810  		v.AddArg(u)
 11811  		return true
 11812  	}
 11813  	// match: (RLWINM [r] (ANDconst [a] u))
 11814  	// cond: mergePPC64RlwinmAnd(r,uint32(a)) != 0
 11815  	// result: (RLWINM [mergePPC64RlwinmAnd(r,uint32(a))] u)
 11816  	for {
 11817  		r := auxIntToInt64(v.AuxInt)
 11818  		if v_0.Op != OpPPC64ANDconst {
 11819  			break
 11820  		}
 11821  		a := auxIntToInt64(v_0.AuxInt)
 11822  		u := v_0.Args[0]
 11823  		if !(mergePPC64RlwinmAnd(r, uint32(a)) != 0) {
 11824  			break
 11825  		}
 11826  		v.reset(OpPPC64RLWINM)
 11827  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, uint32(a)))
 11828  		v.AddArg(u)
 11829  		return true
 11830  	}
 11831  	return false
 11832  }
 11833  func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
 11834  	v_1 := v.Args[1]
 11835  	v_0 := v.Args[0]
 11836  	// match: (ROTL x (MOVDconst [c]))
 11837  	// result: (ROTLconst x [c&63])
 11838  	for {
 11839  		x := v_0
 11840  		if v_1.Op != OpPPC64MOVDconst {
 11841  			break
 11842  		}
 11843  		c := auxIntToInt64(v_1.AuxInt)
 11844  		v.reset(OpPPC64ROTLconst)
 11845  		v.AuxInt = int64ToAuxInt(c & 63)
 11846  		v.AddArg(x)
 11847  		return true
 11848  	}
 11849  	return false
 11850  }
 11851  func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
 11852  	v_1 := v.Args[1]
 11853  	v_0 := v.Args[0]
 11854  	// match: (ROTLW x (MOVDconst [c]))
 11855  	// result: (ROTLWconst x [c&31])
 11856  	for {
 11857  		x := v_0
 11858  		if v_1.Op != OpPPC64MOVDconst {
 11859  			break
 11860  		}
 11861  		c := auxIntToInt64(v_1.AuxInt)
 11862  		v.reset(OpPPC64ROTLWconst)
 11863  		v.AuxInt = int64ToAuxInt(c & 31)
 11864  		v.AddArg(x)
 11865  		return true
 11866  	}
 11867  	return false
 11868  }
 11869  func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
 11870  	v_0 := v.Args[0]
 11871  	// match: (ROTLWconst [r] (AND (MOVDconst [m]) x))
 11872  	// cond: isPPC64WordRotateMask(m)
 11873  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 11874  	for {
 11875  		r := auxIntToInt64(v.AuxInt)
 11876  		if v_0.Op != OpPPC64AND {
 11877  			break
 11878  		}
 11879  		_ = v_0.Args[1]
 11880  		v_0_0 := v_0.Args[0]
 11881  		v_0_1 := v_0.Args[1]
 11882  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 11883  			if v_0_0.Op != OpPPC64MOVDconst {
 11884  				continue
 11885  			}
 11886  			m := auxIntToInt64(v_0_0.AuxInt)
 11887  			x := v_0_1
 11888  			if !(isPPC64WordRotateMask(m)) {
 11889  				continue
 11890  			}
 11891  			v.reset(OpPPC64RLWINM)
 11892  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 11893  			v.AddArg(x)
 11894  			return true
 11895  		}
 11896  		break
 11897  	}
 11898  	// match: (ROTLWconst [r] (ANDconst [m] x))
 11899  	// cond: isPPC64WordRotateMask(m)
 11900  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 11901  	for {
 11902  		r := auxIntToInt64(v.AuxInt)
 11903  		if v_0.Op != OpPPC64ANDconst {
 11904  			break
 11905  		}
 11906  		m := auxIntToInt64(v_0.AuxInt)
 11907  		x := v_0.Args[0]
 11908  		if !(isPPC64WordRotateMask(m)) {
 11909  			break
 11910  		}
 11911  		v.reset(OpPPC64RLWINM)
 11912  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 11913  		v.AddArg(x)
 11914  		return true
 11915  	}
 11916  	return false
 11917  }
 11918  func rewriteValuePPC64_OpPPC64SETBC(v *Value) bool {
 11919  	v_0 := v.Args[0]
 11920  	b := v.Block
 11921  	typ := &b.Func.Config.Types
 11922  	// match: (SETBC [0] (FlagLT))
 11923  	// result: (MOVDconst [1])
 11924  	for {
 11925  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 11926  			break
 11927  		}
 11928  		v.reset(OpPPC64MOVDconst)
 11929  		v.AuxInt = int64ToAuxInt(1)
 11930  		return true
 11931  	}
 11932  	// match: (SETBC [0] (FlagGT))
 11933  	// result: (MOVDconst [0])
 11934  	for {
 11935  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 11936  			break
 11937  		}
 11938  		v.reset(OpPPC64MOVDconst)
 11939  		v.AuxInt = int64ToAuxInt(0)
 11940  		return true
 11941  	}
 11942  	// match: (SETBC [0] (FlagEQ))
 11943  	// result: (MOVDconst [0])
 11944  	for {
 11945  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 11946  			break
 11947  		}
 11948  		v.reset(OpPPC64MOVDconst)
 11949  		v.AuxInt = int64ToAuxInt(0)
 11950  		return true
 11951  	}
 11952  	// match: (SETBC [1] (FlagGT))
 11953  	// result: (MOVDconst [1])
 11954  	for {
 11955  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 11956  			break
 11957  		}
 11958  		v.reset(OpPPC64MOVDconst)
 11959  		v.AuxInt = int64ToAuxInt(1)
 11960  		return true
 11961  	}
 11962  	// match: (SETBC [1] (FlagLT))
 11963  	// result: (MOVDconst [0])
 11964  	for {
 11965  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 11966  			break
 11967  		}
 11968  		v.reset(OpPPC64MOVDconst)
 11969  		v.AuxInt = int64ToAuxInt(0)
 11970  		return true
 11971  	}
 11972  	// match: (SETBC [1] (FlagEQ))
 11973  	// result: (MOVDconst [0])
 11974  	for {
 11975  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 11976  			break
 11977  		}
 11978  		v.reset(OpPPC64MOVDconst)
 11979  		v.AuxInt = int64ToAuxInt(0)
 11980  		return true
 11981  	}
 11982  	// match: (SETBC [2] (FlagEQ))
 11983  	// result: (MOVDconst [1])
 11984  	for {
 11985  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 11986  			break
 11987  		}
 11988  		v.reset(OpPPC64MOVDconst)
 11989  		v.AuxInt = int64ToAuxInt(1)
 11990  		return true
 11991  	}
 11992  	// match: (SETBC [2] (FlagLT))
 11993  	// result: (MOVDconst [0])
 11994  	for {
 11995  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 11996  			break
 11997  		}
 11998  		v.reset(OpPPC64MOVDconst)
 11999  		v.AuxInt = int64ToAuxInt(0)
 12000  		return true
 12001  	}
 12002  	// match: (SETBC [2] (FlagGT))
 12003  	// result: (MOVDconst [0])
 12004  	for {
 12005  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 12006  			break
 12007  		}
 12008  		v.reset(OpPPC64MOVDconst)
 12009  		v.AuxInt = int64ToAuxInt(0)
 12010  		return true
 12011  	}
 12012  	// match: (SETBC [0] (InvertFlags bool))
 12013  	// result: (SETBC [1] bool)
 12014  	for {
 12015  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 12016  			break
 12017  		}
 12018  		bool := v_0.Args[0]
 12019  		v.reset(OpPPC64SETBC)
 12020  		v.AuxInt = int32ToAuxInt(1)
 12021  		v.AddArg(bool)
 12022  		return true
 12023  	}
 12024  	// match: (SETBC [1] (InvertFlags bool))
 12025  	// result: (SETBC [0] bool)
 12026  	for {
 12027  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 12028  			break
 12029  		}
 12030  		bool := v_0.Args[0]
 12031  		v.reset(OpPPC64SETBC)
 12032  		v.AuxInt = int32ToAuxInt(0)
 12033  		v.AddArg(bool)
 12034  		return true
 12035  	}
 12036  	// match: (SETBC [2] (InvertFlags bool))
 12037  	// result: (SETBC [2] bool)
 12038  	for {
 12039  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 12040  			break
 12041  		}
 12042  		bool := v_0.Args[0]
 12043  		v.reset(OpPPC64SETBC)
 12044  		v.AuxInt = int32ToAuxInt(2)
 12045  		v.AddArg(bool)
 12046  		return true
 12047  	}
 12048  	// match: (SETBC [n] (InvertFlags bool))
 12049  	// result: (SETBCR [n] bool)
 12050  	for {
 12051  		n := auxIntToInt32(v.AuxInt)
 12052  		if v_0.Op != OpPPC64InvertFlags {
 12053  			break
 12054  		}
 12055  		bool := v_0.Args[0]
 12056  		v.reset(OpPPC64SETBCR)
 12057  		v.AuxInt = int32ToAuxInt(n)
 12058  		v.AddArg(bool)
 12059  		return true
 12060  	}
 12061  	// match: (SETBC [2] (CMPconst [0] a:(ANDconst [1] _)))
 12062  	// result: (XORconst [1] a)
 12063  	for {
 12064  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12065  			break
 12066  		}
 12067  		a := v_0.Args[0]
 12068  		if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
 12069  			break
 12070  		}
 12071  		v.reset(OpPPC64XORconst)
 12072  		v.AuxInt = int64ToAuxInt(1)
 12073  		v.AddArg(a)
 12074  		return true
 12075  	}
 12076  	// match: (SETBC [2] (CMPconst [0] a:(AND y z)))
 12077  	// cond: a.Uses == 1
 12078  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 12079  	for {
 12080  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12081  			break
 12082  		}
 12083  		a := v_0.Args[0]
 12084  		if a.Op != OpPPC64AND {
 12085  			break
 12086  		}
 12087  		z := a.Args[1]
 12088  		y := a.Args[0]
 12089  		if !(a.Uses == 1) {
 12090  			break
 12091  		}
 12092  		v.reset(OpPPC64SETBC)
 12093  		v.AuxInt = int32ToAuxInt(2)
 12094  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12095  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 12096  		v1.AddArg2(y, z)
 12097  		v0.AddArg(v1)
 12098  		v.AddArg(v0)
 12099  		return true
 12100  	}
 12101  	// match: (SETBC [2] (CMPconst [0] o:(OR y z)))
 12102  	// cond: o.Uses == 1
 12103  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ORCC y z )))
 12104  	for {
 12105  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12106  			break
 12107  		}
 12108  		o := v_0.Args[0]
 12109  		if o.Op != OpPPC64OR {
 12110  			break
 12111  		}
 12112  		z := o.Args[1]
 12113  		y := o.Args[0]
 12114  		if !(o.Uses == 1) {
 12115  			break
 12116  		}
 12117  		v.reset(OpPPC64SETBC)
 12118  		v.AuxInt = int32ToAuxInt(2)
 12119  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12120  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12121  		v1.AddArg2(y, z)
 12122  		v0.AddArg(v1)
 12123  		v.AddArg(v0)
 12124  		return true
 12125  	}
 12126  	// match: (SETBC [2] (CMPconst [0] a:(XOR y z)))
 12127  	// cond: a.Uses == 1
 12128  	// result: (SETBC [2] (Select1 <types.TypeFlags> (XORCC y z )))
 12129  	for {
 12130  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12131  			break
 12132  		}
 12133  		a := v_0.Args[0]
 12134  		if a.Op != OpPPC64XOR {
 12135  			break
 12136  		}
 12137  		z := a.Args[1]
 12138  		y := a.Args[0]
 12139  		if !(a.Uses == 1) {
 12140  			break
 12141  		}
 12142  		v.reset(OpPPC64SETBC)
 12143  		v.AuxInt = int32ToAuxInt(2)
 12144  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12145  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12146  		v1.AddArg2(y, z)
 12147  		v0.AddArg(v1)
 12148  		v.AddArg(v0)
 12149  		return true
 12150  	}
 12151  	return false
 12152  }
 12153  func rewriteValuePPC64_OpPPC64SETBCR(v *Value) bool {
 12154  	v_0 := v.Args[0]
 12155  	b := v.Block
 12156  	typ := &b.Func.Config.Types
 12157  	// match: (SETBCR [0] (FlagLT))
 12158  	// result: (MOVDconst [0])
 12159  	for {
 12160  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 12161  			break
 12162  		}
 12163  		v.reset(OpPPC64MOVDconst)
 12164  		v.AuxInt = int64ToAuxInt(0)
 12165  		return true
 12166  	}
 12167  	// match: (SETBCR [0] (FlagGT))
 12168  	// result: (MOVDconst [1])
 12169  	for {
 12170  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 12171  			break
 12172  		}
 12173  		v.reset(OpPPC64MOVDconst)
 12174  		v.AuxInt = int64ToAuxInt(1)
 12175  		return true
 12176  	}
 12177  	// match: (SETBCR [0] (FlagEQ))
 12178  	// result: (MOVDconst [1])
 12179  	for {
 12180  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 12181  			break
 12182  		}
 12183  		v.reset(OpPPC64MOVDconst)
 12184  		v.AuxInt = int64ToAuxInt(1)
 12185  		return true
 12186  	}
 12187  	// match: (SETBCR [1] (FlagGT))
 12188  	// result: (MOVDconst [0])
 12189  	for {
 12190  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 12191  			break
 12192  		}
 12193  		v.reset(OpPPC64MOVDconst)
 12194  		v.AuxInt = int64ToAuxInt(0)
 12195  		return true
 12196  	}
 12197  	// match: (SETBCR [1] (FlagLT))
 12198  	// result: (MOVDconst [1])
 12199  	for {
 12200  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 12201  			break
 12202  		}
 12203  		v.reset(OpPPC64MOVDconst)
 12204  		v.AuxInt = int64ToAuxInt(1)
 12205  		return true
 12206  	}
 12207  	// match: (SETBCR [1] (FlagEQ))
 12208  	// result: (MOVDconst [1])
 12209  	for {
 12210  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 12211  			break
 12212  		}
 12213  		v.reset(OpPPC64MOVDconst)
 12214  		v.AuxInt = int64ToAuxInt(1)
 12215  		return true
 12216  	}
 12217  	// match: (SETBCR [2] (FlagEQ))
 12218  	// result: (MOVDconst [0])
 12219  	for {
 12220  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 12221  			break
 12222  		}
 12223  		v.reset(OpPPC64MOVDconst)
 12224  		v.AuxInt = int64ToAuxInt(0)
 12225  		return true
 12226  	}
 12227  	// match: (SETBCR [2] (FlagLT))
 12228  	// result: (MOVDconst [1])
 12229  	for {
 12230  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 12231  			break
 12232  		}
 12233  		v.reset(OpPPC64MOVDconst)
 12234  		v.AuxInt = int64ToAuxInt(1)
 12235  		return true
 12236  	}
 12237  	// match: (SETBCR [2] (FlagGT))
 12238  	// result: (MOVDconst [1])
 12239  	for {
 12240  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 12241  			break
 12242  		}
 12243  		v.reset(OpPPC64MOVDconst)
 12244  		v.AuxInt = int64ToAuxInt(1)
 12245  		return true
 12246  	}
 12247  	// match: (SETBCR [0] (InvertFlags bool))
 12248  	// result: (SETBCR [1] bool)
 12249  	for {
 12250  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 12251  			break
 12252  		}
 12253  		bool := v_0.Args[0]
 12254  		v.reset(OpPPC64SETBCR)
 12255  		v.AuxInt = int32ToAuxInt(1)
 12256  		v.AddArg(bool)
 12257  		return true
 12258  	}
 12259  	// match: (SETBCR [1] (InvertFlags bool))
 12260  	// result: (SETBCR [0] bool)
 12261  	for {
 12262  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 12263  			break
 12264  		}
 12265  		bool := v_0.Args[0]
 12266  		v.reset(OpPPC64SETBCR)
 12267  		v.AuxInt = int32ToAuxInt(0)
 12268  		v.AddArg(bool)
 12269  		return true
 12270  	}
 12271  	// match: (SETBCR [2] (InvertFlags bool))
 12272  	// result: (SETBCR [2] bool)
 12273  	for {
 12274  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 12275  			break
 12276  		}
 12277  		bool := v_0.Args[0]
 12278  		v.reset(OpPPC64SETBCR)
 12279  		v.AuxInt = int32ToAuxInt(2)
 12280  		v.AddArg(bool)
 12281  		return true
 12282  	}
 12283  	// match: (SETBCR [n] (InvertFlags bool))
 12284  	// result: (SETBC [n] bool)
 12285  	for {
 12286  		n := auxIntToInt32(v.AuxInt)
 12287  		if v_0.Op != OpPPC64InvertFlags {
 12288  			break
 12289  		}
 12290  		bool := v_0.Args[0]
 12291  		v.reset(OpPPC64SETBC)
 12292  		v.AuxInt = int32ToAuxInt(n)
 12293  		v.AddArg(bool)
 12294  		return true
 12295  	}
 12296  	// match: (SETBCR [2] (CMPconst [0] a:(ANDconst [1] _)))
 12297  	// result: a
 12298  	for {
 12299  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12300  			break
 12301  		}
 12302  		a := v_0.Args[0]
 12303  		if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
 12304  			break
 12305  		}
 12306  		v.copyOf(a)
 12307  		return true
 12308  	}
 12309  	// match: (SETBCR [2] (CMPconst [0] a:(AND y z)))
 12310  	// cond: a.Uses == 1
 12311  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 12312  	for {
 12313  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12314  			break
 12315  		}
 12316  		a := v_0.Args[0]
 12317  		if a.Op != OpPPC64AND {
 12318  			break
 12319  		}
 12320  		z := a.Args[1]
 12321  		y := a.Args[0]
 12322  		if !(a.Uses == 1) {
 12323  			break
 12324  		}
 12325  		v.reset(OpPPC64SETBCR)
 12326  		v.AuxInt = int32ToAuxInt(2)
 12327  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12328  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 12329  		v1.AddArg2(y, z)
 12330  		v0.AddArg(v1)
 12331  		v.AddArg(v0)
 12332  		return true
 12333  	}
 12334  	// match: (SETBCR [2] (CMPconst [0] o:(OR y z)))
 12335  	// cond: o.Uses == 1
 12336  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ORCC y z )))
 12337  	for {
 12338  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12339  			break
 12340  		}
 12341  		o := v_0.Args[0]
 12342  		if o.Op != OpPPC64OR {
 12343  			break
 12344  		}
 12345  		z := o.Args[1]
 12346  		y := o.Args[0]
 12347  		if !(o.Uses == 1) {
 12348  			break
 12349  		}
 12350  		v.reset(OpPPC64SETBCR)
 12351  		v.AuxInt = int32ToAuxInt(2)
 12352  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12353  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12354  		v1.AddArg2(y, z)
 12355  		v0.AddArg(v1)
 12356  		v.AddArg(v0)
 12357  		return true
 12358  	}
 12359  	// match: (SETBCR [2] (CMPconst [0] a:(XOR y z)))
 12360  	// cond: a.Uses == 1
 12361  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (XORCC y z )))
 12362  	for {
 12363  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12364  			break
 12365  		}
 12366  		a := v_0.Args[0]
 12367  		if a.Op != OpPPC64XOR {
 12368  			break
 12369  		}
 12370  		z := a.Args[1]
 12371  		y := a.Args[0]
 12372  		if !(a.Uses == 1) {
 12373  			break
 12374  		}
 12375  		v.reset(OpPPC64SETBCR)
 12376  		v.AuxInt = int32ToAuxInt(2)
 12377  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12378  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12379  		v1.AddArg2(y, z)
 12380  		v0.AddArg(v1)
 12381  		v.AddArg(v0)
 12382  		return true
 12383  	}
 12384  	return false
 12385  }
 12386  func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
 12387  	v_1 := v.Args[1]
 12388  	v_0 := v.Args[0]
 12389  	// match: (SLD x (MOVDconst [c]))
 12390  	// result: (SLDconst [c&63 | (c>>6&1*63)] x)
 12391  	for {
 12392  		x := v_0
 12393  		if v_1.Op != OpPPC64MOVDconst {
 12394  			break
 12395  		}
 12396  		c := auxIntToInt64(v_1.AuxInt)
 12397  		v.reset(OpPPC64SLDconst)
 12398  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12399  		v.AddArg(x)
 12400  		return true
 12401  	}
 12402  	return false
 12403  }
 12404  func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
 12405  	v_0 := v.Args[0]
 12406  	// match: (SLDconst [l] (SRWconst [r] x))
 12407  	// cond: mergePPC64SldiSrw(l,r) != 0
 12408  	// result: (RLWINM [mergePPC64SldiSrw(l,r)] x)
 12409  	for {
 12410  		l := auxIntToInt64(v.AuxInt)
 12411  		if v_0.Op != OpPPC64SRWconst {
 12412  			break
 12413  		}
 12414  		r := auxIntToInt64(v_0.AuxInt)
 12415  		x := v_0.Args[0]
 12416  		if !(mergePPC64SldiSrw(l, r) != 0) {
 12417  			break
 12418  		}
 12419  		v.reset(OpPPC64RLWINM)
 12420  		v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
 12421  		v.AddArg(x)
 12422  		return true
 12423  	}
 12424  	// match: (SLDconst [s] (RLWINM [r] y))
 12425  	// cond: mergePPC64SldiRlwinm(s,r) != 0
 12426  	// result: (RLWINM [mergePPC64SldiRlwinm(s,r)] y)
 12427  	for {
 12428  		s := auxIntToInt64(v.AuxInt)
 12429  		if v_0.Op != OpPPC64RLWINM {
 12430  			break
 12431  		}
 12432  		r := auxIntToInt64(v_0.AuxInt)
 12433  		y := v_0.Args[0]
 12434  		if !(mergePPC64SldiRlwinm(s, r) != 0) {
 12435  			break
 12436  		}
 12437  		v.reset(OpPPC64RLWINM)
 12438  		v.AuxInt = int64ToAuxInt(mergePPC64SldiRlwinm(s, r))
 12439  		v.AddArg(y)
 12440  		return true
 12441  	}
 12442  	// match: (SLDconst [c] z:(MOVBZreg x))
 12443  	// cond: c < 8 && z.Uses == 1
 12444  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,56,63,64)] x)
 12445  	for {
 12446  		c := auxIntToInt64(v.AuxInt)
 12447  		z := v_0
 12448  		if z.Op != OpPPC64MOVBZreg {
 12449  			break
 12450  		}
 12451  		x := z.Args[0]
 12452  		if !(c < 8 && z.Uses == 1) {
 12453  			break
 12454  		}
 12455  		v.reset(OpPPC64CLRLSLDI)
 12456  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
 12457  		v.AddArg(x)
 12458  		return true
 12459  	}
 12460  	// match: (SLDconst [c] z:(MOVHZreg x))
 12461  	// cond: c < 16 && z.Uses == 1
 12462  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,48,63,64)] x)
 12463  	for {
 12464  		c := auxIntToInt64(v.AuxInt)
 12465  		z := v_0
 12466  		if z.Op != OpPPC64MOVHZreg {
 12467  			break
 12468  		}
 12469  		x := z.Args[0]
 12470  		if !(c < 16 && z.Uses == 1) {
 12471  			break
 12472  		}
 12473  		v.reset(OpPPC64CLRLSLDI)
 12474  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
 12475  		v.AddArg(x)
 12476  		return true
 12477  	}
 12478  	// match: (SLDconst [c] z:(MOVWZreg x))
 12479  	// cond: c < 32 && z.Uses == 1
 12480  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,32,63,64)] x)
 12481  	for {
 12482  		c := auxIntToInt64(v.AuxInt)
 12483  		z := v_0
 12484  		if z.Op != OpPPC64MOVWZreg {
 12485  			break
 12486  		}
 12487  		x := z.Args[0]
 12488  		if !(c < 32 && z.Uses == 1) {
 12489  			break
 12490  		}
 12491  		v.reset(OpPPC64CLRLSLDI)
 12492  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
 12493  		v.AddArg(x)
 12494  		return true
 12495  	}
 12496  	// match: (SLDconst [c] z:(ANDconst [d] x))
 12497  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))
 12498  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12499  	for {
 12500  		c := auxIntToInt64(v.AuxInt)
 12501  		z := v_0
 12502  		if z.Op != OpPPC64ANDconst {
 12503  			break
 12504  		}
 12505  		d := auxIntToInt64(z.AuxInt)
 12506  		x := z.Args[0]
 12507  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12508  			break
 12509  		}
 12510  		v.reset(OpPPC64CLRLSLDI)
 12511  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12512  		v.AddArg(x)
 12513  		return true
 12514  	}
 12515  	// match: (SLDconst [c] z:(AND (MOVDconst [d]) x))
 12516  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(64-getPPC64ShiftMaskLength(d))
 12517  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12518  	for {
 12519  		c := auxIntToInt64(v.AuxInt)
 12520  		z := v_0
 12521  		if z.Op != OpPPC64AND {
 12522  			break
 12523  		}
 12524  		_ = z.Args[1]
 12525  		z_0 := z.Args[0]
 12526  		z_1 := z.Args[1]
 12527  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12528  			if z_0.Op != OpPPC64MOVDconst {
 12529  				continue
 12530  			}
 12531  			d := auxIntToInt64(z_0.AuxInt)
 12532  			x := z_1
 12533  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12534  				continue
 12535  			}
 12536  			v.reset(OpPPC64CLRLSLDI)
 12537  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12538  			v.AddArg(x)
 12539  			return true
 12540  		}
 12541  		break
 12542  	}
 12543  	// match: (SLDconst [c] z:(MOVWreg x))
 12544  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12545  	// result: (EXTSWSLconst [c] x)
 12546  	for {
 12547  		c := auxIntToInt64(v.AuxInt)
 12548  		z := v_0
 12549  		if z.Op != OpPPC64MOVWreg {
 12550  			break
 12551  		}
 12552  		x := z.Args[0]
 12553  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12554  			break
 12555  		}
 12556  		v.reset(OpPPC64EXTSWSLconst)
 12557  		v.AuxInt = int64ToAuxInt(c)
 12558  		v.AddArg(x)
 12559  		return true
 12560  	}
 12561  	return false
 12562  }
 12563  func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
 12564  	v_1 := v.Args[1]
 12565  	v_0 := v.Args[0]
 12566  	// match: (SLW x (MOVDconst [c]))
 12567  	// result: (SLWconst [c&31 | (c>>5&1*31)] x)
 12568  	for {
 12569  		x := v_0
 12570  		if v_1.Op != OpPPC64MOVDconst {
 12571  			break
 12572  		}
 12573  		c := auxIntToInt64(v_1.AuxInt)
 12574  		v.reset(OpPPC64SLWconst)
 12575  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12576  		v.AddArg(x)
 12577  		return true
 12578  	}
 12579  	return false
 12580  }
 12581  func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
 12582  	v_0 := v.Args[0]
 12583  	// match: (SLWconst [s] (MOVWZreg w))
 12584  	// result: (SLWconst [s] w)
 12585  	for {
 12586  		s := auxIntToInt64(v.AuxInt)
 12587  		if v_0.Op != OpPPC64MOVWZreg {
 12588  			break
 12589  		}
 12590  		w := v_0.Args[0]
 12591  		v.reset(OpPPC64SLWconst)
 12592  		v.AuxInt = int64ToAuxInt(s)
 12593  		v.AddArg(w)
 12594  		return true
 12595  	}
 12596  	// match: (SLWconst [c] z:(MOVBZreg x))
 12597  	// cond: z.Uses == 1 && c < 8
 12598  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,24,31,32)] x)
 12599  	for {
 12600  		c := auxIntToInt64(v.AuxInt)
 12601  		z := v_0
 12602  		if z.Op != OpPPC64MOVBZreg {
 12603  			break
 12604  		}
 12605  		x := z.Args[0]
 12606  		if !(z.Uses == 1 && c < 8) {
 12607  			break
 12608  		}
 12609  		v.reset(OpPPC64CLRLSLWI)
 12610  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
 12611  		v.AddArg(x)
 12612  		return true
 12613  	}
 12614  	// match: (SLWconst [c] z:(MOVHZreg x))
 12615  	// cond: z.Uses == 1 && c < 16
 12616  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,16,31,32)] x)
 12617  	for {
 12618  		c := auxIntToInt64(v.AuxInt)
 12619  		z := v_0
 12620  		if z.Op != OpPPC64MOVHZreg {
 12621  			break
 12622  		}
 12623  		x := z.Args[0]
 12624  		if !(z.Uses == 1 && c < 16) {
 12625  			break
 12626  		}
 12627  		v.reset(OpPPC64CLRLSLWI)
 12628  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
 12629  		v.AddArg(x)
 12630  		return true
 12631  	}
 12632  	// match: (SLWconst [c] z:(ANDconst [d] x))
 12633  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12634  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12635  	for {
 12636  		c := auxIntToInt64(v.AuxInt)
 12637  		z := v_0
 12638  		if z.Op != OpPPC64ANDconst {
 12639  			break
 12640  		}
 12641  		d := auxIntToInt64(z.AuxInt)
 12642  		x := z.Args[0]
 12643  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12644  			break
 12645  		}
 12646  		v.reset(OpPPC64CLRLSLWI)
 12647  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12648  		v.AddArg(x)
 12649  		return true
 12650  	}
 12651  	// match: (SLWconst [c] z:(AND (MOVDconst [d]) x))
 12652  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12653  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12654  	for {
 12655  		c := auxIntToInt64(v.AuxInt)
 12656  		z := v_0
 12657  		if z.Op != OpPPC64AND {
 12658  			break
 12659  		}
 12660  		_ = z.Args[1]
 12661  		z_0 := z.Args[0]
 12662  		z_1 := z.Args[1]
 12663  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12664  			if z_0.Op != OpPPC64MOVDconst {
 12665  				continue
 12666  			}
 12667  			d := auxIntToInt64(z_0.AuxInt)
 12668  			x := z_1
 12669  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12670  				continue
 12671  			}
 12672  			v.reset(OpPPC64CLRLSLWI)
 12673  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12674  			v.AddArg(x)
 12675  			return true
 12676  		}
 12677  		break
 12678  	}
 12679  	// match: (SLWconst [c] z:(MOVWreg x))
 12680  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12681  	// result: (EXTSWSLconst [c] x)
 12682  	for {
 12683  		c := auxIntToInt64(v.AuxInt)
 12684  		z := v_0
 12685  		if z.Op != OpPPC64MOVWreg {
 12686  			break
 12687  		}
 12688  		x := z.Args[0]
 12689  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12690  			break
 12691  		}
 12692  		v.reset(OpPPC64EXTSWSLconst)
 12693  		v.AuxInt = int64ToAuxInt(c)
 12694  		v.AddArg(x)
 12695  		return true
 12696  	}
 12697  	return false
 12698  }
 12699  func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
 12700  	v_1 := v.Args[1]
 12701  	v_0 := v.Args[0]
 12702  	// match: (SRAD x (MOVDconst [c]))
 12703  	// result: (SRADconst [c&63 | (c>>6&1*63)] x)
 12704  	for {
 12705  		x := v_0
 12706  		if v_1.Op != OpPPC64MOVDconst {
 12707  			break
 12708  		}
 12709  		c := auxIntToInt64(v_1.AuxInt)
 12710  		v.reset(OpPPC64SRADconst)
 12711  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12712  		v.AddArg(x)
 12713  		return true
 12714  	}
 12715  	return false
 12716  }
 12717  func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
 12718  	v_1 := v.Args[1]
 12719  	v_0 := v.Args[0]
 12720  	// match: (SRAW x (MOVDconst [c]))
 12721  	// result: (SRAWconst [c&31 | (c>>5&1*31)] x)
 12722  	for {
 12723  		x := v_0
 12724  		if v_1.Op != OpPPC64MOVDconst {
 12725  			break
 12726  		}
 12727  		c := auxIntToInt64(v_1.AuxInt)
 12728  		v.reset(OpPPC64SRAWconst)
 12729  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12730  		v.AddArg(x)
 12731  		return true
 12732  	}
 12733  	return false
 12734  }
 12735  func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
 12736  	v_1 := v.Args[1]
 12737  	v_0 := v.Args[0]
 12738  	// match: (SRD x (MOVDconst [c]))
 12739  	// result: (SRDconst [c&63 | (c>>6&1*63)] x)
 12740  	for {
 12741  		x := v_0
 12742  		if v_1.Op != OpPPC64MOVDconst {
 12743  			break
 12744  		}
 12745  		c := auxIntToInt64(v_1.AuxInt)
 12746  		v.reset(OpPPC64SRDconst)
 12747  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12748  		v.AddArg(x)
 12749  		return true
 12750  	}
 12751  	return false
 12752  }
 12753  func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
 12754  	v_1 := v.Args[1]
 12755  	v_0 := v.Args[0]
 12756  	// match: (SRW x (MOVDconst [c]))
 12757  	// result: (SRWconst [c&31 | (c>>5&1*31)] x)
 12758  	for {
 12759  		x := v_0
 12760  		if v_1.Op != OpPPC64MOVDconst {
 12761  			break
 12762  		}
 12763  		c := auxIntToInt64(v_1.AuxInt)
 12764  		v.reset(OpPPC64SRWconst)
 12765  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12766  		v.AddArg(x)
 12767  		return true
 12768  	}
 12769  	return false
 12770  }
 12771  func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
 12772  	v_0 := v.Args[0]
 12773  	// match: (SRWconst (ANDconst [m] x) [s])
 12774  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 12775  	// result: (MOVDconst [0])
 12776  	for {
 12777  		s := auxIntToInt64(v.AuxInt)
 12778  		if v_0.Op != OpPPC64ANDconst {
 12779  			break
 12780  		}
 12781  		m := auxIntToInt64(v_0.AuxInt)
 12782  		if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 12783  			break
 12784  		}
 12785  		v.reset(OpPPC64MOVDconst)
 12786  		v.AuxInt = int64ToAuxInt(0)
 12787  		return true
 12788  	}
 12789  	// match: (SRWconst (ANDconst [m] x) [s])
 12790  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 12791  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 12792  	for {
 12793  		s := auxIntToInt64(v.AuxInt)
 12794  		if v_0.Op != OpPPC64ANDconst {
 12795  			break
 12796  		}
 12797  		m := auxIntToInt64(v_0.AuxInt)
 12798  		x := v_0.Args[0]
 12799  		if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 12800  			break
 12801  		}
 12802  		v.reset(OpPPC64RLWINM)
 12803  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 12804  		v.AddArg(x)
 12805  		return true
 12806  	}
 12807  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 12808  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 12809  	// result: (MOVDconst [0])
 12810  	for {
 12811  		s := auxIntToInt64(v.AuxInt)
 12812  		if v_0.Op != OpPPC64AND {
 12813  			break
 12814  		}
 12815  		_ = v_0.Args[1]
 12816  		v_0_0 := v_0.Args[0]
 12817  		v_0_1 := v_0.Args[1]
 12818  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 12819  			if v_0_0.Op != OpPPC64MOVDconst {
 12820  				continue
 12821  			}
 12822  			m := auxIntToInt64(v_0_0.AuxInt)
 12823  			if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 12824  				continue
 12825  			}
 12826  			v.reset(OpPPC64MOVDconst)
 12827  			v.AuxInt = int64ToAuxInt(0)
 12828  			return true
 12829  		}
 12830  		break
 12831  	}
 12832  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 12833  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 12834  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 12835  	for {
 12836  		s := auxIntToInt64(v.AuxInt)
 12837  		if v_0.Op != OpPPC64AND {
 12838  			break
 12839  		}
 12840  		_ = v_0.Args[1]
 12841  		v_0_0 := v_0.Args[0]
 12842  		v_0_1 := v_0.Args[1]
 12843  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 12844  			if v_0_0.Op != OpPPC64MOVDconst {
 12845  				continue
 12846  			}
 12847  			m := auxIntToInt64(v_0_0.AuxInt)
 12848  			x := v_0_1
 12849  			if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 12850  				continue
 12851  			}
 12852  			v.reset(OpPPC64RLWINM)
 12853  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 12854  			v.AddArg(x)
 12855  			return true
 12856  		}
 12857  		break
 12858  	}
 12859  	return false
 12860  }
 12861  func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
 12862  	v_1 := v.Args[1]
 12863  	v_0 := v.Args[0]
 12864  	// match: (SUB x (MOVDconst [c]))
 12865  	// cond: is32Bit(-c)
 12866  	// result: (ADDconst [-c] x)
 12867  	for {
 12868  		x := v_0
 12869  		if v_1.Op != OpPPC64MOVDconst {
 12870  			break
 12871  		}
 12872  		c := auxIntToInt64(v_1.AuxInt)
 12873  		if !(is32Bit(-c)) {
 12874  			break
 12875  		}
 12876  		v.reset(OpPPC64ADDconst)
 12877  		v.AuxInt = int64ToAuxInt(-c)
 12878  		v.AddArg(x)
 12879  		return true
 12880  	}
 12881  	// match: (SUB (MOVDconst [c]) x)
 12882  	// cond: is32Bit(c)
 12883  	// result: (SUBFCconst [c] x)
 12884  	for {
 12885  		if v_0.Op != OpPPC64MOVDconst {
 12886  			break
 12887  		}
 12888  		c := auxIntToInt64(v_0.AuxInt)
 12889  		x := v_1
 12890  		if !(is32Bit(c)) {
 12891  			break
 12892  		}
 12893  		v.reset(OpPPC64SUBFCconst)
 12894  		v.AuxInt = int64ToAuxInt(c)
 12895  		v.AddArg(x)
 12896  		return true
 12897  	}
 12898  	return false
 12899  }
 12900  func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
 12901  	v_2 := v.Args[2]
 12902  	v_1 := v.Args[1]
 12903  	v_0 := v.Args[0]
 12904  	b := v.Block
 12905  	typ := &b.Func.Config.Types
 12906  	// match: (SUBE x y (Select1 <typ.UInt64> (SUBCconst (MOVDconst [0]) [0])))
 12907  	// result: (SUBC x y)
 12908  	for {
 12909  		x := v_0
 12910  		y := v_1
 12911  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
 12912  			break
 12913  		}
 12914  		v_2_0 := v_2.Args[0]
 12915  		if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
 12916  			break
 12917  		}
 12918  		v_2_0_0 := v_2_0.Args[0]
 12919  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
 12920  			break
 12921  		}
 12922  		v.reset(OpPPC64SUBC)
 12923  		v.AddArg2(x, y)
 12924  		return true
 12925  	}
 12926  	return false
 12927  }
 12928  func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
 12929  	v_0 := v.Args[0]
 12930  	// match: (SUBFCconst [c] (NEG x))
 12931  	// result: (ADDconst [c] x)
 12932  	for {
 12933  		c := auxIntToInt64(v.AuxInt)
 12934  		if v_0.Op != OpPPC64NEG {
 12935  			break
 12936  		}
 12937  		x := v_0.Args[0]
 12938  		v.reset(OpPPC64ADDconst)
 12939  		v.AuxInt = int64ToAuxInt(c)
 12940  		v.AddArg(x)
 12941  		return true
 12942  	}
 12943  	// match: (SUBFCconst [c] (SUBFCconst [d] x))
 12944  	// cond: is32Bit(c-d)
 12945  	// result: (ADDconst [c-d] x)
 12946  	for {
 12947  		c := auxIntToInt64(v.AuxInt)
 12948  		if v_0.Op != OpPPC64SUBFCconst {
 12949  			break
 12950  		}
 12951  		d := auxIntToInt64(v_0.AuxInt)
 12952  		x := v_0.Args[0]
 12953  		if !(is32Bit(c - d)) {
 12954  			break
 12955  		}
 12956  		v.reset(OpPPC64ADDconst)
 12957  		v.AuxInt = int64ToAuxInt(c - d)
 12958  		v.AddArg(x)
 12959  		return true
 12960  	}
 12961  	// match: (SUBFCconst [0] x)
 12962  	// result: (NEG x)
 12963  	for {
 12964  		if auxIntToInt64(v.AuxInt) != 0 {
 12965  			break
 12966  		}
 12967  		x := v_0
 12968  		v.reset(OpPPC64NEG)
 12969  		v.AddArg(x)
 12970  		return true
 12971  	}
 12972  	return false
 12973  }
 12974  func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
 12975  	v_1 := v.Args[1]
 12976  	v_0 := v.Args[0]
 12977  	// match: (XOR (MOVDconst [c]) (MOVDconst [d]))
 12978  	// result: (MOVDconst [c^d])
 12979  	for {
 12980  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12981  			if v_0.Op != OpPPC64MOVDconst {
 12982  				continue
 12983  			}
 12984  			c := auxIntToInt64(v_0.AuxInt)
 12985  			if v_1.Op != OpPPC64MOVDconst {
 12986  				continue
 12987  			}
 12988  			d := auxIntToInt64(v_1.AuxInt)
 12989  			v.reset(OpPPC64MOVDconst)
 12990  			v.AuxInt = int64ToAuxInt(c ^ d)
 12991  			return true
 12992  		}
 12993  		break
 12994  	}
 12995  	// match: (XOR x (MOVDconst [c]))
 12996  	// cond: isU32Bit(c)
 12997  	// result: (XORconst [c] x)
 12998  	for {
 12999  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13000  			x := v_0
 13001  			if v_1.Op != OpPPC64MOVDconst {
 13002  				continue
 13003  			}
 13004  			c := auxIntToInt64(v_1.AuxInt)
 13005  			if !(isU32Bit(c)) {
 13006  				continue
 13007  			}
 13008  			v.reset(OpPPC64XORconst)
 13009  			v.AuxInt = int64ToAuxInt(c)
 13010  			v.AddArg(x)
 13011  			return true
 13012  		}
 13013  		break
 13014  	}
 13015  	return false
 13016  }
 13017  func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
 13018  	v_0 := v.Args[0]
 13019  	// match: (XORconst [c] (XORconst [d] x))
 13020  	// result: (XORconst [c^d] x)
 13021  	for {
 13022  		c := auxIntToInt64(v.AuxInt)
 13023  		if v_0.Op != OpPPC64XORconst {
 13024  			break
 13025  		}
 13026  		d := auxIntToInt64(v_0.AuxInt)
 13027  		x := v_0.Args[0]
 13028  		v.reset(OpPPC64XORconst)
 13029  		v.AuxInt = int64ToAuxInt(c ^ d)
 13030  		v.AddArg(x)
 13031  		return true
 13032  	}
 13033  	// match: (XORconst [0] x)
 13034  	// result: x
 13035  	for {
 13036  		if auxIntToInt64(v.AuxInt) != 0 {
 13037  			break
 13038  		}
 13039  		x := v_0
 13040  		v.copyOf(x)
 13041  		return true
 13042  	}
 13043  	// match: (XORconst [1] (SETBCR [n] cmp))
 13044  	// result: (SETBC [n] cmp)
 13045  	for {
 13046  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
 13047  			break
 13048  		}
 13049  		n := auxIntToInt32(v_0.AuxInt)
 13050  		cmp := v_0.Args[0]
 13051  		v.reset(OpPPC64SETBC)
 13052  		v.AuxInt = int32ToAuxInt(n)
 13053  		v.AddArg(cmp)
 13054  		return true
 13055  	}
 13056  	// match: (XORconst [1] (SETBC [n] cmp))
 13057  	// result: (SETBCR [n] cmp)
 13058  	for {
 13059  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
 13060  			break
 13061  		}
 13062  		n := auxIntToInt32(v_0.AuxInt)
 13063  		cmp := v_0.Args[0]
 13064  		v.reset(OpPPC64SETBCR)
 13065  		v.AuxInt = int32ToAuxInt(n)
 13066  		v.AddArg(cmp)
 13067  		return true
 13068  	}
 13069  	return false
 13070  }
 13071  func rewriteValuePPC64_OpPopCount16(v *Value) bool {
 13072  	v_0 := v.Args[0]
 13073  	b := v.Block
 13074  	typ := &b.Func.Config.Types
 13075  	// match: (PopCount16 x)
 13076  	// result: (POPCNTW (MOVHZreg x))
 13077  	for {
 13078  		x := v_0
 13079  		v.reset(OpPPC64POPCNTW)
 13080  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13081  		v0.AddArg(x)
 13082  		v.AddArg(v0)
 13083  		return true
 13084  	}
 13085  }
 13086  func rewriteValuePPC64_OpPopCount32(v *Value) bool {
 13087  	v_0 := v.Args[0]
 13088  	b := v.Block
 13089  	typ := &b.Func.Config.Types
 13090  	// match: (PopCount32 x)
 13091  	// result: (POPCNTW (MOVWZreg x))
 13092  	for {
 13093  		x := v_0
 13094  		v.reset(OpPPC64POPCNTW)
 13095  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 13096  		v0.AddArg(x)
 13097  		v.AddArg(v0)
 13098  		return true
 13099  	}
 13100  }
 13101  func rewriteValuePPC64_OpPopCount8(v *Value) bool {
 13102  	v_0 := v.Args[0]
 13103  	b := v.Block
 13104  	typ := &b.Func.Config.Types
 13105  	// match: (PopCount8 x)
 13106  	// result: (POPCNTB (MOVBZreg x))
 13107  	for {
 13108  		x := v_0
 13109  		v.reset(OpPPC64POPCNTB)
 13110  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 13111  		v0.AddArg(x)
 13112  		v.AddArg(v0)
 13113  		return true
 13114  	}
 13115  }
 13116  func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
 13117  	v_1 := v.Args[1]
 13118  	v_0 := v.Args[0]
 13119  	// match: (PrefetchCache ptr mem)
 13120  	// result: (DCBT ptr mem [0])
 13121  	for {
 13122  		ptr := v_0
 13123  		mem := v_1
 13124  		v.reset(OpPPC64DCBT)
 13125  		v.AuxInt = int64ToAuxInt(0)
 13126  		v.AddArg2(ptr, mem)
 13127  		return true
 13128  	}
 13129  }
 13130  func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
 13131  	v_1 := v.Args[1]
 13132  	v_0 := v.Args[0]
 13133  	// match: (PrefetchCacheStreamed ptr mem)
 13134  	// result: (DCBT ptr mem [16])
 13135  	for {
 13136  		ptr := v_0
 13137  		mem := v_1
 13138  		v.reset(OpPPC64DCBT)
 13139  		v.AuxInt = int64ToAuxInt(16)
 13140  		v.AddArg2(ptr, mem)
 13141  		return true
 13142  	}
 13143  }
 13144  func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
 13145  	v_1 := v.Args[1]
 13146  	v_0 := v.Args[0]
 13147  	b := v.Block
 13148  	typ := &b.Func.Config.Types
 13149  	// match: (RotateLeft16 <t> x (MOVDconst [c]))
 13150  	// result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
 13151  	for {
 13152  		t := v.Type
 13153  		x := v_0
 13154  		if v_1.Op != OpPPC64MOVDconst {
 13155  			break
 13156  		}
 13157  		c := auxIntToInt64(v_1.AuxInt)
 13158  		v.reset(OpOr16)
 13159  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 13160  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13161  		v1.AuxInt = int64ToAuxInt(c & 15)
 13162  		v0.AddArg2(x, v1)
 13163  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 13164  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13165  		v3.AuxInt = int64ToAuxInt(-c & 15)
 13166  		v2.AddArg2(x, v3)
 13167  		v.AddArg2(v0, v2)
 13168  		return true
 13169  	}
 13170  	return false
 13171  }
 13172  func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
 13173  	v_1 := v.Args[1]
 13174  	v_0 := v.Args[0]
 13175  	b := v.Block
 13176  	typ := &b.Func.Config.Types
 13177  	// match: (RotateLeft8 <t> x (MOVDconst [c]))
 13178  	// result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
 13179  	for {
 13180  		t := v.Type
 13181  		x := v_0
 13182  		if v_1.Op != OpPPC64MOVDconst {
 13183  			break
 13184  		}
 13185  		c := auxIntToInt64(v_1.AuxInt)
 13186  		v.reset(OpOr8)
 13187  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 13188  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13189  		v1.AuxInt = int64ToAuxInt(c & 7)
 13190  		v0.AddArg2(x, v1)
 13191  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 13192  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13193  		v3.AuxInt = int64ToAuxInt(-c & 7)
 13194  		v2.AddArg2(x, v3)
 13195  		v.AddArg2(v0, v2)
 13196  		return true
 13197  	}
 13198  	return false
 13199  }
 13200  func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
 13201  	v_1 := v.Args[1]
 13202  	v_0 := v.Args[0]
 13203  	b := v.Block
 13204  	typ := &b.Func.Config.Types
 13205  	// match: (Rsh16Ux16 x y)
 13206  	// cond: shiftIsBounded(v)
 13207  	// result: (SRD (MOVHZreg x) y)
 13208  	for {
 13209  		x := v_0
 13210  		y := v_1
 13211  		if !(shiftIsBounded(v)) {
 13212  			break
 13213  		}
 13214  		v.reset(OpPPC64SRD)
 13215  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13216  		v0.AddArg(x)
 13217  		v.AddArg2(v0, y)
 13218  		return true
 13219  	}
 13220  	// match: (Rsh16Ux16 <t> x y)
 13221  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF0] y)))
 13222  	for {
 13223  		t := v.Type
 13224  		x := v_0
 13225  		y := v_1
 13226  		v.reset(OpPPC64ISEL)
 13227  		v.AuxInt = int32ToAuxInt(2)
 13228  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13229  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13230  		v1.AddArg(x)
 13231  		v0.AddArg2(v1, y)
 13232  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13233  		v2.AuxInt = int64ToAuxInt(0)
 13234  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13235  		v3.AuxInt = int64ToAuxInt(0)
 13236  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13237  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13238  		v4.AddArg(y)
 13239  		v3.AddArg(v4)
 13240  		v.AddArg3(v0, v2, v3)
 13241  		return true
 13242  	}
 13243  }
 13244  func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
 13245  	v_1 := v.Args[1]
 13246  	v_0 := v.Args[0]
 13247  	b := v.Block
 13248  	typ := &b.Func.Config.Types
 13249  	// match: (Rsh16Ux32 x y)
 13250  	// cond: shiftIsBounded(v)
 13251  	// result: (SRD (MOVHZreg x) y)
 13252  	for {
 13253  		x := v_0
 13254  		y := v_1
 13255  		if !(shiftIsBounded(v)) {
 13256  			break
 13257  		}
 13258  		v.reset(OpPPC64SRD)
 13259  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13260  		v0.AddArg(x)
 13261  		v.AddArg2(v0, y)
 13262  		return true
 13263  	}
 13264  	// match: (Rsh16Ux32 <t> x y)
 13265  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
 13266  	for {
 13267  		t := v.Type
 13268  		x := v_0
 13269  		y := v_1
 13270  		v.reset(OpPPC64ISEL)
 13271  		v.AuxInt = int32ToAuxInt(0)
 13272  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13273  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13274  		v1.AddArg(x)
 13275  		v0.AddArg2(v1, y)
 13276  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13277  		v2.AuxInt = int64ToAuxInt(0)
 13278  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13279  		v3.AuxInt = int32ToAuxInt(16)
 13280  		v3.AddArg(y)
 13281  		v.AddArg3(v0, v2, v3)
 13282  		return true
 13283  	}
 13284  }
 13285  func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
 13286  	v_1 := v.Args[1]
 13287  	v_0 := v.Args[0]
 13288  	b := v.Block
 13289  	typ := &b.Func.Config.Types
 13290  	// match: (Rsh16Ux64 x (MOVDconst [c]))
 13291  	// cond: uint64(c) < 16
 13292  	// result: (SRWconst (ZeroExt16to32 x) [c])
 13293  	for {
 13294  		x := v_0
 13295  		if v_1.Op != OpPPC64MOVDconst {
 13296  			break
 13297  		}
 13298  		c := auxIntToInt64(v_1.AuxInt)
 13299  		if !(uint64(c) < 16) {
 13300  			break
 13301  		}
 13302  		v.reset(OpPPC64SRWconst)
 13303  		v.AuxInt = int64ToAuxInt(c)
 13304  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 13305  		v0.AddArg(x)
 13306  		v.AddArg(v0)
 13307  		return true
 13308  	}
 13309  	// match: (Rsh16Ux64 x y)
 13310  	// cond: shiftIsBounded(v)
 13311  	// result: (SRD (MOVHZreg x) y)
 13312  	for {
 13313  		x := v_0
 13314  		y := v_1
 13315  		if !(shiftIsBounded(v)) {
 13316  			break
 13317  		}
 13318  		v.reset(OpPPC64SRD)
 13319  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13320  		v0.AddArg(x)
 13321  		v.AddArg2(v0, y)
 13322  		return true
 13323  	}
 13324  	// match: (Rsh16Ux64 <t> x y)
 13325  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
 13326  	for {
 13327  		t := v.Type
 13328  		x := v_0
 13329  		y := v_1
 13330  		v.reset(OpPPC64ISEL)
 13331  		v.AuxInt = int32ToAuxInt(0)
 13332  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13333  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13334  		v1.AddArg(x)
 13335  		v0.AddArg2(v1, y)
 13336  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13337  		v2.AuxInt = int64ToAuxInt(0)
 13338  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13339  		v3.AuxInt = int64ToAuxInt(16)
 13340  		v3.AddArg(y)
 13341  		v.AddArg3(v0, v2, v3)
 13342  		return true
 13343  	}
 13344  }
 13345  func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
 13346  	v_1 := v.Args[1]
 13347  	v_0 := v.Args[0]
 13348  	b := v.Block
 13349  	typ := &b.Func.Config.Types
 13350  	// match: (Rsh16Ux8 x y)
 13351  	// cond: shiftIsBounded(v)
 13352  	// result: (SRD (MOVHZreg x) y)
 13353  	for {
 13354  		x := v_0
 13355  		y := v_1
 13356  		if !(shiftIsBounded(v)) {
 13357  			break
 13358  		}
 13359  		v.reset(OpPPC64SRD)
 13360  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13361  		v0.AddArg(x)
 13362  		v.AddArg2(v0, y)
 13363  		return true
 13364  	}
 13365  	// match: (Rsh16Ux8 <t> x y)
 13366  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F0] y)))
 13367  	for {
 13368  		t := v.Type
 13369  		x := v_0
 13370  		y := v_1
 13371  		v.reset(OpPPC64ISEL)
 13372  		v.AuxInt = int32ToAuxInt(2)
 13373  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13374  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13375  		v1.AddArg(x)
 13376  		v0.AddArg2(v1, y)
 13377  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13378  		v2.AuxInt = int64ToAuxInt(0)
 13379  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13380  		v3.AuxInt = int64ToAuxInt(0)
 13381  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13382  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13383  		v4.AddArg(y)
 13384  		v3.AddArg(v4)
 13385  		v.AddArg3(v0, v2, v3)
 13386  		return true
 13387  	}
 13388  }
 13389  func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
 13390  	v_1 := v.Args[1]
 13391  	v_0 := v.Args[0]
 13392  	b := v.Block
 13393  	typ := &b.Func.Config.Types
 13394  	// match: (Rsh16x16 x y)
 13395  	// cond: shiftIsBounded(v)
 13396  	// result: (SRAD (MOVHreg x) y)
 13397  	for {
 13398  		x := v_0
 13399  		y := v_1
 13400  		if !(shiftIsBounded(v)) {
 13401  			break
 13402  		}
 13403  		v.reset(OpPPC64SRAD)
 13404  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13405  		v0.AddArg(x)
 13406  		v.AddArg2(v0, y)
 13407  		return true
 13408  	}
 13409  	// match: (Rsh16x16 <t> x y)
 13410  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPconst [0] (ANDconst [0xFFF0] y)))
 13411  	for {
 13412  		t := v.Type
 13413  		x := v_0
 13414  		y := v_1
 13415  		v.reset(OpPPC64ISEL)
 13416  		v.AuxInt = int32ToAuxInt(2)
 13417  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13418  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13419  		v1.AddArg(x)
 13420  		v0.AddArg2(v1, y)
 13421  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13422  		v2.AuxInt = int64ToAuxInt(15)
 13423  		v2.AddArg(v1)
 13424  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13425  		v3.AuxInt = int64ToAuxInt(0)
 13426  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13427  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13428  		v4.AddArg(y)
 13429  		v3.AddArg(v4)
 13430  		v.AddArg3(v0, v2, v3)
 13431  		return true
 13432  	}
 13433  }
 13434  func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
 13435  	v_1 := v.Args[1]
 13436  	v_0 := v.Args[0]
 13437  	b := v.Block
 13438  	typ := &b.Func.Config.Types
 13439  	// match: (Rsh16x32 x y)
 13440  	// cond: shiftIsBounded(v)
 13441  	// result: (SRAD (MOVHreg x) y)
 13442  	for {
 13443  		x := v_0
 13444  		y := v_1
 13445  		if !(shiftIsBounded(v)) {
 13446  			break
 13447  		}
 13448  		v.reset(OpPPC64SRAD)
 13449  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13450  		v0.AddArg(x)
 13451  		v.AddArg2(v0, y)
 13452  		return true
 13453  	}
 13454  	// match: (Rsh16x32 <t> x y)
 13455  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPWUconst y [16]))
 13456  	for {
 13457  		t := v.Type
 13458  		x := v_0
 13459  		y := v_1
 13460  		v.reset(OpPPC64ISEL)
 13461  		v.AuxInt = int32ToAuxInt(0)
 13462  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13463  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13464  		v1.AddArg(x)
 13465  		v0.AddArg2(v1, y)
 13466  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13467  		v2.AuxInt = int64ToAuxInt(15)
 13468  		v2.AddArg(v1)
 13469  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13470  		v3.AuxInt = int32ToAuxInt(16)
 13471  		v3.AddArg(y)
 13472  		v.AddArg3(v0, v2, v3)
 13473  		return true
 13474  	}
 13475  }
 13476  func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
 13477  	v_1 := v.Args[1]
 13478  	v_0 := v.Args[0]
 13479  	b := v.Block
 13480  	typ := &b.Func.Config.Types
 13481  	// match: (Rsh16x64 x (MOVDconst [c]))
 13482  	// cond: uint64(c) >= 16
 13483  	// result: (SRAWconst (SignExt16to32 x) [63])
 13484  	for {
 13485  		x := v_0
 13486  		if v_1.Op != OpPPC64MOVDconst {
 13487  			break
 13488  		}
 13489  		c := auxIntToInt64(v_1.AuxInt)
 13490  		if !(uint64(c) >= 16) {
 13491  			break
 13492  		}
 13493  		v.reset(OpPPC64SRAWconst)
 13494  		v.AuxInt = int64ToAuxInt(63)
 13495  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13496  		v0.AddArg(x)
 13497  		v.AddArg(v0)
 13498  		return true
 13499  	}
 13500  	// match: (Rsh16x64 x (MOVDconst [c]))
 13501  	// cond: uint64(c) < 16
 13502  	// result: (SRAWconst (SignExt16to32 x) [c])
 13503  	for {
 13504  		x := v_0
 13505  		if v_1.Op != OpPPC64MOVDconst {
 13506  			break
 13507  		}
 13508  		c := auxIntToInt64(v_1.AuxInt)
 13509  		if !(uint64(c) < 16) {
 13510  			break
 13511  		}
 13512  		v.reset(OpPPC64SRAWconst)
 13513  		v.AuxInt = int64ToAuxInt(c)
 13514  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13515  		v0.AddArg(x)
 13516  		v.AddArg(v0)
 13517  		return true
 13518  	}
 13519  	// match: (Rsh16x64 x y)
 13520  	// cond: shiftIsBounded(v)
 13521  	// result: (SRAD (MOVHreg x) y)
 13522  	for {
 13523  		x := v_0
 13524  		y := v_1
 13525  		if !(shiftIsBounded(v)) {
 13526  			break
 13527  		}
 13528  		v.reset(OpPPC64SRAD)
 13529  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13530  		v0.AddArg(x)
 13531  		v.AddArg2(v0, y)
 13532  		return true
 13533  	}
 13534  	// match: (Rsh16x64 <t> x y)
 13535  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPUconst y [16]))
 13536  	for {
 13537  		t := v.Type
 13538  		x := v_0
 13539  		y := v_1
 13540  		v.reset(OpPPC64ISEL)
 13541  		v.AuxInt = int32ToAuxInt(0)
 13542  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13543  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13544  		v1.AddArg(x)
 13545  		v0.AddArg2(v1, y)
 13546  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13547  		v2.AuxInt = int64ToAuxInt(15)
 13548  		v2.AddArg(v1)
 13549  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13550  		v3.AuxInt = int64ToAuxInt(16)
 13551  		v3.AddArg(y)
 13552  		v.AddArg3(v0, v2, v3)
 13553  		return true
 13554  	}
 13555  }
 13556  func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
 13557  	v_1 := v.Args[1]
 13558  	v_0 := v.Args[0]
 13559  	b := v.Block
 13560  	typ := &b.Func.Config.Types
 13561  	// match: (Rsh16x8 x y)
 13562  	// cond: shiftIsBounded(v)
 13563  	// result: (SRAD (MOVHreg x) y)
 13564  	for {
 13565  		x := v_0
 13566  		y := v_1
 13567  		if !(shiftIsBounded(v)) {
 13568  			break
 13569  		}
 13570  		v.reset(OpPPC64SRAD)
 13571  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13572  		v0.AddArg(x)
 13573  		v.AddArg2(v0, y)
 13574  		return true
 13575  	}
 13576  	// match: (Rsh16x8 <t> x y)
 13577  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPconst [0] (ANDconst [0x00F0] y)))
 13578  	for {
 13579  		t := v.Type
 13580  		x := v_0
 13581  		y := v_1
 13582  		v.reset(OpPPC64ISEL)
 13583  		v.AuxInt = int32ToAuxInt(2)
 13584  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13585  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13586  		v1.AddArg(x)
 13587  		v0.AddArg2(v1, y)
 13588  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13589  		v2.AuxInt = int64ToAuxInt(15)
 13590  		v2.AddArg(v1)
 13591  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13592  		v3.AuxInt = int64ToAuxInt(0)
 13593  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13594  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13595  		v4.AddArg(y)
 13596  		v3.AddArg(v4)
 13597  		v.AddArg3(v0, v2, v3)
 13598  		return true
 13599  	}
 13600  }
 13601  func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
 13602  	v_1 := v.Args[1]
 13603  	v_0 := v.Args[0]
 13604  	b := v.Block
 13605  	typ := &b.Func.Config.Types
 13606  	// match: (Rsh32Ux16 x y)
 13607  	// cond: shiftIsBounded(v)
 13608  	// result: (SRW x y)
 13609  	for {
 13610  		x := v_0
 13611  		y := v_1
 13612  		if !(shiftIsBounded(v)) {
 13613  			break
 13614  		}
 13615  		v.reset(OpPPC64SRW)
 13616  		v.AddArg2(x, y)
 13617  		return true
 13618  	}
 13619  	// match: (Rsh32Ux16 <t> x y)
 13620  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFE0] y)))
 13621  	for {
 13622  		t := v.Type
 13623  		x := v_0
 13624  		y := v_1
 13625  		v.reset(OpPPC64ISEL)
 13626  		v.AuxInt = int32ToAuxInt(2)
 13627  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13628  		v0.AddArg2(x, y)
 13629  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13630  		v1.AuxInt = int64ToAuxInt(0)
 13631  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13632  		v2.AuxInt = int64ToAuxInt(0)
 13633  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13634  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 13635  		v3.AddArg(y)
 13636  		v2.AddArg(v3)
 13637  		v.AddArg3(v0, v1, v2)
 13638  		return true
 13639  	}
 13640  }
 13641  func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
 13642  	v_1 := v.Args[1]
 13643  	v_0 := v.Args[0]
 13644  	b := v.Block
 13645  	typ := &b.Func.Config.Types
 13646  	// match: (Rsh32Ux32 x y)
 13647  	// cond: shiftIsBounded(v)
 13648  	// result: (SRW x y)
 13649  	for {
 13650  		x := v_0
 13651  		y := v_1
 13652  		if !(shiftIsBounded(v)) {
 13653  			break
 13654  		}
 13655  		v.reset(OpPPC64SRW)
 13656  		v.AddArg2(x, y)
 13657  		return true
 13658  	}
 13659  	// match: (Rsh32Ux32 <t> x y)
 13660  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
 13661  	for {
 13662  		t := v.Type
 13663  		x := v_0
 13664  		y := v_1
 13665  		v.reset(OpPPC64ISEL)
 13666  		v.AuxInt = int32ToAuxInt(0)
 13667  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13668  		v0.AddArg2(x, y)
 13669  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13670  		v1.AuxInt = int64ToAuxInt(0)
 13671  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13672  		v2.AuxInt = int32ToAuxInt(32)
 13673  		v2.AddArg(y)
 13674  		v.AddArg3(v0, v1, v2)
 13675  		return true
 13676  	}
 13677  }
 13678  func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
 13679  	v_1 := v.Args[1]
 13680  	v_0 := v.Args[0]
 13681  	b := v.Block
 13682  	typ := &b.Func.Config.Types
 13683  	// match: (Rsh32Ux64 x (MOVDconst [c]))
 13684  	// cond: uint64(c) < 32
 13685  	// result: (SRWconst x [c])
 13686  	for {
 13687  		x := v_0
 13688  		if v_1.Op != OpPPC64MOVDconst {
 13689  			break
 13690  		}
 13691  		c := auxIntToInt64(v_1.AuxInt)
 13692  		if !(uint64(c) < 32) {
 13693  			break
 13694  		}
 13695  		v.reset(OpPPC64SRWconst)
 13696  		v.AuxInt = int64ToAuxInt(c)
 13697  		v.AddArg(x)
 13698  		return true
 13699  	}
 13700  	// match: (Rsh32Ux64 x y)
 13701  	// cond: shiftIsBounded(v)
 13702  	// result: (SRW x y)
 13703  	for {
 13704  		x := v_0
 13705  		y := v_1
 13706  		if !(shiftIsBounded(v)) {
 13707  			break
 13708  		}
 13709  		v.reset(OpPPC64SRW)
 13710  		v.AddArg2(x, y)
 13711  		return true
 13712  	}
 13713  	// match: (Rsh32Ux64 <t> x y)
 13714  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
 13715  	for {
 13716  		t := v.Type
 13717  		x := v_0
 13718  		y := v_1
 13719  		v.reset(OpPPC64ISEL)
 13720  		v.AuxInt = int32ToAuxInt(0)
 13721  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13722  		v0.AddArg2(x, y)
 13723  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13724  		v1.AuxInt = int64ToAuxInt(0)
 13725  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13726  		v2.AuxInt = int64ToAuxInt(32)
 13727  		v2.AddArg(y)
 13728  		v.AddArg3(v0, v1, v2)
 13729  		return true
 13730  	}
 13731  }
 13732  func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
 13733  	v_1 := v.Args[1]
 13734  	v_0 := v.Args[0]
 13735  	b := v.Block
 13736  	typ := &b.Func.Config.Types
 13737  	// match: (Rsh32Ux8 x y)
 13738  	// cond: shiftIsBounded(v)
 13739  	// result: (SRW x y)
 13740  	for {
 13741  		x := v_0
 13742  		y := v_1
 13743  		if !(shiftIsBounded(v)) {
 13744  			break
 13745  		}
 13746  		v.reset(OpPPC64SRW)
 13747  		v.AddArg2(x, y)
 13748  		return true
 13749  	}
 13750  	// match: (Rsh32Ux8 <t> x y)
 13751  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00E0] y)))
 13752  	for {
 13753  		t := v.Type
 13754  		x := v_0
 13755  		y := v_1
 13756  		v.reset(OpPPC64ISEL)
 13757  		v.AuxInt = int32ToAuxInt(2)
 13758  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13759  		v0.AddArg2(x, y)
 13760  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13761  		v1.AuxInt = int64ToAuxInt(0)
 13762  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13763  		v2.AuxInt = int64ToAuxInt(0)
 13764  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13765  		v3.AuxInt = int64ToAuxInt(0x00E0)
 13766  		v3.AddArg(y)
 13767  		v2.AddArg(v3)
 13768  		v.AddArg3(v0, v1, v2)
 13769  		return true
 13770  	}
 13771  }
 13772  func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
 13773  	v_1 := v.Args[1]
 13774  	v_0 := v.Args[0]
 13775  	b := v.Block
 13776  	typ := &b.Func.Config.Types
 13777  	// match: (Rsh32x16 x y)
 13778  	// cond: shiftIsBounded(v)
 13779  	// result: (SRAW x y)
 13780  	for {
 13781  		x := v_0
 13782  		y := v_1
 13783  		if !(shiftIsBounded(v)) {
 13784  			break
 13785  		}
 13786  		v.reset(OpPPC64SRAW)
 13787  		v.AddArg2(x, y)
 13788  		return true
 13789  	}
 13790  	// match: (Rsh32x16 <t> x y)
 13791  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPconst [0] (ANDconst [0xFFE0] y)))
 13792  	for {
 13793  		t := v.Type
 13794  		x := v_0
 13795  		y := v_1
 13796  		v.reset(OpPPC64ISEL)
 13797  		v.AuxInt = int32ToAuxInt(2)
 13798  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13799  		v0.AddArg2(x, y)
 13800  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13801  		v1.AuxInt = int64ToAuxInt(31)
 13802  		v1.AddArg(x)
 13803  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13804  		v2.AuxInt = int64ToAuxInt(0)
 13805  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13806  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 13807  		v3.AddArg(y)
 13808  		v2.AddArg(v3)
 13809  		v.AddArg3(v0, v1, v2)
 13810  		return true
 13811  	}
 13812  }
 13813  func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
 13814  	v_1 := v.Args[1]
 13815  	v_0 := v.Args[0]
 13816  	b := v.Block
 13817  	// match: (Rsh32x32 x y)
 13818  	// cond: shiftIsBounded(v)
 13819  	// result: (SRAW x y)
 13820  	for {
 13821  		x := v_0
 13822  		y := v_1
 13823  		if !(shiftIsBounded(v)) {
 13824  			break
 13825  		}
 13826  		v.reset(OpPPC64SRAW)
 13827  		v.AddArg2(x, y)
 13828  		return true
 13829  	}
 13830  	// match: (Rsh32x32 <t> x y)
 13831  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPWUconst y [32]))
 13832  	for {
 13833  		t := v.Type
 13834  		x := v_0
 13835  		y := v_1
 13836  		v.reset(OpPPC64ISEL)
 13837  		v.AuxInt = int32ToAuxInt(0)
 13838  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13839  		v0.AddArg2(x, y)
 13840  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13841  		v1.AuxInt = int64ToAuxInt(31)
 13842  		v1.AddArg(x)
 13843  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13844  		v2.AuxInt = int32ToAuxInt(32)
 13845  		v2.AddArg(y)
 13846  		v.AddArg3(v0, v1, v2)
 13847  		return true
 13848  	}
 13849  }
 13850  func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
 13851  	v_1 := v.Args[1]
 13852  	v_0 := v.Args[0]
 13853  	b := v.Block
 13854  	// match: (Rsh32x64 x (MOVDconst [c]))
 13855  	// cond: uint64(c) >= 32
 13856  	// result: (SRAWconst x [63])
 13857  	for {
 13858  		x := v_0
 13859  		if v_1.Op != OpPPC64MOVDconst {
 13860  			break
 13861  		}
 13862  		c := auxIntToInt64(v_1.AuxInt)
 13863  		if !(uint64(c) >= 32) {
 13864  			break
 13865  		}
 13866  		v.reset(OpPPC64SRAWconst)
 13867  		v.AuxInt = int64ToAuxInt(63)
 13868  		v.AddArg(x)
 13869  		return true
 13870  	}
 13871  	// match: (Rsh32x64 x (MOVDconst [c]))
 13872  	// cond: uint64(c) < 32
 13873  	// result: (SRAWconst x [c])
 13874  	for {
 13875  		x := v_0
 13876  		if v_1.Op != OpPPC64MOVDconst {
 13877  			break
 13878  		}
 13879  		c := auxIntToInt64(v_1.AuxInt)
 13880  		if !(uint64(c) < 32) {
 13881  			break
 13882  		}
 13883  		v.reset(OpPPC64SRAWconst)
 13884  		v.AuxInt = int64ToAuxInt(c)
 13885  		v.AddArg(x)
 13886  		return true
 13887  	}
 13888  	// match: (Rsh32x64 x y)
 13889  	// cond: shiftIsBounded(v)
 13890  	// result: (SRAW x y)
 13891  	for {
 13892  		x := v_0
 13893  		y := v_1
 13894  		if !(shiftIsBounded(v)) {
 13895  			break
 13896  		}
 13897  		v.reset(OpPPC64SRAW)
 13898  		v.AddArg2(x, y)
 13899  		return true
 13900  	}
 13901  	// match: (Rsh32x64 <t> x y)
 13902  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPUconst y [32]))
 13903  	for {
 13904  		t := v.Type
 13905  		x := v_0
 13906  		y := v_1
 13907  		v.reset(OpPPC64ISEL)
 13908  		v.AuxInt = int32ToAuxInt(0)
 13909  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13910  		v0.AddArg2(x, y)
 13911  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13912  		v1.AuxInt = int64ToAuxInt(31)
 13913  		v1.AddArg(x)
 13914  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13915  		v2.AuxInt = int64ToAuxInt(32)
 13916  		v2.AddArg(y)
 13917  		v.AddArg3(v0, v1, v2)
 13918  		return true
 13919  	}
 13920  }
 13921  func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
 13922  	v_1 := v.Args[1]
 13923  	v_0 := v.Args[0]
 13924  	b := v.Block
 13925  	typ := &b.Func.Config.Types
 13926  	// match: (Rsh32x8 x y)
 13927  	// cond: shiftIsBounded(v)
 13928  	// result: (SRAW x y)
 13929  	for {
 13930  		x := v_0
 13931  		y := v_1
 13932  		if !(shiftIsBounded(v)) {
 13933  			break
 13934  		}
 13935  		v.reset(OpPPC64SRAW)
 13936  		v.AddArg2(x, y)
 13937  		return true
 13938  	}
 13939  	// match: (Rsh32x8 <t> x y)
 13940  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPconst [0] (ANDconst [0x00E0] y)))
 13941  	for {
 13942  		t := v.Type
 13943  		x := v_0
 13944  		y := v_1
 13945  		v.reset(OpPPC64ISEL)
 13946  		v.AuxInt = int32ToAuxInt(2)
 13947  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13948  		v0.AddArg2(x, y)
 13949  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13950  		v1.AuxInt = int64ToAuxInt(31)
 13951  		v1.AddArg(x)
 13952  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13953  		v2.AuxInt = int64ToAuxInt(0)
 13954  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13955  		v3.AuxInt = int64ToAuxInt(0x00E0)
 13956  		v3.AddArg(y)
 13957  		v2.AddArg(v3)
 13958  		v.AddArg3(v0, v1, v2)
 13959  		return true
 13960  	}
 13961  }
 13962  func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
 13963  	v_1 := v.Args[1]
 13964  	v_0 := v.Args[0]
 13965  	b := v.Block
 13966  	typ := &b.Func.Config.Types
 13967  	// match: (Rsh64Ux16 x y)
 13968  	// cond: shiftIsBounded(v)
 13969  	// result: (SRD x y)
 13970  	for {
 13971  		x := v_0
 13972  		y := v_1
 13973  		if !(shiftIsBounded(v)) {
 13974  			break
 13975  		}
 13976  		v.reset(OpPPC64SRD)
 13977  		v.AddArg2(x, y)
 13978  		return true
 13979  	}
 13980  	// match: (Rsh64Ux16 <t> x y)
 13981  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFC0] y)))
 13982  	for {
 13983  		t := v.Type
 13984  		x := v_0
 13985  		y := v_1
 13986  		v.reset(OpPPC64ISEL)
 13987  		v.AuxInt = int32ToAuxInt(2)
 13988  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13989  		v0.AddArg2(x, y)
 13990  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13991  		v1.AuxInt = int64ToAuxInt(0)
 13992  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13993  		v2.AuxInt = int64ToAuxInt(0)
 13994  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13995  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 13996  		v3.AddArg(y)
 13997  		v2.AddArg(v3)
 13998  		v.AddArg3(v0, v1, v2)
 13999  		return true
 14000  	}
 14001  }
 14002  func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
 14003  	v_1 := v.Args[1]
 14004  	v_0 := v.Args[0]
 14005  	b := v.Block
 14006  	typ := &b.Func.Config.Types
 14007  	// match: (Rsh64Ux32 x y)
 14008  	// cond: shiftIsBounded(v)
 14009  	// result: (SRD x y)
 14010  	for {
 14011  		x := v_0
 14012  		y := v_1
 14013  		if !(shiftIsBounded(v)) {
 14014  			break
 14015  		}
 14016  		v.reset(OpPPC64SRD)
 14017  		v.AddArg2(x, y)
 14018  		return true
 14019  	}
 14020  	// match: (Rsh64Ux32 <t> x y)
 14021  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
 14022  	for {
 14023  		t := v.Type
 14024  		x := v_0
 14025  		y := v_1
 14026  		v.reset(OpPPC64ISEL)
 14027  		v.AuxInt = int32ToAuxInt(0)
 14028  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14029  		v0.AddArg2(x, y)
 14030  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14031  		v1.AuxInt = int64ToAuxInt(0)
 14032  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14033  		v2.AuxInt = int32ToAuxInt(64)
 14034  		v2.AddArg(y)
 14035  		v.AddArg3(v0, v1, v2)
 14036  		return true
 14037  	}
 14038  }
 14039  func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
 14040  	v_1 := v.Args[1]
 14041  	v_0 := v.Args[0]
 14042  	b := v.Block
 14043  	typ := &b.Func.Config.Types
 14044  	// match: (Rsh64Ux64 x (MOVDconst [c]))
 14045  	// cond: uint64(c) < 64
 14046  	// result: (SRDconst x [c])
 14047  	for {
 14048  		x := v_0
 14049  		if v_1.Op != OpPPC64MOVDconst {
 14050  			break
 14051  		}
 14052  		c := auxIntToInt64(v_1.AuxInt)
 14053  		if !(uint64(c) < 64) {
 14054  			break
 14055  		}
 14056  		v.reset(OpPPC64SRDconst)
 14057  		v.AuxInt = int64ToAuxInt(c)
 14058  		v.AddArg(x)
 14059  		return true
 14060  	}
 14061  	// match: (Rsh64Ux64 x y)
 14062  	// cond: shiftIsBounded(v)
 14063  	// result: (SRD x y)
 14064  	for {
 14065  		x := v_0
 14066  		y := v_1
 14067  		if !(shiftIsBounded(v)) {
 14068  			break
 14069  		}
 14070  		v.reset(OpPPC64SRD)
 14071  		v.AddArg2(x, y)
 14072  		return true
 14073  	}
 14074  	// match: (Rsh64Ux64 <t> x y)
 14075  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
 14076  	for {
 14077  		t := v.Type
 14078  		x := v_0
 14079  		y := v_1
 14080  		v.reset(OpPPC64ISEL)
 14081  		v.AuxInt = int32ToAuxInt(0)
 14082  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14083  		v0.AddArg2(x, y)
 14084  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14085  		v1.AuxInt = int64ToAuxInt(0)
 14086  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14087  		v2.AuxInt = int64ToAuxInt(64)
 14088  		v2.AddArg(y)
 14089  		v.AddArg3(v0, v1, v2)
 14090  		return true
 14091  	}
 14092  }
 14093  func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
 14094  	v_1 := v.Args[1]
 14095  	v_0 := v.Args[0]
 14096  	b := v.Block
 14097  	typ := &b.Func.Config.Types
 14098  	// match: (Rsh64Ux8 x y)
 14099  	// cond: shiftIsBounded(v)
 14100  	// result: (SRD x y)
 14101  	for {
 14102  		x := v_0
 14103  		y := v_1
 14104  		if !(shiftIsBounded(v)) {
 14105  			break
 14106  		}
 14107  		v.reset(OpPPC64SRD)
 14108  		v.AddArg2(x, y)
 14109  		return true
 14110  	}
 14111  	// match: (Rsh64Ux8 <t> x y)
 14112  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00C0] y)))
 14113  	for {
 14114  		t := v.Type
 14115  		x := v_0
 14116  		y := v_1
 14117  		v.reset(OpPPC64ISEL)
 14118  		v.AuxInt = int32ToAuxInt(2)
 14119  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14120  		v0.AddArg2(x, y)
 14121  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14122  		v1.AuxInt = int64ToAuxInt(0)
 14123  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14124  		v2.AuxInt = int64ToAuxInt(0)
 14125  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14126  		v3.AuxInt = int64ToAuxInt(0x00C0)
 14127  		v3.AddArg(y)
 14128  		v2.AddArg(v3)
 14129  		v.AddArg3(v0, v1, v2)
 14130  		return true
 14131  	}
 14132  }
 14133  func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
 14134  	v_1 := v.Args[1]
 14135  	v_0 := v.Args[0]
 14136  	b := v.Block
 14137  	typ := &b.Func.Config.Types
 14138  	// match: (Rsh64x16 x y)
 14139  	// cond: shiftIsBounded(v)
 14140  	// result: (SRAD x y)
 14141  	for {
 14142  		x := v_0
 14143  		y := v_1
 14144  		if !(shiftIsBounded(v)) {
 14145  			break
 14146  		}
 14147  		v.reset(OpPPC64SRAD)
 14148  		v.AddArg2(x, y)
 14149  		return true
 14150  	}
 14151  	// match: (Rsh64x16 <t> x y)
 14152  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPconst [0] (ANDconst [0xFFC0] y)))
 14153  	for {
 14154  		t := v.Type
 14155  		x := v_0
 14156  		y := v_1
 14157  		v.reset(OpPPC64ISEL)
 14158  		v.AuxInt = int32ToAuxInt(2)
 14159  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14160  		v0.AddArg2(x, y)
 14161  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14162  		v1.AuxInt = int64ToAuxInt(63)
 14163  		v1.AddArg(x)
 14164  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14165  		v2.AuxInt = int64ToAuxInt(0)
 14166  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14167  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 14168  		v3.AddArg(y)
 14169  		v2.AddArg(v3)
 14170  		v.AddArg3(v0, v1, v2)
 14171  		return true
 14172  	}
 14173  }
 14174  func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
 14175  	v_1 := v.Args[1]
 14176  	v_0 := v.Args[0]
 14177  	b := v.Block
 14178  	// match: (Rsh64x32 x y)
 14179  	// cond: shiftIsBounded(v)
 14180  	// result: (SRAD x y)
 14181  	for {
 14182  		x := v_0
 14183  		y := v_1
 14184  		if !(shiftIsBounded(v)) {
 14185  			break
 14186  		}
 14187  		v.reset(OpPPC64SRAD)
 14188  		v.AddArg2(x, y)
 14189  		return true
 14190  	}
 14191  	// match: (Rsh64x32 <t> x y)
 14192  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPWUconst y [64]))
 14193  	for {
 14194  		t := v.Type
 14195  		x := v_0
 14196  		y := v_1
 14197  		v.reset(OpPPC64ISEL)
 14198  		v.AuxInt = int32ToAuxInt(0)
 14199  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14200  		v0.AddArg2(x, y)
 14201  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14202  		v1.AuxInt = int64ToAuxInt(63)
 14203  		v1.AddArg(x)
 14204  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14205  		v2.AuxInt = int32ToAuxInt(64)
 14206  		v2.AddArg(y)
 14207  		v.AddArg3(v0, v1, v2)
 14208  		return true
 14209  	}
 14210  }
 14211  func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
 14212  	v_1 := v.Args[1]
 14213  	v_0 := v.Args[0]
 14214  	b := v.Block
 14215  	// match: (Rsh64x64 x (MOVDconst [c]))
 14216  	// cond: uint64(c) >= 64
 14217  	// result: (SRADconst x [63])
 14218  	for {
 14219  		x := v_0
 14220  		if v_1.Op != OpPPC64MOVDconst {
 14221  			break
 14222  		}
 14223  		c := auxIntToInt64(v_1.AuxInt)
 14224  		if !(uint64(c) >= 64) {
 14225  			break
 14226  		}
 14227  		v.reset(OpPPC64SRADconst)
 14228  		v.AuxInt = int64ToAuxInt(63)
 14229  		v.AddArg(x)
 14230  		return true
 14231  	}
 14232  	// match: (Rsh64x64 x (MOVDconst [c]))
 14233  	// cond: uint64(c) < 64
 14234  	// result: (SRADconst x [c])
 14235  	for {
 14236  		x := v_0
 14237  		if v_1.Op != OpPPC64MOVDconst {
 14238  			break
 14239  		}
 14240  		c := auxIntToInt64(v_1.AuxInt)
 14241  		if !(uint64(c) < 64) {
 14242  			break
 14243  		}
 14244  		v.reset(OpPPC64SRADconst)
 14245  		v.AuxInt = int64ToAuxInt(c)
 14246  		v.AddArg(x)
 14247  		return true
 14248  	}
 14249  	// match: (Rsh64x64 x y)
 14250  	// cond: shiftIsBounded(v)
 14251  	// result: (SRAD x y)
 14252  	for {
 14253  		x := v_0
 14254  		y := v_1
 14255  		if !(shiftIsBounded(v)) {
 14256  			break
 14257  		}
 14258  		v.reset(OpPPC64SRAD)
 14259  		v.AddArg2(x, y)
 14260  		return true
 14261  	}
 14262  	// match: (Rsh64x64 <t> x y)
 14263  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPUconst y [64]))
 14264  	for {
 14265  		t := v.Type
 14266  		x := v_0
 14267  		y := v_1
 14268  		v.reset(OpPPC64ISEL)
 14269  		v.AuxInt = int32ToAuxInt(0)
 14270  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14271  		v0.AddArg2(x, y)
 14272  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14273  		v1.AuxInt = int64ToAuxInt(63)
 14274  		v1.AddArg(x)
 14275  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14276  		v2.AuxInt = int64ToAuxInt(64)
 14277  		v2.AddArg(y)
 14278  		v.AddArg3(v0, v1, v2)
 14279  		return true
 14280  	}
 14281  }
 14282  func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
 14283  	v_1 := v.Args[1]
 14284  	v_0 := v.Args[0]
 14285  	b := v.Block
 14286  	typ := &b.Func.Config.Types
 14287  	// match: (Rsh64x8 x y)
 14288  	// cond: shiftIsBounded(v)
 14289  	// result: (SRAD x y)
 14290  	for {
 14291  		x := v_0
 14292  		y := v_1
 14293  		if !(shiftIsBounded(v)) {
 14294  			break
 14295  		}
 14296  		v.reset(OpPPC64SRAD)
 14297  		v.AddArg2(x, y)
 14298  		return true
 14299  	}
 14300  	// match: (Rsh64x8 <t> x y)
 14301  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPconst [0] (ANDconst [0x00C0] y)))
 14302  	for {
 14303  		t := v.Type
 14304  		x := v_0
 14305  		y := v_1
 14306  		v.reset(OpPPC64ISEL)
 14307  		v.AuxInt = int32ToAuxInt(2)
 14308  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14309  		v0.AddArg2(x, y)
 14310  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14311  		v1.AuxInt = int64ToAuxInt(63)
 14312  		v1.AddArg(x)
 14313  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14314  		v2.AuxInt = int64ToAuxInt(0)
 14315  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14316  		v3.AuxInt = int64ToAuxInt(0x00C0)
 14317  		v3.AddArg(y)
 14318  		v2.AddArg(v3)
 14319  		v.AddArg3(v0, v1, v2)
 14320  		return true
 14321  	}
 14322  }
 14323  func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
 14324  	v_1 := v.Args[1]
 14325  	v_0 := v.Args[0]
 14326  	b := v.Block
 14327  	typ := &b.Func.Config.Types
 14328  	// match: (Rsh8Ux16 x y)
 14329  	// cond: shiftIsBounded(v)
 14330  	// result: (SRD (MOVBZreg x) y)
 14331  	for {
 14332  		x := v_0
 14333  		y := v_1
 14334  		if !(shiftIsBounded(v)) {
 14335  			break
 14336  		}
 14337  		v.reset(OpPPC64SRD)
 14338  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14339  		v0.AddArg(x)
 14340  		v.AddArg2(v0, y)
 14341  		return true
 14342  	}
 14343  	// match: (Rsh8Ux16 <t> x y)
 14344  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF8] y)))
 14345  	for {
 14346  		t := v.Type
 14347  		x := v_0
 14348  		y := v_1
 14349  		v.reset(OpPPC64ISEL)
 14350  		v.AuxInt = int32ToAuxInt(2)
 14351  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14352  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14353  		v1.AddArg(x)
 14354  		v0.AddArg2(v1, y)
 14355  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14356  		v2.AuxInt = int64ToAuxInt(0)
 14357  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14358  		v3.AuxInt = int64ToAuxInt(0)
 14359  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14360  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14361  		v4.AddArg(y)
 14362  		v3.AddArg(v4)
 14363  		v.AddArg3(v0, v2, v3)
 14364  		return true
 14365  	}
 14366  }
 14367  func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
 14368  	v_1 := v.Args[1]
 14369  	v_0 := v.Args[0]
 14370  	b := v.Block
 14371  	typ := &b.Func.Config.Types
 14372  	// match: (Rsh8Ux32 x y)
 14373  	// cond: shiftIsBounded(v)
 14374  	// result: (SRD (MOVBZreg x) y)
 14375  	for {
 14376  		x := v_0
 14377  		y := v_1
 14378  		if !(shiftIsBounded(v)) {
 14379  			break
 14380  		}
 14381  		v.reset(OpPPC64SRD)
 14382  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14383  		v0.AddArg(x)
 14384  		v.AddArg2(v0, y)
 14385  		return true
 14386  	}
 14387  	// match: (Rsh8Ux32 <t> x y)
 14388  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
 14389  	for {
 14390  		t := v.Type
 14391  		x := v_0
 14392  		y := v_1
 14393  		v.reset(OpPPC64ISEL)
 14394  		v.AuxInt = int32ToAuxInt(0)
 14395  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14396  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14397  		v1.AddArg(x)
 14398  		v0.AddArg2(v1, y)
 14399  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14400  		v2.AuxInt = int64ToAuxInt(0)
 14401  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14402  		v3.AuxInt = int32ToAuxInt(8)
 14403  		v3.AddArg(y)
 14404  		v.AddArg3(v0, v2, v3)
 14405  		return true
 14406  	}
 14407  }
 14408  func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
 14409  	v_1 := v.Args[1]
 14410  	v_0 := v.Args[0]
 14411  	b := v.Block
 14412  	typ := &b.Func.Config.Types
 14413  	// match: (Rsh8Ux64 x (MOVDconst [c]))
 14414  	// cond: uint64(c) < 8
 14415  	// result: (SRWconst (ZeroExt8to32 x) [c])
 14416  	for {
 14417  		x := v_0
 14418  		if v_1.Op != OpPPC64MOVDconst {
 14419  			break
 14420  		}
 14421  		c := auxIntToInt64(v_1.AuxInt)
 14422  		if !(uint64(c) < 8) {
 14423  			break
 14424  		}
 14425  		v.reset(OpPPC64SRWconst)
 14426  		v.AuxInt = int64ToAuxInt(c)
 14427  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 14428  		v0.AddArg(x)
 14429  		v.AddArg(v0)
 14430  		return true
 14431  	}
 14432  	// match: (Rsh8Ux64 x y)
 14433  	// cond: shiftIsBounded(v)
 14434  	// result: (SRD (MOVBZreg x) y)
 14435  	for {
 14436  		x := v_0
 14437  		y := v_1
 14438  		if !(shiftIsBounded(v)) {
 14439  			break
 14440  		}
 14441  		v.reset(OpPPC64SRD)
 14442  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14443  		v0.AddArg(x)
 14444  		v.AddArg2(v0, y)
 14445  		return true
 14446  	}
 14447  	// match: (Rsh8Ux64 <t> x y)
 14448  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
 14449  	for {
 14450  		t := v.Type
 14451  		x := v_0
 14452  		y := v_1
 14453  		v.reset(OpPPC64ISEL)
 14454  		v.AuxInt = int32ToAuxInt(0)
 14455  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14456  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14457  		v1.AddArg(x)
 14458  		v0.AddArg2(v1, y)
 14459  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14460  		v2.AuxInt = int64ToAuxInt(0)
 14461  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14462  		v3.AuxInt = int64ToAuxInt(8)
 14463  		v3.AddArg(y)
 14464  		v.AddArg3(v0, v2, v3)
 14465  		return true
 14466  	}
 14467  }
 14468  func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
 14469  	v_1 := v.Args[1]
 14470  	v_0 := v.Args[0]
 14471  	b := v.Block
 14472  	typ := &b.Func.Config.Types
 14473  	// match: (Rsh8Ux8 x y)
 14474  	// cond: shiftIsBounded(v)
 14475  	// result: (SRD (MOVBZreg x) y)
 14476  	for {
 14477  		x := v_0
 14478  		y := v_1
 14479  		if !(shiftIsBounded(v)) {
 14480  			break
 14481  		}
 14482  		v.reset(OpPPC64SRD)
 14483  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14484  		v0.AddArg(x)
 14485  		v.AddArg2(v0, y)
 14486  		return true
 14487  	}
 14488  	// match: (Rsh8Ux8 <t> x y)
 14489  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F8] y)))
 14490  	for {
 14491  		t := v.Type
 14492  		x := v_0
 14493  		y := v_1
 14494  		v.reset(OpPPC64ISEL)
 14495  		v.AuxInt = int32ToAuxInt(2)
 14496  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14497  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14498  		v1.AddArg(x)
 14499  		v0.AddArg2(v1, y)
 14500  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14501  		v2.AuxInt = int64ToAuxInt(0)
 14502  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14503  		v3.AuxInt = int64ToAuxInt(0)
 14504  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14505  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14506  		v4.AddArg(y)
 14507  		v3.AddArg(v4)
 14508  		v.AddArg3(v0, v2, v3)
 14509  		return true
 14510  	}
 14511  }
 14512  func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
 14513  	v_1 := v.Args[1]
 14514  	v_0 := v.Args[0]
 14515  	b := v.Block
 14516  	typ := &b.Func.Config.Types
 14517  	// match: (Rsh8x16 x y)
 14518  	// cond: shiftIsBounded(v)
 14519  	// result: (SRAD (MOVBreg x) y)
 14520  	for {
 14521  		x := v_0
 14522  		y := v_1
 14523  		if !(shiftIsBounded(v)) {
 14524  			break
 14525  		}
 14526  		v.reset(OpPPC64SRAD)
 14527  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14528  		v0.AddArg(x)
 14529  		v.AddArg2(v0, y)
 14530  		return true
 14531  	}
 14532  	// match: (Rsh8x16 <t> x y)
 14533  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPconst [0] (ANDconst [0xFFF8] y)))
 14534  	for {
 14535  		t := v.Type
 14536  		x := v_0
 14537  		y := v_1
 14538  		v.reset(OpPPC64ISEL)
 14539  		v.AuxInt = int32ToAuxInt(2)
 14540  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14541  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14542  		v1.AddArg(x)
 14543  		v0.AddArg2(v1, y)
 14544  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14545  		v2.AuxInt = int64ToAuxInt(7)
 14546  		v2.AddArg(v1)
 14547  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14548  		v3.AuxInt = int64ToAuxInt(0)
 14549  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14550  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14551  		v4.AddArg(y)
 14552  		v3.AddArg(v4)
 14553  		v.AddArg3(v0, v2, v3)
 14554  		return true
 14555  	}
 14556  }
 14557  func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
 14558  	v_1 := v.Args[1]
 14559  	v_0 := v.Args[0]
 14560  	b := v.Block
 14561  	typ := &b.Func.Config.Types
 14562  	// match: (Rsh8x32 x y)
 14563  	// cond: shiftIsBounded(v)
 14564  	// result: (SRAD (MOVBreg x) y)
 14565  	for {
 14566  		x := v_0
 14567  		y := v_1
 14568  		if !(shiftIsBounded(v)) {
 14569  			break
 14570  		}
 14571  		v.reset(OpPPC64SRAD)
 14572  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14573  		v0.AddArg(x)
 14574  		v.AddArg2(v0, y)
 14575  		return true
 14576  	}
 14577  	// match: (Rsh8x32 <t> x y)
 14578  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPWUconst y [8]))
 14579  	for {
 14580  		t := v.Type
 14581  		x := v_0
 14582  		y := v_1
 14583  		v.reset(OpPPC64ISEL)
 14584  		v.AuxInt = int32ToAuxInt(0)
 14585  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14586  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14587  		v1.AddArg(x)
 14588  		v0.AddArg2(v1, y)
 14589  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14590  		v2.AuxInt = int64ToAuxInt(7)
 14591  		v2.AddArg(v1)
 14592  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14593  		v3.AuxInt = int32ToAuxInt(8)
 14594  		v3.AddArg(y)
 14595  		v.AddArg3(v0, v2, v3)
 14596  		return true
 14597  	}
 14598  }
 14599  func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
 14600  	v_1 := v.Args[1]
 14601  	v_0 := v.Args[0]
 14602  	b := v.Block
 14603  	typ := &b.Func.Config.Types
 14604  	// match: (Rsh8x64 x (MOVDconst [c]))
 14605  	// cond: uint64(c) >= 8
 14606  	// result: (SRAWconst (SignExt8to32 x) [63])
 14607  	for {
 14608  		x := v_0
 14609  		if v_1.Op != OpPPC64MOVDconst {
 14610  			break
 14611  		}
 14612  		c := auxIntToInt64(v_1.AuxInt)
 14613  		if !(uint64(c) >= 8) {
 14614  			break
 14615  		}
 14616  		v.reset(OpPPC64SRAWconst)
 14617  		v.AuxInt = int64ToAuxInt(63)
 14618  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14619  		v0.AddArg(x)
 14620  		v.AddArg(v0)
 14621  		return true
 14622  	}
 14623  	// match: (Rsh8x64 x (MOVDconst [c]))
 14624  	// cond: uint64(c) < 8
 14625  	// result: (SRAWconst (SignExt8to32 x) [c])
 14626  	for {
 14627  		x := v_0
 14628  		if v_1.Op != OpPPC64MOVDconst {
 14629  			break
 14630  		}
 14631  		c := auxIntToInt64(v_1.AuxInt)
 14632  		if !(uint64(c) < 8) {
 14633  			break
 14634  		}
 14635  		v.reset(OpPPC64SRAWconst)
 14636  		v.AuxInt = int64ToAuxInt(c)
 14637  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14638  		v0.AddArg(x)
 14639  		v.AddArg(v0)
 14640  		return true
 14641  	}
 14642  	// match: (Rsh8x64 x y)
 14643  	// cond: shiftIsBounded(v)
 14644  	// result: (SRAD (MOVBreg x) y)
 14645  	for {
 14646  		x := v_0
 14647  		y := v_1
 14648  		if !(shiftIsBounded(v)) {
 14649  			break
 14650  		}
 14651  		v.reset(OpPPC64SRAD)
 14652  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14653  		v0.AddArg(x)
 14654  		v.AddArg2(v0, y)
 14655  		return true
 14656  	}
 14657  	// match: (Rsh8x64 <t> x y)
 14658  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPUconst y [8]))
 14659  	for {
 14660  		t := v.Type
 14661  		x := v_0
 14662  		y := v_1
 14663  		v.reset(OpPPC64ISEL)
 14664  		v.AuxInt = int32ToAuxInt(0)
 14665  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14666  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14667  		v1.AddArg(x)
 14668  		v0.AddArg2(v1, y)
 14669  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14670  		v2.AuxInt = int64ToAuxInt(7)
 14671  		v2.AddArg(v1)
 14672  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14673  		v3.AuxInt = int64ToAuxInt(8)
 14674  		v3.AddArg(y)
 14675  		v.AddArg3(v0, v2, v3)
 14676  		return true
 14677  	}
 14678  }
 14679  func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
 14680  	v_1 := v.Args[1]
 14681  	v_0 := v.Args[0]
 14682  	b := v.Block
 14683  	typ := &b.Func.Config.Types
 14684  	// match: (Rsh8x8 x y)
 14685  	// cond: shiftIsBounded(v)
 14686  	// result: (SRAD (MOVBreg x) y)
 14687  	for {
 14688  		x := v_0
 14689  		y := v_1
 14690  		if !(shiftIsBounded(v)) {
 14691  			break
 14692  		}
 14693  		v.reset(OpPPC64SRAD)
 14694  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14695  		v0.AddArg(x)
 14696  		v.AddArg2(v0, y)
 14697  		return true
 14698  	}
 14699  	// match: (Rsh8x8 <t> x y)
 14700  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPconst [0] (ANDconst [0x00F8] y)))
 14701  	for {
 14702  		t := v.Type
 14703  		x := v_0
 14704  		y := v_1
 14705  		v.reset(OpPPC64ISEL)
 14706  		v.AuxInt = int32ToAuxInt(2)
 14707  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14708  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14709  		v1.AddArg(x)
 14710  		v0.AddArg2(v1, y)
 14711  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14712  		v2.AuxInt = int64ToAuxInt(7)
 14713  		v2.AddArg(v1)
 14714  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14715  		v3.AuxInt = int64ToAuxInt(0)
 14716  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14717  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14718  		v4.AddArg(y)
 14719  		v3.AddArg(v4)
 14720  		v.AddArg3(v0, v2, v3)
 14721  		return true
 14722  	}
 14723  }
 14724  func rewriteValuePPC64_OpSelect0(v *Value) bool {
 14725  	v_0 := v.Args[0]
 14726  	b := v.Block
 14727  	typ := &b.Func.Config.Types
 14728  	// match: (Select0 (Mul64uhilo x y))
 14729  	// result: (MULHDU x y)
 14730  	for {
 14731  		if v_0.Op != OpMul64uhilo {
 14732  			break
 14733  		}
 14734  		y := v_0.Args[1]
 14735  		x := v_0.Args[0]
 14736  		v.reset(OpPPC64MULHDU)
 14737  		v.AddArg2(x, y)
 14738  		return true
 14739  	}
 14740  	// match: (Select0 (Mul64uover x y))
 14741  	// result: (MULLD x y)
 14742  	for {
 14743  		if v_0.Op != OpMul64uover {
 14744  			break
 14745  		}
 14746  		y := v_0.Args[1]
 14747  		x := v_0.Args[0]
 14748  		v.reset(OpPPC64MULLD)
 14749  		v.AddArg2(x, y)
 14750  		return true
 14751  	}
 14752  	// match: (Select0 (Add64carry x y c))
 14753  	// result: (Select0 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1]))))
 14754  	for {
 14755  		if v_0.Op != OpAdd64carry {
 14756  			break
 14757  		}
 14758  		c := v_0.Args[2]
 14759  		x := v_0.Args[0]
 14760  		y := v_0.Args[1]
 14761  		v.reset(OpSelect0)
 14762  		v.Type = typ.UInt64
 14763  		v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 14764  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14765  		v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14766  		v2.AuxInt = int64ToAuxInt(-1)
 14767  		v2.AddArg(c)
 14768  		v1.AddArg(v2)
 14769  		v0.AddArg3(x, y, v1)
 14770  		v.AddArg(v0)
 14771  		return true
 14772  	}
 14773  	// match: (Select0 (Sub64borrow x y c))
 14774  	// result: (Select0 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))
 14775  	for {
 14776  		if v_0.Op != OpSub64borrow {
 14777  			break
 14778  		}
 14779  		c := v_0.Args[2]
 14780  		x := v_0.Args[0]
 14781  		y := v_0.Args[1]
 14782  		v.reset(OpSelect0)
 14783  		v.Type = typ.UInt64
 14784  		v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 14785  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14786  		v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14787  		v2.AuxInt = int64ToAuxInt(0)
 14788  		v2.AddArg(c)
 14789  		v1.AddArg(v2)
 14790  		v0.AddArg3(x, y, v1)
 14791  		v.AddArg(v0)
 14792  		return true
 14793  	}
 14794  	return false
 14795  }
 14796  func rewriteValuePPC64_OpSelect1(v *Value) bool {
 14797  	v_0 := v.Args[0]
 14798  	b := v.Block
 14799  	typ := &b.Func.Config.Types
 14800  	// match: (Select1 (Mul64uhilo x y))
 14801  	// result: (MULLD x y)
 14802  	for {
 14803  		if v_0.Op != OpMul64uhilo {
 14804  			break
 14805  		}
 14806  		y := v_0.Args[1]
 14807  		x := v_0.Args[0]
 14808  		v.reset(OpPPC64MULLD)
 14809  		v.AddArg2(x, y)
 14810  		return true
 14811  	}
 14812  	// match: (Select1 (Mul64uover x y))
 14813  	// result: (SETBCR [2] (CMPconst [0] (MULHDU <x.Type> x y)))
 14814  	for {
 14815  		if v_0.Op != OpMul64uover {
 14816  			break
 14817  		}
 14818  		y := v_0.Args[1]
 14819  		x := v_0.Args[0]
 14820  		v.reset(OpPPC64SETBCR)
 14821  		v.AuxInt = int32ToAuxInt(2)
 14822  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14823  		v0.AuxInt = int64ToAuxInt(0)
 14824  		v1 := b.NewValue0(v.Pos, OpPPC64MULHDU, x.Type)
 14825  		v1.AddArg2(x, y)
 14826  		v0.AddArg(v1)
 14827  		v.AddArg(v0)
 14828  		return true
 14829  	}
 14830  	// match: (Select1 (Add64carry x y c))
 14831  	// result: (ADDZEzero (Select1 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1])))))
 14832  	for {
 14833  		if v_0.Op != OpAdd64carry {
 14834  			break
 14835  		}
 14836  		c := v_0.Args[2]
 14837  		x := v_0.Args[0]
 14838  		y := v_0.Args[1]
 14839  		v.reset(OpPPC64ADDZEzero)
 14840  		v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14841  		v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 14842  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14843  		v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14844  		v3.AuxInt = int64ToAuxInt(-1)
 14845  		v3.AddArg(c)
 14846  		v2.AddArg(v3)
 14847  		v1.AddArg3(x, y, v2)
 14848  		v0.AddArg(v1)
 14849  		v.AddArg(v0)
 14850  		return true
 14851  	}
 14852  	// match: (Select1 (ADDCconst n:(ADDZEzero x) [-1]))
 14853  	// cond: n.Uses <= 2
 14854  	// result: x
 14855  	for {
 14856  		if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
 14857  			break
 14858  		}
 14859  		n := v_0.Args[0]
 14860  		if n.Op != OpPPC64ADDZEzero {
 14861  			break
 14862  		}
 14863  		x := n.Args[0]
 14864  		if !(n.Uses <= 2) {
 14865  			break
 14866  		}
 14867  		v.copyOf(x)
 14868  		return true
 14869  	}
 14870  	// match: (Select1 (Sub64borrow x y c))
 14871  	// result: (NEG (SUBZEzero (Select1 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))))
 14872  	for {
 14873  		if v_0.Op != OpSub64borrow {
 14874  			break
 14875  		}
 14876  		c := v_0.Args[2]
 14877  		x := v_0.Args[0]
 14878  		y := v_0.Args[1]
 14879  		v.reset(OpPPC64NEG)
 14880  		v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
 14881  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14882  		v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 14883  		v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14884  		v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14885  		v4.AuxInt = int64ToAuxInt(0)
 14886  		v4.AddArg(c)
 14887  		v3.AddArg(v4)
 14888  		v2.AddArg3(x, y, v3)
 14889  		v1.AddArg(v2)
 14890  		v0.AddArg(v1)
 14891  		v.AddArg(v0)
 14892  		return true
 14893  	}
 14894  	// match: (Select1 (SUBCconst n:(NEG (SUBZEzero x)) [0]))
 14895  	// cond: n.Uses <= 2
 14896  	// result: x
 14897  	for {
 14898  		if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14899  			break
 14900  		}
 14901  		n := v_0.Args[0]
 14902  		if n.Op != OpPPC64NEG {
 14903  			break
 14904  		}
 14905  		n_0 := n.Args[0]
 14906  		if n_0.Op != OpPPC64SUBZEzero {
 14907  			break
 14908  		}
 14909  		x := n_0.Args[0]
 14910  		if !(n.Uses <= 2) {
 14911  			break
 14912  		}
 14913  		v.copyOf(x)
 14914  		return true
 14915  	}
 14916  	return false
 14917  }
 14918  func rewriteValuePPC64_OpSelectN(v *Value) bool {
 14919  	v_0 := v.Args[0]
 14920  	b := v.Block
 14921  	config := b.Func.Config
 14922  	// match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
 14923  	// 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)
 14924  	// result: (Move [sz] dst src mem)
 14925  	for {
 14926  		if auxIntToInt64(v.AuxInt) != 0 {
 14927  			break
 14928  		}
 14929  		call := v_0
 14930  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
 14931  			break
 14932  		}
 14933  		sym := auxToCall(call.Aux)
 14934  		s1 := call.Args[0]
 14935  		if s1.Op != OpPPC64MOVDstore {
 14936  			break
 14937  		}
 14938  		_ = s1.Args[2]
 14939  		s1_1 := s1.Args[1]
 14940  		if s1_1.Op != OpPPC64MOVDconst {
 14941  			break
 14942  		}
 14943  		sz := auxIntToInt64(s1_1.AuxInt)
 14944  		s2 := s1.Args[2]
 14945  		if s2.Op != OpPPC64MOVDstore {
 14946  			break
 14947  		}
 14948  		_ = s2.Args[2]
 14949  		src := s2.Args[1]
 14950  		s3 := s2.Args[2]
 14951  		if s3.Op != OpPPC64MOVDstore {
 14952  			break
 14953  		}
 14954  		mem := s3.Args[2]
 14955  		dst := s3.Args[1]
 14956  		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)) {
 14957  			break
 14958  		}
 14959  		v.reset(OpMove)
 14960  		v.AuxInt = int64ToAuxInt(sz)
 14961  		v.AddArg3(dst, src, mem)
 14962  		return true
 14963  	}
 14964  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
 14965  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 14966  	// result: (Move [sz] dst src mem)
 14967  	for {
 14968  		if auxIntToInt64(v.AuxInt) != 0 {
 14969  			break
 14970  		}
 14971  		call := v_0
 14972  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
 14973  			break
 14974  		}
 14975  		sym := auxToCall(call.Aux)
 14976  		mem := call.Args[3]
 14977  		dst := call.Args[0]
 14978  		src := call.Args[1]
 14979  		call_2 := call.Args[2]
 14980  		if call_2.Op != OpPPC64MOVDconst {
 14981  			break
 14982  		}
 14983  		sz := auxIntToInt64(call_2.AuxInt)
 14984  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 14985  			break
 14986  		}
 14987  		v.reset(OpMove)
 14988  		v.AuxInt = int64ToAuxInt(sz)
 14989  		v.AddArg3(dst, src, mem)
 14990  		return true
 14991  	}
 14992  	return false
 14993  }
 14994  func rewriteValuePPC64_OpSlicemask(v *Value) bool {
 14995  	v_0 := v.Args[0]
 14996  	b := v.Block
 14997  	// match: (Slicemask <t> x)
 14998  	// result: (SRADconst (NEG <t> x) [63])
 14999  	for {
 15000  		t := v.Type
 15001  		x := v_0
 15002  		v.reset(OpPPC64SRADconst)
 15003  		v.AuxInt = int64ToAuxInt(63)
 15004  		v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
 15005  		v0.AddArg(x)
 15006  		v.AddArg(v0)
 15007  		return true
 15008  	}
 15009  }
 15010  func rewriteValuePPC64_OpStore(v *Value) bool {
 15011  	v_2 := v.Args[2]
 15012  	v_1 := v.Args[1]
 15013  	v_0 := v.Args[0]
 15014  	// match: (Store {t} ptr val mem)
 15015  	// cond: t.Size() == 8 && t.IsFloat()
 15016  	// result: (FMOVDstore ptr val mem)
 15017  	for {
 15018  		t := auxToType(v.Aux)
 15019  		ptr := v_0
 15020  		val := v_1
 15021  		mem := v_2
 15022  		if !(t.Size() == 8 && t.IsFloat()) {
 15023  			break
 15024  		}
 15025  		v.reset(OpPPC64FMOVDstore)
 15026  		v.AddArg3(ptr, val, mem)
 15027  		return true
 15028  	}
 15029  	// match: (Store {t} ptr val mem)
 15030  	// cond: t.Size() == 4 && t.IsFloat()
 15031  	// result: (FMOVSstore ptr val mem)
 15032  	for {
 15033  		t := auxToType(v.Aux)
 15034  		ptr := v_0
 15035  		val := v_1
 15036  		mem := v_2
 15037  		if !(t.Size() == 4 && t.IsFloat()) {
 15038  			break
 15039  		}
 15040  		v.reset(OpPPC64FMOVSstore)
 15041  		v.AddArg3(ptr, val, mem)
 15042  		return true
 15043  	}
 15044  	// match: (Store {t} ptr val mem)
 15045  	// cond: t.Size() == 8 && !t.IsFloat()
 15046  	// result: (MOVDstore ptr val mem)
 15047  	for {
 15048  		t := auxToType(v.Aux)
 15049  		ptr := v_0
 15050  		val := v_1
 15051  		mem := v_2
 15052  		if !(t.Size() == 8 && !t.IsFloat()) {
 15053  			break
 15054  		}
 15055  		v.reset(OpPPC64MOVDstore)
 15056  		v.AddArg3(ptr, val, mem)
 15057  		return true
 15058  	}
 15059  	// match: (Store {t} ptr val mem)
 15060  	// cond: t.Size() == 4 && !t.IsFloat()
 15061  	// result: (MOVWstore ptr val mem)
 15062  	for {
 15063  		t := auxToType(v.Aux)
 15064  		ptr := v_0
 15065  		val := v_1
 15066  		mem := v_2
 15067  		if !(t.Size() == 4 && !t.IsFloat()) {
 15068  			break
 15069  		}
 15070  		v.reset(OpPPC64MOVWstore)
 15071  		v.AddArg3(ptr, val, mem)
 15072  		return true
 15073  	}
 15074  	// match: (Store {t} ptr val mem)
 15075  	// cond: t.Size() == 2
 15076  	// result: (MOVHstore ptr val mem)
 15077  	for {
 15078  		t := auxToType(v.Aux)
 15079  		ptr := v_0
 15080  		val := v_1
 15081  		mem := v_2
 15082  		if !(t.Size() == 2) {
 15083  			break
 15084  		}
 15085  		v.reset(OpPPC64MOVHstore)
 15086  		v.AddArg3(ptr, val, mem)
 15087  		return true
 15088  	}
 15089  	// match: (Store {t} ptr val mem)
 15090  	// cond: t.Size() == 1
 15091  	// result: (MOVBstore ptr val mem)
 15092  	for {
 15093  		t := auxToType(v.Aux)
 15094  		ptr := v_0
 15095  		val := v_1
 15096  		mem := v_2
 15097  		if !(t.Size() == 1) {
 15098  			break
 15099  		}
 15100  		v.reset(OpPPC64MOVBstore)
 15101  		v.AddArg3(ptr, val, mem)
 15102  		return true
 15103  	}
 15104  	return false
 15105  }
 15106  func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
 15107  	v_0 := v.Args[0]
 15108  	// match: (Trunc16to8 <t> x)
 15109  	// cond: t.IsSigned()
 15110  	// result: (MOVBreg x)
 15111  	for {
 15112  		t := v.Type
 15113  		x := v_0
 15114  		if !(t.IsSigned()) {
 15115  			break
 15116  		}
 15117  		v.reset(OpPPC64MOVBreg)
 15118  		v.AddArg(x)
 15119  		return true
 15120  	}
 15121  	// match: (Trunc16to8 x)
 15122  	// result: (MOVBZreg x)
 15123  	for {
 15124  		x := v_0
 15125  		v.reset(OpPPC64MOVBZreg)
 15126  		v.AddArg(x)
 15127  		return true
 15128  	}
 15129  }
 15130  func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
 15131  	v_0 := v.Args[0]
 15132  	// match: (Trunc32to16 <t> x)
 15133  	// cond: t.IsSigned()
 15134  	// result: (MOVHreg x)
 15135  	for {
 15136  		t := v.Type
 15137  		x := v_0
 15138  		if !(t.IsSigned()) {
 15139  			break
 15140  		}
 15141  		v.reset(OpPPC64MOVHreg)
 15142  		v.AddArg(x)
 15143  		return true
 15144  	}
 15145  	// match: (Trunc32to16 x)
 15146  	// result: (MOVHZreg x)
 15147  	for {
 15148  		x := v_0
 15149  		v.reset(OpPPC64MOVHZreg)
 15150  		v.AddArg(x)
 15151  		return true
 15152  	}
 15153  }
 15154  func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
 15155  	v_0 := v.Args[0]
 15156  	// match: (Trunc32to8 <t> x)
 15157  	// cond: t.IsSigned()
 15158  	// result: (MOVBreg x)
 15159  	for {
 15160  		t := v.Type
 15161  		x := v_0
 15162  		if !(t.IsSigned()) {
 15163  			break
 15164  		}
 15165  		v.reset(OpPPC64MOVBreg)
 15166  		v.AddArg(x)
 15167  		return true
 15168  	}
 15169  	// match: (Trunc32to8 x)
 15170  	// result: (MOVBZreg x)
 15171  	for {
 15172  		x := v_0
 15173  		v.reset(OpPPC64MOVBZreg)
 15174  		v.AddArg(x)
 15175  		return true
 15176  	}
 15177  }
 15178  func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
 15179  	v_0 := v.Args[0]
 15180  	// match: (Trunc64to16 <t> x)
 15181  	// cond: t.IsSigned()
 15182  	// result: (MOVHreg x)
 15183  	for {
 15184  		t := v.Type
 15185  		x := v_0
 15186  		if !(t.IsSigned()) {
 15187  			break
 15188  		}
 15189  		v.reset(OpPPC64MOVHreg)
 15190  		v.AddArg(x)
 15191  		return true
 15192  	}
 15193  	// match: (Trunc64to16 x)
 15194  	// result: (MOVHZreg x)
 15195  	for {
 15196  		x := v_0
 15197  		v.reset(OpPPC64MOVHZreg)
 15198  		v.AddArg(x)
 15199  		return true
 15200  	}
 15201  }
 15202  func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
 15203  	v_0 := v.Args[0]
 15204  	// match: (Trunc64to32 <t> x)
 15205  	// cond: t.IsSigned()
 15206  	// result: (MOVWreg x)
 15207  	for {
 15208  		t := v.Type
 15209  		x := v_0
 15210  		if !(t.IsSigned()) {
 15211  			break
 15212  		}
 15213  		v.reset(OpPPC64MOVWreg)
 15214  		v.AddArg(x)
 15215  		return true
 15216  	}
 15217  	// match: (Trunc64to32 x)
 15218  	// result: (MOVWZreg x)
 15219  	for {
 15220  		x := v_0
 15221  		v.reset(OpPPC64MOVWZreg)
 15222  		v.AddArg(x)
 15223  		return true
 15224  	}
 15225  }
 15226  func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
 15227  	v_0 := v.Args[0]
 15228  	// match: (Trunc64to8 <t> x)
 15229  	// cond: t.IsSigned()
 15230  	// result: (MOVBreg x)
 15231  	for {
 15232  		t := v.Type
 15233  		x := v_0
 15234  		if !(t.IsSigned()) {
 15235  			break
 15236  		}
 15237  		v.reset(OpPPC64MOVBreg)
 15238  		v.AddArg(x)
 15239  		return true
 15240  	}
 15241  	// match: (Trunc64to8 x)
 15242  	// result: (MOVBZreg x)
 15243  	for {
 15244  		x := v_0
 15245  		v.reset(OpPPC64MOVBZreg)
 15246  		v.AddArg(x)
 15247  		return true
 15248  	}
 15249  }
 15250  func rewriteValuePPC64_OpZero(v *Value) bool {
 15251  	v_1 := v.Args[1]
 15252  	v_0 := v.Args[0]
 15253  	b := v.Block
 15254  	// match: (Zero [0] _ mem)
 15255  	// result: mem
 15256  	for {
 15257  		if auxIntToInt64(v.AuxInt) != 0 {
 15258  			break
 15259  		}
 15260  		mem := v_1
 15261  		v.copyOf(mem)
 15262  		return true
 15263  	}
 15264  	// match: (Zero [1] destptr mem)
 15265  	// result: (MOVBstorezero destptr mem)
 15266  	for {
 15267  		if auxIntToInt64(v.AuxInt) != 1 {
 15268  			break
 15269  		}
 15270  		destptr := v_0
 15271  		mem := v_1
 15272  		v.reset(OpPPC64MOVBstorezero)
 15273  		v.AddArg2(destptr, mem)
 15274  		return true
 15275  	}
 15276  	// match: (Zero [2] destptr mem)
 15277  	// result: (MOVHstorezero destptr mem)
 15278  	for {
 15279  		if auxIntToInt64(v.AuxInt) != 2 {
 15280  			break
 15281  		}
 15282  		destptr := v_0
 15283  		mem := v_1
 15284  		v.reset(OpPPC64MOVHstorezero)
 15285  		v.AddArg2(destptr, mem)
 15286  		return true
 15287  	}
 15288  	// match: (Zero [3] destptr mem)
 15289  	// result: (MOVBstorezero [2] destptr (MOVHstorezero destptr mem))
 15290  	for {
 15291  		if auxIntToInt64(v.AuxInt) != 3 {
 15292  			break
 15293  		}
 15294  		destptr := v_0
 15295  		mem := v_1
 15296  		v.reset(OpPPC64MOVBstorezero)
 15297  		v.AuxInt = int32ToAuxInt(2)
 15298  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15299  		v0.AddArg2(destptr, mem)
 15300  		v.AddArg2(destptr, v0)
 15301  		return true
 15302  	}
 15303  	// match: (Zero [4] destptr mem)
 15304  	// result: (MOVWstorezero destptr mem)
 15305  	for {
 15306  		if auxIntToInt64(v.AuxInt) != 4 {
 15307  			break
 15308  		}
 15309  		destptr := v_0
 15310  		mem := v_1
 15311  		v.reset(OpPPC64MOVWstorezero)
 15312  		v.AddArg2(destptr, mem)
 15313  		return true
 15314  	}
 15315  	// match: (Zero [5] destptr mem)
 15316  	// result: (MOVBstorezero [4] destptr (MOVWstorezero destptr mem))
 15317  	for {
 15318  		if auxIntToInt64(v.AuxInt) != 5 {
 15319  			break
 15320  		}
 15321  		destptr := v_0
 15322  		mem := v_1
 15323  		v.reset(OpPPC64MOVBstorezero)
 15324  		v.AuxInt = int32ToAuxInt(4)
 15325  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15326  		v0.AddArg2(destptr, mem)
 15327  		v.AddArg2(destptr, v0)
 15328  		return true
 15329  	}
 15330  	// match: (Zero [6] destptr mem)
 15331  	// result: (MOVHstorezero [4] destptr (MOVWstorezero destptr mem))
 15332  	for {
 15333  		if auxIntToInt64(v.AuxInt) != 6 {
 15334  			break
 15335  		}
 15336  		destptr := v_0
 15337  		mem := v_1
 15338  		v.reset(OpPPC64MOVHstorezero)
 15339  		v.AuxInt = int32ToAuxInt(4)
 15340  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15341  		v0.AddArg2(destptr, mem)
 15342  		v.AddArg2(destptr, v0)
 15343  		return true
 15344  	}
 15345  	// match: (Zero [7] destptr mem)
 15346  	// result: (MOVBstorezero [6] destptr (MOVHstorezero [4] destptr (MOVWstorezero destptr mem)))
 15347  	for {
 15348  		if auxIntToInt64(v.AuxInt) != 7 {
 15349  			break
 15350  		}
 15351  		destptr := v_0
 15352  		mem := v_1
 15353  		v.reset(OpPPC64MOVBstorezero)
 15354  		v.AuxInt = int32ToAuxInt(6)
 15355  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15356  		v0.AuxInt = int32ToAuxInt(4)
 15357  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15358  		v1.AddArg2(destptr, mem)
 15359  		v0.AddArg2(destptr, v1)
 15360  		v.AddArg2(destptr, v0)
 15361  		return true
 15362  	}
 15363  	// match: (Zero [8] {t} destptr mem)
 15364  	// result: (MOVDstorezero destptr mem)
 15365  	for {
 15366  		if auxIntToInt64(v.AuxInt) != 8 {
 15367  			break
 15368  		}
 15369  		destptr := v_0
 15370  		mem := v_1
 15371  		v.reset(OpPPC64MOVDstorezero)
 15372  		v.AddArg2(destptr, mem)
 15373  		return true
 15374  	}
 15375  	// match: (Zero [12] {t} destptr mem)
 15376  	// result: (MOVWstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15377  	for {
 15378  		if auxIntToInt64(v.AuxInt) != 12 {
 15379  			break
 15380  		}
 15381  		destptr := v_0
 15382  		mem := v_1
 15383  		v.reset(OpPPC64MOVWstorezero)
 15384  		v.AuxInt = int32ToAuxInt(8)
 15385  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15386  		v0.AuxInt = int32ToAuxInt(0)
 15387  		v0.AddArg2(destptr, mem)
 15388  		v.AddArg2(destptr, v0)
 15389  		return true
 15390  	}
 15391  	// match: (Zero [16] {t} destptr mem)
 15392  	// result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15393  	for {
 15394  		if auxIntToInt64(v.AuxInt) != 16 {
 15395  			break
 15396  		}
 15397  		destptr := v_0
 15398  		mem := v_1
 15399  		v.reset(OpPPC64MOVDstorezero)
 15400  		v.AuxInt = int32ToAuxInt(8)
 15401  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15402  		v0.AuxInt = int32ToAuxInt(0)
 15403  		v0.AddArg2(destptr, mem)
 15404  		v.AddArg2(destptr, v0)
 15405  		return true
 15406  	}
 15407  	// match: (Zero [24] {t} destptr mem)
 15408  	// result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))
 15409  	for {
 15410  		if auxIntToInt64(v.AuxInt) != 24 {
 15411  			break
 15412  		}
 15413  		destptr := v_0
 15414  		mem := v_1
 15415  		v.reset(OpPPC64MOVDstorezero)
 15416  		v.AuxInt = int32ToAuxInt(16)
 15417  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15418  		v0.AuxInt = int32ToAuxInt(8)
 15419  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15420  		v1.AuxInt = int32ToAuxInt(0)
 15421  		v1.AddArg2(destptr, mem)
 15422  		v0.AddArg2(destptr, v1)
 15423  		v.AddArg2(destptr, v0)
 15424  		return true
 15425  	}
 15426  	// match: (Zero [32] {t} destptr mem)
 15427  	// result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))))
 15428  	for {
 15429  		if auxIntToInt64(v.AuxInt) != 32 {
 15430  			break
 15431  		}
 15432  		destptr := v_0
 15433  		mem := v_1
 15434  		v.reset(OpPPC64MOVDstorezero)
 15435  		v.AuxInt = int32ToAuxInt(24)
 15436  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15437  		v0.AuxInt = int32ToAuxInt(16)
 15438  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15439  		v1.AuxInt = int32ToAuxInt(8)
 15440  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15441  		v2.AuxInt = int32ToAuxInt(0)
 15442  		v2.AddArg2(destptr, mem)
 15443  		v1.AddArg2(destptr, v2)
 15444  		v0.AddArg2(destptr, v1)
 15445  		v.AddArg2(destptr, v0)
 15446  		return true
 15447  	}
 15448  	// match: (Zero [s] ptr mem)
 15449  	// cond: buildcfg.GOPPC64 <= 8 && s < 64
 15450  	// result: (LoweredZeroShort [s] ptr mem)
 15451  	for {
 15452  		s := auxIntToInt64(v.AuxInt)
 15453  		ptr := v_0
 15454  		mem := v_1
 15455  		if !(buildcfg.GOPPC64 <= 8 && s < 64) {
 15456  			break
 15457  		}
 15458  		v.reset(OpPPC64LoweredZeroShort)
 15459  		v.AuxInt = int64ToAuxInt(s)
 15460  		v.AddArg2(ptr, mem)
 15461  		return true
 15462  	}
 15463  	// match: (Zero [s] ptr mem)
 15464  	// cond: buildcfg.GOPPC64 <= 8
 15465  	// result: (LoweredZero [s] ptr mem)
 15466  	for {
 15467  		s := auxIntToInt64(v.AuxInt)
 15468  		ptr := v_0
 15469  		mem := v_1
 15470  		if !(buildcfg.GOPPC64 <= 8) {
 15471  			break
 15472  		}
 15473  		v.reset(OpPPC64LoweredZero)
 15474  		v.AuxInt = int64ToAuxInt(s)
 15475  		v.AddArg2(ptr, mem)
 15476  		return true
 15477  	}
 15478  	// match: (Zero [s] ptr mem)
 15479  	// cond: s < 128 && buildcfg.GOPPC64 >= 9
 15480  	// result: (LoweredQuadZeroShort [s] ptr mem)
 15481  	for {
 15482  		s := auxIntToInt64(v.AuxInt)
 15483  		ptr := v_0
 15484  		mem := v_1
 15485  		if !(s < 128 && buildcfg.GOPPC64 >= 9) {
 15486  			break
 15487  		}
 15488  		v.reset(OpPPC64LoweredQuadZeroShort)
 15489  		v.AuxInt = int64ToAuxInt(s)
 15490  		v.AddArg2(ptr, mem)
 15491  		return true
 15492  	}
 15493  	// match: (Zero [s] ptr mem)
 15494  	// cond: buildcfg.GOPPC64 >= 9
 15495  	// result: (LoweredQuadZero [s] ptr mem)
 15496  	for {
 15497  		s := auxIntToInt64(v.AuxInt)
 15498  		ptr := v_0
 15499  		mem := v_1
 15500  		if !(buildcfg.GOPPC64 >= 9) {
 15501  			break
 15502  		}
 15503  		v.reset(OpPPC64LoweredQuadZero)
 15504  		v.AuxInt = int64ToAuxInt(s)
 15505  		v.AddArg2(ptr, mem)
 15506  		return true
 15507  	}
 15508  	return false
 15509  }
 15510  func rewriteBlockPPC64(b *Block) bool {
 15511  	typ := &b.Func.Config.Types
 15512  	switch b.Kind {
 15513  	case BlockPPC64EQ:
 15514  		// match: (EQ (FlagEQ) yes no)
 15515  		// result: (First yes no)
 15516  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15517  			b.Reset(BlockFirst)
 15518  			return true
 15519  		}
 15520  		// match: (EQ (FlagLT) yes no)
 15521  		// result: (First no yes)
 15522  		for b.Controls[0].Op == OpPPC64FlagLT {
 15523  			b.Reset(BlockFirst)
 15524  			b.swapSuccessors()
 15525  			return true
 15526  		}
 15527  		// match: (EQ (FlagGT) yes no)
 15528  		// result: (First no yes)
 15529  		for b.Controls[0].Op == OpPPC64FlagGT {
 15530  			b.Reset(BlockFirst)
 15531  			b.swapSuccessors()
 15532  			return true
 15533  		}
 15534  		// match: (EQ (InvertFlags cmp) yes no)
 15535  		// result: (EQ cmp yes no)
 15536  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15537  			v_0 := b.Controls[0]
 15538  			cmp := v_0.Args[0]
 15539  			b.resetWithControl(BlockPPC64EQ, cmp)
 15540  			return true
 15541  		}
 15542  		// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
 15543  		// cond: z.Uses == 1
 15544  		// result: (EQ (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15545  		for b.Controls[0].Op == OpPPC64CMPconst {
 15546  			v_0 := b.Controls[0]
 15547  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15548  				break
 15549  			}
 15550  			z := v_0.Args[0]
 15551  			if z.Op != OpPPC64AND {
 15552  				break
 15553  			}
 15554  			_ = z.Args[1]
 15555  			z_0 := z.Args[0]
 15556  			z_1 := z.Args[1]
 15557  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15558  				x := z_0
 15559  				y := z_1
 15560  				if !(z.Uses == 1) {
 15561  					continue
 15562  				}
 15563  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15564  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15565  				v1.AddArg2(x, y)
 15566  				v0.AddArg(v1)
 15567  				b.resetWithControl(BlockPPC64EQ, v0)
 15568  				return true
 15569  			}
 15570  			break
 15571  		}
 15572  		// match: (EQ (CMPconst [0] z:(OR x y)) yes no)
 15573  		// cond: z.Uses == 1
 15574  		// result: (EQ (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15575  		for b.Controls[0].Op == OpPPC64CMPconst {
 15576  			v_0 := b.Controls[0]
 15577  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15578  				break
 15579  			}
 15580  			z := v_0.Args[0]
 15581  			if z.Op != OpPPC64OR {
 15582  				break
 15583  			}
 15584  			_ = z.Args[1]
 15585  			z_0 := z.Args[0]
 15586  			z_1 := z.Args[1]
 15587  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15588  				x := z_0
 15589  				y := z_1
 15590  				if !(z.Uses == 1) {
 15591  					continue
 15592  				}
 15593  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15594  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15595  				v1.AddArg2(x, y)
 15596  				v0.AddArg(v1)
 15597  				b.resetWithControl(BlockPPC64EQ, v0)
 15598  				return true
 15599  			}
 15600  			break
 15601  		}
 15602  		// match: (EQ (CMPconst [0] z:(XOR x y)) yes no)
 15603  		// cond: z.Uses == 1
 15604  		// result: (EQ (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15605  		for b.Controls[0].Op == OpPPC64CMPconst {
 15606  			v_0 := b.Controls[0]
 15607  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15608  				break
 15609  			}
 15610  			z := v_0.Args[0]
 15611  			if z.Op != OpPPC64XOR {
 15612  				break
 15613  			}
 15614  			_ = z.Args[1]
 15615  			z_0 := z.Args[0]
 15616  			z_1 := z.Args[1]
 15617  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15618  				x := z_0
 15619  				y := z_1
 15620  				if !(z.Uses == 1) {
 15621  					continue
 15622  				}
 15623  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15624  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15625  				v1.AddArg2(x, y)
 15626  				v0.AddArg(v1)
 15627  				b.resetWithControl(BlockPPC64EQ, v0)
 15628  				return true
 15629  			}
 15630  			break
 15631  		}
 15632  	case BlockPPC64GE:
 15633  		// match: (GE (FlagEQ) yes no)
 15634  		// result: (First yes no)
 15635  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15636  			b.Reset(BlockFirst)
 15637  			return true
 15638  		}
 15639  		// match: (GE (FlagLT) yes no)
 15640  		// result: (First no yes)
 15641  		for b.Controls[0].Op == OpPPC64FlagLT {
 15642  			b.Reset(BlockFirst)
 15643  			b.swapSuccessors()
 15644  			return true
 15645  		}
 15646  		// match: (GE (FlagGT) yes no)
 15647  		// result: (First yes no)
 15648  		for b.Controls[0].Op == OpPPC64FlagGT {
 15649  			b.Reset(BlockFirst)
 15650  			return true
 15651  		}
 15652  		// match: (GE (InvertFlags cmp) yes no)
 15653  		// result: (LE cmp yes no)
 15654  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15655  			v_0 := b.Controls[0]
 15656  			cmp := v_0.Args[0]
 15657  			b.resetWithControl(BlockPPC64LE, cmp)
 15658  			return true
 15659  		}
 15660  		// match: (GE (CMPconst [0] z:(AND x y)) yes no)
 15661  		// cond: z.Uses == 1
 15662  		// result: (GE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15663  		for b.Controls[0].Op == OpPPC64CMPconst {
 15664  			v_0 := b.Controls[0]
 15665  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15666  				break
 15667  			}
 15668  			z := v_0.Args[0]
 15669  			if z.Op != OpPPC64AND {
 15670  				break
 15671  			}
 15672  			_ = z.Args[1]
 15673  			z_0 := z.Args[0]
 15674  			z_1 := z.Args[1]
 15675  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15676  				x := z_0
 15677  				y := z_1
 15678  				if !(z.Uses == 1) {
 15679  					continue
 15680  				}
 15681  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15682  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15683  				v1.AddArg2(x, y)
 15684  				v0.AddArg(v1)
 15685  				b.resetWithControl(BlockPPC64GE, v0)
 15686  				return true
 15687  			}
 15688  			break
 15689  		}
 15690  		// match: (GE (CMPconst [0] z:(OR x y)) yes no)
 15691  		// cond: z.Uses == 1
 15692  		// result: (GE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15693  		for b.Controls[0].Op == OpPPC64CMPconst {
 15694  			v_0 := b.Controls[0]
 15695  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15696  				break
 15697  			}
 15698  			z := v_0.Args[0]
 15699  			if z.Op != OpPPC64OR {
 15700  				break
 15701  			}
 15702  			_ = z.Args[1]
 15703  			z_0 := z.Args[0]
 15704  			z_1 := z.Args[1]
 15705  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15706  				x := z_0
 15707  				y := z_1
 15708  				if !(z.Uses == 1) {
 15709  					continue
 15710  				}
 15711  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15712  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15713  				v1.AddArg2(x, y)
 15714  				v0.AddArg(v1)
 15715  				b.resetWithControl(BlockPPC64GE, v0)
 15716  				return true
 15717  			}
 15718  			break
 15719  		}
 15720  		// match: (GE (CMPconst [0] z:(XOR x y)) yes no)
 15721  		// cond: z.Uses == 1
 15722  		// result: (GE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15723  		for b.Controls[0].Op == OpPPC64CMPconst {
 15724  			v_0 := b.Controls[0]
 15725  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15726  				break
 15727  			}
 15728  			z := v_0.Args[0]
 15729  			if z.Op != OpPPC64XOR {
 15730  				break
 15731  			}
 15732  			_ = z.Args[1]
 15733  			z_0 := z.Args[0]
 15734  			z_1 := z.Args[1]
 15735  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15736  				x := z_0
 15737  				y := z_1
 15738  				if !(z.Uses == 1) {
 15739  					continue
 15740  				}
 15741  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15742  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15743  				v1.AddArg2(x, y)
 15744  				v0.AddArg(v1)
 15745  				b.resetWithControl(BlockPPC64GE, v0)
 15746  				return true
 15747  			}
 15748  			break
 15749  		}
 15750  	case BlockPPC64GT:
 15751  		// match: (GT (FlagEQ) yes no)
 15752  		// result: (First no yes)
 15753  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15754  			b.Reset(BlockFirst)
 15755  			b.swapSuccessors()
 15756  			return true
 15757  		}
 15758  		// match: (GT (FlagLT) yes no)
 15759  		// result: (First no yes)
 15760  		for b.Controls[0].Op == OpPPC64FlagLT {
 15761  			b.Reset(BlockFirst)
 15762  			b.swapSuccessors()
 15763  			return true
 15764  		}
 15765  		// match: (GT (FlagGT) yes no)
 15766  		// result: (First yes no)
 15767  		for b.Controls[0].Op == OpPPC64FlagGT {
 15768  			b.Reset(BlockFirst)
 15769  			return true
 15770  		}
 15771  		// match: (GT (InvertFlags cmp) yes no)
 15772  		// result: (LT cmp yes no)
 15773  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15774  			v_0 := b.Controls[0]
 15775  			cmp := v_0.Args[0]
 15776  			b.resetWithControl(BlockPPC64LT, cmp)
 15777  			return true
 15778  		}
 15779  		// match: (GT (CMPconst [0] z:(AND x y)) yes no)
 15780  		// cond: z.Uses == 1
 15781  		// result: (GT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15782  		for b.Controls[0].Op == OpPPC64CMPconst {
 15783  			v_0 := b.Controls[0]
 15784  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15785  				break
 15786  			}
 15787  			z := v_0.Args[0]
 15788  			if z.Op != OpPPC64AND {
 15789  				break
 15790  			}
 15791  			_ = z.Args[1]
 15792  			z_0 := z.Args[0]
 15793  			z_1 := z.Args[1]
 15794  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15795  				x := z_0
 15796  				y := z_1
 15797  				if !(z.Uses == 1) {
 15798  					continue
 15799  				}
 15800  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15801  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15802  				v1.AddArg2(x, y)
 15803  				v0.AddArg(v1)
 15804  				b.resetWithControl(BlockPPC64GT, v0)
 15805  				return true
 15806  			}
 15807  			break
 15808  		}
 15809  		// match: (GT (CMPconst [0] z:(OR x y)) yes no)
 15810  		// cond: z.Uses == 1
 15811  		// result: (GT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15812  		for b.Controls[0].Op == OpPPC64CMPconst {
 15813  			v_0 := b.Controls[0]
 15814  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15815  				break
 15816  			}
 15817  			z := v_0.Args[0]
 15818  			if z.Op != OpPPC64OR {
 15819  				break
 15820  			}
 15821  			_ = z.Args[1]
 15822  			z_0 := z.Args[0]
 15823  			z_1 := z.Args[1]
 15824  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15825  				x := z_0
 15826  				y := z_1
 15827  				if !(z.Uses == 1) {
 15828  					continue
 15829  				}
 15830  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15831  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15832  				v1.AddArg2(x, y)
 15833  				v0.AddArg(v1)
 15834  				b.resetWithControl(BlockPPC64GT, v0)
 15835  				return true
 15836  			}
 15837  			break
 15838  		}
 15839  		// match: (GT (CMPconst [0] z:(XOR x y)) yes no)
 15840  		// cond: z.Uses == 1
 15841  		// result: (GT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15842  		for b.Controls[0].Op == OpPPC64CMPconst {
 15843  			v_0 := b.Controls[0]
 15844  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15845  				break
 15846  			}
 15847  			z := v_0.Args[0]
 15848  			if z.Op != OpPPC64XOR {
 15849  				break
 15850  			}
 15851  			_ = z.Args[1]
 15852  			z_0 := z.Args[0]
 15853  			z_1 := z.Args[1]
 15854  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15855  				x := z_0
 15856  				y := z_1
 15857  				if !(z.Uses == 1) {
 15858  					continue
 15859  				}
 15860  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15861  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15862  				v1.AddArg2(x, y)
 15863  				v0.AddArg(v1)
 15864  				b.resetWithControl(BlockPPC64GT, v0)
 15865  				return true
 15866  			}
 15867  			break
 15868  		}
 15869  	case BlockIf:
 15870  		// match: (If (Equal cc) yes no)
 15871  		// result: (EQ cc yes no)
 15872  		for b.Controls[0].Op == OpPPC64Equal {
 15873  			v_0 := b.Controls[0]
 15874  			cc := v_0.Args[0]
 15875  			b.resetWithControl(BlockPPC64EQ, cc)
 15876  			return true
 15877  		}
 15878  		// match: (If (NotEqual cc) yes no)
 15879  		// result: (NE cc yes no)
 15880  		for b.Controls[0].Op == OpPPC64NotEqual {
 15881  			v_0 := b.Controls[0]
 15882  			cc := v_0.Args[0]
 15883  			b.resetWithControl(BlockPPC64NE, cc)
 15884  			return true
 15885  		}
 15886  		// match: (If (LessThan cc) yes no)
 15887  		// result: (LT cc yes no)
 15888  		for b.Controls[0].Op == OpPPC64LessThan {
 15889  			v_0 := b.Controls[0]
 15890  			cc := v_0.Args[0]
 15891  			b.resetWithControl(BlockPPC64LT, cc)
 15892  			return true
 15893  		}
 15894  		// match: (If (LessEqual cc) yes no)
 15895  		// result: (LE cc yes no)
 15896  		for b.Controls[0].Op == OpPPC64LessEqual {
 15897  			v_0 := b.Controls[0]
 15898  			cc := v_0.Args[0]
 15899  			b.resetWithControl(BlockPPC64LE, cc)
 15900  			return true
 15901  		}
 15902  		// match: (If (GreaterThan cc) yes no)
 15903  		// result: (GT cc yes no)
 15904  		for b.Controls[0].Op == OpPPC64GreaterThan {
 15905  			v_0 := b.Controls[0]
 15906  			cc := v_0.Args[0]
 15907  			b.resetWithControl(BlockPPC64GT, cc)
 15908  			return true
 15909  		}
 15910  		// match: (If (GreaterEqual cc) yes no)
 15911  		// result: (GE cc yes no)
 15912  		for b.Controls[0].Op == OpPPC64GreaterEqual {
 15913  			v_0 := b.Controls[0]
 15914  			cc := v_0.Args[0]
 15915  			b.resetWithControl(BlockPPC64GE, cc)
 15916  			return true
 15917  		}
 15918  		// match: (If (FLessThan cc) yes no)
 15919  		// result: (FLT cc yes no)
 15920  		for b.Controls[0].Op == OpPPC64FLessThan {
 15921  			v_0 := b.Controls[0]
 15922  			cc := v_0.Args[0]
 15923  			b.resetWithControl(BlockPPC64FLT, cc)
 15924  			return true
 15925  		}
 15926  		// match: (If (FLessEqual cc) yes no)
 15927  		// result: (FLE cc yes no)
 15928  		for b.Controls[0].Op == OpPPC64FLessEqual {
 15929  			v_0 := b.Controls[0]
 15930  			cc := v_0.Args[0]
 15931  			b.resetWithControl(BlockPPC64FLE, cc)
 15932  			return true
 15933  		}
 15934  		// match: (If (FGreaterThan cc) yes no)
 15935  		// result: (FGT cc yes no)
 15936  		for b.Controls[0].Op == OpPPC64FGreaterThan {
 15937  			v_0 := b.Controls[0]
 15938  			cc := v_0.Args[0]
 15939  			b.resetWithControl(BlockPPC64FGT, cc)
 15940  			return true
 15941  		}
 15942  		// match: (If (FGreaterEqual cc) yes no)
 15943  		// result: (FGE cc yes no)
 15944  		for b.Controls[0].Op == OpPPC64FGreaterEqual {
 15945  			v_0 := b.Controls[0]
 15946  			cc := v_0.Args[0]
 15947  			b.resetWithControl(BlockPPC64FGE, cc)
 15948  			return true
 15949  		}
 15950  		// match: (If cond yes no)
 15951  		// result: (NE (CMPconst [0] (ANDconst [1] cond)) yes no)
 15952  		for {
 15953  			cond := b.Controls[0]
 15954  			v0 := b.NewValue0(cond.Pos, OpPPC64CMPconst, types.TypeFlags)
 15955  			v0.AuxInt = int64ToAuxInt(0)
 15956  			v1 := b.NewValue0(cond.Pos, OpPPC64ANDconst, typ.Int)
 15957  			v1.AuxInt = int64ToAuxInt(1)
 15958  			v1.AddArg(cond)
 15959  			v0.AddArg(v1)
 15960  			b.resetWithControl(BlockPPC64NE, v0)
 15961  			return true
 15962  		}
 15963  	case BlockPPC64LE:
 15964  		// match: (LE (FlagEQ) yes no)
 15965  		// result: (First yes no)
 15966  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15967  			b.Reset(BlockFirst)
 15968  			return true
 15969  		}
 15970  		// match: (LE (FlagLT) yes no)
 15971  		// result: (First yes no)
 15972  		for b.Controls[0].Op == OpPPC64FlagLT {
 15973  			b.Reset(BlockFirst)
 15974  			return true
 15975  		}
 15976  		// match: (LE (FlagGT) yes no)
 15977  		// result: (First no yes)
 15978  		for b.Controls[0].Op == OpPPC64FlagGT {
 15979  			b.Reset(BlockFirst)
 15980  			b.swapSuccessors()
 15981  			return true
 15982  		}
 15983  		// match: (LE (InvertFlags cmp) yes no)
 15984  		// result: (GE cmp yes no)
 15985  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15986  			v_0 := b.Controls[0]
 15987  			cmp := v_0.Args[0]
 15988  			b.resetWithControl(BlockPPC64GE, cmp)
 15989  			return true
 15990  		}
 15991  		// match: (LE (CMPconst [0] z:(AND x y)) yes no)
 15992  		// cond: z.Uses == 1
 15993  		// result: (LE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15994  		for b.Controls[0].Op == OpPPC64CMPconst {
 15995  			v_0 := b.Controls[0]
 15996  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15997  				break
 15998  			}
 15999  			z := v_0.Args[0]
 16000  			if z.Op != OpPPC64AND {
 16001  				break
 16002  			}
 16003  			_ = z.Args[1]
 16004  			z_0 := z.Args[0]
 16005  			z_1 := z.Args[1]
 16006  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16007  				x := z_0
 16008  				y := z_1
 16009  				if !(z.Uses == 1) {
 16010  					continue
 16011  				}
 16012  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16013  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16014  				v1.AddArg2(x, y)
 16015  				v0.AddArg(v1)
 16016  				b.resetWithControl(BlockPPC64LE, v0)
 16017  				return true
 16018  			}
 16019  			break
 16020  		}
 16021  		// match: (LE (CMPconst [0] z:(OR x y)) yes no)
 16022  		// cond: z.Uses == 1
 16023  		// result: (LE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16024  		for b.Controls[0].Op == OpPPC64CMPconst {
 16025  			v_0 := b.Controls[0]
 16026  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16027  				break
 16028  			}
 16029  			z := v_0.Args[0]
 16030  			if z.Op != OpPPC64OR {
 16031  				break
 16032  			}
 16033  			_ = z.Args[1]
 16034  			z_0 := z.Args[0]
 16035  			z_1 := z.Args[1]
 16036  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16037  				x := z_0
 16038  				y := z_1
 16039  				if !(z.Uses == 1) {
 16040  					continue
 16041  				}
 16042  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16043  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16044  				v1.AddArg2(x, y)
 16045  				v0.AddArg(v1)
 16046  				b.resetWithControl(BlockPPC64LE, v0)
 16047  				return true
 16048  			}
 16049  			break
 16050  		}
 16051  		// match: (LE (CMPconst [0] z:(XOR x y)) yes no)
 16052  		// cond: z.Uses == 1
 16053  		// result: (LE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16054  		for b.Controls[0].Op == OpPPC64CMPconst {
 16055  			v_0 := b.Controls[0]
 16056  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16057  				break
 16058  			}
 16059  			z := v_0.Args[0]
 16060  			if z.Op != OpPPC64XOR {
 16061  				break
 16062  			}
 16063  			_ = z.Args[1]
 16064  			z_0 := z.Args[0]
 16065  			z_1 := z.Args[1]
 16066  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16067  				x := z_0
 16068  				y := z_1
 16069  				if !(z.Uses == 1) {
 16070  					continue
 16071  				}
 16072  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16073  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16074  				v1.AddArg2(x, y)
 16075  				v0.AddArg(v1)
 16076  				b.resetWithControl(BlockPPC64LE, v0)
 16077  				return true
 16078  			}
 16079  			break
 16080  		}
 16081  	case BlockPPC64LT:
 16082  		// match: (LT (FlagEQ) yes no)
 16083  		// result: (First no yes)
 16084  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16085  			b.Reset(BlockFirst)
 16086  			b.swapSuccessors()
 16087  			return true
 16088  		}
 16089  		// match: (LT (FlagLT) yes no)
 16090  		// result: (First yes no)
 16091  		for b.Controls[0].Op == OpPPC64FlagLT {
 16092  			b.Reset(BlockFirst)
 16093  			return true
 16094  		}
 16095  		// match: (LT (FlagGT) yes no)
 16096  		// result: (First no yes)
 16097  		for b.Controls[0].Op == OpPPC64FlagGT {
 16098  			b.Reset(BlockFirst)
 16099  			b.swapSuccessors()
 16100  			return true
 16101  		}
 16102  		// match: (LT (InvertFlags cmp) yes no)
 16103  		// result: (GT cmp yes no)
 16104  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16105  			v_0 := b.Controls[0]
 16106  			cmp := v_0.Args[0]
 16107  			b.resetWithControl(BlockPPC64GT, cmp)
 16108  			return true
 16109  		}
 16110  		// match: (LT (CMPconst [0] z:(AND x y)) yes no)
 16111  		// cond: z.Uses == 1
 16112  		// result: (LT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16113  		for b.Controls[0].Op == OpPPC64CMPconst {
 16114  			v_0 := b.Controls[0]
 16115  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16116  				break
 16117  			}
 16118  			z := v_0.Args[0]
 16119  			if z.Op != OpPPC64AND {
 16120  				break
 16121  			}
 16122  			_ = z.Args[1]
 16123  			z_0 := z.Args[0]
 16124  			z_1 := z.Args[1]
 16125  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16126  				x := z_0
 16127  				y := z_1
 16128  				if !(z.Uses == 1) {
 16129  					continue
 16130  				}
 16131  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16132  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16133  				v1.AddArg2(x, y)
 16134  				v0.AddArg(v1)
 16135  				b.resetWithControl(BlockPPC64LT, v0)
 16136  				return true
 16137  			}
 16138  			break
 16139  		}
 16140  		// match: (LT (CMPconst [0] z:(OR x y)) yes no)
 16141  		// cond: z.Uses == 1
 16142  		// result: (LT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16143  		for b.Controls[0].Op == OpPPC64CMPconst {
 16144  			v_0 := b.Controls[0]
 16145  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16146  				break
 16147  			}
 16148  			z := v_0.Args[0]
 16149  			if z.Op != OpPPC64OR {
 16150  				break
 16151  			}
 16152  			_ = z.Args[1]
 16153  			z_0 := z.Args[0]
 16154  			z_1 := z.Args[1]
 16155  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16156  				x := z_0
 16157  				y := z_1
 16158  				if !(z.Uses == 1) {
 16159  					continue
 16160  				}
 16161  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16162  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16163  				v1.AddArg2(x, y)
 16164  				v0.AddArg(v1)
 16165  				b.resetWithControl(BlockPPC64LT, v0)
 16166  				return true
 16167  			}
 16168  			break
 16169  		}
 16170  		// match: (LT (CMPconst [0] z:(XOR x y)) yes no)
 16171  		// cond: z.Uses == 1
 16172  		// result: (LT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16173  		for b.Controls[0].Op == OpPPC64CMPconst {
 16174  			v_0 := b.Controls[0]
 16175  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16176  				break
 16177  			}
 16178  			z := v_0.Args[0]
 16179  			if z.Op != OpPPC64XOR {
 16180  				break
 16181  			}
 16182  			_ = z.Args[1]
 16183  			z_0 := z.Args[0]
 16184  			z_1 := z.Args[1]
 16185  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16186  				x := z_0
 16187  				y := z_1
 16188  				if !(z.Uses == 1) {
 16189  					continue
 16190  				}
 16191  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16192  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16193  				v1.AddArg2(x, y)
 16194  				v0.AddArg(v1)
 16195  				b.resetWithControl(BlockPPC64LT, v0)
 16196  				return true
 16197  			}
 16198  			break
 16199  		}
 16200  	case BlockPPC64NE:
 16201  		// match: (NE (CMPconst [0] (ANDconst [1] (Equal cc))) yes no)
 16202  		// result: (EQ cc yes no)
 16203  		for b.Controls[0].Op == OpPPC64CMPconst {
 16204  			v_0 := b.Controls[0]
 16205  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16206  				break
 16207  			}
 16208  			v_0_0 := v_0.Args[0]
 16209  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16210  				break
 16211  			}
 16212  			v_0_0_0 := v_0_0.Args[0]
 16213  			if v_0_0_0.Op != OpPPC64Equal {
 16214  				break
 16215  			}
 16216  			cc := v_0_0_0.Args[0]
 16217  			b.resetWithControl(BlockPPC64EQ, cc)
 16218  			return true
 16219  		}
 16220  		// match: (NE (CMPconst [0] (ANDconst [1] (NotEqual cc))) yes no)
 16221  		// result: (NE cc yes no)
 16222  		for b.Controls[0].Op == OpPPC64CMPconst {
 16223  			v_0 := b.Controls[0]
 16224  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16225  				break
 16226  			}
 16227  			v_0_0 := v_0.Args[0]
 16228  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16229  				break
 16230  			}
 16231  			v_0_0_0 := v_0_0.Args[0]
 16232  			if v_0_0_0.Op != OpPPC64NotEqual {
 16233  				break
 16234  			}
 16235  			cc := v_0_0_0.Args[0]
 16236  			b.resetWithControl(BlockPPC64NE, cc)
 16237  			return true
 16238  		}
 16239  		// match: (NE (CMPconst [0] (ANDconst [1] (LessThan cc))) yes no)
 16240  		// result: (LT cc yes no)
 16241  		for b.Controls[0].Op == OpPPC64CMPconst {
 16242  			v_0 := b.Controls[0]
 16243  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16244  				break
 16245  			}
 16246  			v_0_0 := v_0.Args[0]
 16247  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16248  				break
 16249  			}
 16250  			v_0_0_0 := v_0_0.Args[0]
 16251  			if v_0_0_0.Op != OpPPC64LessThan {
 16252  				break
 16253  			}
 16254  			cc := v_0_0_0.Args[0]
 16255  			b.resetWithControl(BlockPPC64LT, cc)
 16256  			return true
 16257  		}
 16258  		// match: (NE (CMPconst [0] (ANDconst [1] (LessEqual cc))) yes no)
 16259  		// result: (LE cc yes no)
 16260  		for b.Controls[0].Op == OpPPC64CMPconst {
 16261  			v_0 := b.Controls[0]
 16262  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16263  				break
 16264  			}
 16265  			v_0_0 := v_0.Args[0]
 16266  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16267  				break
 16268  			}
 16269  			v_0_0_0 := v_0_0.Args[0]
 16270  			if v_0_0_0.Op != OpPPC64LessEqual {
 16271  				break
 16272  			}
 16273  			cc := v_0_0_0.Args[0]
 16274  			b.resetWithControl(BlockPPC64LE, cc)
 16275  			return true
 16276  		}
 16277  		// match: (NE (CMPconst [0] (ANDconst [1] (GreaterThan cc))) yes no)
 16278  		// result: (GT cc yes no)
 16279  		for b.Controls[0].Op == OpPPC64CMPconst {
 16280  			v_0 := b.Controls[0]
 16281  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16282  				break
 16283  			}
 16284  			v_0_0 := v_0.Args[0]
 16285  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16286  				break
 16287  			}
 16288  			v_0_0_0 := v_0_0.Args[0]
 16289  			if v_0_0_0.Op != OpPPC64GreaterThan {
 16290  				break
 16291  			}
 16292  			cc := v_0_0_0.Args[0]
 16293  			b.resetWithControl(BlockPPC64GT, cc)
 16294  			return true
 16295  		}
 16296  		// match: (NE (CMPconst [0] (ANDconst [1] (GreaterEqual cc))) yes no)
 16297  		// result: (GE cc yes no)
 16298  		for b.Controls[0].Op == OpPPC64CMPconst {
 16299  			v_0 := b.Controls[0]
 16300  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16301  				break
 16302  			}
 16303  			v_0_0 := v_0.Args[0]
 16304  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16305  				break
 16306  			}
 16307  			v_0_0_0 := v_0_0.Args[0]
 16308  			if v_0_0_0.Op != OpPPC64GreaterEqual {
 16309  				break
 16310  			}
 16311  			cc := v_0_0_0.Args[0]
 16312  			b.resetWithControl(BlockPPC64GE, cc)
 16313  			return true
 16314  		}
 16315  		// match: (NE (CMPconst [0] (ANDconst [1] (FLessThan cc))) yes no)
 16316  		// result: (FLT cc yes no)
 16317  		for b.Controls[0].Op == OpPPC64CMPconst {
 16318  			v_0 := b.Controls[0]
 16319  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16320  				break
 16321  			}
 16322  			v_0_0 := v_0.Args[0]
 16323  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16324  				break
 16325  			}
 16326  			v_0_0_0 := v_0_0.Args[0]
 16327  			if v_0_0_0.Op != OpPPC64FLessThan {
 16328  				break
 16329  			}
 16330  			cc := v_0_0_0.Args[0]
 16331  			b.resetWithControl(BlockPPC64FLT, cc)
 16332  			return true
 16333  		}
 16334  		// match: (NE (CMPconst [0] (ANDconst [1] (FLessEqual cc))) yes no)
 16335  		// result: (FLE cc yes no)
 16336  		for b.Controls[0].Op == OpPPC64CMPconst {
 16337  			v_0 := b.Controls[0]
 16338  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16339  				break
 16340  			}
 16341  			v_0_0 := v_0.Args[0]
 16342  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16343  				break
 16344  			}
 16345  			v_0_0_0 := v_0_0.Args[0]
 16346  			if v_0_0_0.Op != OpPPC64FLessEqual {
 16347  				break
 16348  			}
 16349  			cc := v_0_0_0.Args[0]
 16350  			b.resetWithControl(BlockPPC64FLE, cc)
 16351  			return true
 16352  		}
 16353  		// match: (NE (CMPconst [0] (ANDconst [1] (FGreaterThan cc))) yes no)
 16354  		// result: (FGT cc yes no)
 16355  		for b.Controls[0].Op == OpPPC64CMPconst {
 16356  			v_0 := b.Controls[0]
 16357  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16358  				break
 16359  			}
 16360  			v_0_0 := v_0.Args[0]
 16361  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16362  				break
 16363  			}
 16364  			v_0_0_0 := v_0_0.Args[0]
 16365  			if v_0_0_0.Op != OpPPC64FGreaterThan {
 16366  				break
 16367  			}
 16368  			cc := v_0_0_0.Args[0]
 16369  			b.resetWithControl(BlockPPC64FGT, cc)
 16370  			return true
 16371  		}
 16372  		// match: (NE (CMPconst [0] (ANDconst [1] (FGreaterEqual cc))) yes no)
 16373  		// result: (FGE cc yes no)
 16374  		for b.Controls[0].Op == OpPPC64CMPconst {
 16375  			v_0 := b.Controls[0]
 16376  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16377  				break
 16378  			}
 16379  			v_0_0 := v_0.Args[0]
 16380  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16381  				break
 16382  			}
 16383  			v_0_0_0 := v_0_0.Args[0]
 16384  			if v_0_0_0.Op != OpPPC64FGreaterEqual {
 16385  				break
 16386  			}
 16387  			cc := v_0_0_0.Args[0]
 16388  			b.resetWithControl(BlockPPC64FGE, cc)
 16389  			return true
 16390  		}
 16391  		// match: (NE (FlagEQ) yes no)
 16392  		// result: (First no yes)
 16393  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16394  			b.Reset(BlockFirst)
 16395  			b.swapSuccessors()
 16396  			return true
 16397  		}
 16398  		// match: (NE (FlagLT) yes no)
 16399  		// result: (First yes no)
 16400  		for b.Controls[0].Op == OpPPC64FlagLT {
 16401  			b.Reset(BlockFirst)
 16402  			return true
 16403  		}
 16404  		// match: (NE (FlagGT) yes no)
 16405  		// result: (First yes no)
 16406  		for b.Controls[0].Op == OpPPC64FlagGT {
 16407  			b.Reset(BlockFirst)
 16408  			return true
 16409  		}
 16410  		// match: (NE (InvertFlags cmp) yes no)
 16411  		// result: (NE cmp yes no)
 16412  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16413  			v_0 := b.Controls[0]
 16414  			cmp := v_0.Args[0]
 16415  			b.resetWithControl(BlockPPC64NE, cmp)
 16416  			return true
 16417  		}
 16418  		// match: (NE (CMPconst [0] z:(AND x y)) yes no)
 16419  		// cond: z.Uses == 1
 16420  		// result: (NE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16421  		for b.Controls[0].Op == OpPPC64CMPconst {
 16422  			v_0 := b.Controls[0]
 16423  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16424  				break
 16425  			}
 16426  			z := v_0.Args[0]
 16427  			if z.Op != OpPPC64AND {
 16428  				break
 16429  			}
 16430  			_ = z.Args[1]
 16431  			z_0 := z.Args[0]
 16432  			z_1 := z.Args[1]
 16433  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16434  				x := z_0
 16435  				y := z_1
 16436  				if !(z.Uses == 1) {
 16437  					continue
 16438  				}
 16439  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16440  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16441  				v1.AddArg2(x, y)
 16442  				v0.AddArg(v1)
 16443  				b.resetWithControl(BlockPPC64NE, v0)
 16444  				return true
 16445  			}
 16446  			break
 16447  		}
 16448  		// match: (NE (CMPconst [0] z:(OR x y)) yes no)
 16449  		// cond: z.Uses == 1
 16450  		// result: (NE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16451  		for b.Controls[0].Op == OpPPC64CMPconst {
 16452  			v_0 := b.Controls[0]
 16453  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16454  				break
 16455  			}
 16456  			z := v_0.Args[0]
 16457  			if z.Op != OpPPC64OR {
 16458  				break
 16459  			}
 16460  			_ = z.Args[1]
 16461  			z_0 := z.Args[0]
 16462  			z_1 := z.Args[1]
 16463  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16464  				x := z_0
 16465  				y := z_1
 16466  				if !(z.Uses == 1) {
 16467  					continue
 16468  				}
 16469  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16470  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16471  				v1.AddArg2(x, y)
 16472  				v0.AddArg(v1)
 16473  				b.resetWithControl(BlockPPC64NE, v0)
 16474  				return true
 16475  			}
 16476  			break
 16477  		}
 16478  		// match: (NE (CMPconst [0] z:(XOR x y)) yes no)
 16479  		// cond: z.Uses == 1
 16480  		// result: (NE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16481  		for b.Controls[0].Op == OpPPC64CMPconst {
 16482  			v_0 := b.Controls[0]
 16483  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16484  				break
 16485  			}
 16486  			z := v_0.Args[0]
 16487  			if z.Op != OpPPC64XOR {
 16488  				break
 16489  			}
 16490  			_ = z.Args[1]
 16491  			z_0 := z.Args[0]
 16492  			z_1 := z.Args[1]
 16493  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16494  				x := z_0
 16495  				y := z_1
 16496  				if !(z.Uses == 1) {
 16497  					continue
 16498  				}
 16499  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16500  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16501  				v1.AddArg2(x, y)
 16502  				v0.AddArg(v1)
 16503  				b.resetWithControl(BlockPPC64NE, v0)
 16504  				return true
 16505  			}
 16506  			break
 16507  		}
 16508  	}
 16509  	return false
 16510  }
 16511  

View as plain text