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 OpTailCallInter:
   839  		v.Op = OpPPC64CALLtailinter
   840  		return true
   841  	case OpTrunc:
   842  		v.Op = OpPPC64FTRUNC
   843  		return true
   844  	case OpTrunc16to8:
   845  		return rewriteValuePPC64_OpTrunc16to8(v)
   846  	case OpTrunc32to16:
   847  		return rewriteValuePPC64_OpTrunc32to16(v)
   848  	case OpTrunc32to8:
   849  		return rewriteValuePPC64_OpTrunc32to8(v)
   850  	case OpTrunc64to16:
   851  		return rewriteValuePPC64_OpTrunc64to16(v)
   852  	case OpTrunc64to32:
   853  		return rewriteValuePPC64_OpTrunc64to32(v)
   854  	case OpTrunc64to8:
   855  		return rewriteValuePPC64_OpTrunc64to8(v)
   856  	case OpWB:
   857  		v.Op = OpPPC64LoweredWB
   858  		return true
   859  	case OpXor16:
   860  		v.Op = OpPPC64XOR
   861  		return true
   862  	case OpXor32:
   863  		v.Op = OpPPC64XOR
   864  		return true
   865  	case OpXor64:
   866  		v.Op = OpPPC64XOR
   867  		return true
   868  	case OpXor8:
   869  		v.Op = OpPPC64XOR
   870  		return true
   871  	case OpZero:
   872  		return rewriteValuePPC64_OpZero(v)
   873  	case OpZeroExt16to32:
   874  		v.Op = OpPPC64MOVHZreg
   875  		return true
   876  	case OpZeroExt16to64:
   877  		v.Op = OpPPC64MOVHZreg
   878  		return true
   879  	case OpZeroExt32to64:
   880  		v.Op = OpPPC64MOVWZreg
   881  		return true
   882  	case OpZeroExt8to16:
   883  		v.Op = OpPPC64MOVBZreg
   884  		return true
   885  	case OpZeroExt8to32:
   886  		v.Op = OpPPC64MOVBZreg
   887  		return true
   888  	case OpZeroExt8to64:
   889  		v.Op = OpPPC64MOVBZreg
   890  		return true
   891  	}
   892  	return false
   893  }
   894  func rewriteValuePPC64_OpAddr(v *Value) bool {
   895  	v_0 := v.Args[0]
   896  	// match: (Addr {sym} base)
   897  	// result: (MOVDaddr {sym} [0] base)
   898  	for {
   899  		sym := auxToSym(v.Aux)
   900  		base := v_0
   901  		v.reset(OpPPC64MOVDaddr)
   902  		v.AuxInt = int32ToAuxInt(0)
   903  		v.Aux = symToAux(sym)
   904  		v.AddArg(base)
   905  		return true
   906  	}
   907  }
   908  func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
   909  	v_3 := v.Args[3]
   910  	v_2 := v.Args[2]
   911  	v_1 := v.Args[1]
   912  	v_0 := v.Args[0]
   913  	// match: (AtomicCompareAndSwap32 ptr old new_ mem)
   914  	// result: (LoweredAtomicCas32 [1] ptr old new_ mem)
   915  	for {
   916  		ptr := v_0
   917  		old := v_1
   918  		new_ := v_2
   919  		mem := v_3
   920  		v.reset(OpPPC64LoweredAtomicCas32)
   921  		v.AuxInt = int64ToAuxInt(1)
   922  		v.AddArg4(ptr, old, new_, mem)
   923  		return true
   924  	}
   925  }
   926  func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
   927  	v_3 := v.Args[3]
   928  	v_2 := v.Args[2]
   929  	v_1 := v.Args[1]
   930  	v_0 := v.Args[0]
   931  	// match: (AtomicCompareAndSwap64 ptr old new_ mem)
   932  	// result: (LoweredAtomicCas64 [1] ptr old new_ mem)
   933  	for {
   934  		ptr := v_0
   935  		old := v_1
   936  		new_ := v_2
   937  		mem := v_3
   938  		v.reset(OpPPC64LoweredAtomicCas64)
   939  		v.AuxInt = int64ToAuxInt(1)
   940  		v.AddArg4(ptr, old, new_, mem)
   941  		return true
   942  	}
   943  }
   944  func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
   945  	v_3 := v.Args[3]
   946  	v_2 := v.Args[2]
   947  	v_1 := v.Args[1]
   948  	v_0 := v.Args[0]
   949  	// match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
   950  	// result: (LoweredAtomicCas32 [0] ptr old new_ mem)
   951  	for {
   952  		ptr := v_0
   953  		old := v_1
   954  		new_ := v_2
   955  		mem := v_3
   956  		v.reset(OpPPC64LoweredAtomicCas32)
   957  		v.AuxInt = int64ToAuxInt(0)
   958  		v.AddArg4(ptr, old, new_, mem)
   959  		return true
   960  	}
   961  }
   962  func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
   963  	v_1 := v.Args[1]
   964  	v_0 := v.Args[0]
   965  	// match: (AtomicLoad32 ptr mem)
   966  	// result: (LoweredAtomicLoad32 [1] ptr mem)
   967  	for {
   968  		ptr := v_0
   969  		mem := v_1
   970  		v.reset(OpPPC64LoweredAtomicLoad32)
   971  		v.AuxInt = int64ToAuxInt(1)
   972  		v.AddArg2(ptr, mem)
   973  		return true
   974  	}
   975  }
   976  func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
   977  	v_1 := v.Args[1]
   978  	v_0 := v.Args[0]
   979  	// match: (AtomicLoad64 ptr mem)
   980  	// result: (LoweredAtomicLoad64 [1] ptr mem)
   981  	for {
   982  		ptr := v_0
   983  		mem := v_1
   984  		v.reset(OpPPC64LoweredAtomicLoad64)
   985  		v.AuxInt = int64ToAuxInt(1)
   986  		v.AddArg2(ptr, mem)
   987  		return true
   988  	}
   989  }
   990  func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
   991  	v_1 := v.Args[1]
   992  	v_0 := v.Args[0]
   993  	// match: (AtomicLoad8 ptr mem)
   994  	// result: (LoweredAtomicLoad8 [1] ptr mem)
   995  	for {
   996  		ptr := v_0
   997  		mem := v_1
   998  		v.reset(OpPPC64LoweredAtomicLoad8)
   999  		v.AuxInt = int64ToAuxInt(1)
  1000  		v.AddArg2(ptr, mem)
  1001  		return true
  1002  	}
  1003  }
  1004  func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
  1005  	v_1 := v.Args[1]
  1006  	v_0 := v.Args[0]
  1007  	// match: (AtomicLoadAcq32 ptr mem)
  1008  	// result: (LoweredAtomicLoad32 [0] ptr mem)
  1009  	for {
  1010  		ptr := v_0
  1011  		mem := v_1
  1012  		v.reset(OpPPC64LoweredAtomicLoad32)
  1013  		v.AuxInt = int64ToAuxInt(0)
  1014  		v.AddArg2(ptr, mem)
  1015  		return true
  1016  	}
  1017  }
  1018  func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
  1019  	v_1 := v.Args[1]
  1020  	v_0 := v.Args[0]
  1021  	// match: (AtomicLoadAcq64 ptr mem)
  1022  	// result: (LoweredAtomicLoad64 [0] ptr mem)
  1023  	for {
  1024  		ptr := v_0
  1025  		mem := v_1
  1026  		v.reset(OpPPC64LoweredAtomicLoad64)
  1027  		v.AuxInt = int64ToAuxInt(0)
  1028  		v.AddArg2(ptr, mem)
  1029  		return true
  1030  	}
  1031  }
  1032  func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
  1033  	v_1 := v.Args[1]
  1034  	v_0 := v.Args[0]
  1035  	// match: (AtomicLoadPtr ptr mem)
  1036  	// result: (LoweredAtomicLoadPtr [1] ptr mem)
  1037  	for {
  1038  		ptr := v_0
  1039  		mem := v_1
  1040  		v.reset(OpPPC64LoweredAtomicLoadPtr)
  1041  		v.AuxInt = int64ToAuxInt(1)
  1042  		v.AddArg2(ptr, mem)
  1043  		return true
  1044  	}
  1045  }
  1046  func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
  1047  	v_2 := v.Args[2]
  1048  	v_1 := v.Args[1]
  1049  	v_0 := v.Args[0]
  1050  	// match: (AtomicStore32 ptr val mem)
  1051  	// result: (LoweredAtomicStore32 [1] ptr val mem)
  1052  	for {
  1053  		ptr := v_0
  1054  		val := v_1
  1055  		mem := v_2
  1056  		v.reset(OpPPC64LoweredAtomicStore32)
  1057  		v.AuxInt = int64ToAuxInt(1)
  1058  		v.AddArg3(ptr, val, mem)
  1059  		return true
  1060  	}
  1061  }
  1062  func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
  1063  	v_2 := v.Args[2]
  1064  	v_1 := v.Args[1]
  1065  	v_0 := v.Args[0]
  1066  	// match: (AtomicStore64 ptr val mem)
  1067  	// result: (LoweredAtomicStore64 [1] ptr val mem)
  1068  	for {
  1069  		ptr := v_0
  1070  		val := v_1
  1071  		mem := v_2
  1072  		v.reset(OpPPC64LoweredAtomicStore64)
  1073  		v.AuxInt = int64ToAuxInt(1)
  1074  		v.AddArg3(ptr, val, mem)
  1075  		return true
  1076  	}
  1077  }
  1078  func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
  1079  	v_2 := v.Args[2]
  1080  	v_1 := v.Args[1]
  1081  	v_0 := v.Args[0]
  1082  	// match: (AtomicStore8 ptr val mem)
  1083  	// result: (LoweredAtomicStore8 [1] ptr val mem)
  1084  	for {
  1085  		ptr := v_0
  1086  		val := v_1
  1087  		mem := v_2
  1088  		v.reset(OpPPC64LoweredAtomicStore8)
  1089  		v.AuxInt = int64ToAuxInt(1)
  1090  		v.AddArg3(ptr, val, mem)
  1091  		return true
  1092  	}
  1093  }
  1094  func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
  1095  	v_2 := v.Args[2]
  1096  	v_1 := v.Args[1]
  1097  	v_0 := v.Args[0]
  1098  	// match: (AtomicStoreRel32 ptr val mem)
  1099  	// result: (LoweredAtomicStore32 [0] ptr val mem)
  1100  	for {
  1101  		ptr := v_0
  1102  		val := v_1
  1103  		mem := v_2
  1104  		v.reset(OpPPC64LoweredAtomicStore32)
  1105  		v.AuxInt = int64ToAuxInt(0)
  1106  		v.AddArg3(ptr, val, mem)
  1107  		return true
  1108  	}
  1109  }
  1110  func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
  1111  	v_2 := v.Args[2]
  1112  	v_1 := v.Args[1]
  1113  	v_0 := v.Args[0]
  1114  	// match: (AtomicStoreRel64 ptr val mem)
  1115  	// result: (LoweredAtomicStore64 [0] ptr val mem)
  1116  	for {
  1117  		ptr := v_0
  1118  		val := v_1
  1119  		mem := v_2
  1120  		v.reset(OpPPC64LoweredAtomicStore64)
  1121  		v.AuxInt = int64ToAuxInt(0)
  1122  		v.AddArg3(ptr, val, mem)
  1123  		return true
  1124  	}
  1125  }
  1126  func rewriteValuePPC64_OpAvg64u(v *Value) bool {
  1127  	v_1 := v.Args[1]
  1128  	v_0 := v.Args[0]
  1129  	b := v.Block
  1130  	// match: (Avg64u <t> x y)
  1131  	// result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y)
  1132  	for {
  1133  		t := v.Type
  1134  		x := v_0
  1135  		y := v_1
  1136  		v.reset(OpPPC64ADD)
  1137  		v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
  1138  		v0.AuxInt = int64ToAuxInt(1)
  1139  		v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
  1140  		v1.AddArg2(x, y)
  1141  		v0.AddArg(v1)
  1142  		v.AddArg2(v0, y)
  1143  		return true
  1144  	}
  1145  }
  1146  func rewriteValuePPC64_OpBitLen16(v *Value) bool {
  1147  	v_0 := v.Args[0]
  1148  	b := v.Block
  1149  	typ := &b.Func.Config.Types
  1150  	// match: (BitLen16 x)
  1151  	// result: (BitLen64 (ZeroExt16to64 x))
  1152  	for {
  1153  		x := v_0
  1154  		v.reset(OpBitLen64)
  1155  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1156  		v0.AddArg(x)
  1157  		v.AddArg(v0)
  1158  		return true
  1159  	}
  1160  }
  1161  func rewriteValuePPC64_OpBitLen32(v *Value) bool {
  1162  	v_0 := v.Args[0]
  1163  	b := v.Block
  1164  	typ := &b.Func.Config.Types
  1165  	// match: (BitLen32 x)
  1166  	// result: (SUBFCconst [32] (CNTLZW <typ.Int> x))
  1167  	for {
  1168  		x := v_0
  1169  		v.reset(OpPPC64SUBFCconst)
  1170  		v.AuxInt = int64ToAuxInt(32)
  1171  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
  1172  		v0.AddArg(x)
  1173  		v.AddArg(v0)
  1174  		return true
  1175  	}
  1176  }
  1177  func rewriteValuePPC64_OpBitLen64(v *Value) bool {
  1178  	v_0 := v.Args[0]
  1179  	b := v.Block
  1180  	typ := &b.Func.Config.Types
  1181  	// match: (BitLen64 x)
  1182  	// result: (SUBFCconst [64] (CNTLZD <typ.Int> x))
  1183  	for {
  1184  		x := v_0
  1185  		v.reset(OpPPC64SUBFCconst)
  1186  		v.AuxInt = int64ToAuxInt(64)
  1187  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
  1188  		v0.AddArg(x)
  1189  		v.AddArg(v0)
  1190  		return true
  1191  	}
  1192  }
  1193  func rewriteValuePPC64_OpBitLen8(v *Value) bool {
  1194  	v_0 := v.Args[0]
  1195  	b := v.Block
  1196  	typ := &b.Func.Config.Types
  1197  	// match: (BitLen8 x)
  1198  	// result: (BitLen64 (ZeroExt8to64 x))
  1199  	for {
  1200  		x := v_0
  1201  		v.reset(OpBitLen64)
  1202  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1203  		v0.AddArg(x)
  1204  		v.AddArg(v0)
  1205  		return true
  1206  	}
  1207  }
  1208  func rewriteValuePPC64_OpBswap16(v *Value) bool {
  1209  	v_0 := v.Args[0]
  1210  	b := v.Block
  1211  	typ := &b.Func.Config.Types
  1212  	// match: (Bswap16 x)
  1213  	// cond: buildcfg.GOPPC64>=10
  1214  	// result: (BRH x)
  1215  	for {
  1216  		x := v_0
  1217  		if !(buildcfg.GOPPC64 >= 10) {
  1218  			break
  1219  		}
  1220  		v.reset(OpPPC64BRH)
  1221  		v.AddArg(x)
  1222  		return true
  1223  	}
  1224  	// match: (Bswap16 x:(MOVHZload [off] {sym} ptr mem))
  1225  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1226  	for {
  1227  		x := v_0
  1228  		if x.Op != OpPPC64MOVHZload {
  1229  			break
  1230  		}
  1231  		off := auxIntToInt32(x.AuxInt)
  1232  		sym := auxToSym(x.Aux)
  1233  		mem := x.Args[1]
  1234  		ptr := x.Args[0]
  1235  		b = x.Block
  1236  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  1237  		v.copyOf(v0)
  1238  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1239  		v1.AuxInt = int32ToAuxInt(off)
  1240  		v1.Aux = symToAux(sym)
  1241  		v1.AddArg(ptr)
  1242  		v0.AddArg2(v1, mem)
  1243  		return true
  1244  	}
  1245  	// match: (Bswap16 x:(MOVHZloadidx ptr idx mem))
  1246  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  1247  	for {
  1248  		x := v_0
  1249  		if x.Op != OpPPC64MOVHZloadidx {
  1250  			break
  1251  		}
  1252  		mem := x.Args[2]
  1253  		ptr := x.Args[0]
  1254  		idx := x.Args[1]
  1255  		b = x.Block
  1256  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  1257  		v.copyOf(v0)
  1258  		v0.AddArg3(ptr, idx, mem)
  1259  		return true
  1260  	}
  1261  	return false
  1262  }
  1263  func rewriteValuePPC64_OpBswap32(v *Value) bool {
  1264  	v_0 := v.Args[0]
  1265  	b := v.Block
  1266  	typ := &b.Func.Config.Types
  1267  	// match: (Bswap32 x)
  1268  	// cond: buildcfg.GOPPC64>=10
  1269  	// result: (BRW x)
  1270  	for {
  1271  		x := v_0
  1272  		if !(buildcfg.GOPPC64 >= 10) {
  1273  			break
  1274  		}
  1275  		v.reset(OpPPC64BRW)
  1276  		v.AddArg(x)
  1277  		return true
  1278  	}
  1279  	// match: (Bswap32 x:(MOVWZload [off] {sym} ptr mem))
  1280  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1281  	for {
  1282  		x := v_0
  1283  		if x.Op != OpPPC64MOVWZload {
  1284  			break
  1285  		}
  1286  		off := auxIntToInt32(x.AuxInt)
  1287  		sym := auxToSym(x.Aux)
  1288  		mem := x.Args[1]
  1289  		ptr := x.Args[0]
  1290  		b = x.Block
  1291  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  1292  		v.copyOf(v0)
  1293  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1294  		v1.AuxInt = int32ToAuxInt(off)
  1295  		v1.Aux = symToAux(sym)
  1296  		v1.AddArg(ptr)
  1297  		v0.AddArg2(v1, mem)
  1298  		return true
  1299  	}
  1300  	// match: (Bswap32 x:(MOVWZloadidx ptr idx mem))
  1301  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  1302  	for {
  1303  		x := v_0
  1304  		if x.Op != OpPPC64MOVWZloadidx {
  1305  			break
  1306  		}
  1307  		mem := x.Args[2]
  1308  		ptr := x.Args[0]
  1309  		idx := x.Args[1]
  1310  		b = x.Block
  1311  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  1312  		v.copyOf(v0)
  1313  		v0.AddArg3(ptr, idx, mem)
  1314  		return true
  1315  	}
  1316  	return false
  1317  }
  1318  func rewriteValuePPC64_OpBswap64(v *Value) bool {
  1319  	v_0 := v.Args[0]
  1320  	b := v.Block
  1321  	typ := &b.Func.Config.Types
  1322  	// match: (Bswap64 x)
  1323  	// cond: buildcfg.GOPPC64>=10
  1324  	// result: (BRD x)
  1325  	for {
  1326  		x := v_0
  1327  		if !(buildcfg.GOPPC64 >= 10) {
  1328  			break
  1329  		}
  1330  		v.reset(OpPPC64BRD)
  1331  		v.AddArg(x)
  1332  		return true
  1333  	}
  1334  	// match: (Bswap64 x:(MOVDload [off] {sym} ptr mem))
  1335  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1336  	for {
  1337  		x := v_0
  1338  		if x.Op != OpPPC64MOVDload {
  1339  			break
  1340  		}
  1341  		off := auxIntToInt32(x.AuxInt)
  1342  		sym := auxToSym(x.Aux)
  1343  		mem := x.Args[1]
  1344  		ptr := x.Args[0]
  1345  		b = x.Block
  1346  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  1347  		v.copyOf(v0)
  1348  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1349  		v1.AuxInt = int32ToAuxInt(off)
  1350  		v1.Aux = symToAux(sym)
  1351  		v1.AddArg(ptr)
  1352  		v0.AddArg2(v1, mem)
  1353  		return true
  1354  	}
  1355  	// match: (Bswap64 x:(MOVDloadidx ptr idx mem))
  1356  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  1357  	for {
  1358  		x := v_0
  1359  		if x.Op != OpPPC64MOVDloadidx {
  1360  			break
  1361  		}
  1362  		mem := x.Args[2]
  1363  		ptr := x.Args[0]
  1364  		idx := x.Args[1]
  1365  		b = x.Block
  1366  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  1367  		v.copyOf(v0)
  1368  		v0.AddArg3(ptr, idx, mem)
  1369  		return true
  1370  	}
  1371  	return false
  1372  }
  1373  func rewriteValuePPC64_OpCom16(v *Value) bool {
  1374  	v_0 := v.Args[0]
  1375  	// match: (Com16 x)
  1376  	// result: (NOR x x)
  1377  	for {
  1378  		x := v_0
  1379  		v.reset(OpPPC64NOR)
  1380  		v.AddArg2(x, x)
  1381  		return true
  1382  	}
  1383  }
  1384  func rewriteValuePPC64_OpCom32(v *Value) bool {
  1385  	v_0 := v.Args[0]
  1386  	// match: (Com32 x)
  1387  	// result: (NOR x x)
  1388  	for {
  1389  		x := v_0
  1390  		v.reset(OpPPC64NOR)
  1391  		v.AddArg2(x, x)
  1392  		return true
  1393  	}
  1394  }
  1395  func rewriteValuePPC64_OpCom64(v *Value) bool {
  1396  	v_0 := v.Args[0]
  1397  	// match: (Com64 x)
  1398  	// result: (NOR x x)
  1399  	for {
  1400  		x := v_0
  1401  		v.reset(OpPPC64NOR)
  1402  		v.AddArg2(x, x)
  1403  		return true
  1404  	}
  1405  }
  1406  func rewriteValuePPC64_OpCom8(v *Value) bool {
  1407  	v_0 := v.Args[0]
  1408  	// match: (Com8 x)
  1409  	// result: (NOR x x)
  1410  	for {
  1411  		x := v_0
  1412  		v.reset(OpPPC64NOR)
  1413  		v.AddArg2(x, x)
  1414  		return true
  1415  	}
  1416  }
  1417  func rewriteValuePPC64_OpCondSelect(v *Value) bool {
  1418  	v_2 := v.Args[2]
  1419  	v_1 := v.Args[1]
  1420  	v_0 := v.Args[0]
  1421  	b := v.Block
  1422  	typ := &b.Func.Config.Types
  1423  	// match: (CondSelect x y (SETBC [a] cmp))
  1424  	// result: (ISEL [a] x y cmp)
  1425  	for {
  1426  		x := v_0
  1427  		y := v_1
  1428  		if v_2.Op != OpPPC64SETBC {
  1429  			break
  1430  		}
  1431  		a := auxIntToInt32(v_2.AuxInt)
  1432  		cmp := v_2.Args[0]
  1433  		v.reset(OpPPC64ISEL)
  1434  		v.AuxInt = int32ToAuxInt(a)
  1435  		v.AddArg3(x, y, cmp)
  1436  		return true
  1437  	}
  1438  	// match: (CondSelect x y (SETBCR [a] cmp))
  1439  	// result: (ISEL [a+4] x y cmp)
  1440  	for {
  1441  		x := v_0
  1442  		y := v_1
  1443  		if v_2.Op != OpPPC64SETBCR {
  1444  			break
  1445  		}
  1446  		a := auxIntToInt32(v_2.AuxInt)
  1447  		cmp := v_2.Args[0]
  1448  		v.reset(OpPPC64ISEL)
  1449  		v.AuxInt = int32ToAuxInt(a + 4)
  1450  		v.AddArg3(x, y, cmp)
  1451  		return true
  1452  	}
  1453  	// match: (CondSelect x y bool)
  1454  	// cond: flagArg(bool) == nil
  1455  	// result: (ISEL [6] x y (CMPconst [0] (ANDconst [1] bool)))
  1456  	for {
  1457  		x := v_0
  1458  		y := v_1
  1459  		bool := v_2
  1460  		if !(flagArg(bool) == nil) {
  1461  			break
  1462  		}
  1463  		v.reset(OpPPC64ISEL)
  1464  		v.AuxInt = int32ToAuxInt(6)
  1465  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  1466  		v0.AuxInt = int64ToAuxInt(0)
  1467  		v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  1468  		v1.AuxInt = int64ToAuxInt(1)
  1469  		v1.AddArg(bool)
  1470  		v0.AddArg(v1)
  1471  		v.AddArg3(x, y, v0)
  1472  		return true
  1473  	}
  1474  	return false
  1475  }
  1476  func rewriteValuePPC64_OpConst16(v *Value) bool {
  1477  	// match: (Const16 [val])
  1478  	// result: (MOVDconst [int64(val)])
  1479  	for {
  1480  		val := auxIntToInt16(v.AuxInt)
  1481  		v.reset(OpPPC64MOVDconst)
  1482  		v.AuxInt = int64ToAuxInt(int64(val))
  1483  		return true
  1484  	}
  1485  }
  1486  func rewriteValuePPC64_OpConst32(v *Value) bool {
  1487  	// match: (Const32 [val])
  1488  	// result: (MOVDconst [int64(val)])
  1489  	for {
  1490  		val := auxIntToInt32(v.AuxInt)
  1491  		v.reset(OpPPC64MOVDconst)
  1492  		v.AuxInt = int64ToAuxInt(int64(val))
  1493  		return true
  1494  	}
  1495  }
  1496  func rewriteValuePPC64_OpConst64(v *Value) bool {
  1497  	// match: (Const64 [val])
  1498  	// result: (MOVDconst [int64(val)])
  1499  	for {
  1500  		val := auxIntToInt64(v.AuxInt)
  1501  		v.reset(OpPPC64MOVDconst)
  1502  		v.AuxInt = int64ToAuxInt(int64(val))
  1503  		return true
  1504  	}
  1505  }
  1506  func rewriteValuePPC64_OpConst8(v *Value) bool {
  1507  	// match: (Const8 [val])
  1508  	// result: (MOVDconst [int64(val)])
  1509  	for {
  1510  		val := auxIntToInt8(v.AuxInt)
  1511  		v.reset(OpPPC64MOVDconst)
  1512  		v.AuxInt = int64ToAuxInt(int64(val))
  1513  		return true
  1514  	}
  1515  }
  1516  func rewriteValuePPC64_OpConstBool(v *Value) bool {
  1517  	// match: (ConstBool [t])
  1518  	// result: (MOVDconst [b2i(t)])
  1519  	for {
  1520  		t := auxIntToBool(v.AuxInt)
  1521  		v.reset(OpPPC64MOVDconst)
  1522  		v.AuxInt = int64ToAuxInt(b2i(t))
  1523  		return true
  1524  	}
  1525  }
  1526  func rewriteValuePPC64_OpConstNil(v *Value) bool {
  1527  	// match: (ConstNil)
  1528  	// result: (MOVDconst [0])
  1529  	for {
  1530  		v.reset(OpPPC64MOVDconst)
  1531  		v.AuxInt = int64ToAuxInt(0)
  1532  		return true
  1533  	}
  1534  }
  1535  func rewriteValuePPC64_OpCopysign(v *Value) bool {
  1536  	v_1 := v.Args[1]
  1537  	v_0 := v.Args[0]
  1538  	// match: (Copysign x y)
  1539  	// result: (FCPSGN y x)
  1540  	for {
  1541  		x := v_0
  1542  		y := v_1
  1543  		v.reset(OpPPC64FCPSGN)
  1544  		v.AddArg2(y, x)
  1545  		return true
  1546  	}
  1547  }
  1548  func rewriteValuePPC64_OpCtz16(v *Value) bool {
  1549  	v_0 := v.Args[0]
  1550  	b := v.Block
  1551  	typ := &b.Func.Config.Types
  1552  	// match: (Ctz16 x)
  1553  	// cond: buildcfg.GOPPC64 <= 8
  1554  	// result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x)))
  1555  	for {
  1556  		x := v_0
  1557  		if !(buildcfg.GOPPC64 <= 8) {
  1558  			break
  1559  		}
  1560  		v.reset(OpPPC64POPCNTW)
  1561  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  1562  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
  1563  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
  1564  		v2.AuxInt = int64ToAuxInt(-1)
  1565  		v2.AddArg(x)
  1566  		v1.AddArg2(v2, x)
  1567  		v0.AddArg(v1)
  1568  		v.AddArg(v0)
  1569  		return true
  1570  	}
  1571  	// match: (Ctz16 x)
  1572  	// cond: buildcfg.GOPPC64 >= 9
  1573  	// result: (CNTTZD (OR <typ.UInt64> x (MOVDconst [1<<16])))
  1574  	for {
  1575  		x := v_0
  1576  		if !(buildcfg.GOPPC64 >= 9) {
  1577  			break
  1578  		}
  1579  		v.reset(OpPPC64CNTTZD)
  1580  		v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
  1581  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  1582  		v1.AuxInt = int64ToAuxInt(1 << 16)
  1583  		v0.AddArg2(x, v1)
  1584  		v.AddArg(v0)
  1585  		return true
  1586  	}
  1587  	return false
  1588  }
  1589  func rewriteValuePPC64_OpCtz32(v *Value) bool {
  1590  	v_0 := v.Args[0]
  1591  	b := v.Block
  1592  	typ := &b.Func.Config.Types
  1593  	// match: (Ctz32 x)
  1594  	// cond: buildcfg.GOPPC64 <= 8
  1595  	// result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x)))
  1596  	for {
  1597  		x := v_0
  1598  		if !(buildcfg.GOPPC64 <= 8) {
  1599  			break
  1600  		}
  1601  		v.reset(OpPPC64POPCNTW)
  1602  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1603  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
  1604  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
  1605  		v2.AuxInt = int64ToAuxInt(-1)
  1606  		v2.AddArg(x)
  1607  		v1.AddArg2(v2, x)
  1608  		v0.AddArg(v1)
  1609  		v.AddArg(v0)
  1610  		return true
  1611  	}
  1612  	// match: (Ctz32 x)
  1613  	// cond: buildcfg.GOPPC64 >= 9
  1614  	// result: (CNTTZW (MOVWZreg x))
  1615  	for {
  1616  		x := v_0
  1617  		if !(buildcfg.GOPPC64 >= 9) {
  1618  			break
  1619  		}
  1620  		v.reset(OpPPC64CNTTZW)
  1621  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1622  		v0.AddArg(x)
  1623  		v.AddArg(v0)
  1624  		return true
  1625  	}
  1626  	return false
  1627  }
  1628  func rewriteValuePPC64_OpCtz64(v *Value) bool {
  1629  	v_0 := v.Args[0]
  1630  	b := v.Block
  1631  	typ := &b.Func.Config.Types
  1632  	// match: (Ctz64 x)
  1633  	// cond: buildcfg.GOPPC64 <= 8
  1634  	// result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x))
  1635  	for {
  1636  		x := v_0
  1637  		if !(buildcfg.GOPPC64 <= 8) {
  1638  			break
  1639  		}
  1640  		v.reset(OpPPC64POPCNTD)
  1641  		v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
  1642  		v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
  1643  		v1.AuxInt = int64ToAuxInt(-1)
  1644  		v1.AddArg(x)
  1645  		v0.AddArg2(v1, x)
  1646  		v.AddArg(v0)
  1647  		return true
  1648  	}
  1649  	// match: (Ctz64 x)
  1650  	// cond: buildcfg.GOPPC64 >= 9
  1651  	// result: (CNTTZD x)
  1652  	for {
  1653  		x := v_0
  1654  		if !(buildcfg.GOPPC64 >= 9) {
  1655  			break
  1656  		}
  1657  		v.reset(OpPPC64CNTTZD)
  1658  		v.AddArg(x)
  1659  		return true
  1660  	}
  1661  	return false
  1662  }
  1663  func rewriteValuePPC64_OpCtz8(v *Value) bool {
  1664  	v_0 := v.Args[0]
  1665  	b := v.Block
  1666  	typ := &b.Func.Config.Types
  1667  	// match: (Ctz8 x)
  1668  	// cond: buildcfg.GOPPC64 <= 8
  1669  	// result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x)))
  1670  	for {
  1671  		x := v_0
  1672  		if !(buildcfg.GOPPC64 <= 8) {
  1673  			break
  1674  		}
  1675  		v.reset(OpPPC64POPCNTB)
  1676  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  1677  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
  1678  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
  1679  		v2.AuxInt = int64ToAuxInt(-1)
  1680  		v2.AddArg(x)
  1681  		v1.AddArg2(v2, x)
  1682  		v0.AddArg(v1)
  1683  		v.AddArg(v0)
  1684  		return true
  1685  	}
  1686  	// match: (Ctz8 x)
  1687  	// cond: buildcfg.GOPPC64 >= 9
  1688  	// result: (CNTTZD (OR <typ.UInt64> x (MOVDconst [1<<8])))
  1689  	for {
  1690  		x := v_0
  1691  		if !(buildcfg.GOPPC64 >= 9) {
  1692  			break
  1693  		}
  1694  		v.reset(OpPPC64CNTTZD)
  1695  		v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
  1696  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  1697  		v1.AuxInt = int64ToAuxInt(1 << 8)
  1698  		v0.AddArg2(x, v1)
  1699  		v.AddArg(v0)
  1700  		return true
  1701  	}
  1702  	return false
  1703  }
  1704  func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
  1705  	v_0 := v.Args[0]
  1706  	b := v.Block
  1707  	typ := &b.Func.Config.Types
  1708  	// match: (Cvt32Fto32 x)
  1709  	// result: (MFVSRD (FCTIWZ x))
  1710  	for {
  1711  		x := v_0
  1712  		v.reset(OpPPC64MFVSRD)
  1713  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1714  		v0.AddArg(x)
  1715  		v.AddArg(v0)
  1716  		return true
  1717  	}
  1718  }
  1719  func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
  1720  	v_0 := v.Args[0]
  1721  	b := v.Block
  1722  	typ := &b.Func.Config.Types
  1723  	// match: (Cvt32Fto64 x)
  1724  	// result: (MFVSRD (FCTIDZ x))
  1725  	for {
  1726  		x := v_0
  1727  		v.reset(OpPPC64MFVSRD)
  1728  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1729  		v0.AddArg(x)
  1730  		v.AddArg(v0)
  1731  		return true
  1732  	}
  1733  }
  1734  func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
  1735  	v_0 := v.Args[0]
  1736  	b := v.Block
  1737  	typ := &b.Func.Config.Types
  1738  	// match: (Cvt32to32F x)
  1739  	// result: (FCFIDS (MTVSRD (SignExt32to64 x)))
  1740  	for {
  1741  		x := v_0
  1742  		v.reset(OpPPC64FCFIDS)
  1743  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1744  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1745  		v1.AddArg(x)
  1746  		v0.AddArg(v1)
  1747  		v.AddArg(v0)
  1748  		return true
  1749  	}
  1750  }
  1751  func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
  1752  	v_0 := v.Args[0]
  1753  	b := v.Block
  1754  	typ := &b.Func.Config.Types
  1755  	// match: (Cvt32to64F x)
  1756  	// result: (FCFID (MTVSRD (SignExt32to64 x)))
  1757  	for {
  1758  		x := v_0
  1759  		v.reset(OpPPC64FCFID)
  1760  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1761  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1762  		v1.AddArg(x)
  1763  		v0.AddArg(v1)
  1764  		v.AddArg(v0)
  1765  		return true
  1766  	}
  1767  }
  1768  func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
  1769  	v_0 := v.Args[0]
  1770  	b := v.Block
  1771  	typ := &b.Func.Config.Types
  1772  	// match: (Cvt64Fto32 x)
  1773  	// result: (MFVSRD (FCTIWZ x))
  1774  	for {
  1775  		x := v_0
  1776  		v.reset(OpPPC64MFVSRD)
  1777  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1778  		v0.AddArg(x)
  1779  		v.AddArg(v0)
  1780  		return true
  1781  	}
  1782  }
  1783  func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
  1784  	v_0 := v.Args[0]
  1785  	b := v.Block
  1786  	typ := &b.Func.Config.Types
  1787  	// match: (Cvt64Fto64 x)
  1788  	// result: (MFVSRD (FCTIDZ x))
  1789  	for {
  1790  		x := v_0
  1791  		v.reset(OpPPC64MFVSRD)
  1792  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1793  		v0.AddArg(x)
  1794  		v.AddArg(v0)
  1795  		return true
  1796  	}
  1797  }
  1798  func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
  1799  	v_0 := v.Args[0]
  1800  	b := v.Block
  1801  	typ := &b.Func.Config.Types
  1802  	// match: (Cvt64to32F x)
  1803  	// result: (FCFIDS (MTVSRD x))
  1804  	for {
  1805  		x := v_0
  1806  		v.reset(OpPPC64FCFIDS)
  1807  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1808  		v0.AddArg(x)
  1809  		v.AddArg(v0)
  1810  		return true
  1811  	}
  1812  }
  1813  func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
  1814  	v_0 := v.Args[0]
  1815  	b := v.Block
  1816  	typ := &b.Func.Config.Types
  1817  	// match: (Cvt64to64F x)
  1818  	// result: (FCFID (MTVSRD x))
  1819  	for {
  1820  		x := v_0
  1821  		v.reset(OpPPC64FCFID)
  1822  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1823  		v0.AddArg(x)
  1824  		v.AddArg(v0)
  1825  		return true
  1826  	}
  1827  }
  1828  func rewriteValuePPC64_OpDiv16(v *Value) bool {
  1829  	v_1 := v.Args[1]
  1830  	v_0 := v.Args[0]
  1831  	b := v.Block
  1832  	typ := &b.Func.Config.Types
  1833  	// match: (Div16 [false] x y)
  1834  	// result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
  1835  	for {
  1836  		if auxIntToBool(v.AuxInt) != false {
  1837  			break
  1838  		}
  1839  		x := v_0
  1840  		y := v_1
  1841  		v.reset(OpPPC64DIVW)
  1842  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1843  		v0.AddArg(x)
  1844  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1845  		v1.AddArg(y)
  1846  		v.AddArg2(v0, v1)
  1847  		return true
  1848  	}
  1849  	return false
  1850  }
  1851  func rewriteValuePPC64_OpDiv16u(v *Value) bool {
  1852  	v_1 := v.Args[1]
  1853  	v_0 := v.Args[0]
  1854  	b := v.Block
  1855  	typ := &b.Func.Config.Types
  1856  	// match: (Div16u x y)
  1857  	// result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
  1858  	for {
  1859  		x := v_0
  1860  		y := v_1
  1861  		v.reset(OpPPC64DIVWU)
  1862  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1863  		v0.AddArg(x)
  1864  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1865  		v1.AddArg(y)
  1866  		v.AddArg2(v0, v1)
  1867  		return true
  1868  	}
  1869  }
  1870  func rewriteValuePPC64_OpDiv32(v *Value) bool {
  1871  	v_1 := v.Args[1]
  1872  	v_0 := v.Args[0]
  1873  	// match: (Div32 [false] x y)
  1874  	// result: (DIVW x y)
  1875  	for {
  1876  		if auxIntToBool(v.AuxInt) != false {
  1877  			break
  1878  		}
  1879  		x := v_0
  1880  		y := v_1
  1881  		v.reset(OpPPC64DIVW)
  1882  		v.AddArg2(x, y)
  1883  		return true
  1884  	}
  1885  	return false
  1886  }
  1887  func rewriteValuePPC64_OpDiv64(v *Value) bool {
  1888  	v_1 := v.Args[1]
  1889  	v_0 := v.Args[0]
  1890  	// match: (Div64 [false] x y)
  1891  	// result: (DIVD x y)
  1892  	for {
  1893  		if auxIntToBool(v.AuxInt) != false {
  1894  			break
  1895  		}
  1896  		x := v_0
  1897  		y := v_1
  1898  		v.reset(OpPPC64DIVD)
  1899  		v.AddArg2(x, y)
  1900  		return true
  1901  	}
  1902  	return false
  1903  }
  1904  func rewriteValuePPC64_OpDiv8(v *Value) bool {
  1905  	v_1 := v.Args[1]
  1906  	v_0 := v.Args[0]
  1907  	b := v.Block
  1908  	typ := &b.Func.Config.Types
  1909  	// match: (Div8 x y)
  1910  	// result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
  1911  	for {
  1912  		x := v_0
  1913  		y := v_1
  1914  		v.reset(OpPPC64DIVW)
  1915  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1916  		v0.AddArg(x)
  1917  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1918  		v1.AddArg(y)
  1919  		v.AddArg2(v0, v1)
  1920  		return true
  1921  	}
  1922  }
  1923  func rewriteValuePPC64_OpDiv8u(v *Value) bool {
  1924  	v_1 := v.Args[1]
  1925  	v_0 := v.Args[0]
  1926  	b := v.Block
  1927  	typ := &b.Func.Config.Types
  1928  	// match: (Div8u x y)
  1929  	// result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
  1930  	for {
  1931  		x := v_0
  1932  		y := v_1
  1933  		v.reset(OpPPC64DIVWU)
  1934  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1935  		v0.AddArg(x)
  1936  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1937  		v1.AddArg(y)
  1938  		v.AddArg2(v0, v1)
  1939  		return true
  1940  	}
  1941  }
  1942  func rewriteValuePPC64_OpEq16(v *Value) bool {
  1943  	v_1 := v.Args[1]
  1944  	v_0 := v.Args[0]
  1945  	b := v.Block
  1946  	typ := &b.Func.Config.Types
  1947  	// match: (Eq16 x y)
  1948  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  1949  	// result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  1950  	for {
  1951  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1952  			x := v_0
  1953  			y := v_1
  1954  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  1955  				continue
  1956  			}
  1957  			v.reset(OpPPC64Equal)
  1958  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1959  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1960  			v1.AddArg(x)
  1961  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1962  			v2.AddArg(y)
  1963  			v0.AddArg2(v1, v2)
  1964  			v.AddArg(v0)
  1965  			return true
  1966  		}
  1967  		break
  1968  	}
  1969  	// match: (Eq16 x y)
  1970  	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1971  	for {
  1972  		x := v_0
  1973  		y := v_1
  1974  		v.reset(OpPPC64Equal)
  1975  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1976  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1977  		v1.AddArg(x)
  1978  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1979  		v2.AddArg(y)
  1980  		v0.AddArg2(v1, v2)
  1981  		v.AddArg(v0)
  1982  		return true
  1983  	}
  1984  }
  1985  func rewriteValuePPC64_OpEq32(v *Value) bool {
  1986  	v_1 := v.Args[1]
  1987  	v_0 := v.Args[0]
  1988  	b := v.Block
  1989  	// match: (Eq32 x y)
  1990  	// result: (Equal (CMPW x y))
  1991  	for {
  1992  		x := v_0
  1993  		y := v_1
  1994  		v.reset(OpPPC64Equal)
  1995  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1996  		v0.AddArg2(x, y)
  1997  		v.AddArg(v0)
  1998  		return true
  1999  	}
  2000  }
  2001  func rewriteValuePPC64_OpEq32F(v *Value) bool {
  2002  	v_1 := v.Args[1]
  2003  	v_0 := v.Args[0]
  2004  	b := v.Block
  2005  	// match: (Eq32F x y)
  2006  	// result: (Equal (FCMPU x y))
  2007  	for {
  2008  		x := v_0
  2009  		y := v_1
  2010  		v.reset(OpPPC64Equal)
  2011  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2012  		v0.AddArg2(x, y)
  2013  		v.AddArg(v0)
  2014  		return true
  2015  	}
  2016  }
  2017  func rewriteValuePPC64_OpEq64(v *Value) bool {
  2018  	v_1 := v.Args[1]
  2019  	v_0 := v.Args[0]
  2020  	b := v.Block
  2021  	// match: (Eq64 x y)
  2022  	// result: (Equal (CMP x y))
  2023  	for {
  2024  		x := v_0
  2025  		y := v_1
  2026  		v.reset(OpPPC64Equal)
  2027  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2028  		v0.AddArg2(x, y)
  2029  		v.AddArg(v0)
  2030  		return true
  2031  	}
  2032  }
  2033  func rewriteValuePPC64_OpEq64F(v *Value) bool {
  2034  	v_1 := v.Args[1]
  2035  	v_0 := v.Args[0]
  2036  	b := v.Block
  2037  	// match: (Eq64F x y)
  2038  	// result: (Equal (FCMPU x y))
  2039  	for {
  2040  		x := v_0
  2041  		y := v_1
  2042  		v.reset(OpPPC64Equal)
  2043  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2044  		v0.AddArg2(x, y)
  2045  		v.AddArg(v0)
  2046  		return true
  2047  	}
  2048  }
  2049  func rewriteValuePPC64_OpEq8(v *Value) bool {
  2050  	v_1 := v.Args[1]
  2051  	v_0 := v.Args[0]
  2052  	b := v.Block
  2053  	typ := &b.Func.Config.Types
  2054  	// match: (Eq8 x y)
  2055  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  2056  	// result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2057  	for {
  2058  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2059  			x := v_0
  2060  			y := v_1
  2061  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  2062  				continue
  2063  			}
  2064  			v.reset(OpPPC64Equal)
  2065  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2066  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2067  			v1.AddArg(x)
  2068  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2069  			v2.AddArg(y)
  2070  			v0.AddArg2(v1, v2)
  2071  			v.AddArg(v0)
  2072  			return true
  2073  		}
  2074  		break
  2075  	}
  2076  	// match: (Eq8 x y)
  2077  	// result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2078  	for {
  2079  		x := v_0
  2080  		y := v_1
  2081  		v.reset(OpPPC64Equal)
  2082  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2083  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2084  		v1.AddArg(x)
  2085  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2086  		v2.AddArg(y)
  2087  		v0.AddArg2(v1, v2)
  2088  		v.AddArg(v0)
  2089  		return true
  2090  	}
  2091  }
  2092  func rewriteValuePPC64_OpEqB(v *Value) bool {
  2093  	v_1 := v.Args[1]
  2094  	v_0 := v.Args[0]
  2095  	b := v.Block
  2096  	typ := &b.Func.Config.Types
  2097  	// match: (EqB x y)
  2098  	// result: (ANDconst [1] (EQV x y))
  2099  	for {
  2100  		x := v_0
  2101  		y := v_1
  2102  		v.reset(OpPPC64ANDconst)
  2103  		v.AuxInt = int64ToAuxInt(1)
  2104  		v0 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
  2105  		v0.AddArg2(x, y)
  2106  		v.AddArg(v0)
  2107  		return true
  2108  	}
  2109  }
  2110  func rewriteValuePPC64_OpEqPtr(v *Value) bool {
  2111  	v_1 := v.Args[1]
  2112  	v_0 := v.Args[0]
  2113  	b := v.Block
  2114  	// match: (EqPtr x y)
  2115  	// result: (Equal (CMP x y))
  2116  	for {
  2117  		x := v_0
  2118  		y := v_1
  2119  		v.reset(OpPPC64Equal)
  2120  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2121  		v0.AddArg2(x, y)
  2122  		v.AddArg(v0)
  2123  		return true
  2124  	}
  2125  }
  2126  func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
  2127  	v_1 := v.Args[1]
  2128  	v_0 := v.Args[0]
  2129  	b := v.Block
  2130  	// match: (IsInBounds idx len)
  2131  	// result: (LessThan (CMPU idx len))
  2132  	for {
  2133  		idx := v_0
  2134  		len := v_1
  2135  		v.reset(OpPPC64LessThan)
  2136  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2137  		v0.AddArg2(idx, len)
  2138  		v.AddArg(v0)
  2139  		return true
  2140  	}
  2141  }
  2142  func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
  2143  	v_0 := v.Args[0]
  2144  	b := v.Block
  2145  	// match: (IsNonNil ptr)
  2146  	// result: (NotEqual (CMPconst [0] ptr))
  2147  	for {
  2148  		ptr := v_0
  2149  		v.reset(OpPPC64NotEqual)
  2150  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2151  		v0.AuxInt = int64ToAuxInt(0)
  2152  		v0.AddArg(ptr)
  2153  		v.AddArg(v0)
  2154  		return true
  2155  	}
  2156  }
  2157  func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
  2158  	v_1 := v.Args[1]
  2159  	v_0 := v.Args[0]
  2160  	b := v.Block
  2161  	// match: (IsSliceInBounds idx len)
  2162  	// result: (LessEqual (CMPU idx len))
  2163  	for {
  2164  		idx := v_0
  2165  		len := v_1
  2166  		v.reset(OpPPC64LessEqual)
  2167  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2168  		v0.AddArg2(idx, len)
  2169  		v.AddArg(v0)
  2170  		return true
  2171  	}
  2172  }
  2173  func rewriteValuePPC64_OpLeq16(v *Value) bool {
  2174  	v_1 := v.Args[1]
  2175  	v_0 := v.Args[0]
  2176  	b := v.Block
  2177  	typ := &b.Func.Config.Types
  2178  	// match: (Leq16 x y)
  2179  	// result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2180  	for {
  2181  		x := v_0
  2182  		y := v_1
  2183  		v.reset(OpPPC64LessEqual)
  2184  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2185  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2186  		v1.AddArg(x)
  2187  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2188  		v2.AddArg(y)
  2189  		v0.AddArg2(v1, v2)
  2190  		v.AddArg(v0)
  2191  		return true
  2192  	}
  2193  }
  2194  func rewriteValuePPC64_OpLeq16U(v *Value) bool {
  2195  	v_1 := v.Args[1]
  2196  	v_0 := v.Args[0]
  2197  	b := v.Block
  2198  	typ := &b.Func.Config.Types
  2199  	// match: (Leq16U x y)
  2200  	// result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2201  	for {
  2202  		x := v_0
  2203  		y := v_1
  2204  		v.reset(OpPPC64LessEqual)
  2205  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2206  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2207  		v1.AddArg(x)
  2208  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2209  		v2.AddArg(y)
  2210  		v0.AddArg2(v1, v2)
  2211  		v.AddArg(v0)
  2212  		return true
  2213  	}
  2214  }
  2215  func rewriteValuePPC64_OpLeq32(v *Value) bool {
  2216  	v_1 := v.Args[1]
  2217  	v_0 := v.Args[0]
  2218  	b := v.Block
  2219  	// match: (Leq32 x y)
  2220  	// result: (LessEqual (CMPW x y))
  2221  	for {
  2222  		x := v_0
  2223  		y := v_1
  2224  		v.reset(OpPPC64LessEqual)
  2225  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2226  		v0.AddArg2(x, y)
  2227  		v.AddArg(v0)
  2228  		return true
  2229  	}
  2230  }
  2231  func rewriteValuePPC64_OpLeq32F(v *Value) bool {
  2232  	v_1 := v.Args[1]
  2233  	v_0 := v.Args[0]
  2234  	b := v.Block
  2235  	// match: (Leq32F x y)
  2236  	// result: (FLessEqual (FCMPU x y))
  2237  	for {
  2238  		x := v_0
  2239  		y := v_1
  2240  		v.reset(OpPPC64FLessEqual)
  2241  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2242  		v0.AddArg2(x, y)
  2243  		v.AddArg(v0)
  2244  		return true
  2245  	}
  2246  }
  2247  func rewriteValuePPC64_OpLeq32U(v *Value) bool {
  2248  	v_1 := v.Args[1]
  2249  	v_0 := v.Args[0]
  2250  	b := v.Block
  2251  	// match: (Leq32U x y)
  2252  	// result: (LessEqual (CMPWU x y))
  2253  	for {
  2254  		x := v_0
  2255  		y := v_1
  2256  		v.reset(OpPPC64LessEqual)
  2257  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2258  		v0.AddArg2(x, y)
  2259  		v.AddArg(v0)
  2260  		return true
  2261  	}
  2262  }
  2263  func rewriteValuePPC64_OpLeq64(v *Value) bool {
  2264  	v_1 := v.Args[1]
  2265  	v_0 := v.Args[0]
  2266  	b := v.Block
  2267  	// match: (Leq64 x y)
  2268  	// result: (LessEqual (CMP x y))
  2269  	for {
  2270  		x := v_0
  2271  		y := v_1
  2272  		v.reset(OpPPC64LessEqual)
  2273  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2274  		v0.AddArg2(x, y)
  2275  		v.AddArg(v0)
  2276  		return true
  2277  	}
  2278  }
  2279  func rewriteValuePPC64_OpLeq64F(v *Value) bool {
  2280  	v_1 := v.Args[1]
  2281  	v_0 := v.Args[0]
  2282  	b := v.Block
  2283  	// match: (Leq64F x y)
  2284  	// result: (FLessEqual (FCMPU x y))
  2285  	for {
  2286  		x := v_0
  2287  		y := v_1
  2288  		v.reset(OpPPC64FLessEqual)
  2289  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2290  		v0.AddArg2(x, y)
  2291  		v.AddArg(v0)
  2292  		return true
  2293  	}
  2294  }
  2295  func rewriteValuePPC64_OpLeq64U(v *Value) bool {
  2296  	v_1 := v.Args[1]
  2297  	v_0 := v.Args[0]
  2298  	b := v.Block
  2299  	// match: (Leq64U x y)
  2300  	// result: (LessEqual (CMPU x y))
  2301  	for {
  2302  		x := v_0
  2303  		y := v_1
  2304  		v.reset(OpPPC64LessEqual)
  2305  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2306  		v0.AddArg2(x, y)
  2307  		v.AddArg(v0)
  2308  		return true
  2309  	}
  2310  }
  2311  func rewriteValuePPC64_OpLeq8(v *Value) bool {
  2312  	v_1 := v.Args[1]
  2313  	v_0 := v.Args[0]
  2314  	b := v.Block
  2315  	typ := &b.Func.Config.Types
  2316  	// match: (Leq8 x y)
  2317  	// result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2318  	for {
  2319  		x := v_0
  2320  		y := v_1
  2321  		v.reset(OpPPC64LessEqual)
  2322  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2323  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2324  		v1.AddArg(x)
  2325  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2326  		v2.AddArg(y)
  2327  		v0.AddArg2(v1, v2)
  2328  		v.AddArg(v0)
  2329  		return true
  2330  	}
  2331  }
  2332  func rewriteValuePPC64_OpLeq8U(v *Value) bool {
  2333  	v_1 := v.Args[1]
  2334  	v_0 := v.Args[0]
  2335  	b := v.Block
  2336  	typ := &b.Func.Config.Types
  2337  	// match: (Leq8U x y)
  2338  	// result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2339  	for {
  2340  		x := v_0
  2341  		y := v_1
  2342  		v.reset(OpPPC64LessEqual)
  2343  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2344  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2345  		v1.AddArg(x)
  2346  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2347  		v2.AddArg(y)
  2348  		v0.AddArg2(v1, v2)
  2349  		v.AddArg(v0)
  2350  		return true
  2351  	}
  2352  }
  2353  func rewriteValuePPC64_OpLess16(v *Value) bool {
  2354  	v_1 := v.Args[1]
  2355  	v_0 := v.Args[0]
  2356  	b := v.Block
  2357  	typ := &b.Func.Config.Types
  2358  	// match: (Less16 x y)
  2359  	// result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2360  	for {
  2361  		x := v_0
  2362  		y := v_1
  2363  		v.reset(OpPPC64LessThan)
  2364  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2365  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2366  		v1.AddArg(x)
  2367  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2368  		v2.AddArg(y)
  2369  		v0.AddArg2(v1, v2)
  2370  		v.AddArg(v0)
  2371  		return true
  2372  	}
  2373  }
  2374  func rewriteValuePPC64_OpLess16U(v *Value) bool {
  2375  	v_1 := v.Args[1]
  2376  	v_0 := v.Args[0]
  2377  	b := v.Block
  2378  	typ := &b.Func.Config.Types
  2379  	// match: (Less16U x y)
  2380  	// result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2381  	for {
  2382  		x := v_0
  2383  		y := v_1
  2384  		v.reset(OpPPC64LessThan)
  2385  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2386  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2387  		v1.AddArg(x)
  2388  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2389  		v2.AddArg(y)
  2390  		v0.AddArg2(v1, v2)
  2391  		v.AddArg(v0)
  2392  		return true
  2393  	}
  2394  }
  2395  func rewriteValuePPC64_OpLess32(v *Value) bool {
  2396  	v_1 := v.Args[1]
  2397  	v_0 := v.Args[0]
  2398  	b := v.Block
  2399  	// match: (Less32 x y)
  2400  	// result: (LessThan (CMPW x y))
  2401  	for {
  2402  		x := v_0
  2403  		y := v_1
  2404  		v.reset(OpPPC64LessThan)
  2405  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2406  		v0.AddArg2(x, y)
  2407  		v.AddArg(v0)
  2408  		return true
  2409  	}
  2410  }
  2411  func rewriteValuePPC64_OpLess32F(v *Value) bool {
  2412  	v_1 := v.Args[1]
  2413  	v_0 := v.Args[0]
  2414  	b := v.Block
  2415  	// match: (Less32F x y)
  2416  	// result: (FLessThan (FCMPU x y))
  2417  	for {
  2418  		x := v_0
  2419  		y := v_1
  2420  		v.reset(OpPPC64FLessThan)
  2421  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2422  		v0.AddArg2(x, y)
  2423  		v.AddArg(v0)
  2424  		return true
  2425  	}
  2426  }
  2427  func rewriteValuePPC64_OpLess32U(v *Value) bool {
  2428  	v_1 := v.Args[1]
  2429  	v_0 := v.Args[0]
  2430  	b := v.Block
  2431  	// match: (Less32U x y)
  2432  	// result: (LessThan (CMPWU x y))
  2433  	for {
  2434  		x := v_0
  2435  		y := v_1
  2436  		v.reset(OpPPC64LessThan)
  2437  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2438  		v0.AddArg2(x, y)
  2439  		v.AddArg(v0)
  2440  		return true
  2441  	}
  2442  }
  2443  func rewriteValuePPC64_OpLess64(v *Value) bool {
  2444  	v_1 := v.Args[1]
  2445  	v_0 := v.Args[0]
  2446  	b := v.Block
  2447  	// match: (Less64 x y)
  2448  	// result: (LessThan (CMP x y))
  2449  	for {
  2450  		x := v_0
  2451  		y := v_1
  2452  		v.reset(OpPPC64LessThan)
  2453  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2454  		v0.AddArg2(x, y)
  2455  		v.AddArg(v0)
  2456  		return true
  2457  	}
  2458  }
  2459  func rewriteValuePPC64_OpLess64F(v *Value) bool {
  2460  	v_1 := v.Args[1]
  2461  	v_0 := v.Args[0]
  2462  	b := v.Block
  2463  	// match: (Less64F x y)
  2464  	// result: (FLessThan (FCMPU x y))
  2465  	for {
  2466  		x := v_0
  2467  		y := v_1
  2468  		v.reset(OpPPC64FLessThan)
  2469  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2470  		v0.AddArg2(x, y)
  2471  		v.AddArg(v0)
  2472  		return true
  2473  	}
  2474  }
  2475  func rewriteValuePPC64_OpLess64U(v *Value) bool {
  2476  	v_1 := v.Args[1]
  2477  	v_0 := v.Args[0]
  2478  	b := v.Block
  2479  	// match: (Less64U x y)
  2480  	// result: (LessThan (CMPU x y))
  2481  	for {
  2482  		x := v_0
  2483  		y := v_1
  2484  		v.reset(OpPPC64LessThan)
  2485  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2486  		v0.AddArg2(x, y)
  2487  		v.AddArg(v0)
  2488  		return true
  2489  	}
  2490  }
  2491  func rewriteValuePPC64_OpLess8(v *Value) bool {
  2492  	v_1 := v.Args[1]
  2493  	v_0 := v.Args[0]
  2494  	b := v.Block
  2495  	typ := &b.Func.Config.Types
  2496  	// match: (Less8 x y)
  2497  	// result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2498  	for {
  2499  		x := v_0
  2500  		y := v_1
  2501  		v.reset(OpPPC64LessThan)
  2502  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2503  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2504  		v1.AddArg(x)
  2505  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2506  		v2.AddArg(y)
  2507  		v0.AddArg2(v1, v2)
  2508  		v.AddArg(v0)
  2509  		return true
  2510  	}
  2511  }
  2512  func rewriteValuePPC64_OpLess8U(v *Value) bool {
  2513  	v_1 := v.Args[1]
  2514  	v_0 := v.Args[0]
  2515  	b := v.Block
  2516  	typ := &b.Func.Config.Types
  2517  	// match: (Less8U x y)
  2518  	// result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2519  	for {
  2520  		x := v_0
  2521  		y := v_1
  2522  		v.reset(OpPPC64LessThan)
  2523  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2524  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2525  		v1.AddArg(x)
  2526  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2527  		v2.AddArg(y)
  2528  		v0.AddArg2(v1, v2)
  2529  		v.AddArg(v0)
  2530  		return true
  2531  	}
  2532  }
  2533  func rewriteValuePPC64_OpLoad(v *Value) bool {
  2534  	v_1 := v.Args[1]
  2535  	v_0 := v.Args[0]
  2536  	b := v.Block
  2537  	typ := &b.Func.Config.Types
  2538  	// match: (Load <t> ptr mem)
  2539  	// cond: (is64BitInt(t) || isPtr(t))
  2540  	// result: (MOVDload ptr mem)
  2541  	for {
  2542  		t := v.Type
  2543  		ptr := v_0
  2544  		mem := v_1
  2545  		if !(is64BitInt(t) || isPtr(t)) {
  2546  			break
  2547  		}
  2548  		v.reset(OpPPC64MOVDload)
  2549  		v.AddArg2(ptr, mem)
  2550  		return true
  2551  	}
  2552  	// match: (Load <t> ptr mem)
  2553  	// cond: is32BitInt(t) && t.IsSigned()
  2554  	// result: (MOVWload ptr mem)
  2555  	for {
  2556  		t := v.Type
  2557  		ptr := v_0
  2558  		mem := v_1
  2559  		if !(is32BitInt(t) && t.IsSigned()) {
  2560  			break
  2561  		}
  2562  		v.reset(OpPPC64MOVWload)
  2563  		v.AddArg2(ptr, mem)
  2564  		return true
  2565  	}
  2566  	// match: (Load <t> ptr mem)
  2567  	// cond: is32BitInt(t) && !t.IsSigned()
  2568  	// result: (MOVWZload ptr mem)
  2569  	for {
  2570  		t := v.Type
  2571  		ptr := v_0
  2572  		mem := v_1
  2573  		if !(is32BitInt(t) && !t.IsSigned()) {
  2574  			break
  2575  		}
  2576  		v.reset(OpPPC64MOVWZload)
  2577  		v.AddArg2(ptr, mem)
  2578  		return true
  2579  	}
  2580  	// match: (Load <t> ptr mem)
  2581  	// cond: is16BitInt(t) && t.IsSigned()
  2582  	// result: (MOVHload ptr mem)
  2583  	for {
  2584  		t := v.Type
  2585  		ptr := v_0
  2586  		mem := v_1
  2587  		if !(is16BitInt(t) && t.IsSigned()) {
  2588  			break
  2589  		}
  2590  		v.reset(OpPPC64MOVHload)
  2591  		v.AddArg2(ptr, mem)
  2592  		return true
  2593  	}
  2594  	// match: (Load <t> ptr mem)
  2595  	// cond: is16BitInt(t) && !t.IsSigned()
  2596  	// result: (MOVHZload ptr mem)
  2597  	for {
  2598  		t := v.Type
  2599  		ptr := v_0
  2600  		mem := v_1
  2601  		if !(is16BitInt(t) && !t.IsSigned()) {
  2602  			break
  2603  		}
  2604  		v.reset(OpPPC64MOVHZload)
  2605  		v.AddArg2(ptr, mem)
  2606  		return true
  2607  	}
  2608  	// match: (Load <t> ptr mem)
  2609  	// cond: t.IsBoolean()
  2610  	// result: (MOVBZload ptr mem)
  2611  	for {
  2612  		t := v.Type
  2613  		ptr := v_0
  2614  		mem := v_1
  2615  		if !(t.IsBoolean()) {
  2616  			break
  2617  		}
  2618  		v.reset(OpPPC64MOVBZload)
  2619  		v.AddArg2(ptr, mem)
  2620  		return true
  2621  	}
  2622  	// match: (Load <t> ptr mem)
  2623  	// cond: is8BitInt(t) && t.IsSigned()
  2624  	// result: (MOVBreg (MOVBZload ptr mem))
  2625  	for {
  2626  		t := v.Type
  2627  		ptr := v_0
  2628  		mem := v_1
  2629  		if !(is8BitInt(t) && t.IsSigned()) {
  2630  			break
  2631  		}
  2632  		v.reset(OpPPC64MOVBreg)
  2633  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  2634  		v0.AddArg2(ptr, mem)
  2635  		v.AddArg(v0)
  2636  		return true
  2637  	}
  2638  	// match: (Load <t> ptr mem)
  2639  	// cond: is8BitInt(t) && !t.IsSigned()
  2640  	// result: (MOVBZload ptr mem)
  2641  	for {
  2642  		t := v.Type
  2643  		ptr := v_0
  2644  		mem := v_1
  2645  		if !(is8BitInt(t) && !t.IsSigned()) {
  2646  			break
  2647  		}
  2648  		v.reset(OpPPC64MOVBZload)
  2649  		v.AddArg2(ptr, mem)
  2650  		return true
  2651  	}
  2652  	// match: (Load <t> ptr mem)
  2653  	// cond: is32BitFloat(t)
  2654  	// result: (FMOVSload ptr mem)
  2655  	for {
  2656  		t := v.Type
  2657  		ptr := v_0
  2658  		mem := v_1
  2659  		if !(is32BitFloat(t)) {
  2660  			break
  2661  		}
  2662  		v.reset(OpPPC64FMOVSload)
  2663  		v.AddArg2(ptr, mem)
  2664  		return true
  2665  	}
  2666  	// match: (Load <t> ptr mem)
  2667  	// cond: is64BitFloat(t)
  2668  	// result: (FMOVDload ptr mem)
  2669  	for {
  2670  		t := v.Type
  2671  		ptr := v_0
  2672  		mem := v_1
  2673  		if !(is64BitFloat(t)) {
  2674  			break
  2675  		}
  2676  		v.reset(OpPPC64FMOVDload)
  2677  		v.AddArg2(ptr, mem)
  2678  		return true
  2679  	}
  2680  	return false
  2681  }
  2682  func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
  2683  	v_1 := v.Args[1]
  2684  	v_0 := v.Args[0]
  2685  	b := v.Block
  2686  	typ := &b.Func.Config.Types
  2687  	// match: (LocalAddr <t> {sym} base mem)
  2688  	// cond: t.Elem().HasPointers()
  2689  	// result: (MOVDaddr {sym} (SPanchored base mem))
  2690  	for {
  2691  		t := v.Type
  2692  		sym := auxToSym(v.Aux)
  2693  		base := v_0
  2694  		mem := v_1
  2695  		if !(t.Elem().HasPointers()) {
  2696  			break
  2697  		}
  2698  		v.reset(OpPPC64MOVDaddr)
  2699  		v.Aux = symToAux(sym)
  2700  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  2701  		v0.AddArg2(base, mem)
  2702  		v.AddArg(v0)
  2703  		return true
  2704  	}
  2705  	// match: (LocalAddr <t> {sym} base _)
  2706  	// cond: !t.Elem().HasPointers()
  2707  	// result: (MOVDaddr {sym} base)
  2708  	for {
  2709  		t := v.Type
  2710  		sym := auxToSym(v.Aux)
  2711  		base := v_0
  2712  		if !(!t.Elem().HasPointers()) {
  2713  			break
  2714  		}
  2715  		v.reset(OpPPC64MOVDaddr)
  2716  		v.Aux = symToAux(sym)
  2717  		v.AddArg(base)
  2718  		return true
  2719  	}
  2720  	return false
  2721  }
  2722  func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
  2723  	v_1 := v.Args[1]
  2724  	v_0 := v.Args[0]
  2725  	b := v.Block
  2726  	typ := &b.Func.Config.Types
  2727  	// match: (Lsh16x16 x y)
  2728  	// cond: shiftIsBounded(v)
  2729  	// result: (SLD x y)
  2730  	for {
  2731  		x := v_0
  2732  		y := v_1
  2733  		if !(shiftIsBounded(v)) {
  2734  			break
  2735  		}
  2736  		v.reset(OpPPC64SLD)
  2737  		v.AddArg2(x, y)
  2738  		return true
  2739  	}
  2740  	// match: (Lsh16x16 <t> x y)
  2741  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF0] y)))
  2742  	for {
  2743  		t := v.Type
  2744  		x := v_0
  2745  		y := v_1
  2746  		v.reset(OpPPC64ISEL)
  2747  		v.AuxInt = int32ToAuxInt(2)
  2748  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2749  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2750  		v1.AddArg(x)
  2751  		v0.AddArg2(v1, y)
  2752  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2753  		v2.AuxInt = int64ToAuxInt(0)
  2754  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2755  		v3.AuxInt = int64ToAuxInt(0)
  2756  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2757  		v4.AuxInt = int64ToAuxInt(0xFFF0)
  2758  		v4.AddArg(y)
  2759  		v3.AddArg(v4)
  2760  		v.AddArg3(v0, v2, v3)
  2761  		return true
  2762  	}
  2763  }
  2764  func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
  2765  	v_1 := v.Args[1]
  2766  	v_0 := v.Args[0]
  2767  	b := v.Block
  2768  	typ := &b.Func.Config.Types
  2769  	// match: (Lsh16x32 x y)
  2770  	// cond: shiftIsBounded(v)
  2771  	// result: (SLD x y)
  2772  	for {
  2773  		x := v_0
  2774  		y := v_1
  2775  		if !(shiftIsBounded(v)) {
  2776  			break
  2777  		}
  2778  		v.reset(OpPPC64SLD)
  2779  		v.AddArg2(x, y)
  2780  		return true
  2781  	}
  2782  	// match: (Lsh16x32 <t> x y)
  2783  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
  2784  	for {
  2785  		t := v.Type
  2786  		x := v_0
  2787  		y := v_1
  2788  		v.reset(OpPPC64ISEL)
  2789  		v.AuxInt = int32ToAuxInt(0)
  2790  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2791  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2792  		v1.AddArg(x)
  2793  		v0.AddArg2(v1, y)
  2794  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2795  		v2.AuxInt = int64ToAuxInt(0)
  2796  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2797  		v3.AuxInt = int32ToAuxInt(16)
  2798  		v3.AddArg(y)
  2799  		v.AddArg3(v0, v2, v3)
  2800  		return true
  2801  	}
  2802  }
  2803  func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
  2804  	v_1 := v.Args[1]
  2805  	v_0 := v.Args[0]
  2806  	b := v.Block
  2807  	typ := &b.Func.Config.Types
  2808  	// match: (Lsh16x64 x (MOVDconst [c]))
  2809  	// cond: uint64(c) < 16
  2810  	// result: (SLWconst x [c])
  2811  	for {
  2812  		x := v_0
  2813  		if v_1.Op != OpPPC64MOVDconst {
  2814  			break
  2815  		}
  2816  		c := auxIntToInt64(v_1.AuxInt)
  2817  		if !(uint64(c) < 16) {
  2818  			break
  2819  		}
  2820  		v.reset(OpPPC64SLWconst)
  2821  		v.AuxInt = int64ToAuxInt(c)
  2822  		v.AddArg(x)
  2823  		return true
  2824  	}
  2825  	// match: (Lsh16x64 x y)
  2826  	// cond: shiftIsBounded(v)
  2827  	// result: (SLD x y)
  2828  	for {
  2829  		x := v_0
  2830  		y := v_1
  2831  		if !(shiftIsBounded(v)) {
  2832  			break
  2833  		}
  2834  		v.reset(OpPPC64SLD)
  2835  		v.AddArg2(x, y)
  2836  		return true
  2837  	}
  2838  	// match: (Lsh16x64 <t> x y)
  2839  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
  2840  	for {
  2841  		t := v.Type
  2842  		x := v_0
  2843  		y := v_1
  2844  		v.reset(OpPPC64ISEL)
  2845  		v.AuxInt = int32ToAuxInt(0)
  2846  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2847  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2848  		v1.AddArg(x)
  2849  		v0.AddArg2(v1, y)
  2850  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2851  		v2.AuxInt = int64ToAuxInt(0)
  2852  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  2853  		v3.AuxInt = int64ToAuxInt(16)
  2854  		v3.AddArg(y)
  2855  		v.AddArg3(v0, v2, v3)
  2856  		return true
  2857  	}
  2858  }
  2859  func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
  2860  	v_1 := v.Args[1]
  2861  	v_0 := v.Args[0]
  2862  	b := v.Block
  2863  	typ := &b.Func.Config.Types
  2864  	// match: (Lsh16x8 x y)
  2865  	// cond: shiftIsBounded(v)
  2866  	// result: (SLD x y)
  2867  	for {
  2868  		x := v_0
  2869  		y := v_1
  2870  		if !(shiftIsBounded(v)) {
  2871  			break
  2872  		}
  2873  		v.reset(OpPPC64SLD)
  2874  		v.AddArg2(x, y)
  2875  		return true
  2876  	}
  2877  	// match: (Lsh16x8 <t> x y)
  2878  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F0] y)))
  2879  	for {
  2880  		t := v.Type
  2881  		x := v_0
  2882  		y := v_1
  2883  		v.reset(OpPPC64ISEL)
  2884  		v.AuxInt = int32ToAuxInt(2)
  2885  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2886  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2887  		v1.AddArg(x)
  2888  		v0.AddArg2(v1, y)
  2889  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2890  		v2.AuxInt = int64ToAuxInt(0)
  2891  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2892  		v3.AuxInt = int64ToAuxInt(0)
  2893  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2894  		v4.AuxInt = int64ToAuxInt(0x00F0)
  2895  		v4.AddArg(y)
  2896  		v3.AddArg(v4)
  2897  		v.AddArg3(v0, v2, v3)
  2898  		return true
  2899  	}
  2900  }
  2901  func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
  2902  	v_1 := v.Args[1]
  2903  	v_0 := v.Args[0]
  2904  	b := v.Block
  2905  	typ := &b.Func.Config.Types
  2906  	// match: (Lsh32x16 x y)
  2907  	// cond: shiftIsBounded(v)
  2908  	// result: (SLW x y)
  2909  	for {
  2910  		x := v_0
  2911  		y := v_1
  2912  		if !(shiftIsBounded(v)) {
  2913  			break
  2914  		}
  2915  		v.reset(OpPPC64SLW)
  2916  		v.AddArg2(x, y)
  2917  		return true
  2918  	}
  2919  	// match: (Lsh32x16 <t> x y)
  2920  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFE0] y)))
  2921  	for {
  2922  		t := v.Type
  2923  		x := v_0
  2924  		y := v_1
  2925  		v.reset(OpPPC64ISEL)
  2926  		v.AuxInt = int32ToAuxInt(2)
  2927  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2928  		v0.AddArg2(x, y)
  2929  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2930  		v1.AuxInt = int64ToAuxInt(0)
  2931  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2932  		v2.AuxInt = int64ToAuxInt(0)
  2933  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2934  		v3.AuxInt = int64ToAuxInt(0xFFE0)
  2935  		v3.AddArg(y)
  2936  		v2.AddArg(v3)
  2937  		v.AddArg3(v0, v1, v2)
  2938  		return true
  2939  	}
  2940  }
  2941  func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
  2942  	v_1 := v.Args[1]
  2943  	v_0 := v.Args[0]
  2944  	b := v.Block
  2945  	typ := &b.Func.Config.Types
  2946  	// match: (Lsh32x32 x y)
  2947  	// cond: shiftIsBounded(v)
  2948  	// result: (SLW x y)
  2949  	for {
  2950  		x := v_0
  2951  		y := v_1
  2952  		if !(shiftIsBounded(v)) {
  2953  			break
  2954  		}
  2955  		v.reset(OpPPC64SLW)
  2956  		v.AddArg2(x, y)
  2957  		return true
  2958  	}
  2959  	// match: (Lsh32x32 <t> x y)
  2960  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
  2961  	for {
  2962  		t := v.Type
  2963  		x := v_0
  2964  		y := v_1
  2965  		v.reset(OpPPC64ISEL)
  2966  		v.AuxInt = int32ToAuxInt(0)
  2967  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2968  		v0.AddArg2(x, y)
  2969  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2970  		v1.AuxInt = int64ToAuxInt(0)
  2971  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2972  		v2.AuxInt = int32ToAuxInt(32)
  2973  		v2.AddArg(y)
  2974  		v.AddArg3(v0, v1, v2)
  2975  		return true
  2976  	}
  2977  }
  2978  func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
  2979  	v_1 := v.Args[1]
  2980  	v_0 := v.Args[0]
  2981  	b := v.Block
  2982  	typ := &b.Func.Config.Types
  2983  	// match: (Lsh32x64 x (MOVDconst [c]))
  2984  	// cond: uint64(c) < 32
  2985  	// result: (SLWconst x [c])
  2986  	for {
  2987  		x := v_0
  2988  		if v_1.Op != OpPPC64MOVDconst {
  2989  			break
  2990  		}
  2991  		c := auxIntToInt64(v_1.AuxInt)
  2992  		if !(uint64(c) < 32) {
  2993  			break
  2994  		}
  2995  		v.reset(OpPPC64SLWconst)
  2996  		v.AuxInt = int64ToAuxInt(c)
  2997  		v.AddArg(x)
  2998  		return true
  2999  	}
  3000  	// match: (Lsh32x64 x y)
  3001  	// cond: shiftIsBounded(v)
  3002  	// result: (SLW x y)
  3003  	for {
  3004  		x := v_0
  3005  		y := v_1
  3006  		if !(shiftIsBounded(v)) {
  3007  			break
  3008  		}
  3009  		v.reset(OpPPC64SLW)
  3010  		v.AddArg2(x, y)
  3011  		return true
  3012  	}
  3013  	// match: (Lsh32x64 <t> x y)
  3014  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
  3015  	for {
  3016  		t := v.Type
  3017  		x := v_0
  3018  		y := v_1
  3019  		v.reset(OpPPC64ISEL)
  3020  		v.AuxInt = int32ToAuxInt(0)
  3021  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  3022  		v0.AddArg2(x, y)
  3023  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3024  		v1.AuxInt = int64ToAuxInt(0)
  3025  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3026  		v2.AuxInt = int64ToAuxInt(32)
  3027  		v2.AddArg(y)
  3028  		v.AddArg3(v0, v1, v2)
  3029  		return true
  3030  	}
  3031  }
  3032  func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
  3033  	v_1 := v.Args[1]
  3034  	v_0 := v.Args[0]
  3035  	b := v.Block
  3036  	typ := &b.Func.Config.Types
  3037  	// match: (Lsh32x8 x y)
  3038  	// cond: shiftIsBounded(v)
  3039  	// result: (SLW x y)
  3040  	for {
  3041  		x := v_0
  3042  		y := v_1
  3043  		if !(shiftIsBounded(v)) {
  3044  			break
  3045  		}
  3046  		v.reset(OpPPC64SLW)
  3047  		v.AddArg2(x, y)
  3048  		return true
  3049  	}
  3050  	// match: (Lsh32x8 <t> x y)
  3051  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00E0] y)))
  3052  	for {
  3053  		t := v.Type
  3054  		x := v_0
  3055  		y := v_1
  3056  		v.reset(OpPPC64ISEL)
  3057  		v.AuxInt = int32ToAuxInt(2)
  3058  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  3059  		v0.AddArg2(x, y)
  3060  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3061  		v1.AuxInt = int64ToAuxInt(0)
  3062  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3063  		v2.AuxInt = int64ToAuxInt(0)
  3064  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3065  		v3.AuxInt = int64ToAuxInt(0x00E0)
  3066  		v3.AddArg(y)
  3067  		v2.AddArg(v3)
  3068  		v.AddArg3(v0, v1, v2)
  3069  		return true
  3070  	}
  3071  }
  3072  func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
  3073  	v_1 := v.Args[1]
  3074  	v_0 := v.Args[0]
  3075  	b := v.Block
  3076  	typ := &b.Func.Config.Types
  3077  	// match: (Lsh64x16 x y)
  3078  	// cond: shiftIsBounded(v)
  3079  	// result: (SLD x y)
  3080  	for {
  3081  		x := v_0
  3082  		y := v_1
  3083  		if !(shiftIsBounded(v)) {
  3084  			break
  3085  		}
  3086  		v.reset(OpPPC64SLD)
  3087  		v.AddArg2(x, y)
  3088  		return true
  3089  	}
  3090  	// match: (Lsh64x16 <t> x y)
  3091  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFC0] y)))
  3092  	for {
  3093  		t := v.Type
  3094  		x := v_0
  3095  		y := v_1
  3096  		v.reset(OpPPC64ISEL)
  3097  		v.AuxInt = int32ToAuxInt(2)
  3098  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3099  		v0.AddArg2(x, y)
  3100  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3101  		v1.AuxInt = int64ToAuxInt(0)
  3102  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3103  		v2.AuxInt = int64ToAuxInt(0)
  3104  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3105  		v3.AuxInt = int64ToAuxInt(0xFFC0)
  3106  		v3.AddArg(y)
  3107  		v2.AddArg(v3)
  3108  		v.AddArg3(v0, v1, v2)
  3109  		return true
  3110  	}
  3111  }
  3112  func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
  3113  	v_1 := v.Args[1]
  3114  	v_0 := v.Args[0]
  3115  	b := v.Block
  3116  	typ := &b.Func.Config.Types
  3117  	// match: (Lsh64x32 x y)
  3118  	// cond: shiftIsBounded(v)
  3119  	// result: (SLD x y)
  3120  	for {
  3121  		x := v_0
  3122  		y := v_1
  3123  		if !(shiftIsBounded(v)) {
  3124  			break
  3125  		}
  3126  		v.reset(OpPPC64SLD)
  3127  		v.AddArg2(x, y)
  3128  		return true
  3129  	}
  3130  	// match: (Lsh64x32 <t> x y)
  3131  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
  3132  	for {
  3133  		t := v.Type
  3134  		x := v_0
  3135  		y := v_1
  3136  		v.reset(OpPPC64ISEL)
  3137  		v.AuxInt = int32ToAuxInt(0)
  3138  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3139  		v0.AddArg2(x, y)
  3140  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3141  		v1.AuxInt = int64ToAuxInt(0)
  3142  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3143  		v2.AuxInt = int32ToAuxInt(64)
  3144  		v2.AddArg(y)
  3145  		v.AddArg3(v0, v1, v2)
  3146  		return true
  3147  	}
  3148  }
  3149  func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
  3150  	v_1 := v.Args[1]
  3151  	v_0 := v.Args[0]
  3152  	b := v.Block
  3153  	typ := &b.Func.Config.Types
  3154  	// match: (Lsh64x64 x (MOVDconst [c]))
  3155  	// cond: uint64(c) < 64
  3156  	// result: (SLDconst x [c])
  3157  	for {
  3158  		x := v_0
  3159  		if v_1.Op != OpPPC64MOVDconst {
  3160  			break
  3161  		}
  3162  		c := auxIntToInt64(v_1.AuxInt)
  3163  		if !(uint64(c) < 64) {
  3164  			break
  3165  		}
  3166  		v.reset(OpPPC64SLDconst)
  3167  		v.AuxInt = int64ToAuxInt(c)
  3168  		v.AddArg(x)
  3169  		return true
  3170  	}
  3171  	// match: (Lsh64x64 x y)
  3172  	// cond: shiftIsBounded(v)
  3173  	// result: (SLD x y)
  3174  	for {
  3175  		x := v_0
  3176  		y := v_1
  3177  		if !(shiftIsBounded(v)) {
  3178  			break
  3179  		}
  3180  		v.reset(OpPPC64SLD)
  3181  		v.AddArg2(x, y)
  3182  		return true
  3183  	}
  3184  	// match: (Lsh64x64 <t> x y)
  3185  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
  3186  	for {
  3187  		t := v.Type
  3188  		x := v_0
  3189  		y := v_1
  3190  		v.reset(OpPPC64ISEL)
  3191  		v.AuxInt = int32ToAuxInt(0)
  3192  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3193  		v0.AddArg2(x, y)
  3194  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3195  		v1.AuxInt = int64ToAuxInt(0)
  3196  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3197  		v2.AuxInt = int64ToAuxInt(64)
  3198  		v2.AddArg(y)
  3199  		v.AddArg3(v0, v1, v2)
  3200  		return true
  3201  	}
  3202  }
  3203  func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
  3204  	v_1 := v.Args[1]
  3205  	v_0 := v.Args[0]
  3206  	b := v.Block
  3207  	typ := &b.Func.Config.Types
  3208  	// match: (Lsh64x8 x y)
  3209  	// cond: shiftIsBounded(v)
  3210  	// result: (SLD x y)
  3211  	for {
  3212  		x := v_0
  3213  		y := v_1
  3214  		if !(shiftIsBounded(v)) {
  3215  			break
  3216  		}
  3217  		v.reset(OpPPC64SLD)
  3218  		v.AddArg2(x, y)
  3219  		return true
  3220  	}
  3221  	// match: (Lsh64x8 <t> x y)
  3222  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00C0] y)))
  3223  	for {
  3224  		t := v.Type
  3225  		x := v_0
  3226  		y := v_1
  3227  		v.reset(OpPPC64ISEL)
  3228  		v.AuxInt = int32ToAuxInt(2)
  3229  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3230  		v0.AddArg2(x, y)
  3231  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3232  		v1.AuxInt = int64ToAuxInt(0)
  3233  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3234  		v2.AuxInt = int64ToAuxInt(0)
  3235  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3236  		v3.AuxInt = int64ToAuxInt(0x00C0)
  3237  		v3.AddArg(y)
  3238  		v2.AddArg(v3)
  3239  		v.AddArg3(v0, v1, v2)
  3240  		return true
  3241  	}
  3242  }
  3243  func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
  3244  	v_1 := v.Args[1]
  3245  	v_0 := v.Args[0]
  3246  	b := v.Block
  3247  	typ := &b.Func.Config.Types
  3248  	// match: (Lsh8x16 x y)
  3249  	// cond: shiftIsBounded(v)
  3250  	// result: (SLD x y)
  3251  	for {
  3252  		x := v_0
  3253  		y := v_1
  3254  		if !(shiftIsBounded(v)) {
  3255  			break
  3256  		}
  3257  		v.reset(OpPPC64SLD)
  3258  		v.AddArg2(x, y)
  3259  		return true
  3260  	}
  3261  	// match: (Lsh8x16 <t> x y)
  3262  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF8] y)))
  3263  	for {
  3264  		t := v.Type
  3265  		x := v_0
  3266  		y := v_1
  3267  		v.reset(OpPPC64ISEL)
  3268  		v.AuxInt = int32ToAuxInt(2)
  3269  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3270  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3271  		v1.AddArg(x)
  3272  		v0.AddArg2(v1, y)
  3273  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3274  		v2.AuxInt = int64ToAuxInt(0)
  3275  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3276  		v3.AuxInt = int64ToAuxInt(0)
  3277  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3278  		v4.AuxInt = int64ToAuxInt(0xFFF8)
  3279  		v4.AddArg(y)
  3280  		v3.AddArg(v4)
  3281  		v.AddArg3(v0, v2, v3)
  3282  		return true
  3283  	}
  3284  }
  3285  func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
  3286  	v_1 := v.Args[1]
  3287  	v_0 := v.Args[0]
  3288  	b := v.Block
  3289  	typ := &b.Func.Config.Types
  3290  	// match: (Lsh8x32 x y)
  3291  	// cond: shiftIsBounded(v)
  3292  	// result: (SLD x y)
  3293  	for {
  3294  		x := v_0
  3295  		y := v_1
  3296  		if !(shiftIsBounded(v)) {
  3297  			break
  3298  		}
  3299  		v.reset(OpPPC64SLD)
  3300  		v.AddArg2(x, y)
  3301  		return true
  3302  	}
  3303  	// match: (Lsh8x32 <t> x y)
  3304  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
  3305  	for {
  3306  		t := v.Type
  3307  		x := v_0
  3308  		y := v_1
  3309  		v.reset(OpPPC64ISEL)
  3310  		v.AuxInt = int32ToAuxInt(0)
  3311  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3312  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3313  		v1.AddArg(x)
  3314  		v0.AddArg2(v1, y)
  3315  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3316  		v2.AuxInt = int64ToAuxInt(0)
  3317  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3318  		v3.AuxInt = int32ToAuxInt(8)
  3319  		v3.AddArg(y)
  3320  		v.AddArg3(v0, v2, v3)
  3321  		return true
  3322  	}
  3323  }
  3324  func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
  3325  	v_1 := v.Args[1]
  3326  	v_0 := v.Args[0]
  3327  	b := v.Block
  3328  	typ := &b.Func.Config.Types
  3329  	// match: (Lsh8x64 x (MOVDconst [c]))
  3330  	// cond: uint64(c) < 8
  3331  	// result: (SLWconst x [c])
  3332  	for {
  3333  		x := v_0
  3334  		if v_1.Op != OpPPC64MOVDconst {
  3335  			break
  3336  		}
  3337  		c := auxIntToInt64(v_1.AuxInt)
  3338  		if !(uint64(c) < 8) {
  3339  			break
  3340  		}
  3341  		v.reset(OpPPC64SLWconst)
  3342  		v.AuxInt = int64ToAuxInt(c)
  3343  		v.AddArg(x)
  3344  		return true
  3345  	}
  3346  	// match: (Lsh8x64 x y)
  3347  	// cond: shiftIsBounded(v)
  3348  	// result: (SLD x y)
  3349  	for {
  3350  		x := v_0
  3351  		y := v_1
  3352  		if !(shiftIsBounded(v)) {
  3353  			break
  3354  		}
  3355  		v.reset(OpPPC64SLD)
  3356  		v.AddArg2(x, y)
  3357  		return true
  3358  	}
  3359  	// match: (Lsh8x64 <t> x y)
  3360  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
  3361  	for {
  3362  		t := v.Type
  3363  		x := v_0
  3364  		y := v_1
  3365  		v.reset(OpPPC64ISEL)
  3366  		v.AuxInt = int32ToAuxInt(0)
  3367  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3368  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3369  		v1.AddArg(x)
  3370  		v0.AddArg2(v1, y)
  3371  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3372  		v2.AuxInt = int64ToAuxInt(0)
  3373  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3374  		v3.AuxInt = int64ToAuxInt(8)
  3375  		v3.AddArg(y)
  3376  		v.AddArg3(v0, v2, v3)
  3377  		return true
  3378  	}
  3379  }
  3380  func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
  3381  	v_1 := v.Args[1]
  3382  	v_0 := v.Args[0]
  3383  	b := v.Block
  3384  	typ := &b.Func.Config.Types
  3385  	// match: (Lsh8x8 x y)
  3386  	// cond: shiftIsBounded(v)
  3387  	// result: (SLD x y)
  3388  	for {
  3389  		x := v_0
  3390  		y := v_1
  3391  		if !(shiftIsBounded(v)) {
  3392  			break
  3393  		}
  3394  		v.reset(OpPPC64SLD)
  3395  		v.AddArg2(x, y)
  3396  		return true
  3397  	}
  3398  	// match: (Lsh8x8 <t> x y)
  3399  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F8] y)))
  3400  	for {
  3401  		t := v.Type
  3402  		x := v_0
  3403  		y := v_1
  3404  		v.reset(OpPPC64ISEL)
  3405  		v.AuxInt = int32ToAuxInt(2)
  3406  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3407  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3408  		v1.AddArg(x)
  3409  		v0.AddArg2(v1, y)
  3410  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3411  		v2.AuxInt = int64ToAuxInt(0)
  3412  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3413  		v3.AuxInt = int64ToAuxInt(0)
  3414  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3415  		v4.AuxInt = int64ToAuxInt(0x00F8)
  3416  		v4.AddArg(y)
  3417  		v3.AddArg(v4)
  3418  		v.AddArg3(v0, v2, v3)
  3419  		return true
  3420  	}
  3421  }
  3422  func rewriteValuePPC64_OpMax32F(v *Value) bool {
  3423  	v_1 := v.Args[1]
  3424  	v_0 := v.Args[0]
  3425  	// match: (Max32F x y)
  3426  	// cond: buildcfg.GOPPC64 >= 9
  3427  	// result: (XSMAXJDP x y)
  3428  	for {
  3429  		x := v_0
  3430  		y := v_1
  3431  		if !(buildcfg.GOPPC64 >= 9) {
  3432  			break
  3433  		}
  3434  		v.reset(OpPPC64XSMAXJDP)
  3435  		v.AddArg2(x, y)
  3436  		return true
  3437  	}
  3438  	return false
  3439  }
  3440  func rewriteValuePPC64_OpMax64F(v *Value) bool {
  3441  	v_1 := v.Args[1]
  3442  	v_0 := v.Args[0]
  3443  	// match: (Max64F x y)
  3444  	// cond: buildcfg.GOPPC64 >= 9
  3445  	// result: (XSMAXJDP x y)
  3446  	for {
  3447  		x := v_0
  3448  		y := v_1
  3449  		if !(buildcfg.GOPPC64 >= 9) {
  3450  			break
  3451  		}
  3452  		v.reset(OpPPC64XSMAXJDP)
  3453  		v.AddArg2(x, y)
  3454  		return true
  3455  	}
  3456  	return false
  3457  }
  3458  func rewriteValuePPC64_OpMin32F(v *Value) bool {
  3459  	v_1 := v.Args[1]
  3460  	v_0 := v.Args[0]
  3461  	// match: (Min32F x y)
  3462  	// cond: buildcfg.GOPPC64 >= 9
  3463  	// result: (XSMINJDP x y)
  3464  	for {
  3465  		x := v_0
  3466  		y := v_1
  3467  		if !(buildcfg.GOPPC64 >= 9) {
  3468  			break
  3469  		}
  3470  		v.reset(OpPPC64XSMINJDP)
  3471  		v.AddArg2(x, y)
  3472  		return true
  3473  	}
  3474  	return false
  3475  }
  3476  func rewriteValuePPC64_OpMin64F(v *Value) bool {
  3477  	v_1 := v.Args[1]
  3478  	v_0 := v.Args[0]
  3479  	// match: (Min64F x y)
  3480  	// cond: buildcfg.GOPPC64 >= 9
  3481  	// result: (XSMINJDP x y)
  3482  	for {
  3483  		x := v_0
  3484  		y := v_1
  3485  		if !(buildcfg.GOPPC64 >= 9) {
  3486  			break
  3487  		}
  3488  		v.reset(OpPPC64XSMINJDP)
  3489  		v.AddArg2(x, y)
  3490  		return true
  3491  	}
  3492  	return false
  3493  }
  3494  func rewriteValuePPC64_OpMod16(v *Value) bool {
  3495  	v_1 := v.Args[1]
  3496  	v_0 := v.Args[0]
  3497  	b := v.Block
  3498  	typ := &b.Func.Config.Types
  3499  	// match: (Mod16 x y)
  3500  	// result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
  3501  	for {
  3502  		x := v_0
  3503  		y := v_1
  3504  		v.reset(OpMod32)
  3505  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3506  		v0.AddArg(x)
  3507  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3508  		v1.AddArg(y)
  3509  		v.AddArg2(v0, v1)
  3510  		return true
  3511  	}
  3512  }
  3513  func rewriteValuePPC64_OpMod16u(v *Value) bool {
  3514  	v_1 := v.Args[1]
  3515  	v_0 := v.Args[0]
  3516  	b := v.Block
  3517  	typ := &b.Func.Config.Types
  3518  	// match: (Mod16u x y)
  3519  	// result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
  3520  	for {
  3521  		x := v_0
  3522  		y := v_1
  3523  		v.reset(OpMod32u)
  3524  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3525  		v0.AddArg(x)
  3526  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3527  		v1.AddArg(y)
  3528  		v.AddArg2(v0, v1)
  3529  		return true
  3530  	}
  3531  }
  3532  func rewriteValuePPC64_OpMod32(v *Value) bool {
  3533  	v_1 := v.Args[1]
  3534  	v_0 := v.Args[0]
  3535  	b := v.Block
  3536  	typ := &b.Func.Config.Types
  3537  	// match: (Mod32 x y)
  3538  	// cond: buildcfg.GOPPC64 >= 9
  3539  	// result: (MODSW x y)
  3540  	for {
  3541  		x := v_0
  3542  		y := v_1
  3543  		if !(buildcfg.GOPPC64 >= 9) {
  3544  			break
  3545  		}
  3546  		v.reset(OpPPC64MODSW)
  3547  		v.AddArg2(x, y)
  3548  		return true
  3549  	}
  3550  	// match: (Mod32 x y)
  3551  	// cond: buildcfg.GOPPC64 <= 8
  3552  	// result: (SUB x (MULLW y (DIVW x y)))
  3553  	for {
  3554  		x := v_0
  3555  		y := v_1
  3556  		if !(buildcfg.GOPPC64 <= 8) {
  3557  			break
  3558  		}
  3559  		v.reset(OpPPC64SUB)
  3560  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3561  		v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
  3562  		v1.AddArg2(x, y)
  3563  		v0.AddArg2(y, v1)
  3564  		v.AddArg2(x, v0)
  3565  		return true
  3566  	}
  3567  	return false
  3568  }
  3569  func rewriteValuePPC64_OpMod32u(v *Value) bool {
  3570  	v_1 := v.Args[1]
  3571  	v_0 := v.Args[0]
  3572  	b := v.Block
  3573  	typ := &b.Func.Config.Types
  3574  	// match: (Mod32u x y)
  3575  	// cond: buildcfg.GOPPC64 >= 9
  3576  	// result: (MODUW x y)
  3577  	for {
  3578  		x := v_0
  3579  		y := v_1
  3580  		if !(buildcfg.GOPPC64 >= 9) {
  3581  			break
  3582  		}
  3583  		v.reset(OpPPC64MODUW)
  3584  		v.AddArg2(x, y)
  3585  		return true
  3586  	}
  3587  	// match: (Mod32u x y)
  3588  	// cond: buildcfg.GOPPC64 <= 8
  3589  	// result: (SUB x (MULLW y (DIVWU x y)))
  3590  	for {
  3591  		x := v_0
  3592  		y := v_1
  3593  		if !(buildcfg.GOPPC64 <= 8) {
  3594  			break
  3595  		}
  3596  		v.reset(OpPPC64SUB)
  3597  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3598  		v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
  3599  		v1.AddArg2(x, y)
  3600  		v0.AddArg2(y, v1)
  3601  		v.AddArg2(x, v0)
  3602  		return true
  3603  	}
  3604  	return false
  3605  }
  3606  func rewriteValuePPC64_OpMod64(v *Value) bool {
  3607  	v_1 := v.Args[1]
  3608  	v_0 := v.Args[0]
  3609  	b := v.Block
  3610  	typ := &b.Func.Config.Types
  3611  	// match: (Mod64 x y)
  3612  	// cond: buildcfg.GOPPC64 >=9
  3613  	// result: (MODSD x y)
  3614  	for {
  3615  		x := v_0
  3616  		y := v_1
  3617  		if !(buildcfg.GOPPC64 >= 9) {
  3618  			break
  3619  		}
  3620  		v.reset(OpPPC64MODSD)
  3621  		v.AddArg2(x, y)
  3622  		return true
  3623  	}
  3624  	// match: (Mod64 x y)
  3625  	// cond: buildcfg.GOPPC64 <=8
  3626  	// result: (SUB x (MULLD y (DIVD x y)))
  3627  	for {
  3628  		x := v_0
  3629  		y := v_1
  3630  		if !(buildcfg.GOPPC64 <= 8) {
  3631  			break
  3632  		}
  3633  		v.reset(OpPPC64SUB)
  3634  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3635  		v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
  3636  		v1.AddArg2(x, y)
  3637  		v0.AddArg2(y, v1)
  3638  		v.AddArg2(x, v0)
  3639  		return true
  3640  	}
  3641  	return false
  3642  }
  3643  func rewriteValuePPC64_OpMod64u(v *Value) bool {
  3644  	v_1 := v.Args[1]
  3645  	v_0 := v.Args[0]
  3646  	b := v.Block
  3647  	typ := &b.Func.Config.Types
  3648  	// match: (Mod64u x y)
  3649  	// cond: buildcfg.GOPPC64 >= 9
  3650  	// result: (MODUD x y)
  3651  	for {
  3652  		x := v_0
  3653  		y := v_1
  3654  		if !(buildcfg.GOPPC64 >= 9) {
  3655  			break
  3656  		}
  3657  		v.reset(OpPPC64MODUD)
  3658  		v.AddArg2(x, y)
  3659  		return true
  3660  	}
  3661  	// match: (Mod64u x y)
  3662  	// cond: buildcfg.GOPPC64 <= 8
  3663  	// result: (SUB x (MULLD y (DIVDU x y)))
  3664  	for {
  3665  		x := v_0
  3666  		y := v_1
  3667  		if !(buildcfg.GOPPC64 <= 8) {
  3668  			break
  3669  		}
  3670  		v.reset(OpPPC64SUB)
  3671  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3672  		v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
  3673  		v1.AddArg2(x, y)
  3674  		v0.AddArg2(y, v1)
  3675  		v.AddArg2(x, v0)
  3676  		return true
  3677  	}
  3678  	return false
  3679  }
  3680  func rewriteValuePPC64_OpMod8(v *Value) bool {
  3681  	v_1 := v.Args[1]
  3682  	v_0 := v.Args[0]
  3683  	b := v.Block
  3684  	typ := &b.Func.Config.Types
  3685  	// match: (Mod8 x y)
  3686  	// result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
  3687  	for {
  3688  		x := v_0
  3689  		y := v_1
  3690  		v.reset(OpMod32)
  3691  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3692  		v0.AddArg(x)
  3693  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3694  		v1.AddArg(y)
  3695  		v.AddArg2(v0, v1)
  3696  		return true
  3697  	}
  3698  }
  3699  func rewriteValuePPC64_OpMod8u(v *Value) bool {
  3700  	v_1 := v.Args[1]
  3701  	v_0 := v.Args[0]
  3702  	b := v.Block
  3703  	typ := &b.Func.Config.Types
  3704  	// match: (Mod8u x y)
  3705  	// result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
  3706  	for {
  3707  		x := v_0
  3708  		y := v_1
  3709  		v.reset(OpMod32u)
  3710  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3711  		v0.AddArg(x)
  3712  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3713  		v1.AddArg(y)
  3714  		v.AddArg2(v0, v1)
  3715  		return true
  3716  	}
  3717  }
  3718  func rewriteValuePPC64_OpMove(v *Value) bool {
  3719  	v_2 := v.Args[2]
  3720  	v_1 := v.Args[1]
  3721  	v_0 := v.Args[0]
  3722  	b := v.Block
  3723  	typ := &b.Func.Config.Types
  3724  	// match: (Move [0] _ _ mem)
  3725  	// result: mem
  3726  	for {
  3727  		if auxIntToInt64(v.AuxInt) != 0 {
  3728  			break
  3729  		}
  3730  		mem := v_2
  3731  		v.copyOf(mem)
  3732  		return true
  3733  	}
  3734  	// match: (Move [1] dst src mem)
  3735  	// result: (MOVBstore dst (MOVBZload src mem) mem)
  3736  	for {
  3737  		if auxIntToInt64(v.AuxInt) != 1 {
  3738  			break
  3739  		}
  3740  		dst := v_0
  3741  		src := v_1
  3742  		mem := v_2
  3743  		v.reset(OpPPC64MOVBstore)
  3744  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3745  		v0.AddArg2(src, mem)
  3746  		v.AddArg3(dst, v0, mem)
  3747  		return true
  3748  	}
  3749  	// match: (Move [2] dst src mem)
  3750  	// result: (MOVHstore dst (MOVHZload src mem) mem)
  3751  	for {
  3752  		if auxIntToInt64(v.AuxInt) != 2 {
  3753  			break
  3754  		}
  3755  		dst := v_0
  3756  		src := v_1
  3757  		mem := v_2
  3758  		v.reset(OpPPC64MOVHstore)
  3759  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3760  		v0.AddArg2(src, mem)
  3761  		v.AddArg3(dst, v0, mem)
  3762  		return true
  3763  	}
  3764  	// match: (Move [4] dst src mem)
  3765  	// result: (MOVWstore dst (MOVWZload src mem) mem)
  3766  	for {
  3767  		if auxIntToInt64(v.AuxInt) != 4 {
  3768  			break
  3769  		}
  3770  		dst := v_0
  3771  		src := v_1
  3772  		mem := v_2
  3773  		v.reset(OpPPC64MOVWstore)
  3774  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3775  		v0.AddArg2(src, mem)
  3776  		v.AddArg3(dst, v0, mem)
  3777  		return true
  3778  	}
  3779  	// match: (Move [8] {t} dst src mem)
  3780  	// result: (MOVDstore dst (MOVDload src mem) mem)
  3781  	for {
  3782  		if auxIntToInt64(v.AuxInt) != 8 {
  3783  			break
  3784  		}
  3785  		dst := v_0
  3786  		src := v_1
  3787  		mem := v_2
  3788  		v.reset(OpPPC64MOVDstore)
  3789  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
  3790  		v0.AddArg2(src, mem)
  3791  		v.AddArg3(dst, v0, mem)
  3792  		return true
  3793  	}
  3794  	// match: (Move [3] dst src mem)
  3795  	// result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
  3796  	for {
  3797  		if auxIntToInt64(v.AuxInt) != 3 {
  3798  			break
  3799  		}
  3800  		dst := v_0
  3801  		src := v_1
  3802  		mem := v_2
  3803  		v.reset(OpPPC64MOVBstore)
  3804  		v.AuxInt = int32ToAuxInt(2)
  3805  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3806  		v0.AuxInt = int32ToAuxInt(2)
  3807  		v0.AddArg2(src, mem)
  3808  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3809  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
  3810  		v2.AddArg2(src, mem)
  3811  		v1.AddArg3(dst, v2, mem)
  3812  		v.AddArg3(dst, v0, v1)
  3813  		return true
  3814  	}
  3815  	// match: (Move [5] dst src mem)
  3816  	// result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3817  	for {
  3818  		if auxIntToInt64(v.AuxInt) != 5 {
  3819  			break
  3820  		}
  3821  		dst := v_0
  3822  		src := v_1
  3823  		mem := v_2
  3824  		v.reset(OpPPC64MOVBstore)
  3825  		v.AuxInt = int32ToAuxInt(4)
  3826  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3827  		v0.AuxInt = int32ToAuxInt(4)
  3828  		v0.AddArg2(src, mem)
  3829  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3830  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3831  		v2.AddArg2(src, mem)
  3832  		v1.AddArg3(dst, v2, mem)
  3833  		v.AddArg3(dst, v0, v1)
  3834  		return true
  3835  	}
  3836  	// match: (Move [6] dst src mem)
  3837  	// result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3838  	for {
  3839  		if auxIntToInt64(v.AuxInt) != 6 {
  3840  			break
  3841  		}
  3842  		dst := v_0
  3843  		src := v_1
  3844  		mem := v_2
  3845  		v.reset(OpPPC64MOVHstore)
  3846  		v.AuxInt = int32ToAuxInt(4)
  3847  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3848  		v0.AuxInt = int32ToAuxInt(4)
  3849  		v0.AddArg2(src, mem)
  3850  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3851  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3852  		v2.AddArg2(src, mem)
  3853  		v1.AddArg3(dst, v2, mem)
  3854  		v.AddArg3(dst, v0, v1)
  3855  		return true
  3856  	}
  3857  	// match: (Move [7] dst src mem)
  3858  	// result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)))
  3859  	for {
  3860  		if auxIntToInt64(v.AuxInt) != 7 {
  3861  			break
  3862  		}
  3863  		dst := v_0
  3864  		src := v_1
  3865  		mem := v_2
  3866  		v.reset(OpPPC64MOVBstore)
  3867  		v.AuxInt = int32ToAuxInt(6)
  3868  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3869  		v0.AuxInt = int32ToAuxInt(6)
  3870  		v0.AddArg2(src, mem)
  3871  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3872  		v1.AuxInt = int32ToAuxInt(4)
  3873  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3874  		v2.AuxInt = int32ToAuxInt(4)
  3875  		v2.AddArg2(src, mem)
  3876  		v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3877  		v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3878  		v4.AddArg2(src, mem)
  3879  		v3.AddArg3(dst, v4, mem)
  3880  		v1.AddArg3(dst, v2, v3)
  3881  		v.AddArg3(dst, v0, v1)
  3882  		return true
  3883  	}
  3884  	// match: (Move [s] dst src mem)
  3885  	// cond: s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)
  3886  	// result: (LoweredMove [s] dst src mem)
  3887  	for {
  3888  		s := auxIntToInt64(v.AuxInt)
  3889  		dst := v_0
  3890  		src := v_1
  3891  		mem := v_2
  3892  		if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) {
  3893  			break
  3894  		}
  3895  		v.reset(OpPPC64LoweredMove)
  3896  		v.AuxInt = int64ToAuxInt(s)
  3897  		v.AddArg3(dst, src, mem)
  3898  		return true
  3899  	}
  3900  	// match: (Move [s] dst src mem)
  3901  	// cond: s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9
  3902  	// result: (LoweredQuadMoveShort [s] dst src mem)
  3903  	for {
  3904  		s := auxIntToInt64(v.AuxInt)
  3905  		dst := v_0
  3906  		src := v_1
  3907  		mem := v_2
  3908  		if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) {
  3909  			break
  3910  		}
  3911  		v.reset(OpPPC64LoweredQuadMoveShort)
  3912  		v.AuxInt = int64ToAuxInt(s)
  3913  		v.AddArg3(dst, src, mem)
  3914  		return true
  3915  	}
  3916  	// match: (Move [s] dst src mem)
  3917  	// cond: s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)
  3918  	// result: (LoweredQuadMove [s] dst src mem)
  3919  	for {
  3920  		s := auxIntToInt64(v.AuxInt)
  3921  		dst := v_0
  3922  		src := v_1
  3923  		mem := v_2
  3924  		if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) {
  3925  			break
  3926  		}
  3927  		v.reset(OpPPC64LoweredQuadMove)
  3928  		v.AuxInt = int64ToAuxInt(s)
  3929  		v.AddArg3(dst, src, mem)
  3930  		return true
  3931  	}
  3932  	return false
  3933  }
  3934  func rewriteValuePPC64_OpNeq16(v *Value) bool {
  3935  	v_1 := v.Args[1]
  3936  	v_0 := v.Args[0]
  3937  	b := v.Block
  3938  	typ := &b.Func.Config.Types
  3939  	// match: (Neq16 x y)
  3940  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  3941  	// result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  3942  	for {
  3943  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3944  			x := v_0
  3945  			y := v_1
  3946  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  3947  				continue
  3948  			}
  3949  			v.reset(OpPPC64NotEqual)
  3950  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3951  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3952  			v1.AddArg(x)
  3953  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3954  			v2.AddArg(y)
  3955  			v0.AddArg2(v1, v2)
  3956  			v.AddArg(v0)
  3957  			return true
  3958  		}
  3959  		break
  3960  	}
  3961  	// match: (Neq16 x y)
  3962  	// result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  3963  	for {
  3964  		x := v_0
  3965  		y := v_1
  3966  		v.reset(OpPPC64NotEqual)
  3967  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3968  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3969  		v1.AddArg(x)
  3970  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3971  		v2.AddArg(y)
  3972  		v0.AddArg2(v1, v2)
  3973  		v.AddArg(v0)
  3974  		return true
  3975  	}
  3976  }
  3977  func rewriteValuePPC64_OpNeq32(v *Value) bool {
  3978  	v_1 := v.Args[1]
  3979  	v_0 := v.Args[0]
  3980  	b := v.Block
  3981  	// match: (Neq32 x y)
  3982  	// result: (NotEqual (CMPW x y))
  3983  	for {
  3984  		x := v_0
  3985  		y := v_1
  3986  		v.reset(OpPPC64NotEqual)
  3987  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3988  		v0.AddArg2(x, y)
  3989  		v.AddArg(v0)
  3990  		return true
  3991  	}
  3992  }
  3993  func rewriteValuePPC64_OpNeq32F(v *Value) bool {
  3994  	v_1 := v.Args[1]
  3995  	v_0 := v.Args[0]
  3996  	b := v.Block
  3997  	// match: (Neq32F x y)
  3998  	// result: (NotEqual (FCMPU x y))
  3999  	for {
  4000  		x := v_0
  4001  		y := v_1
  4002  		v.reset(OpPPC64NotEqual)
  4003  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  4004  		v0.AddArg2(x, y)
  4005  		v.AddArg(v0)
  4006  		return true
  4007  	}
  4008  }
  4009  func rewriteValuePPC64_OpNeq64(v *Value) bool {
  4010  	v_1 := v.Args[1]
  4011  	v_0 := v.Args[0]
  4012  	b := v.Block
  4013  	// match: (Neq64 x y)
  4014  	// result: (NotEqual (CMP x y))
  4015  	for {
  4016  		x := v_0
  4017  		y := v_1
  4018  		v.reset(OpPPC64NotEqual)
  4019  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  4020  		v0.AddArg2(x, y)
  4021  		v.AddArg(v0)
  4022  		return true
  4023  	}
  4024  }
  4025  func rewriteValuePPC64_OpNeq64F(v *Value) bool {
  4026  	v_1 := v.Args[1]
  4027  	v_0 := v.Args[0]
  4028  	b := v.Block
  4029  	// match: (Neq64F x y)
  4030  	// result: (NotEqual (FCMPU x y))
  4031  	for {
  4032  		x := v_0
  4033  		y := v_1
  4034  		v.reset(OpPPC64NotEqual)
  4035  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  4036  		v0.AddArg2(x, y)
  4037  		v.AddArg(v0)
  4038  		return true
  4039  	}
  4040  }
  4041  func rewriteValuePPC64_OpNeq8(v *Value) bool {
  4042  	v_1 := v.Args[1]
  4043  	v_0 := v.Args[0]
  4044  	b := v.Block
  4045  	typ := &b.Func.Config.Types
  4046  	// match: (Neq8 x y)
  4047  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  4048  	// result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  4049  	for {
  4050  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4051  			x := v_0
  4052  			y := v_1
  4053  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  4054  				continue
  4055  			}
  4056  			v.reset(OpPPC64NotEqual)
  4057  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  4058  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  4059  			v1.AddArg(x)
  4060  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  4061  			v2.AddArg(y)
  4062  			v0.AddArg2(v1, v2)
  4063  			v.AddArg(v0)
  4064  			return true
  4065  		}
  4066  		break
  4067  	}
  4068  	// match: (Neq8 x y)
  4069  	// result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  4070  	for {
  4071  		x := v_0
  4072  		y := v_1
  4073  		v.reset(OpPPC64NotEqual)
  4074  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  4075  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  4076  		v1.AddArg(x)
  4077  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  4078  		v2.AddArg(y)
  4079  		v0.AddArg2(v1, v2)
  4080  		v.AddArg(v0)
  4081  		return true
  4082  	}
  4083  }
  4084  func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
  4085  	v_1 := v.Args[1]
  4086  	v_0 := v.Args[0]
  4087  	b := v.Block
  4088  	// match: (NeqPtr x y)
  4089  	// result: (NotEqual (CMP x y))
  4090  	for {
  4091  		x := v_0
  4092  		y := v_1
  4093  		v.reset(OpPPC64NotEqual)
  4094  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  4095  		v0.AddArg2(x, y)
  4096  		v.AddArg(v0)
  4097  		return true
  4098  	}
  4099  }
  4100  func rewriteValuePPC64_OpNot(v *Value) bool {
  4101  	v_0 := v.Args[0]
  4102  	// match: (Not x)
  4103  	// result: (XORconst [1] x)
  4104  	for {
  4105  		x := v_0
  4106  		v.reset(OpPPC64XORconst)
  4107  		v.AuxInt = int64ToAuxInt(1)
  4108  		v.AddArg(x)
  4109  		return true
  4110  	}
  4111  }
  4112  func rewriteValuePPC64_OpOffPtr(v *Value) bool {
  4113  	v_0 := v.Args[0]
  4114  	b := v.Block
  4115  	typ := &b.Func.Config.Types
  4116  	// match: (OffPtr [off] ptr)
  4117  	// result: (ADD (MOVDconst <typ.Int64> [off]) ptr)
  4118  	for {
  4119  		off := auxIntToInt64(v.AuxInt)
  4120  		ptr := v_0
  4121  		v.reset(OpPPC64ADD)
  4122  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  4123  		v0.AuxInt = int64ToAuxInt(off)
  4124  		v.AddArg2(v0, ptr)
  4125  		return true
  4126  	}
  4127  }
  4128  func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
  4129  	v_1 := v.Args[1]
  4130  	v_0 := v.Args[0]
  4131  	b := v.Block
  4132  	// match: (ADD z l:(MULLD x y))
  4133  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4134  	// result: (MADDLD x y z )
  4135  	for {
  4136  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4137  			z := v_0
  4138  			l := v_1
  4139  			if l.Op != OpPPC64MULLD {
  4140  				continue
  4141  			}
  4142  			y := l.Args[1]
  4143  			x := l.Args[0]
  4144  			if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4145  				continue
  4146  			}
  4147  			v.reset(OpPPC64MADDLD)
  4148  			v.AddArg3(x, y, z)
  4149  			return true
  4150  		}
  4151  		break
  4152  	}
  4153  	// match: (ADD z l:(MULLDconst <mt> [x] y))
  4154  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4155  	// result: (MADDLD (MOVDconst <mt> [int64(x)]) y z )
  4156  	for {
  4157  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4158  			z := v_0
  4159  			l := v_1
  4160  			if l.Op != OpPPC64MULLDconst {
  4161  				continue
  4162  			}
  4163  			mt := l.Type
  4164  			x := auxIntToInt32(l.AuxInt)
  4165  			y := l.Args[0]
  4166  			if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4167  				continue
  4168  			}
  4169  			v.reset(OpPPC64MADDLD)
  4170  			v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, mt)
  4171  			v0.AuxInt = int64ToAuxInt(int64(x))
  4172  			v.AddArg3(v0, y, z)
  4173  			return true
  4174  		}
  4175  		break
  4176  	}
  4177  	// match: (ADD x (MOVDconst <t> [c]))
  4178  	// cond: is32Bit(c) && !t.IsPtr()
  4179  	// result: (ADDconst [c] x)
  4180  	for {
  4181  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4182  			x := v_0
  4183  			if v_1.Op != OpPPC64MOVDconst {
  4184  				continue
  4185  			}
  4186  			t := v_1.Type
  4187  			c := auxIntToInt64(v_1.AuxInt)
  4188  			if !(is32Bit(c) && !t.IsPtr()) {
  4189  				continue
  4190  			}
  4191  			v.reset(OpPPC64ADDconst)
  4192  			v.AuxInt = int64ToAuxInt(c)
  4193  			v.AddArg(x)
  4194  			return true
  4195  		}
  4196  		break
  4197  	}
  4198  	return false
  4199  }
  4200  func rewriteValuePPC64_OpPPC64ADDC(v *Value) bool {
  4201  	v_1 := v.Args[1]
  4202  	v_0 := v.Args[0]
  4203  	// match: (ADDC x (MOVDconst [y]))
  4204  	// cond: is16Bit(y)
  4205  	// result: (ADDCconst [y] x)
  4206  	for {
  4207  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4208  			x := v_0
  4209  			if v_1.Op != OpPPC64MOVDconst {
  4210  				continue
  4211  			}
  4212  			y := auxIntToInt64(v_1.AuxInt)
  4213  			if !(is16Bit(y)) {
  4214  				continue
  4215  			}
  4216  			v.reset(OpPPC64ADDCconst)
  4217  			v.AuxInt = int64ToAuxInt(y)
  4218  			v.AddArg(x)
  4219  			return true
  4220  		}
  4221  		break
  4222  	}
  4223  	return false
  4224  }
  4225  func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool {
  4226  	v_2 := v.Args[2]
  4227  	v_1 := v.Args[1]
  4228  	v_0 := v.Args[0]
  4229  	b := v.Block
  4230  	typ := &b.Func.Config.Types
  4231  	// match: (ADDE x y (Select1 <typ.UInt64> (ADDCconst (MOVDconst [0]) [-1])))
  4232  	// result: (ADDC x y)
  4233  	for {
  4234  		x := v_0
  4235  		y := v_1
  4236  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
  4237  			break
  4238  		}
  4239  		v_2_0 := v_2.Args[0]
  4240  		if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 {
  4241  			break
  4242  		}
  4243  		v_2_0_0 := v_2_0.Args[0]
  4244  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
  4245  			break
  4246  		}
  4247  		v.reset(OpPPC64ADDC)
  4248  		v.AddArg2(x, y)
  4249  		return true
  4250  	}
  4251  	// match: (ADDE (MOVDconst [0]) y c)
  4252  	// result: (ADDZE y c)
  4253  	for {
  4254  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4255  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4256  				continue
  4257  			}
  4258  			y := v_1
  4259  			c := v_2
  4260  			v.reset(OpPPC64ADDZE)
  4261  			v.AddArg2(y, c)
  4262  			return true
  4263  		}
  4264  		break
  4265  	}
  4266  	return false
  4267  }
  4268  func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
  4269  	v_0 := v.Args[0]
  4270  	b := v.Block
  4271  	// match: (ADDconst <at> [z] l:(MULLD x y))
  4272  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4273  	// result: (MADDLD x y (MOVDconst <at> [int64(z)]))
  4274  	for {
  4275  		at := v.Type
  4276  		z := auxIntToInt64(v.AuxInt)
  4277  		l := v_0
  4278  		if l.Op != OpPPC64MULLD {
  4279  			break
  4280  		}
  4281  		y := l.Args[1]
  4282  		x := l.Args[0]
  4283  		if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4284  			break
  4285  		}
  4286  		v.reset(OpPPC64MADDLD)
  4287  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, at)
  4288  		v0.AuxInt = int64ToAuxInt(int64(z))
  4289  		v.AddArg3(x, y, v0)
  4290  		return true
  4291  	}
  4292  	// match: (ADDconst <at> [z] l:(MULLDconst <mt> [x] y))
  4293  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4294  	// result: (MADDLD (MOVDconst <mt> [int64(x)]) y (MOVDconst <at> [int64(z)]))
  4295  	for {
  4296  		at := v.Type
  4297  		z := auxIntToInt64(v.AuxInt)
  4298  		l := v_0
  4299  		if l.Op != OpPPC64MULLDconst {
  4300  			break
  4301  		}
  4302  		mt := l.Type
  4303  		x := auxIntToInt32(l.AuxInt)
  4304  		y := l.Args[0]
  4305  		if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4306  			break
  4307  		}
  4308  		v.reset(OpPPC64MADDLD)
  4309  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, mt)
  4310  		v0.AuxInt = int64ToAuxInt(int64(x))
  4311  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, at)
  4312  		v1.AuxInt = int64ToAuxInt(int64(z))
  4313  		v.AddArg3(v0, y, v1)
  4314  		return true
  4315  	}
  4316  	// match: (ADDconst [c] (ADDconst [d] x))
  4317  	// cond: is32Bit(c+d)
  4318  	// result: (ADDconst [c+d] x)
  4319  	for {
  4320  		c := auxIntToInt64(v.AuxInt)
  4321  		if v_0.Op != OpPPC64ADDconst {
  4322  			break
  4323  		}
  4324  		d := auxIntToInt64(v_0.AuxInt)
  4325  		x := v_0.Args[0]
  4326  		if !(is32Bit(c + d)) {
  4327  			break
  4328  		}
  4329  		v.reset(OpPPC64ADDconst)
  4330  		v.AuxInt = int64ToAuxInt(c + d)
  4331  		v.AddArg(x)
  4332  		return true
  4333  	}
  4334  	// match: (ADDconst [0] x)
  4335  	// result: x
  4336  	for {
  4337  		if auxIntToInt64(v.AuxInt) != 0 {
  4338  			break
  4339  		}
  4340  		x := v_0
  4341  		v.copyOf(x)
  4342  		return true
  4343  	}
  4344  	// match: (ADDconst [c] (MOVDaddr [d] {sym} x))
  4345  	// cond: is32Bit(c+int64(d))
  4346  	// result: (MOVDaddr [int32(c+int64(d))] {sym} x)
  4347  	for {
  4348  		c := auxIntToInt64(v.AuxInt)
  4349  		if v_0.Op != OpPPC64MOVDaddr {
  4350  			break
  4351  		}
  4352  		d := auxIntToInt32(v_0.AuxInt)
  4353  		sym := auxToSym(v_0.Aux)
  4354  		x := v_0.Args[0]
  4355  		if !(is32Bit(c + int64(d))) {
  4356  			break
  4357  		}
  4358  		v.reset(OpPPC64MOVDaddr)
  4359  		v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
  4360  		v.Aux = symToAux(sym)
  4361  		v.AddArg(x)
  4362  		return true
  4363  	}
  4364  	// match: (ADDconst [c] x:(SP))
  4365  	// cond: is32Bit(c)
  4366  	// result: (MOVDaddr [int32(c)] x)
  4367  	for {
  4368  		c := auxIntToInt64(v.AuxInt)
  4369  		x := v_0
  4370  		if x.Op != OpSP || !(is32Bit(c)) {
  4371  			break
  4372  		}
  4373  		v.reset(OpPPC64MOVDaddr)
  4374  		v.AuxInt = int32ToAuxInt(int32(c))
  4375  		v.AddArg(x)
  4376  		return true
  4377  	}
  4378  	// match: (ADDconst [c] (SUBFCconst [d] x))
  4379  	// cond: is32Bit(c+d)
  4380  	// result: (SUBFCconst [c+d] x)
  4381  	for {
  4382  		c := auxIntToInt64(v.AuxInt)
  4383  		if v_0.Op != OpPPC64SUBFCconst {
  4384  			break
  4385  		}
  4386  		d := auxIntToInt64(v_0.AuxInt)
  4387  		x := v_0.Args[0]
  4388  		if !(is32Bit(c + d)) {
  4389  			break
  4390  		}
  4391  		v.reset(OpPPC64SUBFCconst)
  4392  		v.AuxInt = int64ToAuxInt(c + d)
  4393  		v.AddArg(x)
  4394  		return true
  4395  	}
  4396  	return false
  4397  }
  4398  func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
  4399  	v_1 := v.Args[1]
  4400  	v_0 := v.Args[0]
  4401  	// match: (AND <t> x (MOVDconst [m]))
  4402  	// cond: t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))
  4403  	// result: (ANDconst [int64(uint8(m))] x)
  4404  	for {
  4405  		t := v.Type
  4406  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4407  			x := v_0
  4408  			if v_1.Op != OpPPC64MOVDconst {
  4409  				continue
  4410  			}
  4411  			m := auxIntToInt64(v_1.AuxInt)
  4412  			if !(t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))) {
  4413  				continue
  4414  			}
  4415  			v.reset(OpPPC64ANDconst)
  4416  			v.AuxInt = int64ToAuxInt(int64(uint8(m)))
  4417  			v.AddArg(x)
  4418  			return true
  4419  		}
  4420  		break
  4421  	}
  4422  	// match: (AND <t> x (MOVDconst [m]))
  4423  	// cond: t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))
  4424  	// result: (ANDconst [int64(uint16(m))] x)
  4425  	for {
  4426  		t := v.Type
  4427  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4428  			x := v_0
  4429  			if v_1.Op != OpPPC64MOVDconst {
  4430  				continue
  4431  			}
  4432  			m := auxIntToInt64(v_1.AuxInt)
  4433  			if !(t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))) {
  4434  				continue
  4435  			}
  4436  			v.reset(OpPPC64ANDconst)
  4437  			v.AuxInt = int64ToAuxInt(int64(uint16(m)))
  4438  			v.AddArg(x)
  4439  			return true
  4440  		}
  4441  		break
  4442  	}
  4443  	// match: (AND (MOVDconst [m]) (ROTLWconst [r] x))
  4444  	// cond: isPPC64WordRotateMask(m)
  4445  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4446  	for {
  4447  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4448  			if v_0.Op != OpPPC64MOVDconst {
  4449  				continue
  4450  			}
  4451  			m := auxIntToInt64(v_0.AuxInt)
  4452  			if v_1.Op != OpPPC64ROTLWconst {
  4453  				continue
  4454  			}
  4455  			r := auxIntToInt64(v_1.AuxInt)
  4456  			x := v_1.Args[0]
  4457  			if !(isPPC64WordRotateMask(m)) {
  4458  				continue
  4459  			}
  4460  			v.reset(OpPPC64RLWINM)
  4461  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4462  			v.AddArg(x)
  4463  			return true
  4464  		}
  4465  		break
  4466  	}
  4467  	// match: (AND (MOVDconst [m]) (ROTLW x r))
  4468  	// cond: isPPC64WordRotateMask(m)
  4469  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4470  	for {
  4471  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4472  			if v_0.Op != OpPPC64MOVDconst {
  4473  				continue
  4474  			}
  4475  			m := auxIntToInt64(v_0.AuxInt)
  4476  			if v_1.Op != OpPPC64ROTLW {
  4477  				continue
  4478  			}
  4479  			r := v_1.Args[1]
  4480  			x := v_1.Args[0]
  4481  			if !(isPPC64WordRotateMask(m)) {
  4482  				continue
  4483  			}
  4484  			v.reset(OpPPC64RLWNM)
  4485  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4486  			v.AddArg2(x, r)
  4487  			return true
  4488  		}
  4489  		break
  4490  	}
  4491  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4492  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4493  	// result: (MOVDconst [0])
  4494  	for {
  4495  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4496  			if v_0.Op != OpPPC64MOVDconst {
  4497  				continue
  4498  			}
  4499  			m := auxIntToInt64(v_0.AuxInt)
  4500  			if v_1.Op != OpPPC64SRWconst {
  4501  				continue
  4502  			}
  4503  			s := auxIntToInt64(v_1.AuxInt)
  4504  			if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4505  				continue
  4506  			}
  4507  			v.reset(OpPPC64MOVDconst)
  4508  			v.AuxInt = int64ToAuxInt(0)
  4509  			return true
  4510  		}
  4511  		break
  4512  	}
  4513  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4514  	// cond: mergePPC64AndSrwi(m,s) != 0
  4515  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4516  	for {
  4517  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4518  			if v_0.Op != OpPPC64MOVDconst {
  4519  				continue
  4520  			}
  4521  			m := auxIntToInt64(v_0.AuxInt)
  4522  			if v_1.Op != OpPPC64SRWconst {
  4523  				continue
  4524  			}
  4525  			s := auxIntToInt64(v_1.AuxInt)
  4526  			x := v_1.Args[0]
  4527  			if !(mergePPC64AndSrwi(m, s) != 0) {
  4528  				continue
  4529  			}
  4530  			v.reset(OpPPC64RLWINM)
  4531  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4532  			v.AddArg(x)
  4533  			return true
  4534  		}
  4535  		break
  4536  	}
  4537  	// match: (AND (MOVDconst [m]) (SRDconst x [s]))
  4538  	// cond: mergePPC64AndSrdi(m,s) != 0
  4539  	// result: (RLWINM [mergePPC64AndSrdi(m,s)] x)
  4540  	for {
  4541  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4542  			if v_0.Op != OpPPC64MOVDconst {
  4543  				continue
  4544  			}
  4545  			m := auxIntToInt64(v_0.AuxInt)
  4546  			if v_1.Op != OpPPC64SRDconst {
  4547  				continue
  4548  			}
  4549  			s := auxIntToInt64(v_1.AuxInt)
  4550  			x := v_1.Args[0]
  4551  			if !(mergePPC64AndSrdi(m, s) != 0) {
  4552  				continue
  4553  			}
  4554  			v.reset(OpPPC64RLWINM)
  4555  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
  4556  			v.AddArg(x)
  4557  			return true
  4558  		}
  4559  		break
  4560  	}
  4561  	// match: (AND (MOVDconst [m]) (SLDconst x [s]))
  4562  	// cond: mergePPC64AndSldi(m,s) != 0
  4563  	// result: (RLWINM [mergePPC64AndSldi(m,s)] x)
  4564  	for {
  4565  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4566  			if v_0.Op != OpPPC64MOVDconst {
  4567  				continue
  4568  			}
  4569  			m := auxIntToInt64(v_0.AuxInt)
  4570  			if v_1.Op != OpPPC64SLDconst {
  4571  				continue
  4572  			}
  4573  			s := auxIntToInt64(v_1.AuxInt)
  4574  			x := v_1.Args[0]
  4575  			if !(mergePPC64AndSldi(m, s) != 0) {
  4576  				continue
  4577  			}
  4578  			v.reset(OpPPC64RLWINM)
  4579  			v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
  4580  			v.AddArg(x)
  4581  			return true
  4582  		}
  4583  		break
  4584  	}
  4585  	// match: (AND x (NOR y y))
  4586  	// result: (ANDN x y)
  4587  	for {
  4588  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4589  			x := v_0
  4590  			if v_1.Op != OpPPC64NOR {
  4591  				continue
  4592  			}
  4593  			y := v_1.Args[1]
  4594  			if y != v_1.Args[0] {
  4595  				continue
  4596  			}
  4597  			v.reset(OpPPC64ANDN)
  4598  			v.AddArg2(x, y)
  4599  			return true
  4600  		}
  4601  		break
  4602  	}
  4603  	// match: (AND (MOVDconst [c]) (MOVDconst [d]))
  4604  	// result: (MOVDconst [c&d])
  4605  	for {
  4606  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4607  			if v_0.Op != OpPPC64MOVDconst {
  4608  				continue
  4609  			}
  4610  			c := auxIntToInt64(v_0.AuxInt)
  4611  			if v_1.Op != OpPPC64MOVDconst {
  4612  				continue
  4613  			}
  4614  			d := auxIntToInt64(v_1.AuxInt)
  4615  			v.reset(OpPPC64MOVDconst)
  4616  			v.AuxInt = int64ToAuxInt(c & d)
  4617  			return true
  4618  		}
  4619  		break
  4620  	}
  4621  	// match: (AND x (MOVDconst [-1]))
  4622  	// result: x
  4623  	for {
  4624  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4625  			x := v_0
  4626  			if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  4627  				continue
  4628  			}
  4629  			v.copyOf(x)
  4630  			return true
  4631  		}
  4632  		break
  4633  	}
  4634  	// match: (AND x (MOVDconst [c]))
  4635  	// cond: isU16Bit(c)
  4636  	// result: (ANDconst [c] x)
  4637  	for {
  4638  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4639  			x := v_0
  4640  			if v_1.Op != OpPPC64MOVDconst {
  4641  				continue
  4642  			}
  4643  			c := auxIntToInt64(v_1.AuxInt)
  4644  			if !(isU16Bit(c)) {
  4645  				continue
  4646  			}
  4647  			v.reset(OpPPC64ANDconst)
  4648  			v.AuxInt = int64ToAuxInt(c)
  4649  			v.AddArg(x)
  4650  			return true
  4651  		}
  4652  		break
  4653  	}
  4654  	// match: (AND (MOVDconst [c]) y:(MOVWZreg _))
  4655  	// cond: c&0xFFFFFFFF == 0xFFFFFFFF
  4656  	// result: y
  4657  	for {
  4658  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4659  			if v_0.Op != OpPPC64MOVDconst {
  4660  				continue
  4661  			}
  4662  			c := auxIntToInt64(v_0.AuxInt)
  4663  			y := v_1
  4664  			if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
  4665  				continue
  4666  			}
  4667  			v.copyOf(y)
  4668  			return true
  4669  		}
  4670  		break
  4671  	}
  4672  	// match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x))
  4673  	// result: (MOVWZreg x)
  4674  	for {
  4675  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4676  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
  4677  				continue
  4678  			}
  4679  			y := v_1
  4680  			if y.Op != OpPPC64MOVWreg {
  4681  				continue
  4682  			}
  4683  			x := y.Args[0]
  4684  			v.reset(OpPPC64MOVWZreg)
  4685  			v.AddArg(x)
  4686  			return true
  4687  		}
  4688  		break
  4689  	}
  4690  	// match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
  4691  	// result: (ANDconst [c&0xFF] x)
  4692  	for {
  4693  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4694  			if v_0.Op != OpPPC64MOVDconst {
  4695  				continue
  4696  			}
  4697  			c := auxIntToInt64(v_0.AuxInt)
  4698  			x := v_1
  4699  			if x.Op != OpPPC64MOVBZload {
  4700  				continue
  4701  			}
  4702  			v.reset(OpPPC64ANDconst)
  4703  			v.AuxInt = int64ToAuxInt(c & 0xFF)
  4704  			v.AddArg(x)
  4705  			return true
  4706  		}
  4707  		break
  4708  	}
  4709  	return false
  4710  }
  4711  func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
  4712  	v_1 := v.Args[1]
  4713  	v_0 := v.Args[0]
  4714  	// match: (ANDN (MOVDconst [c]) (MOVDconst [d]))
  4715  	// result: (MOVDconst [c&^d])
  4716  	for {
  4717  		if v_0.Op != OpPPC64MOVDconst {
  4718  			break
  4719  		}
  4720  		c := auxIntToInt64(v_0.AuxInt)
  4721  		if v_1.Op != OpPPC64MOVDconst {
  4722  			break
  4723  		}
  4724  		d := auxIntToInt64(v_1.AuxInt)
  4725  		v.reset(OpPPC64MOVDconst)
  4726  		v.AuxInt = int64ToAuxInt(c &^ d)
  4727  		return true
  4728  	}
  4729  	return false
  4730  }
  4731  func rewriteValuePPC64_OpPPC64ANDconst(v *Value) bool {
  4732  	v_0 := v.Args[0]
  4733  	// match: (ANDconst [m] (ROTLWconst [r] x))
  4734  	// cond: isPPC64WordRotateMask(m)
  4735  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4736  	for {
  4737  		m := auxIntToInt64(v.AuxInt)
  4738  		if v_0.Op != OpPPC64ROTLWconst {
  4739  			break
  4740  		}
  4741  		r := auxIntToInt64(v_0.AuxInt)
  4742  		x := v_0.Args[0]
  4743  		if !(isPPC64WordRotateMask(m)) {
  4744  			break
  4745  		}
  4746  		v.reset(OpPPC64RLWINM)
  4747  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4748  		v.AddArg(x)
  4749  		return true
  4750  	}
  4751  	// match: (ANDconst [m] (ROTLW x r))
  4752  	// cond: isPPC64WordRotateMask(m)
  4753  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4754  	for {
  4755  		m := auxIntToInt64(v.AuxInt)
  4756  		if v_0.Op != OpPPC64ROTLW {
  4757  			break
  4758  		}
  4759  		r := v_0.Args[1]
  4760  		x := v_0.Args[0]
  4761  		if !(isPPC64WordRotateMask(m)) {
  4762  			break
  4763  		}
  4764  		v.reset(OpPPC64RLWNM)
  4765  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4766  		v.AddArg2(x, r)
  4767  		return true
  4768  	}
  4769  	// match: (ANDconst [m] (SRWconst x [s]))
  4770  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4771  	// result: (MOVDconst [0])
  4772  	for {
  4773  		m := auxIntToInt64(v.AuxInt)
  4774  		if v_0.Op != OpPPC64SRWconst {
  4775  			break
  4776  		}
  4777  		s := auxIntToInt64(v_0.AuxInt)
  4778  		if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4779  			break
  4780  		}
  4781  		v.reset(OpPPC64MOVDconst)
  4782  		v.AuxInt = int64ToAuxInt(0)
  4783  		return true
  4784  	}
  4785  	// match: (ANDconst [m] (SRWconst x [s]))
  4786  	// cond: mergePPC64AndSrwi(m,s) != 0
  4787  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4788  	for {
  4789  		m := auxIntToInt64(v.AuxInt)
  4790  		if v_0.Op != OpPPC64SRWconst {
  4791  			break
  4792  		}
  4793  		s := auxIntToInt64(v_0.AuxInt)
  4794  		x := v_0.Args[0]
  4795  		if !(mergePPC64AndSrwi(m, s) != 0) {
  4796  			break
  4797  		}
  4798  		v.reset(OpPPC64RLWINM)
  4799  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4800  		v.AddArg(x)
  4801  		return true
  4802  	}
  4803  	// match: (ANDconst [m] (SRDconst x [s]))
  4804  	// cond: mergePPC64AndSrdi(m,s) != 0
  4805  	// result: (RLWINM [mergePPC64AndSrdi(m,s)] x)
  4806  	for {
  4807  		m := auxIntToInt64(v.AuxInt)
  4808  		if v_0.Op != OpPPC64SRDconst {
  4809  			break
  4810  		}
  4811  		s := auxIntToInt64(v_0.AuxInt)
  4812  		x := v_0.Args[0]
  4813  		if !(mergePPC64AndSrdi(m, s) != 0) {
  4814  			break
  4815  		}
  4816  		v.reset(OpPPC64RLWINM)
  4817  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
  4818  		v.AddArg(x)
  4819  		return true
  4820  	}
  4821  	// match: (ANDconst [m] (SLDconst x [s]))
  4822  	// cond: mergePPC64AndSldi(m,s) != 0
  4823  	// result: (RLWINM [mergePPC64AndSldi(m,s)] x)
  4824  	for {
  4825  		m := auxIntToInt64(v.AuxInt)
  4826  		if v_0.Op != OpPPC64SLDconst {
  4827  			break
  4828  		}
  4829  		s := auxIntToInt64(v_0.AuxInt)
  4830  		x := v_0.Args[0]
  4831  		if !(mergePPC64AndSldi(m, s) != 0) {
  4832  			break
  4833  		}
  4834  		v.reset(OpPPC64RLWINM)
  4835  		v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
  4836  		v.AddArg(x)
  4837  		return true
  4838  	}
  4839  	// match: (ANDconst [c] (ANDconst [d] x))
  4840  	// result: (ANDconst [c&d] x)
  4841  	for {
  4842  		c := auxIntToInt64(v.AuxInt)
  4843  		if v_0.Op != OpPPC64ANDconst {
  4844  			break
  4845  		}
  4846  		d := auxIntToInt64(v_0.AuxInt)
  4847  		x := v_0.Args[0]
  4848  		v.reset(OpPPC64ANDconst)
  4849  		v.AuxInt = int64ToAuxInt(c & d)
  4850  		v.AddArg(x)
  4851  		return true
  4852  	}
  4853  	// match: (ANDconst [-1] x)
  4854  	// result: x
  4855  	for {
  4856  		if auxIntToInt64(v.AuxInt) != -1 {
  4857  			break
  4858  		}
  4859  		x := v_0
  4860  		v.copyOf(x)
  4861  		return true
  4862  	}
  4863  	// match: (ANDconst [0] _)
  4864  	// result: (MOVDconst [0])
  4865  	for {
  4866  		if auxIntToInt64(v.AuxInt) != 0 {
  4867  			break
  4868  		}
  4869  		v.reset(OpPPC64MOVDconst)
  4870  		v.AuxInt = int64ToAuxInt(0)
  4871  		return true
  4872  	}
  4873  	// match: (ANDconst [c] y:(MOVBZreg _))
  4874  	// cond: c&0xFF == 0xFF
  4875  	// result: y
  4876  	for {
  4877  		c := auxIntToInt64(v.AuxInt)
  4878  		y := v_0
  4879  		if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
  4880  			break
  4881  		}
  4882  		v.copyOf(y)
  4883  		return true
  4884  	}
  4885  	// match: (ANDconst [0xFF] (MOVBreg x))
  4886  	// result: (MOVBZreg x)
  4887  	for {
  4888  		if auxIntToInt64(v.AuxInt) != 0xFF || v_0.Op != OpPPC64MOVBreg {
  4889  			break
  4890  		}
  4891  		x := v_0.Args[0]
  4892  		v.reset(OpPPC64MOVBZreg)
  4893  		v.AddArg(x)
  4894  		return true
  4895  	}
  4896  	// match: (ANDconst [c] y:(MOVHZreg _))
  4897  	// cond: c&0xFFFF == 0xFFFF
  4898  	// result: y
  4899  	for {
  4900  		c := auxIntToInt64(v.AuxInt)
  4901  		y := v_0
  4902  		if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
  4903  			break
  4904  		}
  4905  		v.copyOf(y)
  4906  		return true
  4907  	}
  4908  	// match: (ANDconst [0xFFFF] (MOVHreg x))
  4909  	// result: (MOVHZreg x)
  4910  	for {
  4911  		if auxIntToInt64(v.AuxInt) != 0xFFFF || v_0.Op != OpPPC64MOVHreg {
  4912  			break
  4913  		}
  4914  		x := v_0.Args[0]
  4915  		v.reset(OpPPC64MOVHZreg)
  4916  		v.AddArg(x)
  4917  		return true
  4918  	}
  4919  	// match: (ANDconst [c] (MOVBZreg x))
  4920  	// result: (ANDconst [c&0xFF] x)
  4921  	for {
  4922  		c := auxIntToInt64(v.AuxInt)
  4923  		if v_0.Op != OpPPC64MOVBZreg {
  4924  			break
  4925  		}
  4926  		x := v_0.Args[0]
  4927  		v.reset(OpPPC64ANDconst)
  4928  		v.AuxInt = int64ToAuxInt(c & 0xFF)
  4929  		v.AddArg(x)
  4930  		return true
  4931  	}
  4932  	// match: (ANDconst [c] (MOVHZreg x))
  4933  	// result: (ANDconst [c&0xFFFF] x)
  4934  	for {
  4935  		c := auxIntToInt64(v.AuxInt)
  4936  		if v_0.Op != OpPPC64MOVHZreg {
  4937  			break
  4938  		}
  4939  		x := v_0.Args[0]
  4940  		v.reset(OpPPC64ANDconst)
  4941  		v.AuxInt = int64ToAuxInt(c & 0xFFFF)
  4942  		v.AddArg(x)
  4943  		return true
  4944  	}
  4945  	// match: (ANDconst [c] (MOVWZreg x))
  4946  	// result: (ANDconst [c&0xFFFFFFFF] x)
  4947  	for {
  4948  		c := auxIntToInt64(v.AuxInt)
  4949  		if v_0.Op != OpPPC64MOVWZreg {
  4950  			break
  4951  		}
  4952  		x := v_0.Args[0]
  4953  		v.reset(OpPPC64ANDconst)
  4954  		v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
  4955  		v.AddArg(x)
  4956  		return true
  4957  	}
  4958  	// match: (ANDconst [m] (RLWINM [r] y))
  4959  	// cond: mergePPC64AndRlwinm(uint32(m),r) != 0
  4960  	// result: (RLWINM [mergePPC64AndRlwinm(uint32(m),r)] y)
  4961  	for {
  4962  		m := auxIntToInt64(v.AuxInt)
  4963  		if v_0.Op != OpPPC64RLWINM {
  4964  			break
  4965  		}
  4966  		r := auxIntToInt64(v_0.AuxInt)
  4967  		y := v_0.Args[0]
  4968  		if !(mergePPC64AndRlwinm(uint32(m), r) != 0) {
  4969  			break
  4970  		}
  4971  		v.reset(OpPPC64RLWINM)
  4972  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(uint32(m), r))
  4973  		v.AddArg(y)
  4974  		return true
  4975  	}
  4976  	// match: (ANDconst [1] z:(SRADconst [63] x))
  4977  	// cond: z.Uses == 1
  4978  	// result: (SRDconst [63] x)
  4979  	for {
  4980  		if auxIntToInt64(v.AuxInt) != 1 {
  4981  			break
  4982  		}
  4983  		z := v_0
  4984  		if z.Op != OpPPC64SRADconst || auxIntToInt64(z.AuxInt) != 63 {
  4985  			break
  4986  		}
  4987  		x := z.Args[0]
  4988  		if !(z.Uses == 1) {
  4989  			break
  4990  		}
  4991  		v.reset(OpPPC64SRDconst)
  4992  		v.AuxInt = int64ToAuxInt(63)
  4993  		v.AddArg(x)
  4994  		return true
  4995  	}
  4996  	return false
  4997  }
  4998  func rewriteValuePPC64_OpPPC64BRD(v *Value) bool {
  4999  	v_0 := v.Args[0]
  5000  	b := v.Block
  5001  	typ := &b.Func.Config.Types
  5002  	// match: (BRD x:(MOVDload [off] {sym} ptr mem))
  5003  	// cond: x.Uses == 1
  5004  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  5005  	for {
  5006  		x := v_0
  5007  		if x.Op != OpPPC64MOVDload {
  5008  			break
  5009  		}
  5010  		off := auxIntToInt32(x.AuxInt)
  5011  		sym := auxToSym(x.Aux)
  5012  		mem := x.Args[1]
  5013  		ptr := x.Args[0]
  5014  		if !(x.Uses == 1) {
  5015  			break
  5016  		}
  5017  		b = x.Block
  5018  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  5019  		v.copyOf(v0)
  5020  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  5021  		v1.AuxInt = int32ToAuxInt(off)
  5022  		v1.Aux = symToAux(sym)
  5023  		v1.AddArg(ptr)
  5024  		v0.AddArg2(v1, mem)
  5025  		return true
  5026  	}
  5027  	// match: (BRD x:(MOVDloadidx ptr idx mem))
  5028  	// cond: x.Uses == 1
  5029  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  5030  	for {
  5031  		x := v_0
  5032  		if x.Op != OpPPC64MOVDloadidx {
  5033  			break
  5034  		}
  5035  		mem := x.Args[2]
  5036  		ptr := x.Args[0]
  5037  		idx := x.Args[1]
  5038  		if !(x.Uses == 1) {
  5039  			break
  5040  		}
  5041  		b = x.Block
  5042  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  5043  		v.copyOf(v0)
  5044  		v0.AddArg3(ptr, idx, mem)
  5045  		return true
  5046  	}
  5047  	return false
  5048  }
  5049  func rewriteValuePPC64_OpPPC64BRH(v *Value) bool {
  5050  	v_0 := v.Args[0]
  5051  	b := v.Block
  5052  	typ := &b.Func.Config.Types
  5053  	// match: (BRH x:(MOVHZload [off] {sym} ptr mem))
  5054  	// cond: x.Uses == 1
  5055  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  5056  	for {
  5057  		x := v_0
  5058  		if x.Op != OpPPC64MOVHZload {
  5059  			break
  5060  		}
  5061  		off := auxIntToInt32(x.AuxInt)
  5062  		sym := auxToSym(x.Aux)
  5063  		mem := x.Args[1]
  5064  		ptr := x.Args[0]
  5065  		if !(x.Uses == 1) {
  5066  			break
  5067  		}
  5068  		b = x.Block
  5069  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  5070  		v.copyOf(v0)
  5071  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  5072  		v1.AuxInt = int32ToAuxInt(off)
  5073  		v1.Aux = symToAux(sym)
  5074  		v1.AddArg(ptr)
  5075  		v0.AddArg2(v1, mem)
  5076  		return true
  5077  	}
  5078  	// match: (BRH x:(MOVHZloadidx ptr idx mem))
  5079  	// cond: x.Uses == 1
  5080  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  5081  	for {
  5082  		x := v_0
  5083  		if x.Op != OpPPC64MOVHZloadidx {
  5084  			break
  5085  		}
  5086  		mem := x.Args[2]
  5087  		ptr := x.Args[0]
  5088  		idx := x.Args[1]
  5089  		if !(x.Uses == 1) {
  5090  			break
  5091  		}
  5092  		b = x.Block
  5093  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  5094  		v.copyOf(v0)
  5095  		v0.AddArg3(ptr, idx, mem)
  5096  		return true
  5097  	}
  5098  	return false
  5099  }
  5100  func rewriteValuePPC64_OpPPC64BRW(v *Value) bool {
  5101  	v_0 := v.Args[0]
  5102  	b := v.Block
  5103  	typ := &b.Func.Config.Types
  5104  	// match: (BRW x:(MOVWZload [off] {sym} ptr mem))
  5105  	// cond: x.Uses == 1
  5106  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  5107  	for {
  5108  		x := v_0
  5109  		if x.Op != OpPPC64MOVWZload {
  5110  			break
  5111  		}
  5112  		off := auxIntToInt32(x.AuxInt)
  5113  		sym := auxToSym(x.Aux)
  5114  		mem := x.Args[1]
  5115  		ptr := x.Args[0]
  5116  		if !(x.Uses == 1) {
  5117  			break
  5118  		}
  5119  		b = x.Block
  5120  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  5121  		v.copyOf(v0)
  5122  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  5123  		v1.AuxInt = int32ToAuxInt(off)
  5124  		v1.Aux = symToAux(sym)
  5125  		v1.AddArg(ptr)
  5126  		v0.AddArg2(v1, mem)
  5127  		return true
  5128  	}
  5129  	// match: (BRW x:(MOVWZloadidx ptr idx mem))
  5130  	// cond: x.Uses == 1
  5131  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  5132  	for {
  5133  		x := v_0
  5134  		if x.Op != OpPPC64MOVWZloadidx {
  5135  			break
  5136  		}
  5137  		mem := x.Args[2]
  5138  		ptr := x.Args[0]
  5139  		idx := x.Args[1]
  5140  		if !(x.Uses == 1) {
  5141  			break
  5142  		}
  5143  		b = x.Block
  5144  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  5145  		v.copyOf(v0)
  5146  		v0.AddArg3(ptr, idx, mem)
  5147  		return true
  5148  	}
  5149  	return false
  5150  }
  5151  func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
  5152  	v_0 := v.Args[0]
  5153  	// match: (CLRLSLDI [c] (SRWconst [s] x))
  5154  	// cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0
  5155  	// result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x)
  5156  	for {
  5157  		c := auxIntToInt32(v.AuxInt)
  5158  		if v_0.Op != OpPPC64SRWconst {
  5159  			break
  5160  		}
  5161  		s := auxIntToInt64(v_0.AuxInt)
  5162  		x := v_0.Args[0]
  5163  		if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
  5164  			break
  5165  		}
  5166  		v.reset(OpPPC64RLWINM)
  5167  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
  5168  		v.AddArg(x)
  5169  		return true
  5170  	}
  5171  	// match: (CLRLSLDI [c] (SRDconst [s] x))
  5172  	// cond: mergePPC64ClrlsldiSrd(int64(c),s) != 0
  5173  	// result: (RLWINM [mergePPC64ClrlsldiSrd(int64(c),s)] x)
  5174  	for {
  5175  		c := auxIntToInt32(v.AuxInt)
  5176  		if v_0.Op != OpPPC64SRDconst {
  5177  			break
  5178  		}
  5179  		s := auxIntToInt64(v_0.AuxInt)
  5180  		x := v_0.Args[0]
  5181  		if !(mergePPC64ClrlsldiSrd(int64(c), s) != 0) {
  5182  			break
  5183  		}
  5184  		v.reset(OpPPC64RLWINM)
  5185  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrd(int64(c), s))
  5186  		v.AddArg(x)
  5187  		return true
  5188  	}
  5189  	// match: (CLRLSLDI [c] i:(RLWINM [s] x))
  5190  	// cond: mergePPC64ClrlsldiRlwinm(c,s) != 0
  5191  	// result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x)
  5192  	for {
  5193  		c := auxIntToInt32(v.AuxInt)
  5194  		i := v_0
  5195  		if i.Op != OpPPC64RLWINM {
  5196  			break
  5197  		}
  5198  		s := auxIntToInt64(i.AuxInt)
  5199  		x := i.Args[0]
  5200  		if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
  5201  			break
  5202  		}
  5203  		v.reset(OpPPC64RLWINM)
  5204  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
  5205  		v.AddArg(x)
  5206  		return true
  5207  	}
  5208  	return false
  5209  }
  5210  func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
  5211  	v_1 := v.Args[1]
  5212  	v_0 := v.Args[0]
  5213  	b := v.Block
  5214  	// match: (CMP x (MOVDconst [c]))
  5215  	// cond: is16Bit(c)
  5216  	// result: (CMPconst x [c])
  5217  	for {
  5218  		x := v_0
  5219  		if v_1.Op != OpPPC64MOVDconst {
  5220  			break
  5221  		}
  5222  		c := auxIntToInt64(v_1.AuxInt)
  5223  		if !(is16Bit(c)) {
  5224  			break
  5225  		}
  5226  		v.reset(OpPPC64CMPconst)
  5227  		v.AuxInt = int64ToAuxInt(c)
  5228  		v.AddArg(x)
  5229  		return true
  5230  	}
  5231  	// match: (CMP (MOVDconst [c]) y)
  5232  	// cond: is16Bit(c)
  5233  	// result: (InvertFlags (CMPconst y [c]))
  5234  	for {
  5235  		if v_0.Op != OpPPC64MOVDconst {
  5236  			break
  5237  		}
  5238  		c := auxIntToInt64(v_0.AuxInt)
  5239  		y := v_1
  5240  		if !(is16Bit(c)) {
  5241  			break
  5242  		}
  5243  		v.reset(OpPPC64InvertFlags)
  5244  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  5245  		v0.AuxInt = int64ToAuxInt(c)
  5246  		v0.AddArg(y)
  5247  		v.AddArg(v0)
  5248  		return true
  5249  	}
  5250  	// match: (CMP x y)
  5251  	// cond: canonLessThan(x,y)
  5252  	// result: (InvertFlags (CMP y x))
  5253  	for {
  5254  		x := v_0
  5255  		y := v_1
  5256  		if !(canonLessThan(x, y)) {
  5257  			break
  5258  		}
  5259  		v.reset(OpPPC64InvertFlags)
  5260  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  5261  		v0.AddArg2(y, x)
  5262  		v.AddArg(v0)
  5263  		return true
  5264  	}
  5265  	return false
  5266  }
  5267  func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
  5268  	v_1 := v.Args[1]
  5269  	v_0 := v.Args[0]
  5270  	b := v.Block
  5271  	// match: (CMPU x (MOVDconst [c]))
  5272  	// cond: isU16Bit(c)
  5273  	// result: (CMPUconst x [c])
  5274  	for {
  5275  		x := v_0
  5276  		if v_1.Op != OpPPC64MOVDconst {
  5277  			break
  5278  		}
  5279  		c := auxIntToInt64(v_1.AuxInt)
  5280  		if !(isU16Bit(c)) {
  5281  			break
  5282  		}
  5283  		v.reset(OpPPC64CMPUconst)
  5284  		v.AuxInt = int64ToAuxInt(c)
  5285  		v.AddArg(x)
  5286  		return true
  5287  	}
  5288  	// match: (CMPU (MOVDconst [c]) y)
  5289  	// cond: isU16Bit(c)
  5290  	// result: (InvertFlags (CMPUconst y [c]))
  5291  	for {
  5292  		if v_0.Op != OpPPC64MOVDconst {
  5293  			break
  5294  		}
  5295  		c := auxIntToInt64(v_0.AuxInt)
  5296  		y := v_1
  5297  		if !(isU16Bit(c)) {
  5298  			break
  5299  		}
  5300  		v.reset(OpPPC64InvertFlags)
  5301  		v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  5302  		v0.AuxInt = int64ToAuxInt(c)
  5303  		v0.AddArg(y)
  5304  		v.AddArg(v0)
  5305  		return true
  5306  	}
  5307  	// match: (CMPU x y)
  5308  	// cond: canonLessThan(x,y)
  5309  	// result: (InvertFlags (CMPU y x))
  5310  	for {
  5311  		x := v_0
  5312  		y := v_1
  5313  		if !(canonLessThan(x, y)) {
  5314  			break
  5315  		}
  5316  		v.reset(OpPPC64InvertFlags)
  5317  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  5318  		v0.AddArg2(y, x)
  5319  		v.AddArg(v0)
  5320  		return true
  5321  	}
  5322  	return false
  5323  }
  5324  func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
  5325  	v_0 := v.Args[0]
  5326  	// match: (CMPUconst [d] (ANDconst z [c]))
  5327  	// cond: uint64(d) > uint64(c)
  5328  	// result: (FlagLT)
  5329  	for {
  5330  		d := auxIntToInt64(v.AuxInt)
  5331  		if v_0.Op != OpPPC64ANDconst {
  5332  			break
  5333  		}
  5334  		c := auxIntToInt64(v_0.AuxInt)
  5335  		if !(uint64(d) > uint64(c)) {
  5336  			break
  5337  		}
  5338  		v.reset(OpPPC64FlagLT)
  5339  		return true
  5340  	}
  5341  	// match: (CMPUconst (MOVDconst [x]) [y])
  5342  	// cond: x==y
  5343  	// result: (FlagEQ)
  5344  	for {
  5345  		y := auxIntToInt64(v.AuxInt)
  5346  		if v_0.Op != OpPPC64MOVDconst {
  5347  			break
  5348  		}
  5349  		x := auxIntToInt64(v_0.AuxInt)
  5350  		if !(x == y) {
  5351  			break
  5352  		}
  5353  		v.reset(OpPPC64FlagEQ)
  5354  		return true
  5355  	}
  5356  	// match: (CMPUconst (MOVDconst [x]) [y])
  5357  	// cond: uint64(x)<uint64(y)
  5358  	// result: (FlagLT)
  5359  	for {
  5360  		y := auxIntToInt64(v.AuxInt)
  5361  		if v_0.Op != OpPPC64MOVDconst {
  5362  			break
  5363  		}
  5364  		x := auxIntToInt64(v_0.AuxInt)
  5365  		if !(uint64(x) < uint64(y)) {
  5366  			break
  5367  		}
  5368  		v.reset(OpPPC64FlagLT)
  5369  		return true
  5370  	}
  5371  	// match: (CMPUconst (MOVDconst [x]) [y])
  5372  	// cond: uint64(x)>uint64(y)
  5373  	// result: (FlagGT)
  5374  	for {
  5375  		y := auxIntToInt64(v.AuxInt)
  5376  		if v_0.Op != OpPPC64MOVDconst {
  5377  			break
  5378  		}
  5379  		x := auxIntToInt64(v_0.AuxInt)
  5380  		if !(uint64(x) > uint64(y)) {
  5381  			break
  5382  		}
  5383  		v.reset(OpPPC64FlagGT)
  5384  		return true
  5385  	}
  5386  	// match: (CMPUconst [0] a:(ANDconst [n] z))
  5387  	// result: (CMPconst [0] a)
  5388  	for {
  5389  		if auxIntToInt64(v.AuxInt) != 0 {
  5390  			break
  5391  		}
  5392  		a := v_0
  5393  		if a.Op != OpPPC64ANDconst {
  5394  			break
  5395  		}
  5396  		v.reset(OpPPC64CMPconst)
  5397  		v.AuxInt = int64ToAuxInt(0)
  5398  		v.AddArg(a)
  5399  		return true
  5400  	}
  5401  	return false
  5402  }
  5403  func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
  5404  	v_1 := v.Args[1]
  5405  	v_0 := v.Args[0]
  5406  	b := v.Block
  5407  	// match: (CMPW x (MOVWreg y))
  5408  	// result: (CMPW x y)
  5409  	for {
  5410  		x := v_0
  5411  		if v_1.Op != OpPPC64MOVWreg {
  5412  			break
  5413  		}
  5414  		y := v_1.Args[0]
  5415  		v.reset(OpPPC64CMPW)
  5416  		v.AddArg2(x, y)
  5417  		return true
  5418  	}
  5419  	// match: (CMPW (MOVWreg x) y)
  5420  	// result: (CMPW x y)
  5421  	for {
  5422  		if v_0.Op != OpPPC64MOVWreg {
  5423  			break
  5424  		}
  5425  		x := v_0.Args[0]
  5426  		y := v_1
  5427  		v.reset(OpPPC64CMPW)
  5428  		v.AddArg2(x, y)
  5429  		return true
  5430  	}
  5431  	// match: (CMPW x (MOVDconst [c]))
  5432  	// cond: is16Bit(c)
  5433  	// result: (CMPWconst x [int32(c)])
  5434  	for {
  5435  		x := v_0
  5436  		if v_1.Op != OpPPC64MOVDconst {
  5437  			break
  5438  		}
  5439  		c := auxIntToInt64(v_1.AuxInt)
  5440  		if !(is16Bit(c)) {
  5441  			break
  5442  		}
  5443  		v.reset(OpPPC64CMPWconst)
  5444  		v.AuxInt = int32ToAuxInt(int32(c))
  5445  		v.AddArg(x)
  5446  		return true
  5447  	}
  5448  	// match: (CMPW (MOVDconst [c]) y)
  5449  	// cond: is16Bit(c)
  5450  	// result: (InvertFlags (CMPWconst y [int32(c)]))
  5451  	for {
  5452  		if v_0.Op != OpPPC64MOVDconst {
  5453  			break
  5454  		}
  5455  		c := auxIntToInt64(v_0.AuxInt)
  5456  		y := v_1
  5457  		if !(is16Bit(c)) {
  5458  			break
  5459  		}
  5460  		v.reset(OpPPC64InvertFlags)
  5461  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
  5462  		v0.AuxInt = int32ToAuxInt(int32(c))
  5463  		v0.AddArg(y)
  5464  		v.AddArg(v0)
  5465  		return true
  5466  	}
  5467  	// match: (CMPW x y)
  5468  	// cond: canonLessThan(x,y)
  5469  	// result: (InvertFlags (CMPW y x))
  5470  	for {
  5471  		x := v_0
  5472  		y := v_1
  5473  		if !(canonLessThan(x, y)) {
  5474  			break
  5475  		}
  5476  		v.reset(OpPPC64InvertFlags)
  5477  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  5478  		v0.AddArg2(y, x)
  5479  		v.AddArg(v0)
  5480  		return true
  5481  	}
  5482  	return false
  5483  }
  5484  func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
  5485  	v_1 := v.Args[1]
  5486  	v_0 := v.Args[0]
  5487  	b := v.Block
  5488  	// match: (CMPWU x (MOVWZreg y))
  5489  	// result: (CMPWU x y)
  5490  	for {
  5491  		x := v_0
  5492  		if v_1.Op != OpPPC64MOVWZreg {
  5493  			break
  5494  		}
  5495  		y := v_1.Args[0]
  5496  		v.reset(OpPPC64CMPWU)
  5497  		v.AddArg2(x, y)
  5498  		return true
  5499  	}
  5500  	// match: (CMPWU (MOVWZreg x) y)
  5501  	// result: (CMPWU x y)
  5502  	for {
  5503  		if v_0.Op != OpPPC64MOVWZreg {
  5504  			break
  5505  		}
  5506  		x := v_0.Args[0]
  5507  		y := v_1
  5508  		v.reset(OpPPC64CMPWU)
  5509  		v.AddArg2(x, y)
  5510  		return true
  5511  	}
  5512  	// match: (CMPWU x (MOVDconst [c]))
  5513  	// cond: isU16Bit(c)
  5514  	// result: (CMPWUconst x [int32(c)])
  5515  	for {
  5516  		x := v_0
  5517  		if v_1.Op != OpPPC64MOVDconst {
  5518  			break
  5519  		}
  5520  		c := auxIntToInt64(v_1.AuxInt)
  5521  		if !(isU16Bit(c)) {
  5522  			break
  5523  		}
  5524  		v.reset(OpPPC64CMPWUconst)
  5525  		v.AuxInt = int32ToAuxInt(int32(c))
  5526  		v.AddArg(x)
  5527  		return true
  5528  	}
  5529  	// match: (CMPWU (MOVDconst [c]) y)
  5530  	// cond: isU16Bit(c)
  5531  	// result: (InvertFlags (CMPWUconst y [int32(c)]))
  5532  	for {
  5533  		if v_0.Op != OpPPC64MOVDconst {
  5534  			break
  5535  		}
  5536  		c := auxIntToInt64(v_0.AuxInt)
  5537  		y := v_1
  5538  		if !(isU16Bit(c)) {
  5539  			break
  5540  		}
  5541  		v.reset(OpPPC64InvertFlags)
  5542  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  5543  		v0.AuxInt = int32ToAuxInt(int32(c))
  5544  		v0.AddArg(y)
  5545  		v.AddArg(v0)
  5546  		return true
  5547  	}
  5548  	// match: (CMPWU x y)
  5549  	// cond: canonLessThan(x,y)
  5550  	// result: (InvertFlags (CMPWU y x))
  5551  	for {
  5552  		x := v_0
  5553  		y := v_1
  5554  		if !(canonLessThan(x, y)) {
  5555  			break
  5556  		}
  5557  		v.reset(OpPPC64InvertFlags)
  5558  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  5559  		v0.AddArg2(y, x)
  5560  		v.AddArg(v0)
  5561  		return true
  5562  	}
  5563  	return false
  5564  }
  5565  func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
  5566  	v_0 := v.Args[0]
  5567  	// match: (CMPWUconst [d] (ANDconst z [c]))
  5568  	// cond: uint64(d) > uint64(c)
  5569  	// result: (FlagLT)
  5570  	for {
  5571  		d := auxIntToInt32(v.AuxInt)
  5572  		if v_0.Op != OpPPC64ANDconst {
  5573  			break
  5574  		}
  5575  		c := auxIntToInt64(v_0.AuxInt)
  5576  		if !(uint64(d) > uint64(c)) {
  5577  			break
  5578  		}
  5579  		v.reset(OpPPC64FlagLT)
  5580  		return true
  5581  	}
  5582  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5583  	// cond: int32(x)==int32(y)
  5584  	// result: (FlagEQ)
  5585  	for {
  5586  		y := auxIntToInt32(v.AuxInt)
  5587  		if v_0.Op != OpPPC64MOVDconst {
  5588  			break
  5589  		}
  5590  		x := auxIntToInt64(v_0.AuxInt)
  5591  		if !(int32(x) == int32(y)) {
  5592  			break
  5593  		}
  5594  		v.reset(OpPPC64FlagEQ)
  5595  		return true
  5596  	}
  5597  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5598  	// cond: uint32(x)<uint32(y)
  5599  	// result: (FlagLT)
  5600  	for {
  5601  		y := auxIntToInt32(v.AuxInt)
  5602  		if v_0.Op != OpPPC64MOVDconst {
  5603  			break
  5604  		}
  5605  		x := auxIntToInt64(v_0.AuxInt)
  5606  		if !(uint32(x) < uint32(y)) {
  5607  			break
  5608  		}
  5609  		v.reset(OpPPC64FlagLT)
  5610  		return true
  5611  	}
  5612  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5613  	// cond: uint32(x)>uint32(y)
  5614  	// result: (FlagGT)
  5615  	for {
  5616  		y := auxIntToInt32(v.AuxInt)
  5617  		if v_0.Op != OpPPC64MOVDconst {
  5618  			break
  5619  		}
  5620  		x := auxIntToInt64(v_0.AuxInt)
  5621  		if !(uint32(x) > uint32(y)) {
  5622  			break
  5623  		}
  5624  		v.reset(OpPPC64FlagGT)
  5625  		return true
  5626  	}
  5627  	// match: (CMPWUconst [0] a:(ANDconst [n] z))
  5628  	// result: (CMPconst [0] a)
  5629  	for {
  5630  		if auxIntToInt32(v.AuxInt) != 0 {
  5631  			break
  5632  		}
  5633  		a := v_0
  5634  		if a.Op != OpPPC64ANDconst {
  5635  			break
  5636  		}
  5637  		v.reset(OpPPC64CMPconst)
  5638  		v.AuxInt = int64ToAuxInt(0)
  5639  		v.AddArg(a)
  5640  		return true
  5641  	}
  5642  	return false
  5643  }
  5644  func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
  5645  	v_0 := v.Args[0]
  5646  	// match: (CMPWconst (MOVDconst [x]) [y])
  5647  	// cond: int32(x)==int32(y)
  5648  	// result: (FlagEQ)
  5649  	for {
  5650  		y := auxIntToInt32(v.AuxInt)
  5651  		if v_0.Op != OpPPC64MOVDconst {
  5652  			break
  5653  		}
  5654  		x := auxIntToInt64(v_0.AuxInt)
  5655  		if !(int32(x) == int32(y)) {
  5656  			break
  5657  		}
  5658  		v.reset(OpPPC64FlagEQ)
  5659  		return true
  5660  	}
  5661  	// match: (CMPWconst (MOVDconst [x]) [y])
  5662  	// cond: int32(x)<int32(y)
  5663  	// result: (FlagLT)
  5664  	for {
  5665  		y := auxIntToInt32(v.AuxInt)
  5666  		if v_0.Op != OpPPC64MOVDconst {
  5667  			break
  5668  		}
  5669  		x := auxIntToInt64(v_0.AuxInt)
  5670  		if !(int32(x) < int32(y)) {
  5671  			break
  5672  		}
  5673  		v.reset(OpPPC64FlagLT)
  5674  		return true
  5675  	}
  5676  	// match: (CMPWconst (MOVDconst [x]) [y])
  5677  	// cond: int32(x)>int32(y)
  5678  	// result: (FlagGT)
  5679  	for {
  5680  		y := auxIntToInt32(v.AuxInt)
  5681  		if v_0.Op != OpPPC64MOVDconst {
  5682  			break
  5683  		}
  5684  		x := auxIntToInt64(v_0.AuxInt)
  5685  		if !(int32(x) > int32(y)) {
  5686  			break
  5687  		}
  5688  		v.reset(OpPPC64FlagGT)
  5689  		return true
  5690  	}
  5691  	// match: (CMPWconst [0] a:(ANDconst [n] z))
  5692  	// result: (CMPconst [0] a)
  5693  	for {
  5694  		if auxIntToInt32(v.AuxInt) != 0 {
  5695  			break
  5696  		}
  5697  		a := v_0
  5698  		if a.Op != OpPPC64ANDconst {
  5699  			break
  5700  		}
  5701  		v.reset(OpPPC64CMPconst)
  5702  		v.AuxInt = int64ToAuxInt(0)
  5703  		v.AddArg(a)
  5704  		return true
  5705  	}
  5706  	return false
  5707  }
  5708  func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
  5709  	v_0 := v.Args[0]
  5710  	// match: (CMPconst (MOVDconst [x]) [y])
  5711  	// cond: x==y
  5712  	// result: (FlagEQ)
  5713  	for {
  5714  		y := auxIntToInt64(v.AuxInt)
  5715  		if v_0.Op != OpPPC64MOVDconst {
  5716  			break
  5717  		}
  5718  		x := auxIntToInt64(v_0.AuxInt)
  5719  		if !(x == y) {
  5720  			break
  5721  		}
  5722  		v.reset(OpPPC64FlagEQ)
  5723  		return true
  5724  	}
  5725  	// match: (CMPconst (MOVDconst [x]) [y])
  5726  	// cond: x<y
  5727  	// result: (FlagLT)
  5728  	for {
  5729  		y := auxIntToInt64(v.AuxInt)
  5730  		if v_0.Op != OpPPC64MOVDconst {
  5731  			break
  5732  		}
  5733  		x := auxIntToInt64(v_0.AuxInt)
  5734  		if !(x < y) {
  5735  			break
  5736  		}
  5737  		v.reset(OpPPC64FlagLT)
  5738  		return true
  5739  	}
  5740  	// match: (CMPconst (MOVDconst [x]) [y])
  5741  	// cond: x>y
  5742  	// result: (FlagGT)
  5743  	for {
  5744  		y := auxIntToInt64(v.AuxInt)
  5745  		if v_0.Op != OpPPC64MOVDconst {
  5746  			break
  5747  		}
  5748  		x := auxIntToInt64(v_0.AuxInt)
  5749  		if !(x > y) {
  5750  			break
  5751  		}
  5752  		v.reset(OpPPC64FlagGT)
  5753  		return true
  5754  	}
  5755  	return false
  5756  }
  5757  func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
  5758  	v_0 := v.Args[0]
  5759  	// match: (Equal (FlagEQ))
  5760  	// result: (MOVDconst [1])
  5761  	for {
  5762  		if v_0.Op != OpPPC64FlagEQ {
  5763  			break
  5764  		}
  5765  		v.reset(OpPPC64MOVDconst)
  5766  		v.AuxInt = int64ToAuxInt(1)
  5767  		return true
  5768  	}
  5769  	// match: (Equal (FlagLT))
  5770  	// result: (MOVDconst [0])
  5771  	for {
  5772  		if v_0.Op != OpPPC64FlagLT {
  5773  			break
  5774  		}
  5775  		v.reset(OpPPC64MOVDconst)
  5776  		v.AuxInt = int64ToAuxInt(0)
  5777  		return true
  5778  	}
  5779  	// match: (Equal (FlagGT))
  5780  	// result: (MOVDconst [0])
  5781  	for {
  5782  		if v_0.Op != OpPPC64FlagGT {
  5783  			break
  5784  		}
  5785  		v.reset(OpPPC64MOVDconst)
  5786  		v.AuxInt = int64ToAuxInt(0)
  5787  		return true
  5788  	}
  5789  	// match: (Equal (InvertFlags x))
  5790  	// result: (Equal x)
  5791  	for {
  5792  		if v_0.Op != OpPPC64InvertFlags {
  5793  			break
  5794  		}
  5795  		x := v_0.Args[0]
  5796  		v.reset(OpPPC64Equal)
  5797  		v.AddArg(x)
  5798  		return true
  5799  	}
  5800  	// match: (Equal cmp)
  5801  	// result: (SETBC [2] cmp)
  5802  	for {
  5803  		cmp := v_0
  5804  		v.reset(OpPPC64SETBC)
  5805  		v.AuxInt = int32ToAuxInt(2)
  5806  		v.AddArg(cmp)
  5807  		return true
  5808  	}
  5809  }
  5810  func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
  5811  	v_0 := v.Args[0]
  5812  	// match: (FABS (FMOVDconst [x]))
  5813  	// result: (FMOVDconst [math.Abs(x)])
  5814  	for {
  5815  		if v_0.Op != OpPPC64FMOVDconst {
  5816  			break
  5817  		}
  5818  		x := auxIntToFloat64(v_0.AuxInt)
  5819  		v.reset(OpPPC64FMOVDconst)
  5820  		v.AuxInt = float64ToAuxInt(math.Abs(x))
  5821  		return true
  5822  	}
  5823  	return false
  5824  }
  5825  func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
  5826  	v_1 := v.Args[1]
  5827  	v_0 := v.Args[0]
  5828  	// match: (FADD (FMUL x y) z)
  5829  	// cond: x.Block.Func.useFMA(v)
  5830  	// result: (FMADD x y z)
  5831  	for {
  5832  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5833  			if v_0.Op != OpPPC64FMUL {
  5834  				continue
  5835  			}
  5836  			_ = v_0.Args[1]
  5837  			v_0_0 := v_0.Args[0]
  5838  			v_0_1 := v_0.Args[1]
  5839  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5840  				x := v_0_0
  5841  				y := v_0_1
  5842  				z := v_1
  5843  				if !(x.Block.Func.useFMA(v)) {
  5844  					continue
  5845  				}
  5846  				v.reset(OpPPC64FMADD)
  5847  				v.AddArg3(x, y, z)
  5848  				return true
  5849  			}
  5850  		}
  5851  		break
  5852  	}
  5853  	return false
  5854  }
  5855  func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
  5856  	v_1 := v.Args[1]
  5857  	v_0 := v.Args[0]
  5858  	// match: (FADDS (FMULS x y) z)
  5859  	// cond: x.Block.Func.useFMA(v)
  5860  	// result: (FMADDS x y z)
  5861  	for {
  5862  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5863  			if v_0.Op != OpPPC64FMULS {
  5864  				continue
  5865  			}
  5866  			_ = v_0.Args[1]
  5867  			v_0_0 := v_0.Args[0]
  5868  			v_0_1 := v_0.Args[1]
  5869  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5870  				x := v_0_0
  5871  				y := v_0_1
  5872  				z := v_1
  5873  				if !(x.Block.Func.useFMA(v)) {
  5874  					continue
  5875  				}
  5876  				v.reset(OpPPC64FMADDS)
  5877  				v.AddArg3(x, y, z)
  5878  				return true
  5879  			}
  5880  		}
  5881  		break
  5882  	}
  5883  	return false
  5884  }
  5885  func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
  5886  	v_0 := v.Args[0]
  5887  	// match: (FCEIL (FMOVDconst [x]))
  5888  	// result: (FMOVDconst [math.Ceil(x)])
  5889  	for {
  5890  		if v_0.Op != OpPPC64FMOVDconst {
  5891  			break
  5892  		}
  5893  		x := auxIntToFloat64(v_0.AuxInt)
  5894  		v.reset(OpPPC64FMOVDconst)
  5895  		v.AuxInt = float64ToAuxInt(math.Ceil(x))
  5896  		return true
  5897  	}
  5898  	return false
  5899  }
  5900  func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
  5901  	v_0 := v.Args[0]
  5902  	// match: (FFLOOR (FMOVDconst [x]))
  5903  	// result: (FMOVDconst [math.Floor(x)])
  5904  	for {
  5905  		if v_0.Op != OpPPC64FMOVDconst {
  5906  			break
  5907  		}
  5908  		x := auxIntToFloat64(v_0.AuxInt)
  5909  		v.reset(OpPPC64FMOVDconst)
  5910  		v.AuxInt = float64ToAuxInt(math.Floor(x))
  5911  		return true
  5912  	}
  5913  	return false
  5914  }
  5915  func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
  5916  	v_0 := v.Args[0]
  5917  	b := v.Block
  5918  	typ := &b.Func.Config.Types
  5919  	// match: (FGreaterEqual cmp)
  5920  	// result: (OR (SETBC [2] cmp) (SETBC [1] cmp))
  5921  	for {
  5922  		cmp := v_0
  5923  		v.reset(OpPPC64OR)
  5924  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5925  		v0.AuxInt = int32ToAuxInt(2)
  5926  		v0.AddArg(cmp)
  5927  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5928  		v1.AuxInt = int32ToAuxInt(1)
  5929  		v1.AddArg(cmp)
  5930  		v.AddArg2(v0, v1)
  5931  		return true
  5932  	}
  5933  }
  5934  func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
  5935  	v_0 := v.Args[0]
  5936  	// match: (FGreaterThan cmp)
  5937  	// result: (SETBC [1] cmp)
  5938  	for {
  5939  		cmp := v_0
  5940  		v.reset(OpPPC64SETBC)
  5941  		v.AuxInt = int32ToAuxInt(1)
  5942  		v.AddArg(cmp)
  5943  		return true
  5944  	}
  5945  }
  5946  func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
  5947  	v_0 := v.Args[0]
  5948  	b := v.Block
  5949  	typ := &b.Func.Config.Types
  5950  	// match: (FLessEqual cmp)
  5951  	// result: (OR (SETBC [2] cmp) (SETBC [0] cmp))
  5952  	for {
  5953  		cmp := v_0
  5954  		v.reset(OpPPC64OR)
  5955  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5956  		v0.AuxInt = int32ToAuxInt(2)
  5957  		v0.AddArg(cmp)
  5958  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5959  		v1.AuxInt = int32ToAuxInt(0)
  5960  		v1.AddArg(cmp)
  5961  		v.AddArg2(v0, v1)
  5962  		return true
  5963  	}
  5964  }
  5965  func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
  5966  	v_0 := v.Args[0]
  5967  	// match: (FLessThan cmp)
  5968  	// result: (SETBC [0] cmp)
  5969  	for {
  5970  		cmp := v_0
  5971  		v.reset(OpPPC64SETBC)
  5972  		v.AuxInt = int32ToAuxInt(0)
  5973  		v.AddArg(cmp)
  5974  		return true
  5975  	}
  5976  }
  5977  func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
  5978  	v_1 := v.Args[1]
  5979  	v_0 := v.Args[0]
  5980  	// match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _))
  5981  	// result: (MTVSRD x)
  5982  	for {
  5983  		off := auxIntToInt32(v.AuxInt)
  5984  		sym := auxToSym(v.Aux)
  5985  		ptr := v_0
  5986  		if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5987  			break
  5988  		}
  5989  		x := v_1.Args[1]
  5990  		if ptr != v_1.Args[0] {
  5991  			break
  5992  		}
  5993  		v.reset(OpPPC64MTVSRD)
  5994  		v.AddArg(x)
  5995  		return true
  5996  	}
  5997  	// match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5998  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5999  	// result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6000  	for {
  6001  		off1 := auxIntToInt32(v.AuxInt)
  6002  		sym1 := auxToSym(v.Aux)
  6003  		p := v_0
  6004  		if p.Op != OpPPC64MOVDaddr {
  6005  			break
  6006  		}
  6007  		off2 := auxIntToInt32(p.AuxInt)
  6008  		sym2 := auxToSym(p.Aux)
  6009  		ptr := p.Args[0]
  6010  		mem := v_1
  6011  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6012  			break
  6013  		}
  6014  		v.reset(OpPPC64FMOVDload)
  6015  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6016  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6017  		v.AddArg2(ptr, mem)
  6018  		return true
  6019  	}
  6020  	// match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  6021  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6022  	// result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
  6023  	for {
  6024  		off1 := auxIntToInt32(v.AuxInt)
  6025  		sym := auxToSym(v.Aux)
  6026  		if v_0.Op != OpPPC64ADDconst {
  6027  			break
  6028  		}
  6029  		off2 := auxIntToInt64(v_0.AuxInt)
  6030  		ptr := v_0.Args[0]
  6031  		mem := v_1
  6032  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6033  			break
  6034  		}
  6035  		v.reset(OpPPC64FMOVDload)
  6036  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6037  		v.Aux = symToAux(sym)
  6038  		v.AddArg2(ptr, mem)
  6039  		return true
  6040  	}
  6041  	return false
  6042  }
  6043  func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
  6044  	v_2 := v.Args[2]
  6045  	v_1 := v.Args[1]
  6046  	v_0 := v.Args[0]
  6047  	// match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem)
  6048  	// result: (MOVDstore [off] {sym} ptr x mem)
  6049  	for {
  6050  		off := auxIntToInt32(v.AuxInt)
  6051  		sym := auxToSym(v.Aux)
  6052  		ptr := v_0
  6053  		if v_1.Op != OpPPC64MTVSRD {
  6054  			break
  6055  		}
  6056  		x := v_1.Args[0]
  6057  		mem := v_2
  6058  		v.reset(OpPPC64MOVDstore)
  6059  		v.AuxInt = int32ToAuxInt(off)
  6060  		v.Aux = symToAux(sym)
  6061  		v.AddArg3(ptr, x, mem)
  6062  		return true
  6063  	}
  6064  	// match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  6065  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6066  	// result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
  6067  	for {
  6068  		off1 := auxIntToInt32(v.AuxInt)
  6069  		sym := auxToSym(v.Aux)
  6070  		if v_0.Op != OpPPC64ADDconst {
  6071  			break
  6072  		}
  6073  		off2 := auxIntToInt64(v_0.AuxInt)
  6074  		ptr := v_0.Args[0]
  6075  		val := v_1
  6076  		mem := v_2
  6077  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6078  			break
  6079  		}
  6080  		v.reset(OpPPC64FMOVDstore)
  6081  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6082  		v.Aux = symToAux(sym)
  6083  		v.AddArg3(ptr, val, mem)
  6084  		return true
  6085  	}
  6086  	// match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  6087  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6088  	// result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  6089  	for {
  6090  		off1 := auxIntToInt32(v.AuxInt)
  6091  		sym1 := auxToSym(v.Aux)
  6092  		p := v_0
  6093  		if p.Op != OpPPC64MOVDaddr {
  6094  			break
  6095  		}
  6096  		off2 := auxIntToInt32(p.AuxInt)
  6097  		sym2 := auxToSym(p.Aux)
  6098  		ptr := p.Args[0]
  6099  		val := v_1
  6100  		mem := v_2
  6101  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6102  			break
  6103  		}
  6104  		v.reset(OpPPC64FMOVDstore)
  6105  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6106  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6107  		v.AddArg3(ptr, val, mem)
  6108  		return true
  6109  	}
  6110  	return false
  6111  }
  6112  func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
  6113  	v_1 := v.Args[1]
  6114  	v_0 := v.Args[0]
  6115  	// match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  6116  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6117  	// result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6118  	for {
  6119  		off1 := auxIntToInt32(v.AuxInt)
  6120  		sym1 := auxToSym(v.Aux)
  6121  		p := v_0
  6122  		if p.Op != OpPPC64MOVDaddr {
  6123  			break
  6124  		}
  6125  		off2 := auxIntToInt32(p.AuxInt)
  6126  		sym2 := auxToSym(p.Aux)
  6127  		ptr := p.Args[0]
  6128  		mem := v_1
  6129  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6130  			break
  6131  		}
  6132  		v.reset(OpPPC64FMOVSload)
  6133  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6134  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6135  		v.AddArg2(ptr, mem)
  6136  		return true
  6137  	}
  6138  	// match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
  6139  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6140  	// result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
  6141  	for {
  6142  		off1 := auxIntToInt32(v.AuxInt)
  6143  		sym := auxToSym(v.Aux)
  6144  		if v_0.Op != OpPPC64ADDconst {
  6145  			break
  6146  		}
  6147  		off2 := auxIntToInt64(v_0.AuxInt)
  6148  		ptr := v_0.Args[0]
  6149  		mem := v_1
  6150  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6151  			break
  6152  		}
  6153  		v.reset(OpPPC64FMOVSload)
  6154  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6155  		v.Aux = symToAux(sym)
  6156  		v.AddArg2(ptr, mem)
  6157  		return true
  6158  	}
  6159  	return false
  6160  }
  6161  func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
  6162  	v_2 := v.Args[2]
  6163  	v_1 := v.Args[1]
  6164  	v_0 := v.Args[0]
  6165  	// match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  6166  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6167  	// result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
  6168  	for {
  6169  		off1 := auxIntToInt32(v.AuxInt)
  6170  		sym := auxToSym(v.Aux)
  6171  		if v_0.Op != OpPPC64ADDconst {
  6172  			break
  6173  		}
  6174  		off2 := auxIntToInt64(v_0.AuxInt)
  6175  		ptr := v_0.Args[0]
  6176  		val := v_1
  6177  		mem := v_2
  6178  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6179  			break
  6180  		}
  6181  		v.reset(OpPPC64FMOVSstore)
  6182  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6183  		v.Aux = symToAux(sym)
  6184  		v.AddArg3(ptr, val, mem)
  6185  		return true
  6186  	}
  6187  	// match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  6188  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6189  	// result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  6190  	for {
  6191  		off1 := auxIntToInt32(v.AuxInt)
  6192  		sym1 := auxToSym(v.Aux)
  6193  		p := v_0
  6194  		if p.Op != OpPPC64MOVDaddr {
  6195  			break
  6196  		}
  6197  		off2 := auxIntToInt32(p.AuxInt)
  6198  		sym2 := auxToSym(p.Aux)
  6199  		ptr := p.Args[0]
  6200  		val := v_1
  6201  		mem := v_2
  6202  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6203  			break
  6204  		}
  6205  		v.reset(OpPPC64FMOVSstore)
  6206  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6207  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6208  		v.AddArg3(ptr, val, mem)
  6209  		return true
  6210  	}
  6211  	return false
  6212  }
  6213  func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
  6214  	v_0 := v.Args[0]
  6215  	// match: (FNEG (FABS x))
  6216  	// result: (FNABS x)
  6217  	for {
  6218  		if v_0.Op != OpPPC64FABS {
  6219  			break
  6220  		}
  6221  		x := v_0.Args[0]
  6222  		v.reset(OpPPC64FNABS)
  6223  		v.AddArg(x)
  6224  		return true
  6225  	}
  6226  	// match: (FNEG (FNABS x))
  6227  	// result: (FABS x)
  6228  	for {
  6229  		if v_0.Op != OpPPC64FNABS {
  6230  			break
  6231  		}
  6232  		x := v_0.Args[0]
  6233  		v.reset(OpPPC64FABS)
  6234  		v.AddArg(x)
  6235  		return true
  6236  	}
  6237  	return false
  6238  }
  6239  func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
  6240  	v_0 := v.Args[0]
  6241  	// match: (FSQRT (FMOVDconst [x]))
  6242  	// cond: x >= 0
  6243  	// result: (FMOVDconst [math.Sqrt(x)])
  6244  	for {
  6245  		if v_0.Op != OpPPC64FMOVDconst {
  6246  			break
  6247  		}
  6248  		x := auxIntToFloat64(v_0.AuxInt)
  6249  		if !(x >= 0) {
  6250  			break
  6251  		}
  6252  		v.reset(OpPPC64FMOVDconst)
  6253  		v.AuxInt = float64ToAuxInt(math.Sqrt(x))
  6254  		return true
  6255  	}
  6256  	return false
  6257  }
  6258  func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
  6259  	v_1 := v.Args[1]
  6260  	v_0 := v.Args[0]
  6261  	// match: (FSUB (FMUL x y) z)
  6262  	// cond: x.Block.Func.useFMA(v)
  6263  	// result: (FMSUB x y z)
  6264  	for {
  6265  		if v_0.Op != OpPPC64FMUL {
  6266  			break
  6267  		}
  6268  		_ = v_0.Args[1]
  6269  		v_0_0 := v_0.Args[0]
  6270  		v_0_1 := v_0.Args[1]
  6271  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6272  			x := v_0_0
  6273  			y := v_0_1
  6274  			z := v_1
  6275  			if !(x.Block.Func.useFMA(v)) {
  6276  				continue
  6277  			}
  6278  			v.reset(OpPPC64FMSUB)
  6279  			v.AddArg3(x, y, z)
  6280  			return true
  6281  		}
  6282  		break
  6283  	}
  6284  	return false
  6285  }
  6286  func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
  6287  	v_1 := v.Args[1]
  6288  	v_0 := v.Args[0]
  6289  	// match: (FSUBS (FMULS x y) z)
  6290  	// cond: x.Block.Func.useFMA(v)
  6291  	// result: (FMSUBS x y z)
  6292  	for {
  6293  		if v_0.Op != OpPPC64FMULS {
  6294  			break
  6295  		}
  6296  		_ = v_0.Args[1]
  6297  		v_0_0 := v_0.Args[0]
  6298  		v_0_1 := v_0.Args[1]
  6299  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6300  			x := v_0_0
  6301  			y := v_0_1
  6302  			z := v_1
  6303  			if !(x.Block.Func.useFMA(v)) {
  6304  				continue
  6305  			}
  6306  			v.reset(OpPPC64FMSUBS)
  6307  			v.AddArg3(x, y, z)
  6308  			return true
  6309  		}
  6310  		break
  6311  	}
  6312  	return false
  6313  }
  6314  func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
  6315  	v_0 := v.Args[0]
  6316  	// match: (FTRUNC (FMOVDconst [x]))
  6317  	// result: (FMOVDconst [math.Trunc(x)])
  6318  	for {
  6319  		if v_0.Op != OpPPC64FMOVDconst {
  6320  			break
  6321  		}
  6322  		x := auxIntToFloat64(v_0.AuxInt)
  6323  		v.reset(OpPPC64FMOVDconst)
  6324  		v.AuxInt = float64ToAuxInt(math.Trunc(x))
  6325  		return true
  6326  	}
  6327  	return false
  6328  }
  6329  func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
  6330  	v_0 := v.Args[0]
  6331  	// match: (GreaterEqual (FlagEQ))
  6332  	// result: (MOVDconst [1])
  6333  	for {
  6334  		if v_0.Op != OpPPC64FlagEQ {
  6335  			break
  6336  		}
  6337  		v.reset(OpPPC64MOVDconst)
  6338  		v.AuxInt = int64ToAuxInt(1)
  6339  		return true
  6340  	}
  6341  	// match: (GreaterEqual (FlagLT))
  6342  	// result: (MOVDconst [0])
  6343  	for {
  6344  		if v_0.Op != OpPPC64FlagLT {
  6345  			break
  6346  		}
  6347  		v.reset(OpPPC64MOVDconst)
  6348  		v.AuxInt = int64ToAuxInt(0)
  6349  		return true
  6350  	}
  6351  	// match: (GreaterEqual (FlagGT))
  6352  	// result: (MOVDconst [1])
  6353  	for {
  6354  		if v_0.Op != OpPPC64FlagGT {
  6355  			break
  6356  		}
  6357  		v.reset(OpPPC64MOVDconst)
  6358  		v.AuxInt = int64ToAuxInt(1)
  6359  		return true
  6360  	}
  6361  	// match: (GreaterEqual (InvertFlags x))
  6362  	// result: (LessEqual x)
  6363  	for {
  6364  		if v_0.Op != OpPPC64InvertFlags {
  6365  			break
  6366  		}
  6367  		x := v_0.Args[0]
  6368  		v.reset(OpPPC64LessEqual)
  6369  		v.AddArg(x)
  6370  		return true
  6371  	}
  6372  	// match: (GreaterEqual cmp)
  6373  	// result: (SETBCR [0] cmp)
  6374  	for {
  6375  		cmp := v_0
  6376  		v.reset(OpPPC64SETBCR)
  6377  		v.AuxInt = int32ToAuxInt(0)
  6378  		v.AddArg(cmp)
  6379  		return true
  6380  	}
  6381  }
  6382  func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
  6383  	v_0 := v.Args[0]
  6384  	// match: (GreaterThan (FlagEQ))
  6385  	// result: (MOVDconst [0])
  6386  	for {
  6387  		if v_0.Op != OpPPC64FlagEQ {
  6388  			break
  6389  		}
  6390  		v.reset(OpPPC64MOVDconst)
  6391  		v.AuxInt = int64ToAuxInt(0)
  6392  		return true
  6393  	}
  6394  	// match: (GreaterThan (FlagLT))
  6395  	// result: (MOVDconst [0])
  6396  	for {
  6397  		if v_0.Op != OpPPC64FlagLT {
  6398  			break
  6399  		}
  6400  		v.reset(OpPPC64MOVDconst)
  6401  		v.AuxInt = int64ToAuxInt(0)
  6402  		return true
  6403  	}
  6404  	// match: (GreaterThan (FlagGT))
  6405  	// result: (MOVDconst [1])
  6406  	for {
  6407  		if v_0.Op != OpPPC64FlagGT {
  6408  			break
  6409  		}
  6410  		v.reset(OpPPC64MOVDconst)
  6411  		v.AuxInt = int64ToAuxInt(1)
  6412  		return true
  6413  	}
  6414  	// match: (GreaterThan (InvertFlags x))
  6415  	// result: (LessThan x)
  6416  	for {
  6417  		if v_0.Op != OpPPC64InvertFlags {
  6418  			break
  6419  		}
  6420  		x := v_0.Args[0]
  6421  		v.reset(OpPPC64LessThan)
  6422  		v.AddArg(x)
  6423  		return true
  6424  	}
  6425  	// match: (GreaterThan cmp)
  6426  	// result: (SETBC [1] cmp)
  6427  	for {
  6428  		cmp := v_0
  6429  		v.reset(OpPPC64SETBC)
  6430  		v.AuxInt = int32ToAuxInt(1)
  6431  		v.AddArg(cmp)
  6432  		return true
  6433  	}
  6434  }
  6435  func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
  6436  	v_2 := v.Args[2]
  6437  	v_1 := v.Args[1]
  6438  	v_0 := v.Args[0]
  6439  	// match: (ISEL [6] x y (CMPconst [0] (ANDconst [1] (SETBC [c] cmp))))
  6440  	// result: (ISEL [c] x y cmp)
  6441  	for {
  6442  		if auxIntToInt32(v.AuxInt) != 6 {
  6443  			break
  6444  		}
  6445  		x := v_0
  6446  		y := v_1
  6447  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6448  			break
  6449  		}
  6450  		v_2_0 := v_2.Args[0]
  6451  		if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != 1 {
  6452  			break
  6453  		}
  6454  		v_2_0_0 := v_2_0.Args[0]
  6455  		if v_2_0_0.Op != OpPPC64SETBC {
  6456  			break
  6457  		}
  6458  		c := auxIntToInt32(v_2_0_0.AuxInt)
  6459  		cmp := v_2_0_0.Args[0]
  6460  		v.reset(OpPPC64ISEL)
  6461  		v.AuxInt = int32ToAuxInt(c)
  6462  		v.AddArg3(x, y, cmp)
  6463  		return true
  6464  	}
  6465  	// match: (ISEL [6] x y (CMPconst [0] (SETBC [c] cmp)))
  6466  	// result: (ISEL [c] x y cmp)
  6467  	for {
  6468  		if auxIntToInt32(v.AuxInt) != 6 {
  6469  			break
  6470  		}
  6471  		x := v_0
  6472  		y := v_1
  6473  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6474  			break
  6475  		}
  6476  		v_2_0 := v_2.Args[0]
  6477  		if v_2_0.Op != OpPPC64SETBC {
  6478  			break
  6479  		}
  6480  		c := auxIntToInt32(v_2_0.AuxInt)
  6481  		cmp := v_2_0.Args[0]
  6482  		v.reset(OpPPC64ISEL)
  6483  		v.AuxInt = int32ToAuxInt(c)
  6484  		v.AddArg3(x, y, cmp)
  6485  		return true
  6486  	}
  6487  	// match: (ISEL [6] x y (CMPWconst [0] (SETBC [c] cmp)))
  6488  	// result: (ISEL [c] x y cmp)
  6489  	for {
  6490  		if auxIntToInt32(v.AuxInt) != 6 {
  6491  			break
  6492  		}
  6493  		x := v_0
  6494  		y := v_1
  6495  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6496  			break
  6497  		}
  6498  		v_2_0 := v_2.Args[0]
  6499  		if v_2_0.Op != OpPPC64SETBC {
  6500  			break
  6501  		}
  6502  		c := auxIntToInt32(v_2_0.AuxInt)
  6503  		cmp := v_2_0.Args[0]
  6504  		v.reset(OpPPC64ISEL)
  6505  		v.AuxInt = int32ToAuxInt(c)
  6506  		v.AddArg3(x, y, cmp)
  6507  		return true
  6508  	}
  6509  	// match: (ISEL [6] x y (CMPconst [0] (SETBCR [c] cmp)))
  6510  	// result: (ISEL [c+4] x y cmp)
  6511  	for {
  6512  		if auxIntToInt32(v.AuxInt) != 6 {
  6513  			break
  6514  		}
  6515  		x := v_0
  6516  		y := v_1
  6517  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6518  			break
  6519  		}
  6520  		v_2_0 := v_2.Args[0]
  6521  		if v_2_0.Op != OpPPC64SETBCR {
  6522  			break
  6523  		}
  6524  		c := auxIntToInt32(v_2_0.AuxInt)
  6525  		cmp := v_2_0.Args[0]
  6526  		v.reset(OpPPC64ISEL)
  6527  		v.AuxInt = int32ToAuxInt(c + 4)
  6528  		v.AddArg3(x, y, cmp)
  6529  		return true
  6530  	}
  6531  	// match: (ISEL [6] x y (CMPWconst [0] (SETBCR [c] cmp)))
  6532  	// result: (ISEL [c+4] x y cmp)
  6533  	for {
  6534  		if auxIntToInt32(v.AuxInt) != 6 {
  6535  			break
  6536  		}
  6537  		x := v_0
  6538  		y := v_1
  6539  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6540  			break
  6541  		}
  6542  		v_2_0 := v_2.Args[0]
  6543  		if v_2_0.Op != OpPPC64SETBCR {
  6544  			break
  6545  		}
  6546  		c := auxIntToInt32(v_2_0.AuxInt)
  6547  		cmp := v_2_0.Args[0]
  6548  		v.reset(OpPPC64ISEL)
  6549  		v.AuxInt = int32ToAuxInt(c + 4)
  6550  		v.AddArg3(x, y, cmp)
  6551  		return true
  6552  	}
  6553  	// match: (ISEL [2] x _ (FlagEQ))
  6554  	// result: x
  6555  	for {
  6556  		if auxIntToInt32(v.AuxInt) != 2 {
  6557  			break
  6558  		}
  6559  		x := v_0
  6560  		if v_2.Op != OpPPC64FlagEQ {
  6561  			break
  6562  		}
  6563  		v.copyOf(x)
  6564  		return true
  6565  	}
  6566  	// match: (ISEL [2] _ y (FlagLT))
  6567  	// result: y
  6568  	for {
  6569  		if auxIntToInt32(v.AuxInt) != 2 {
  6570  			break
  6571  		}
  6572  		y := v_1
  6573  		if v_2.Op != OpPPC64FlagLT {
  6574  			break
  6575  		}
  6576  		v.copyOf(y)
  6577  		return true
  6578  	}
  6579  	// match: (ISEL [2] _ y (FlagGT))
  6580  	// result: y
  6581  	for {
  6582  		if auxIntToInt32(v.AuxInt) != 2 {
  6583  			break
  6584  		}
  6585  		y := v_1
  6586  		if v_2.Op != OpPPC64FlagGT {
  6587  			break
  6588  		}
  6589  		v.copyOf(y)
  6590  		return true
  6591  	}
  6592  	// match: (ISEL [6] _ y (FlagEQ))
  6593  	// result: y
  6594  	for {
  6595  		if auxIntToInt32(v.AuxInt) != 6 {
  6596  			break
  6597  		}
  6598  		y := v_1
  6599  		if v_2.Op != OpPPC64FlagEQ {
  6600  			break
  6601  		}
  6602  		v.copyOf(y)
  6603  		return true
  6604  	}
  6605  	// match: (ISEL [6] x _ (FlagLT))
  6606  	// result: x
  6607  	for {
  6608  		if auxIntToInt32(v.AuxInt) != 6 {
  6609  			break
  6610  		}
  6611  		x := v_0
  6612  		if v_2.Op != OpPPC64FlagLT {
  6613  			break
  6614  		}
  6615  		v.copyOf(x)
  6616  		return true
  6617  	}
  6618  	// match: (ISEL [6] x _ (FlagGT))
  6619  	// result: x
  6620  	for {
  6621  		if auxIntToInt32(v.AuxInt) != 6 {
  6622  			break
  6623  		}
  6624  		x := v_0
  6625  		if v_2.Op != OpPPC64FlagGT {
  6626  			break
  6627  		}
  6628  		v.copyOf(x)
  6629  		return true
  6630  	}
  6631  	// match: (ISEL [0] _ y (FlagEQ))
  6632  	// result: y
  6633  	for {
  6634  		if auxIntToInt32(v.AuxInt) != 0 {
  6635  			break
  6636  		}
  6637  		y := v_1
  6638  		if v_2.Op != OpPPC64FlagEQ {
  6639  			break
  6640  		}
  6641  		v.copyOf(y)
  6642  		return true
  6643  	}
  6644  	// match: (ISEL [0] _ y (FlagGT))
  6645  	// result: y
  6646  	for {
  6647  		if auxIntToInt32(v.AuxInt) != 0 {
  6648  			break
  6649  		}
  6650  		y := v_1
  6651  		if v_2.Op != OpPPC64FlagGT {
  6652  			break
  6653  		}
  6654  		v.copyOf(y)
  6655  		return true
  6656  	}
  6657  	// match: (ISEL [0] x _ (FlagLT))
  6658  	// result: x
  6659  	for {
  6660  		if auxIntToInt32(v.AuxInt) != 0 {
  6661  			break
  6662  		}
  6663  		x := v_0
  6664  		if v_2.Op != OpPPC64FlagLT {
  6665  			break
  6666  		}
  6667  		v.copyOf(x)
  6668  		return true
  6669  	}
  6670  	// match: (ISEL [5] _ x (FlagEQ))
  6671  	// result: x
  6672  	for {
  6673  		if auxIntToInt32(v.AuxInt) != 5 {
  6674  			break
  6675  		}
  6676  		x := v_1
  6677  		if v_2.Op != OpPPC64FlagEQ {
  6678  			break
  6679  		}
  6680  		v.copyOf(x)
  6681  		return true
  6682  	}
  6683  	// match: (ISEL [5] _ x (FlagLT))
  6684  	// result: x
  6685  	for {
  6686  		if auxIntToInt32(v.AuxInt) != 5 {
  6687  			break
  6688  		}
  6689  		x := v_1
  6690  		if v_2.Op != OpPPC64FlagLT {
  6691  			break
  6692  		}
  6693  		v.copyOf(x)
  6694  		return true
  6695  	}
  6696  	// match: (ISEL [5] y _ (FlagGT))
  6697  	// result: y
  6698  	for {
  6699  		if auxIntToInt32(v.AuxInt) != 5 {
  6700  			break
  6701  		}
  6702  		y := v_0
  6703  		if v_2.Op != OpPPC64FlagGT {
  6704  			break
  6705  		}
  6706  		v.copyOf(y)
  6707  		return true
  6708  	}
  6709  	// match: (ISEL [1] _ y (FlagEQ))
  6710  	// result: y
  6711  	for {
  6712  		if auxIntToInt32(v.AuxInt) != 1 {
  6713  			break
  6714  		}
  6715  		y := v_1
  6716  		if v_2.Op != OpPPC64FlagEQ {
  6717  			break
  6718  		}
  6719  		v.copyOf(y)
  6720  		return true
  6721  	}
  6722  	// match: (ISEL [1] _ y (FlagLT))
  6723  	// result: y
  6724  	for {
  6725  		if auxIntToInt32(v.AuxInt) != 1 {
  6726  			break
  6727  		}
  6728  		y := v_1
  6729  		if v_2.Op != OpPPC64FlagLT {
  6730  			break
  6731  		}
  6732  		v.copyOf(y)
  6733  		return true
  6734  	}
  6735  	// match: (ISEL [1] x _ (FlagGT))
  6736  	// result: x
  6737  	for {
  6738  		if auxIntToInt32(v.AuxInt) != 1 {
  6739  			break
  6740  		}
  6741  		x := v_0
  6742  		if v_2.Op != OpPPC64FlagGT {
  6743  			break
  6744  		}
  6745  		v.copyOf(x)
  6746  		return true
  6747  	}
  6748  	// match: (ISEL [4] x _ (FlagEQ))
  6749  	// result: x
  6750  	for {
  6751  		if auxIntToInt32(v.AuxInt) != 4 {
  6752  			break
  6753  		}
  6754  		x := v_0
  6755  		if v_2.Op != OpPPC64FlagEQ {
  6756  			break
  6757  		}
  6758  		v.copyOf(x)
  6759  		return true
  6760  	}
  6761  	// match: (ISEL [4] x _ (FlagGT))
  6762  	// result: x
  6763  	for {
  6764  		if auxIntToInt32(v.AuxInt) != 4 {
  6765  			break
  6766  		}
  6767  		x := v_0
  6768  		if v_2.Op != OpPPC64FlagGT {
  6769  			break
  6770  		}
  6771  		v.copyOf(x)
  6772  		return true
  6773  	}
  6774  	// match: (ISEL [4] _ y (FlagLT))
  6775  	// result: y
  6776  	for {
  6777  		if auxIntToInt32(v.AuxInt) != 4 {
  6778  			break
  6779  		}
  6780  		y := v_1
  6781  		if v_2.Op != OpPPC64FlagLT {
  6782  			break
  6783  		}
  6784  		v.copyOf(y)
  6785  		return true
  6786  	}
  6787  	// match: (ISEL [n] x y (InvertFlags bool))
  6788  	// cond: n%4 == 0
  6789  	// result: (ISEL [n+1] x y bool)
  6790  	for {
  6791  		n := auxIntToInt32(v.AuxInt)
  6792  		x := v_0
  6793  		y := v_1
  6794  		if v_2.Op != OpPPC64InvertFlags {
  6795  			break
  6796  		}
  6797  		bool := v_2.Args[0]
  6798  		if !(n%4 == 0) {
  6799  			break
  6800  		}
  6801  		v.reset(OpPPC64ISEL)
  6802  		v.AuxInt = int32ToAuxInt(n + 1)
  6803  		v.AddArg3(x, y, bool)
  6804  		return true
  6805  	}
  6806  	// match: (ISEL [n] x y (InvertFlags bool))
  6807  	// cond: n%4 == 1
  6808  	// result: (ISEL [n-1] x y bool)
  6809  	for {
  6810  		n := auxIntToInt32(v.AuxInt)
  6811  		x := v_0
  6812  		y := v_1
  6813  		if v_2.Op != OpPPC64InvertFlags {
  6814  			break
  6815  		}
  6816  		bool := v_2.Args[0]
  6817  		if !(n%4 == 1) {
  6818  			break
  6819  		}
  6820  		v.reset(OpPPC64ISEL)
  6821  		v.AuxInt = int32ToAuxInt(n - 1)
  6822  		v.AddArg3(x, y, bool)
  6823  		return true
  6824  	}
  6825  	// match: (ISEL [n] x y (InvertFlags bool))
  6826  	// cond: n%4 == 2
  6827  	// result: (ISEL [n] x y bool)
  6828  	for {
  6829  		n := auxIntToInt32(v.AuxInt)
  6830  		x := v_0
  6831  		y := v_1
  6832  		if v_2.Op != OpPPC64InvertFlags {
  6833  			break
  6834  		}
  6835  		bool := v_2.Args[0]
  6836  		if !(n%4 == 2) {
  6837  			break
  6838  		}
  6839  		v.reset(OpPPC64ISEL)
  6840  		v.AuxInt = int32ToAuxInt(n)
  6841  		v.AddArg3(x, y, bool)
  6842  		return true
  6843  	}
  6844  	return false
  6845  }
  6846  func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
  6847  	v_0 := v.Args[0]
  6848  	// match: (LessEqual (FlagEQ))
  6849  	// result: (MOVDconst [1])
  6850  	for {
  6851  		if v_0.Op != OpPPC64FlagEQ {
  6852  			break
  6853  		}
  6854  		v.reset(OpPPC64MOVDconst)
  6855  		v.AuxInt = int64ToAuxInt(1)
  6856  		return true
  6857  	}
  6858  	// match: (LessEqual (FlagLT))
  6859  	// result: (MOVDconst [1])
  6860  	for {
  6861  		if v_0.Op != OpPPC64FlagLT {
  6862  			break
  6863  		}
  6864  		v.reset(OpPPC64MOVDconst)
  6865  		v.AuxInt = int64ToAuxInt(1)
  6866  		return true
  6867  	}
  6868  	// match: (LessEqual (FlagGT))
  6869  	// result: (MOVDconst [0])
  6870  	for {
  6871  		if v_0.Op != OpPPC64FlagGT {
  6872  			break
  6873  		}
  6874  		v.reset(OpPPC64MOVDconst)
  6875  		v.AuxInt = int64ToAuxInt(0)
  6876  		return true
  6877  	}
  6878  	// match: (LessEqual (InvertFlags x))
  6879  	// result: (GreaterEqual x)
  6880  	for {
  6881  		if v_0.Op != OpPPC64InvertFlags {
  6882  			break
  6883  		}
  6884  		x := v_0.Args[0]
  6885  		v.reset(OpPPC64GreaterEqual)
  6886  		v.AddArg(x)
  6887  		return true
  6888  	}
  6889  	// match: (LessEqual cmp)
  6890  	// result: (SETBCR [1] cmp)
  6891  	for {
  6892  		cmp := v_0
  6893  		v.reset(OpPPC64SETBCR)
  6894  		v.AuxInt = int32ToAuxInt(1)
  6895  		v.AddArg(cmp)
  6896  		return true
  6897  	}
  6898  }
  6899  func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
  6900  	v_0 := v.Args[0]
  6901  	// match: (LessThan (FlagEQ))
  6902  	// result: (MOVDconst [0])
  6903  	for {
  6904  		if v_0.Op != OpPPC64FlagEQ {
  6905  			break
  6906  		}
  6907  		v.reset(OpPPC64MOVDconst)
  6908  		v.AuxInt = int64ToAuxInt(0)
  6909  		return true
  6910  	}
  6911  	// match: (LessThan (FlagLT))
  6912  	// result: (MOVDconst [1])
  6913  	for {
  6914  		if v_0.Op != OpPPC64FlagLT {
  6915  			break
  6916  		}
  6917  		v.reset(OpPPC64MOVDconst)
  6918  		v.AuxInt = int64ToAuxInt(1)
  6919  		return true
  6920  	}
  6921  	// match: (LessThan (FlagGT))
  6922  	// result: (MOVDconst [0])
  6923  	for {
  6924  		if v_0.Op != OpPPC64FlagGT {
  6925  			break
  6926  		}
  6927  		v.reset(OpPPC64MOVDconst)
  6928  		v.AuxInt = int64ToAuxInt(0)
  6929  		return true
  6930  	}
  6931  	// match: (LessThan (InvertFlags x))
  6932  	// result: (GreaterThan x)
  6933  	for {
  6934  		if v_0.Op != OpPPC64InvertFlags {
  6935  			break
  6936  		}
  6937  		x := v_0.Args[0]
  6938  		v.reset(OpPPC64GreaterThan)
  6939  		v.AddArg(x)
  6940  		return true
  6941  	}
  6942  	// match: (LessThan cmp)
  6943  	// result: (SETBC [0] cmp)
  6944  	for {
  6945  		cmp := v_0
  6946  		v.reset(OpPPC64SETBC)
  6947  		v.AuxInt = int32ToAuxInt(0)
  6948  		v.AddArg(cmp)
  6949  		return true
  6950  	}
  6951  }
  6952  func rewriteValuePPC64_OpPPC64LoweredPanicBoundsCR(v *Value) bool {
  6953  	v_1 := v.Args[1]
  6954  	v_0 := v.Args[0]
  6955  	// match: (LoweredPanicBoundsCR [kind] {p} (MOVDconst [c]) mem)
  6956  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:p.C, Cy:c}} mem)
  6957  	for {
  6958  		kind := auxIntToInt64(v.AuxInt)
  6959  		p := auxToPanicBoundsC(v.Aux)
  6960  		if v_0.Op != OpPPC64MOVDconst {
  6961  			break
  6962  		}
  6963  		c := auxIntToInt64(v_0.AuxInt)
  6964  		mem := v_1
  6965  		v.reset(OpPPC64LoweredPanicBoundsCC)
  6966  		v.AuxInt = int64ToAuxInt(kind)
  6967  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: p.C, Cy: c})
  6968  		v.AddArg(mem)
  6969  		return true
  6970  	}
  6971  	return false
  6972  }
  6973  func rewriteValuePPC64_OpPPC64LoweredPanicBoundsRC(v *Value) bool {
  6974  	v_1 := v.Args[1]
  6975  	v_0 := v.Args[0]
  6976  	// match: (LoweredPanicBoundsRC [kind] {p} (MOVDconst [c]) mem)
  6977  	// result: (LoweredPanicBoundsCC [kind] {PanicBoundsCC{Cx:c, Cy:p.C}} mem)
  6978  	for {
  6979  		kind := auxIntToInt64(v.AuxInt)
  6980  		p := auxToPanicBoundsC(v.Aux)
  6981  		if v_0.Op != OpPPC64MOVDconst {
  6982  			break
  6983  		}
  6984  		c := auxIntToInt64(v_0.AuxInt)
  6985  		mem := v_1
  6986  		v.reset(OpPPC64LoweredPanicBoundsCC)
  6987  		v.AuxInt = int64ToAuxInt(kind)
  6988  		v.Aux = panicBoundsCCToAux(PanicBoundsCC{Cx: c, Cy: p.C})
  6989  		v.AddArg(mem)
  6990  		return true
  6991  	}
  6992  	return false
  6993  }
  6994  func rewriteValuePPC64_OpPPC64LoweredPanicBoundsRR(v *Value) bool {
  6995  	v_2 := v.Args[2]
  6996  	v_1 := v.Args[1]
  6997  	v_0 := v.Args[0]
  6998  	// match: (LoweredPanicBoundsRR [kind] x (MOVDconst [c]) mem)
  6999  	// result: (LoweredPanicBoundsRC [kind] x {PanicBoundsC{C:c}} mem)
  7000  	for {
  7001  		kind := auxIntToInt64(v.AuxInt)
  7002  		x := v_0
  7003  		if v_1.Op != OpPPC64MOVDconst {
  7004  			break
  7005  		}
  7006  		c := auxIntToInt64(v_1.AuxInt)
  7007  		mem := v_2
  7008  		v.reset(OpPPC64LoweredPanicBoundsRC)
  7009  		v.AuxInt = int64ToAuxInt(kind)
  7010  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  7011  		v.AddArg2(x, mem)
  7012  		return true
  7013  	}
  7014  	// match: (LoweredPanicBoundsRR [kind] (MOVDconst [c]) y mem)
  7015  	// result: (LoweredPanicBoundsCR [kind] {PanicBoundsC{C:c}} y mem)
  7016  	for {
  7017  		kind := auxIntToInt64(v.AuxInt)
  7018  		if v_0.Op != OpPPC64MOVDconst {
  7019  			break
  7020  		}
  7021  		c := auxIntToInt64(v_0.AuxInt)
  7022  		y := v_1
  7023  		mem := v_2
  7024  		v.reset(OpPPC64LoweredPanicBoundsCR)
  7025  		v.AuxInt = int64ToAuxInt(kind)
  7026  		v.Aux = panicBoundsCToAux(PanicBoundsC{C: c})
  7027  		v.AddArg2(y, mem)
  7028  		return true
  7029  	}
  7030  	return false
  7031  }
  7032  func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
  7033  	v_0 := v.Args[0]
  7034  	b := v.Block
  7035  	typ := &b.Func.Config.Types
  7036  	// match: (MFVSRD (FMOVDconst [c]))
  7037  	// result: (MOVDconst [int64(math.Float64bits(c))])
  7038  	for {
  7039  		if v_0.Op != OpPPC64FMOVDconst {
  7040  			break
  7041  		}
  7042  		c := auxIntToFloat64(v_0.AuxInt)
  7043  		v.reset(OpPPC64MOVDconst)
  7044  		v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
  7045  		return true
  7046  	}
  7047  	// match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem))
  7048  	// cond: x.Uses == 1 && clobber(x)
  7049  	// result: @x.Block (MOVDload [off] {sym} ptr mem)
  7050  	for {
  7051  		x := v_0
  7052  		if x.Op != OpPPC64FMOVDload {
  7053  			break
  7054  		}
  7055  		off := auxIntToInt32(x.AuxInt)
  7056  		sym := auxToSym(x.Aux)
  7057  		mem := x.Args[1]
  7058  		ptr := x.Args[0]
  7059  		if !(x.Uses == 1 && clobber(x)) {
  7060  			break
  7061  		}
  7062  		b = x.Block
  7063  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
  7064  		v.copyOf(v0)
  7065  		v0.AuxInt = int32ToAuxInt(off)
  7066  		v0.Aux = symToAux(sym)
  7067  		v0.AddArg2(ptr, mem)
  7068  		return true
  7069  	}
  7070  	return false
  7071  }
  7072  func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
  7073  	v_1 := v.Args[1]
  7074  	v_0 := v.Args[0]
  7075  	// match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  7076  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  7077  	// result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  7078  	for {
  7079  		off1 := auxIntToInt32(v.AuxInt)
  7080  		sym1 := auxToSym(v.Aux)
  7081  		p := v_0
  7082  		if p.Op != OpPPC64MOVDaddr {
  7083  			break
  7084  		}
  7085  		off2 := auxIntToInt32(p.AuxInt)
  7086  		sym2 := auxToSym(p.Aux)
  7087  		ptr := p.Args[0]
  7088  		mem := v_1
  7089  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  7090  			break
  7091  		}
  7092  		v.reset(OpPPC64MOVBZload)
  7093  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7094  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7095  		v.AddArg2(ptr, mem)
  7096  		return true
  7097  	}
  7098  	// match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
  7099  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  7100  	// result: (MOVBZload [off1+int32(off2)] {sym} x mem)
  7101  	for {
  7102  		off1 := auxIntToInt32(v.AuxInt)
  7103  		sym := auxToSym(v.Aux)
  7104  		if v_0.Op != OpPPC64ADDconst {
  7105  			break
  7106  		}
  7107  		off2 := auxIntToInt64(v_0.AuxInt)
  7108  		x := v_0.Args[0]
  7109  		mem := v_1
  7110  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  7111  			break
  7112  		}
  7113  		v.reset(OpPPC64MOVBZload)
  7114  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7115  		v.Aux = symToAux(sym)
  7116  		v.AddArg2(x, mem)
  7117  		return true
  7118  	}
  7119  	// match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem)
  7120  	// cond: sym == nil && p.Uses == 1
  7121  	// result: (MOVBZloadidx ptr idx mem)
  7122  	for {
  7123  		if auxIntToInt32(v.AuxInt) != 0 {
  7124  			break
  7125  		}
  7126  		sym := auxToSym(v.Aux)
  7127  		p := v_0
  7128  		if p.Op != OpPPC64ADD {
  7129  			break
  7130  		}
  7131  		idx := p.Args[1]
  7132  		ptr := p.Args[0]
  7133  		mem := v_1
  7134  		if !(sym == nil && p.Uses == 1) {
  7135  			break
  7136  		}
  7137  		v.reset(OpPPC64MOVBZloadidx)
  7138  		v.AddArg3(ptr, idx, mem)
  7139  		return true
  7140  	}
  7141  	return false
  7142  }
  7143  func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
  7144  	v_2 := v.Args[2]
  7145  	v_1 := v.Args[1]
  7146  	v_0 := v.Args[0]
  7147  	// match: (MOVBZloadidx ptr (MOVDconst [c]) mem)
  7148  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7149  	// result: (MOVBZload [int32(c)] ptr mem)
  7150  	for {
  7151  		ptr := v_0
  7152  		if v_1.Op != OpPPC64MOVDconst {
  7153  			break
  7154  		}
  7155  		c := auxIntToInt64(v_1.AuxInt)
  7156  		mem := v_2
  7157  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7158  			break
  7159  		}
  7160  		v.reset(OpPPC64MOVBZload)
  7161  		v.AuxInt = int32ToAuxInt(int32(c))
  7162  		v.AddArg2(ptr, mem)
  7163  		return true
  7164  	}
  7165  	// match: (MOVBZloadidx (MOVDconst [c]) ptr mem)
  7166  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7167  	// result: (MOVBZload [int32(c)] ptr mem)
  7168  	for {
  7169  		if v_0.Op != OpPPC64MOVDconst {
  7170  			break
  7171  		}
  7172  		c := auxIntToInt64(v_0.AuxInt)
  7173  		ptr := v_1
  7174  		mem := v_2
  7175  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7176  			break
  7177  		}
  7178  		v.reset(OpPPC64MOVBZload)
  7179  		v.AuxInt = int32ToAuxInt(int32(c))
  7180  		v.AddArg2(ptr, mem)
  7181  		return true
  7182  	}
  7183  	return false
  7184  }
  7185  func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
  7186  	v_0 := v.Args[0]
  7187  	b := v.Block
  7188  	typ := &b.Func.Config.Types
  7189  	// match: (MOVBZreg y:(ANDconst [c] _))
  7190  	// cond: uint64(c) <= 0xFF
  7191  	// result: y
  7192  	for {
  7193  		y := v_0
  7194  		if y.Op != OpPPC64ANDconst {
  7195  			break
  7196  		}
  7197  		c := auxIntToInt64(y.AuxInt)
  7198  		if !(uint64(c) <= 0xFF) {
  7199  			break
  7200  		}
  7201  		v.copyOf(y)
  7202  		return true
  7203  	}
  7204  	// match: (MOVBZreg (SRWconst [c] (MOVBZreg x)))
  7205  	// result: (SRWconst [c] (MOVBZreg x))
  7206  	for {
  7207  		if v_0.Op != OpPPC64SRWconst {
  7208  			break
  7209  		}
  7210  		c := auxIntToInt64(v_0.AuxInt)
  7211  		v_0_0 := v_0.Args[0]
  7212  		if v_0_0.Op != OpPPC64MOVBZreg {
  7213  			break
  7214  		}
  7215  		x := v_0_0.Args[0]
  7216  		v.reset(OpPPC64SRWconst)
  7217  		v.AuxInt = int64ToAuxInt(c)
  7218  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  7219  		v0.AddArg(x)
  7220  		v.AddArg(v0)
  7221  		return true
  7222  	}
  7223  	// match: (MOVBZreg (SRWconst [c] x))
  7224  	// cond: x.Type.Size() == 8
  7225  	// result: (SRWconst [c] x)
  7226  	for {
  7227  		if v_0.Op != OpPPC64SRWconst {
  7228  			break
  7229  		}
  7230  		c := auxIntToInt64(v_0.AuxInt)
  7231  		x := v_0.Args[0]
  7232  		if !(x.Type.Size() == 8) {
  7233  			break
  7234  		}
  7235  		v.reset(OpPPC64SRWconst)
  7236  		v.AuxInt = int64ToAuxInt(c)
  7237  		v.AddArg(x)
  7238  		return true
  7239  	}
  7240  	// match: (MOVBZreg (SRDconst [c] x))
  7241  	// cond: c>=56
  7242  	// result: (SRDconst [c] x)
  7243  	for {
  7244  		if v_0.Op != OpPPC64SRDconst {
  7245  			break
  7246  		}
  7247  		c := auxIntToInt64(v_0.AuxInt)
  7248  		x := v_0.Args[0]
  7249  		if !(c >= 56) {
  7250  			break
  7251  		}
  7252  		v.reset(OpPPC64SRDconst)
  7253  		v.AuxInt = int64ToAuxInt(c)
  7254  		v.AddArg(x)
  7255  		return true
  7256  	}
  7257  	// match: (MOVBZreg (SRWconst [c] x))
  7258  	// cond: c>=24
  7259  	// result: (SRWconst [c] x)
  7260  	for {
  7261  		if v_0.Op != OpPPC64SRWconst {
  7262  			break
  7263  		}
  7264  		c := auxIntToInt64(v_0.AuxInt)
  7265  		x := v_0.Args[0]
  7266  		if !(c >= 24) {
  7267  			break
  7268  		}
  7269  		v.reset(OpPPC64SRWconst)
  7270  		v.AuxInt = int64ToAuxInt(c)
  7271  		v.AddArg(x)
  7272  		return true
  7273  	}
  7274  	// match: (MOVBZreg y:(MOVBZreg _))
  7275  	// result: y
  7276  	for {
  7277  		y := v_0
  7278  		if y.Op != OpPPC64MOVBZreg {
  7279  			break
  7280  		}
  7281  		v.copyOf(y)
  7282  		return true
  7283  	}
  7284  	// match: (MOVBZreg (MOVBreg x))
  7285  	// result: (MOVBZreg x)
  7286  	for {
  7287  		if v_0.Op != OpPPC64MOVBreg {
  7288  			break
  7289  		}
  7290  		x := v_0.Args[0]
  7291  		v.reset(OpPPC64MOVBZreg)
  7292  		v.AddArg(x)
  7293  		return true
  7294  	}
  7295  	// match: (MOVBZreg (SRWconst x [s]))
  7296  	// cond: mergePPC64AndSrwi(0xFF,s) != 0
  7297  	// result: (RLWINM [mergePPC64AndSrwi(0xFF,s)] x)
  7298  	for {
  7299  		if v_0.Op != OpPPC64SRWconst {
  7300  			break
  7301  		}
  7302  		s := auxIntToInt64(v_0.AuxInt)
  7303  		x := v_0.Args[0]
  7304  		if !(mergePPC64AndSrwi(0xFF, s) != 0) {
  7305  			break
  7306  		}
  7307  		v.reset(OpPPC64RLWINM)
  7308  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(0xFF, s))
  7309  		v.AddArg(x)
  7310  		return true
  7311  	}
  7312  	// match: (MOVBZreg (RLWINM [r] y))
  7313  	// cond: mergePPC64AndRlwinm(0xFF,r) != 0
  7314  	// result: (RLWINM [mergePPC64AndRlwinm(0xFF,r)] y)
  7315  	for {
  7316  		if v_0.Op != OpPPC64RLWINM {
  7317  			break
  7318  		}
  7319  		r := auxIntToInt64(v_0.AuxInt)
  7320  		y := v_0.Args[0]
  7321  		if !(mergePPC64AndRlwinm(0xFF, r) != 0) {
  7322  			break
  7323  		}
  7324  		v.reset(OpPPC64RLWINM)
  7325  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFF, r))
  7326  		v.AddArg(y)
  7327  		return true
  7328  	}
  7329  	// match: (MOVBZreg (OR <t> x (MOVWZreg y)))
  7330  	// result: (MOVBZreg (OR <t> x y))
  7331  	for {
  7332  		if v_0.Op != OpPPC64OR {
  7333  			break
  7334  		}
  7335  		t := v_0.Type
  7336  		_ = v_0.Args[1]
  7337  		v_0_0 := v_0.Args[0]
  7338  		v_0_1 := v_0.Args[1]
  7339  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7340  			x := v_0_0
  7341  			if v_0_1.Op != OpPPC64MOVWZreg {
  7342  				continue
  7343  			}
  7344  			y := v_0_1.Args[0]
  7345  			v.reset(OpPPC64MOVBZreg)
  7346  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7347  			v0.AddArg2(x, y)
  7348  			v.AddArg(v0)
  7349  			return true
  7350  		}
  7351  		break
  7352  	}
  7353  	// match: (MOVBZreg (XOR <t> x (MOVWZreg y)))
  7354  	// result: (MOVBZreg (XOR <t> x y))
  7355  	for {
  7356  		if v_0.Op != OpPPC64XOR {
  7357  			break
  7358  		}
  7359  		t := v_0.Type
  7360  		_ = v_0.Args[1]
  7361  		v_0_0 := v_0.Args[0]
  7362  		v_0_1 := v_0.Args[1]
  7363  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7364  			x := v_0_0
  7365  			if v_0_1.Op != OpPPC64MOVWZreg {
  7366  				continue
  7367  			}
  7368  			y := v_0_1.Args[0]
  7369  			v.reset(OpPPC64MOVBZreg)
  7370  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7371  			v0.AddArg2(x, y)
  7372  			v.AddArg(v0)
  7373  			return true
  7374  		}
  7375  		break
  7376  	}
  7377  	// match: (MOVBZreg (AND <t> x (MOVWZreg y)))
  7378  	// result: (MOVBZreg (AND <t> x y))
  7379  	for {
  7380  		if v_0.Op != OpPPC64AND {
  7381  			break
  7382  		}
  7383  		t := v_0.Type
  7384  		_ = v_0.Args[1]
  7385  		v_0_0 := v_0.Args[0]
  7386  		v_0_1 := v_0.Args[1]
  7387  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7388  			x := v_0_0
  7389  			if v_0_1.Op != OpPPC64MOVWZreg {
  7390  				continue
  7391  			}
  7392  			y := v_0_1.Args[0]
  7393  			v.reset(OpPPC64MOVBZreg)
  7394  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7395  			v0.AddArg2(x, y)
  7396  			v.AddArg(v0)
  7397  			return true
  7398  		}
  7399  		break
  7400  	}
  7401  	// match: (MOVBZreg (OR <t> x (MOVHZreg y)))
  7402  	// result: (MOVBZreg (OR <t> x y))
  7403  	for {
  7404  		if v_0.Op != OpPPC64OR {
  7405  			break
  7406  		}
  7407  		t := v_0.Type
  7408  		_ = v_0.Args[1]
  7409  		v_0_0 := v_0.Args[0]
  7410  		v_0_1 := v_0.Args[1]
  7411  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7412  			x := v_0_0
  7413  			if v_0_1.Op != OpPPC64MOVHZreg {
  7414  				continue
  7415  			}
  7416  			y := v_0_1.Args[0]
  7417  			v.reset(OpPPC64MOVBZreg)
  7418  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7419  			v0.AddArg2(x, y)
  7420  			v.AddArg(v0)
  7421  			return true
  7422  		}
  7423  		break
  7424  	}
  7425  	// match: (MOVBZreg (XOR <t> x (MOVHZreg y)))
  7426  	// result: (MOVBZreg (XOR <t> x y))
  7427  	for {
  7428  		if v_0.Op != OpPPC64XOR {
  7429  			break
  7430  		}
  7431  		t := v_0.Type
  7432  		_ = v_0.Args[1]
  7433  		v_0_0 := v_0.Args[0]
  7434  		v_0_1 := v_0.Args[1]
  7435  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7436  			x := v_0_0
  7437  			if v_0_1.Op != OpPPC64MOVHZreg {
  7438  				continue
  7439  			}
  7440  			y := v_0_1.Args[0]
  7441  			v.reset(OpPPC64MOVBZreg)
  7442  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7443  			v0.AddArg2(x, y)
  7444  			v.AddArg(v0)
  7445  			return true
  7446  		}
  7447  		break
  7448  	}
  7449  	// match: (MOVBZreg (AND <t> x (MOVHZreg y)))
  7450  	// result: (MOVBZreg (AND <t> x y))
  7451  	for {
  7452  		if v_0.Op != OpPPC64AND {
  7453  			break
  7454  		}
  7455  		t := v_0.Type
  7456  		_ = v_0.Args[1]
  7457  		v_0_0 := v_0.Args[0]
  7458  		v_0_1 := v_0.Args[1]
  7459  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7460  			x := v_0_0
  7461  			if v_0_1.Op != OpPPC64MOVHZreg {
  7462  				continue
  7463  			}
  7464  			y := v_0_1.Args[0]
  7465  			v.reset(OpPPC64MOVBZreg)
  7466  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7467  			v0.AddArg2(x, y)
  7468  			v.AddArg(v0)
  7469  			return true
  7470  		}
  7471  		break
  7472  	}
  7473  	// match: (MOVBZreg (OR <t> x (MOVBZreg y)))
  7474  	// result: (MOVBZreg (OR <t> x y))
  7475  	for {
  7476  		if v_0.Op != OpPPC64OR {
  7477  			break
  7478  		}
  7479  		t := v_0.Type
  7480  		_ = v_0.Args[1]
  7481  		v_0_0 := v_0.Args[0]
  7482  		v_0_1 := v_0.Args[1]
  7483  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7484  			x := v_0_0
  7485  			if v_0_1.Op != OpPPC64MOVBZreg {
  7486  				continue
  7487  			}
  7488  			y := v_0_1.Args[0]
  7489  			v.reset(OpPPC64MOVBZreg)
  7490  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7491  			v0.AddArg2(x, y)
  7492  			v.AddArg(v0)
  7493  			return true
  7494  		}
  7495  		break
  7496  	}
  7497  	// match: (MOVBZreg (XOR <t> x (MOVBZreg y)))
  7498  	// result: (MOVBZreg (XOR <t> x y))
  7499  	for {
  7500  		if v_0.Op != OpPPC64XOR {
  7501  			break
  7502  		}
  7503  		t := v_0.Type
  7504  		_ = v_0.Args[1]
  7505  		v_0_0 := v_0.Args[0]
  7506  		v_0_1 := v_0.Args[1]
  7507  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7508  			x := v_0_0
  7509  			if v_0_1.Op != OpPPC64MOVBZreg {
  7510  				continue
  7511  			}
  7512  			y := v_0_1.Args[0]
  7513  			v.reset(OpPPC64MOVBZreg)
  7514  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7515  			v0.AddArg2(x, y)
  7516  			v.AddArg(v0)
  7517  			return true
  7518  		}
  7519  		break
  7520  	}
  7521  	// match: (MOVBZreg (AND <t> x (MOVBZreg y)))
  7522  	// result: (MOVBZreg (AND <t> x y))
  7523  	for {
  7524  		if v_0.Op != OpPPC64AND {
  7525  			break
  7526  		}
  7527  		t := v_0.Type
  7528  		_ = v_0.Args[1]
  7529  		v_0_0 := v_0.Args[0]
  7530  		v_0_1 := v_0.Args[1]
  7531  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7532  			x := v_0_0
  7533  			if v_0_1.Op != OpPPC64MOVBZreg {
  7534  				continue
  7535  			}
  7536  			y := v_0_1.Args[0]
  7537  			v.reset(OpPPC64MOVBZreg)
  7538  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7539  			v0.AddArg2(x, y)
  7540  			v.AddArg(v0)
  7541  			return true
  7542  		}
  7543  		break
  7544  	}
  7545  	// match: (MOVBZreg z:(ANDconst [c] (MOVBZload ptr x)))
  7546  	// result: z
  7547  	for {
  7548  		z := v_0
  7549  		if z.Op != OpPPC64ANDconst {
  7550  			break
  7551  		}
  7552  		z_0 := z.Args[0]
  7553  		if z_0.Op != OpPPC64MOVBZload {
  7554  			break
  7555  		}
  7556  		v.copyOf(z)
  7557  		return true
  7558  	}
  7559  	// match: (MOVBZreg z:(AND y (MOVBZload ptr x)))
  7560  	// result: z
  7561  	for {
  7562  		z := v_0
  7563  		if z.Op != OpPPC64AND {
  7564  			break
  7565  		}
  7566  		_ = z.Args[1]
  7567  		z_0 := z.Args[0]
  7568  		z_1 := z.Args[1]
  7569  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  7570  			if z_1.Op != OpPPC64MOVBZload {
  7571  				continue
  7572  			}
  7573  			v.copyOf(z)
  7574  			return true
  7575  		}
  7576  		break
  7577  	}
  7578  	// match: (MOVBZreg x:(MOVBZload _ _))
  7579  	// result: x
  7580  	for {
  7581  		x := v_0
  7582  		if x.Op != OpPPC64MOVBZload {
  7583  			break
  7584  		}
  7585  		v.copyOf(x)
  7586  		return true
  7587  	}
  7588  	// match: (MOVBZreg x:(MOVBZloadidx _ _ _))
  7589  	// result: x
  7590  	for {
  7591  		x := v_0
  7592  		if x.Op != OpPPC64MOVBZloadidx {
  7593  			break
  7594  		}
  7595  		v.copyOf(x)
  7596  		return true
  7597  	}
  7598  	// match: (MOVBZreg x:(Select0 (LoweredAtomicLoad8 _ _)))
  7599  	// result: x
  7600  	for {
  7601  		x := v_0
  7602  		if x.Op != OpSelect0 {
  7603  			break
  7604  		}
  7605  		x_0 := x.Args[0]
  7606  		if x_0.Op != OpPPC64LoweredAtomicLoad8 {
  7607  			break
  7608  		}
  7609  		v.copyOf(x)
  7610  		return true
  7611  	}
  7612  	// match: (MOVBZreg x:(Arg <t>))
  7613  	// cond: is8BitInt(t) && !t.IsSigned()
  7614  	// result: x
  7615  	for {
  7616  		x := v_0
  7617  		if x.Op != OpArg {
  7618  			break
  7619  		}
  7620  		t := x.Type
  7621  		if !(is8BitInt(t) && !t.IsSigned()) {
  7622  			break
  7623  		}
  7624  		v.copyOf(x)
  7625  		return true
  7626  	}
  7627  	// match: (MOVBZreg (MOVDconst [c]))
  7628  	// result: (MOVDconst [int64(uint8(c))])
  7629  	for {
  7630  		if v_0.Op != OpPPC64MOVDconst {
  7631  			break
  7632  		}
  7633  		c := auxIntToInt64(v_0.AuxInt)
  7634  		v.reset(OpPPC64MOVDconst)
  7635  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  7636  		return true
  7637  	}
  7638  	return false
  7639  }
  7640  func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
  7641  	v_0 := v.Args[0]
  7642  	b := v.Block
  7643  	typ := &b.Func.Config.Types
  7644  	// match: (MOVBreg y:(ANDconst [c] _))
  7645  	// cond: uint64(c) <= 0x7F
  7646  	// result: y
  7647  	for {
  7648  		y := v_0
  7649  		if y.Op != OpPPC64ANDconst {
  7650  			break
  7651  		}
  7652  		c := auxIntToInt64(y.AuxInt)
  7653  		if !(uint64(c) <= 0x7F) {
  7654  			break
  7655  		}
  7656  		v.copyOf(y)
  7657  		return true
  7658  	}
  7659  	// match: (MOVBreg (SRAWconst [c] (MOVBreg x)))
  7660  	// result: (SRAWconst [c] (MOVBreg x))
  7661  	for {
  7662  		if v_0.Op != OpPPC64SRAWconst {
  7663  			break
  7664  		}
  7665  		c := auxIntToInt64(v_0.AuxInt)
  7666  		v_0_0 := v_0.Args[0]
  7667  		if v_0_0.Op != OpPPC64MOVBreg {
  7668  			break
  7669  		}
  7670  		x := v_0_0.Args[0]
  7671  		v.reset(OpPPC64SRAWconst)
  7672  		v.AuxInt = int64ToAuxInt(c)
  7673  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  7674  		v0.AddArg(x)
  7675  		v.AddArg(v0)
  7676  		return true
  7677  	}
  7678  	// match: (MOVBreg (SRAWconst [c] x))
  7679  	// cond: x.Type.Size() == 8
  7680  	// result: (SRAWconst [c] x)
  7681  	for {
  7682  		if v_0.Op != OpPPC64SRAWconst {
  7683  			break
  7684  		}
  7685  		c := auxIntToInt64(v_0.AuxInt)
  7686  		x := v_0.Args[0]
  7687  		if !(x.Type.Size() == 8) {
  7688  			break
  7689  		}
  7690  		v.reset(OpPPC64SRAWconst)
  7691  		v.AuxInt = int64ToAuxInt(c)
  7692  		v.AddArg(x)
  7693  		return true
  7694  	}
  7695  	// match: (MOVBreg (SRDconst [c] x))
  7696  	// cond: c>56
  7697  	// result: (SRDconst [c] x)
  7698  	for {
  7699  		if v_0.Op != OpPPC64SRDconst {
  7700  			break
  7701  		}
  7702  		c := auxIntToInt64(v_0.AuxInt)
  7703  		x := v_0.Args[0]
  7704  		if !(c > 56) {
  7705  			break
  7706  		}
  7707  		v.reset(OpPPC64SRDconst)
  7708  		v.AuxInt = int64ToAuxInt(c)
  7709  		v.AddArg(x)
  7710  		return true
  7711  	}
  7712  	// match: (MOVBreg (SRDconst [c] x))
  7713  	// cond: c==56
  7714  	// result: (SRADconst [c] x)
  7715  	for {
  7716  		if v_0.Op != OpPPC64SRDconst {
  7717  			break
  7718  		}
  7719  		c := auxIntToInt64(v_0.AuxInt)
  7720  		x := v_0.Args[0]
  7721  		if !(c == 56) {
  7722  			break
  7723  		}
  7724  		v.reset(OpPPC64SRADconst)
  7725  		v.AuxInt = int64ToAuxInt(c)
  7726  		v.AddArg(x)
  7727  		return true
  7728  	}
  7729  	// match: (MOVBreg (SRADconst [c] x))
  7730  	// cond: c>=56
  7731  	// result: (SRADconst [c] x)
  7732  	for {
  7733  		if v_0.Op != OpPPC64SRADconst {
  7734  			break
  7735  		}
  7736  		c := auxIntToInt64(v_0.AuxInt)
  7737  		x := v_0.Args[0]
  7738  		if !(c >= 56) {
  7739  			break
  7740  		}
  7741  		v.reset(OpPPC64SRADconst)
  7742  		v.AuxInt = int64ToAuxInt(c)
  7743  		v.AddArg(x)
  7744  		return true
  7745  	}
  7746  	// match: (MOVBreg (SRWconst [c] x))
  7747  	// cond: c>24
  7748  	// result: (SRWconst [c] x)
  7749  	for {
  7750  		if v_0.Op != OpPPC64SRWconst {
  7751  			break
  7752  		}
  7753  		c := auxIntToInt64(v_0.AuxInt)
  7754  		x := v_0.Args[0]
  7755  		if !(c > 24) {
  7756  			break
  7757  		}
  7758  		v.reset(OpPPC64SRWconst)
  7759  		v.AuxInt = int64ToAuxInt(c)
  7760  		v.AddArg(x)
  7761  		return true
  7762  	}
  7763  	// match: (MOVBreg (SRWconst [c] x))
  7764  	// cond: c==24
  7765  	// result: (SRAWconst [c] x)
  7766  	for {
  7767  		if v_0.Op != OpPPC64SRWconst {
  7768  			break
  7769  		}
  7770  		c := auxIntToInt64(v_0.AuxInt)
  7771  		x := v_0.Args[0]
  7772  		if !(c == 24) {
  7773  			break
  7774  		}
  7775  		v.reset(OpPPC64SRAWconst)
  7776  		v.AuxInt = int64ToAuxInt(c)
  7777  		v.AddArg(x)
  7778  		return true
  7779  	}
  7780  	// match: (MOVBreg (SRAWconst [c] x))
  7781  	// cond: c>=24
  7782  	// result: (SRAWconst [c] x)
  7783  	for {
  7784  		if v_0.Op != OpPPC64SRAWconst {
  7785  			break
  7786  		}
  7787  		c := auxIntToInt64(v_0.AuxInt)
  7788  		x := v_0.Args[0]
  7789  		if !(c >= 24) {
  7790  			break
  7791  		}
  7792  		v.reset(OpPPC64SRAWconst)
  7793  		v.AuxInt = int64ToAuxInt(c)
  7794  		v.AddArg(x)
  7795  		return true
  7796  	}
  7797  	// match: (MOVBreg y:(MOVBreg _))
  7798  	// result: y
  7799  	for {
  7800  		y := v_0
  7801  		if y.Op != OpPPC64MOVBreg {
  7802  			break
  7803  		}
  7804  		v.copyOf(y)
  7805  		return true
  7806  	}
  7807  	// match: (MOVBreg (MOVBZreg x))
  7808  	// result: (MOVBreg x)
  7809  	for {
  7810  		if v_0.Op != OpPPC64MOVBZreg {
  7811  			break
  7812  		}
  7813  		x := v_0.Args[0]
  7814  		v.reset(OpPPC64MOVBreg)
  7815  		v.AddArg(x)
  7816  		return true
  7817  	}
  7818  	// match: (MOVBreg x:(Arg <t>))
  7819  	// cond: is8BitInt(t) && t.IsSigned()
  7820  	// result: x
  7821  	for {
  7822  		x := v_0
  7823  		if x.Op != OpArg {
  7824  			break
  7825  		}
  7826  		t := x.Type
  7827  		if !(is8BitInt(t) && t.IsSigned()) {
  7828  			break
  7829  		}
  7830  		v.copyOf(x)
  7831  		return true
  7832  	}
  7833  	// match: (MOVBreg (MOVDconst [c]))
  7834  	// result: (MOVDconst [int64(int8(c))])
  7835  	for {
  7836  		if v_0.Op != OpPPC64MOVDconst {
  7837  			break
  7838  		}
  7839  		c := auxIntToInt64(v_0.AuxInt)
  7840  		v.reset(OpPPC64MOVDconst)
  7841  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  7842  		return true
  7843  	}
  7844  	return false
  7845  }
  7846  func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
  7847  	v_2 := v.Args[2]
  7848  	v_1 := v.Args[1]
  7849  	v_0 := v.Args[0]
  7850  	b := v.Block
  7851  	typ := &b.Func.Config.Types
  7852  	// match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
  7853  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  7854  	// result: (MOVBstore [off1+int32(off2)] {sym} x val mem)
  7855  	for {
  7856  		off1 := auxIntToInt32(v.AuxInt)
  7857  		sym := auxToSym(v.Aux)
  7858  		if v_0.Op != OpPPC64ADDconst {
  7859  			break
  7860  		}
  7861  		off2 := auxIntToInt64(v_0.AuxInt)
  7862  		x := v_0.Args[0]
  7863  		val := v_1
  7864  		mem := v_2
  7865  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  7866  			break
  7867  		}
  7868  		v.reset(OpPPC64MOVBstore)
  7869  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7870  		v.Aux = symToAux(sym)
  7871  		v.AddArg3(x, val, mem)
  7872  		return true
  7873  	}
  7874  	// match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  7875  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  7876  	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  7877  	for {
  7878  		off1 := auxIntToInt32(v.AuxInt)
  7879  		sym1 := auxToSym(v.Aux)
  7880  		p := v_0
  7881  		if p.Op != OpPPC64MOVDaddr {
  7882  			break
  7883  		}
  7884  		off2 := auxIntToInt32(p.AuxInt)
  7885  		sym2 := auxToSym(p.Aux)
  7886  		ptr := p.Args[0]
  7887  		val := v_1
  7888  		mem := v_2
  7889  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  7890  			break
  7891  		}
  7892  		v.reset(OpPPC64MOVBstore)
  7893  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7894  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7895  		v.AddArg3(ptr, val, mem)
  7896  		return true
  7897  	}
  7898  	// match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
  7899  	// result: (MOVBstorezero [off] {sym} ptr mem)
  7900  	for {
  7901  		off := auxIntToInt32(v.AuxInt)
  7902  		sym := auxToSym(v.Aux)
  7903  		ptr := v_0
  7904  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7905  			break
  7906  		}
  7907  		mem := v_2
  7908  		v.reset(OpPPC64MOVBstorezero)
  7909  		v.AuxInt = int32ToAuxInt(off)
  7910  		v.Aux = symToAux(sym)
  7911  		v.AddArg2(ptr, mem)
  7912  		return true
  7913  	}
  7914  	// match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem)
  7915  	// cond: sym == nil && p.Uses == 1
  7916  	// result: (MOVBstoreidx ptr idx val mem)
  7917  	for {
  7918  		if auxIntToInt32(v.AuxInt) != 0 {
  7919  			break
  7920  		}
  7921  		sym := auxToSym(v.Aux)
  7922  		p := v_0
  7923  		if p.Op != OpPPC64ADD {
  7924  			break
  7925  		}
  7926  		idx := p.Args[1]
  7927  		ptr := p.Args[0]
  7928  		val := v_1
  7929  		mem := v_2
  7930  		if !(sym == nil && p.Uses == 1) {
  7931  			break
  7932  		}
  7933  		v.reset(OpPPC64MOVBstoreidx)
  7934  		v.AddArg4(ptr, idx, val, mem)
  7935  		return true
  7936  	}
  7937  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  7938  	// result: (MOVBstore [off] {sym} ptr x mem)
  7939  	for {
  7940  		off := auxIntToInt32(v.AuxInt)
  7941  		sym := auxToSym(v.Aux)
  7942  		ptr := v_0
  7943  		if v_1.Op != OpPPC64MOVBreg {
  7944  			break
  7945  		}
  7946  		x := v_1.Args[0]
  7947  		mem := v_2
  7948  		v.reset(OpPPC64MOVBstore)
  7949  		v.AuxInt = int32ToAuxInt(off)
  7950  		v.Aux = symToAux(sym)
  7951  		v.AddArg3(ptr, x, mem)
  7952  		return true
  7953  	}
  7954  	// match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
  7955  	// result: (MOVBstore [off] {sym} ptr x mem)
  7956  	for {
  7957  		off := auxIntToInt32(v.AuxInt)
  7958  		sym := auxToSym(v.Aux)
  7959  		ptr := v_0
  7960  		if v_1.Op != OpPPC64MOVBZreg {
  7961  			break
  7962  		}
  7963  		x := v_1.Args[0]
  7964  		mem := v_2
  7965  		v.reset(OpPPC64MOVBstore)
  7966  		v.AuxInt = int32ToAuxInt(off)
  7967  		v.Aux = symToAux(sym)
  7968  		v.AddArg3(ptr, x, mem)
  7969  		return true
  7970  	}
  7971  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  7972  	// result: (MOVBstore [off] {sym} ptr x mem)
  7973  	for {
  7974  		off := auxIntToInt32(v.AuxInt)
  7975  		sym := auxToSym(v.Aux)
  7976  		ptr := v_0
  7977  		if v_1.Op != OpPPC64MOVHreg {
  7978  			break
  7979  		}
  7980  		x := v_1.Args[0]
  7981  		mem := v_2
  7982  		v.reset(OpPPC64MOVBstore)
  7983  		v.AuxInt = int32ToAuxInt(off)
  7984  		v.Aux = symToAux(sym)
  7985  		v.AddArg3(ptr, x, mem)
  7986  		return true
  7987  	}
  7988  	// match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem)
  7989  	// result: (MOVBstore [off] {sym} ptr x mem)
  7990  	for {
  7991  		off := auxIntToInt32(v.AuxInt)
  7992  		sym := auxToSym(v.Aux)
  7993  		ptr := v_0
  7994  		if v_1.Op != OpPPC64MOVHZreg {
  7995  			break
  7996  		}
  7997  		x := v_1.Args[0]
  7998  		mem := v_2
  7999  		v.reset(OpPPC64MOVBstore)
  8000  		v.AuxInt = int32ToAuxInt(off)
  8001  		v.Aux = symToAux(sym)
  8002  		v.AddArg3(ptr, x, mem)
  8003  		return true
  8004  	}
  8005  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  8006  	// result: (MOVBstore [off] {sym} ptr x mem)
  8007  	for {
  8008  		off := auxIntToInt32(v.AuxInt)
  8009  		sym := auxToSym(v.Aux)
  8010  		ptr := v_0
  8011  		if v_1.Op != OpPPC64MOVWreg {
  8012  			break
  8013  		}
  8014  		x := v_1.Args[0]
  8015  		mem := v_2
  8016  		v.reset(OpPPC64MOVBstore)
  8017  		v.AuxInt = int32ToAuxInt(off)
  8018  		v.Aux = symToAux(sym)
  8019  		v.AddArg3(ptr, x, mem)
  8020  		return true
  8021  	}
  8022  	// match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem)
  8023  	// result: (MOVBstore [off] {sym} ptr x mem)
  8024  	for {
  8025  		off := auxIntToInt32(v.AuxInt)
  8026  		sym := auxToSym(v.Aux)
  8027  		ptr := v_0
  8028  		if v_1.Op != OpPPC64MOVWZreg {
  8029  			break
  8030  		}
  8031  		x := v_1.Args[0]
  8032  		mem := v_2
  8033  		v.reset(OpPPC64MOVBstore)
  8034  		v.AuxInt = int32ToAuxInt(off)
  8035  		v.Aux = symToAux(sym)
  8036  		v.AddArg3(ptr, x, mem)
  8037  		return true
  8038  	}
  8039  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem)
  8040  	// cond: c <= 8
  8041  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  8042  	for {
  8043  		off := auxIntToInt32(v.AuxInt)
  8044  		sym := auxToSym(v.Aux)
  8045  		ptr := v_0
  8046  		if v_1.Op != OpPPC64SRWconst {
  8047  			break
  8048  		}
  8049  		c := auxIntToInt64(v_1.AuxInt)
  8050  		v_1_0 := v_1.Args[0]
  8051  		if v_1_0.Op != OpPPC64MOVHreg {
  8052  			break
  8053  		}
  8054  		x := v_1_0.Args[0]
  8055  		mem := v_2
  8056  		if !(c <= 8) {
  8057  			break
  8058  		}
  8059  		v.reset(OpPPC64MOVBstore)
  8060  		v.AuxInt = int32ToAuxInt(off)
  8061  		v.Aux = symToAux(sym)
  8062  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8063  		v0.AuxInt = int64ToAuxInt(c)
  8064  		v0.AddArg(x)
  8065  		v.AddArg3(ptr, v0, mem)
  8066  		return true
  8067  	}
  8068  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem)
  8069  	// cond: c <= 8
  8070  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  8071  	for {
  8072  		off := auxIntToInt32(v.AuxInt)
  8073  		sym := auxToSym(v.Aux)
  8074  		ptr := v_0
  8075  		if v_1.Op != OpPPC64SRWconst {
  8076  			break
  8077  		}
  8078  		c := auxIntToInt64(v_1.AuxInt)
  8079  		v_1_0 := v_1.Args[0]
  8080  		if v_1_0.Op != OpPPC64MOVHZreg {
  8081  			break
  8082  		}
  8083  		x := v_1_0.Args[0]
  8084  		mem := v_2
  8085  		if !(c <= 8) {
  8086  			break
  8087  		}
  8088  		v.reset(OpPPC64MOVBstore)
  8089  		v.AuxInt = int32ToAuxInt(off)
  8090  		v.Aux = symToAux(sym)
  8091  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8092  		v0.AuxInt = int64ToAuxInt(c)
  8093  		v0.AddArg(x)
  8094  		v.AddArg3(ptr, v0, mem)
  8095  		return true
  8096  	}
  8097  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem)
  8098  	// cond: c <= 24
  8099  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  8100  	for {
  8101  		off := auxIntToInt32(v.AuxInt)
  8102  		sym := auxToSym(v.Aux)
  8103  		ptr := v_0
  8104  		if v_1.Op != OpPPC64SRWconst {
  8105  			break
  8106  		}
  8107  		c := auxIntToInt64(v_1.AuxInt)
  8108  		v_1_0 := v_1.Args[0]
  8109  		if v_1_0.Op != OpPPC64MOVWreg {
  8110  			break
  8111  		}
  8112  		x := v_1_0.Args[0]
  8113  		mem := v_2
  8114  		if !(c <= 24) {
  8115  			break
  8116  		}
  8117  		v.reset(OpPPC64MOVBstore)
  8118  		v.AuxInt = int32ToAuxInt(off)
  8119  		v.Aux = symToAux(sym)
  8120  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8121  		v0.AuxInt = int64ToAuxInt(c)
  8122  		v0.AddArg(x)
  8123  		v.AddArg3(ptr, v0, mem)
  8124  		return true
  8125  	}
  8126  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem)
  8127  	// cond: c <= 24
  8128  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  8129  	for {
  8130  		off := auxIntToInt32(v.AuxInt)
  8131  		sym := auxToSym(v.Aux)
  8132  		ptr := v_0
  8133  		if v_1.Op != OpPPC64SRWconst {
  8134  			break
  8135  		}
  8136  		c := auxIntToInt64(v_1.AuxInt)
  8137  		v_1_0 := v_1.Args[0]
  8138  		if v_1_0.Op != OpPPC64MOVWZreg {
  8139  			break
  8140  		}
  8141  		x := v_1_0.Args[0]
  8142  		mem := v_2
  8143  		if !(c <= 24) {
  8144  			break
  8145  		}
  8146  		v.reset(OpPPC64MOVBstore)
  8147  		v.AuxInt = int32ToAuxInt(off)
  8148  		v.Aux = symToAux(sym)
  8149  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8150  		v0.AuxInt = int64ToAuxInt(c)
  8151  		v0.AddArg(x)
  8152  		v.AddArg3(ptr, v0, mem)
  8153  		return true
  8154  	}
  8155  	return false
  8156  }
  8157  func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
  8158  	v_3 := v.Args[3]
  8159  	v_2 := v.Args[2]
  8160  	v_1 := v.Args[1]
  8161  	v_0 := v.Args[0]
  8162  	b := v.Block
  8163  	typ := &b.Func.Config.Types
  8164  	// match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
  8165  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8166  	// result: (MOVBstore [int32(c)] ptr val mem)
  8167  	for {
  8168  		ptr := v_0
  8169  		if v_1.Op != OpPPC64MOVDconst {
  8170  			break
  8171  		}
  8172  		c := auxIntToInt64(v_1.AuxInt)
  8173  		val := v_2
  8174  		mem := v_3
  8175  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8176  			break
  8177  		}
  8178  		v.reset(OpPPC64MOVBstore)
  8179  		v.AuxInt = int32ToAuxInt(int32(c))
  8180  		v.AddArg3(ptr, val, mem)
  8181  		return true
  8182  	}
  8183  	// match: (MOVBstoreidx (MOVDconst [c]) ptr val mem)
  8184  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8185  	// result: (MOVBstore [int32(c)] ptr val mem)
  8186  	for {
  8187  		if v_0.Op != OpPPC64MOVDconst {
  8188  			break
  8189  		}
  8190  		c := auxIntToInt64(v_0.AuxInt)
  8191  		ptr := v_1
  8192  		val := v_2
  8193  		mem := v_3
  8194  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8195  			break
  8196  		}
  8197  		v.reset(OpPPC64MOVBstore)
  8198  		v.AuxInt = int32ToAuxInt(int32(c))
  8199  		v.AddArg3(ptr, val, mem)
  8200  		return true
  8201  	}
  8202  	// match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
  8203  	// result: (MOVBstoreidx ptr idx x mem)
  8204  	for {
  8205  		ptr := v_0
  8206  		idx := v_1
  8207  		if v_2.Op != OpPPC64MOVBreg {
  8208  			break
  8209  		}
  8210  		x := v_2.Args[0]
  8211  		mem := v_3
  8212  		v.reset(OpPPC64MOVBstoreidx)
  8213  		v.AddArg4(ptr, idx, x, mem)
  8214  		return true
  8215  	}
  8216  	// match: (MOVBstoreidx ptr idx (MOVBZreg x) mem)
  8217  	// result: (MOVBstoreidx ptr idx x mem)
  8218  	for {
  8219  		ptr := v_0
  8220  		idx := v_1
  8221  		if v_2.Op != OpPPC64MOVBZreg {
  8222  			break
  8223  		}
  8224  		x := v_2.Args[0]
  8225  		mem := v_3
  8226  		v.reset(OpPPC64MOVBstoreidx)
  8227  		v.AddArg4(ptr, idx, x, mem)
  8228  		return true
  8229  	}
  8230  	// match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
  8231  	// result: (MOVBstoreidx ptr idx x mem)
  8232  	for {
  8233  		ptr := v_0
  8234  		idx := v_1
  8235  		if v_2.Op != OpPPC64MOVHreg {
  8236  			break
  8237  		}
  8238  		x := v_2.Args[0]
  8239  		mem := v_3
  8240  		v.reset(OpPPC64MOVBstoreidx)
  8241  		v.AddArg4(ptr, idx, x, mem)
  8242  		return true
  8243  	}
  8244  	// match: (MOVBstoreidx ptr idx (MOVHZreg x) mem)
  8245  	// result: (MOVBstoreidx ptr idx x mem)
  8246  	for {
  8247  		ptr := v_0
  8248  		idx := v_1
  8249  		if v_2.Op != OpPPC64MOVHZreg {
  8250  			break
  8251  		}
  8252  		x := v_2.Args[0]
  8253  		mem := v_3
  8254  		v.reset(OpPPC64MOVBstoreidx)
  8255  		v.AddArg4(ptr, idx, x, mem)
  8256  		return true
  8257  	}
  8258  	// match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
  8259  	// result: (MOVBstoreidx ptr idx x mem)
  8260  	for {
  8261  		ptr := v_0
  8262  		idx := v_1
  8263  		if v_2.Op != OpPPC64MOVWreg {
  8264  			break
  8265  		}
  8266  		x := v_2.Args[0]
  8267  		mem := v_3
  8268  		v.reset(OpPPC64MOVBstoreidx)
  8269  		v.AddArg4(ptr, idx, x, mem)
  8270  		return true
  8271  	}
  8272  	// match: (MOVBstoreidx ptr idx (MOVWZreg x) mem)
  8273  	// result: (MOVBstoreidx ptr idx x mem)
  8274  	for {
  8275  		ptr := v_0
  8276  		idx := v_1
  8277  		if v_2.Op != OpPPC64MOVWZreg {
  8278  			break
  8279  		}
  8280  		x := v_2.Args[0]
  8281  		mem := v_3
  8282  		v.reset(OpPPC64MOVBstoreidx)
  8283  		v.AddArg4(ptr, idx, x, mem)
  8284  		return true
  8285  	}
  8286  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem)
  8287  	// cond: c <= 8
  8288  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8289  	for {
  8290  		ptr := v_0
  8291  		idx := v_1
  8292  		if v_2.Op != OpPPC64SRWconst {
  8293  			break
  8294  		}
  8295  		c := auxIntToInt64(v_2.AuxInt)
  8296  		v_2_0 := v_2.Args[0]
  8297  		if v_2_0.Op != OpPPC64MOVHreg {
  8298  			break
  8299  		}
  8300  		x := v_2_0.Args[0]
  8301  		mem := v_3
  8302  		if !(c <= 8) {
  8303  			break
  8304  		}
  8305  		v.reset(OpPPC64MOVBstoreidx)
  8306  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8307  		v0.AuxInt = int64ToAuxInt(c)
  8308  		v0.AddArg(x)
  8309  		v.AddArg4(ptr, idx, v0, mem)
  8310  		return true
  8311  	}
  8312  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem)
  8313  	// cond: c <= 8
  8314  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8315  	for {
  8316  		ptr := v_0
  8317  		idx := v_1
  8318  		if v_2.Op != OpPPC64SRWconst {
  8319  			break
  8320  		}
  8321  		c := auxIntToInt64(v_2.AuxInt)
  8322  		v_2_0 := v_2.Args[0]
  8323  		if v_2_0.Op != OpPPC64MOVHZreg {
  8324  			break
  8325  		}
  8326  		x := v_2_0.Args[0]
  8327  		mem := v_3
  8328  		if !(c <= 8) {
  8329  			break
  8330  		}
  8331  		v.reset(OpPPC64MOVBstoreidx)
  8332  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8333  		v0.AuxInt = int64ToAuxInt(c)
  8334  		v0.AddArg(x)
  8335  		v.AddArg4(ptr, idx, v0, mem)
  8336  		return true
  8337  	}
  8338  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem)
  8339  	// cond: c <= 24
  8340  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8341  	for {
  8342  		ptr := v_0
  8343  		idx := v_1
  8344  		if v_2.Op != OpPPC64SRWconst {
  8345  			break
  8346  		}
  8347  		c := auxIntToInt64(v_2.AuxInt)
  8348  		v_2_0 := v_2.Args[0]
  8349  		if v_2_0.Op != OpPPC64MOVWreg {
  8350  			break
  8351  		}
  8352  		x := v_2_0.Args[0]
  8353  		mem := v_3
  8354  		if !(c <= 24) {
  8355  			break
  8356  		}
  8357  		v.reset(OpPPC64MOVBstoreidx)
  8358  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8359  		v0.AuxInt = int64ToAuxInt(c)
  8360  		v0.AddArg(x)
  8361  		v.AddArg4(ptr, idx, v0, mem)
  8362  		return true
  8363  	}
  8364  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem)
  8365  	// cond: c <= 24
  8366  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8367  	for {
  8368  		ptr := v_0
  8369  		idx := v_1
  8370  		if v_2.Op != OpPPC64SRWconst {
  8371  			break
  8372  		}
  8373  		c := auxIntToInt64(v_2.AuxInt)
  8374  		v_2_0 := v_2.Args[0]
  8375  		if v_2_0.Op != OpPPC64MOVWZreg {
  8376  			break
  8377  		}
  8378  		x := v_2_0.Args[0]
  8379  		mem := v_3
  8380  		if !(c <= 24) {
  8381  			break
  8382  		}
  8383  		v.reset(OpPPC64MOVBstoreidx)
  8384  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8385  		v0.AuxInt = int64ToAuxInt(c)
  8386  		v0.AddArg(x)
  8387  		v.AddArg4(ptr, idx, v0, mem)
  8388  		return true
  8389  	}
  8390  	return false
  8391  }
  8392  func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
  8393  	v_1 := v.Args[1]
  8394  	v_0 := v.Args[0]
  8395  	// match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8396  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8397  	// result: (MOVBstorezero [off1+int32(off2)] {sym} x mem)
  8398  	for {
  8399  		off1 := auxIntToInt32(v.AuxInt)
  8400  		sym := auxToSym(v.Aux)
  8401  		if v_0.Op != OpPPC64ADDconst {
  8402  			break
  8403  		}
  8404  		off2 := auxIntToInt64(v_0.AuxInt)
  8405  		x := v_0.Args[0]
  8406  		mem := v_1
  8407  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8408  			break
  8409  		}
  8410  		v.reset(OpPPC64MOVBstorezero)
  8411  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8412  		v.Aux = symToAux(sym)
  8413  		v.AddArg2(x, mem)
  8414  		return true
  8415  	}
  8416  	// match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8417  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8418  	// result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8419  	for {
  8420  		off1 := auxIntToInt32(v.AuxInt)
  8421  		sym1 := auxToSym(v.Aux)
  8422  		p := v_0
  8423  		if p.Op != OpPPC64MOVDaddr {
  8424  			break
  8425  		}
  8426  		off2 := auxIntToInt32(p.AuxInt)
  8427  		sym2 := auxToSym(p.Aux)
  8428  		x := p.Args[0]
  8429  		mem := v_1
  8430  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8431  			break
  8432  		}
  8433  		v.reset(OpPPC64MOVBstorezero)
  8434  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8435  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8436  		v.AddArg2(x, mem)
  8437  		return true
  8438  	}
  8439  	return false
  8440  }
  8441  func rewriteValuePPC64_OpPPC64MOVDaddr(v *Value) bool {
  8442  	v_0 := v.Args[0]
  8443  	// match: (MOVDaddr {sym} [n] p:(ADD x y))
  8444  	// cond: sym == nil && n == 0
  8445  	// result: p
  8446  	for {
  8447  		n := auxIntToInt32(v.AuxInt)
  8448  		sym := auxToSym(v.Aux)
  8449  		p := v_0
  8450  		if p.Op != OpPPC64ADD {
  8451  			break
  8452  		}
  8453  		if !(sym == nil && n == 0) {
  8454  			break
  8455  		}
  8456  		v.copyOf(p)
  8457  		return true
  8458  	}
  8459  	// match: (MOVDaddr {sym} [n] ptr)
  8460  	// cond: sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)
  8461  	// result: ptr
  8462  	for {
  8463  		n := auxIntToInt32(v.AuxInt)
  8464  		sym := auxToSym(v.Aux)
  8465  		ptr := v_0
  8466  		if !(sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)) {
  8467  			break
  8468  		}
  8469  		v.copyOf(ptr)
  8470  		return true
  8471  	}
  8472  	return false
  8473  }
  8474  func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
  8475  	v_1 := v.Args[1]
  8476  	v_0 := v.Args[0]
  8477  	// match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _))
  8478  	// result: (MFVSRD x)
  8479  	for {
  8480  		off := auxIntToInt32(v.AuxInt)
  8481  		sym := auxToSym(v.Aux)
  8482  		ptr := v_0
  8483  		if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  8484  			break
  8485  		}
  8486  		x := v_1.Args[1]
  8487  		if ptr != v_1.Args[0] {
  8488  			break
  8489  		}
  8490  		v.reset(OpPPC64MFVSRD)
  8491  		v.AddArg(x)
  8492  		return true
  8493  	}
  8494  	// match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8495  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8496  	// result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8497  	for {
  8498  		off1 := auxIntToInt32(v.AuxInt)
  8499  		sym1 := auxToSym(v.Aux)
  8500  		p := v_0
  8501  		if p.Op != OpPPC64MOVDaddr {
  8502  			break
  8503  		}
  8504  		off2 := auxIntToInt32(p.AuxInt)
  8505  		sym2 := auxToSym(p.Aux)
  8506  		ptr := p.Args[0]
  8507  		mem := v_1
  8508  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8509  			break
  8510  		}
  8511  		v.reset(OpPPC64MOVDload)
  8512  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8513  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8514  		v.AddArg2(ptr, mem)
  8515  		return true
  8516  	}
  8517  	// match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
  8518  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8519  	// result: (MOVDload [off1+int32(off2)] {sym} x mem)
  8520  	for {
  8521  		off1 := auxIntToInt32(v.AuxInt)
  8522  		sym := auxToSym(v.Aux)
  8523  		if v_0.Op != OpPPC64ADDconst {
  8524  			break
  8525  		}
  8526  		off2 := auxIntToInt64(v_0.AuxInt)
  8527  		x := v_0.Args[0]
  8528  		mem := v_1
  8529  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8530  			break
  8531  		}
  8532  		v.reset(OpPPC64MOVDload)
  8533  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8534  		v.Aux = symToAux(sym)
  8535  		v.AddArg2(x, mem)
  8536  		return true
  8537  	}
  8538  	// match: (MOVDload [0] {sym} p:(ADD ptr idx) mem)
  8539  	// cond: sym == nil && p.Uses == 1
  8540  	// result: (MOVDloadidx ptr idx mem)
  8541  	for {
  8542  		if auxIntToInt32(v.AuxInt) != 0 {
  8543  			break
  8544  		}
  8545  		sym := auxToSym(v.Aux)
  8546  		p := v_0
  8547  		if p.Op != OpPPC64ADD {
  8548  			break
  8549  		}
  8550  		idx := p.Args[1]
  8551  		ptr := p.Args[0]
  8552  		mem := v_1
  8553  		if !(sym == nil && p.Uses == 1) {
  8554  			break
  8555  		}
  8556  		v.reset(OpPPC64MOVDloadidx)
  8557  		v.AddArg3(ptr, idx, mem)
  8558  		return true
  8559  	}
  8560  	return false
  8561  }
  8562  func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
  8563  	v_2 := v.Args[2]
  8564  	v_1 := v.Args[1]
  8565  	v_0 := v.Args[0]
  8566  	// match: (MOVDloadidx ptr (MOVDconst [c]) mem)
  8567  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8568  	// result: (MOVDload [int32(c)] ptr mem)
  8569  	for {
  8570  		ptr := v_0
  8571  		if v_1.Op != OpPPC64MOVDconst {
  8572  			break
  8573  		}
  8574  		c := auxIntToInt64(v_1.AuxInt)
  8575  		mem := v_2
  8576  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8577  			break
  8578  		}
  8579  		v.reset(OpPPC64MOVDload)
  8580  		v.AuxInt = int32ToAuxInt(int32(c))
  8581  		v.AddArg2(ptr, mem)
  8582  		return true
  8583  	}
  8584  	// match: (MOVDloadidx (MOVDconst [c]) ptr mem)
  8585  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8586  	// result: (MOVDload [int32(c)] ptr mem)
  8587  	for {
  8588  		if v_0.Op != OpPPC64MOVDconst {
  8589  			break
  8590  		}
  8591  		c := auxIntToInt64(v_0.AuxInt)
  8592  		ptr := v_1
  8593  		mem := v_2
  8594  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8595  			break
  8596  		}
  8597  		v.reset(OpPPC64MOVDload)
  8598  		v.AuxInt = int32ToAuxInt(int32(c))
  8599  		v.AddArg2(ptr, mem)
  8600  		return true
  8601  	}
  8602  	return false
  8603  }
  8604  func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
  8605  	v_2 := v.Args[2]
  8606  	v_1 := v.Args[1]
  8607  	v_0 := v.Args[0]
  8608  	b := v.Block
  8609  	// match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem)
  8610  	// result: (FMOVDstore [off] {sym} ptr x mem)
  8611  	for {
  8612  		off := auxIntToInt32(v.AuxInt)
  8613  		sym := auxToSym(v.Aux)
  8614  		ptr := v_0
  8615  		if v_1.Op != OpPPC64MFVSRD {
  8616  			break
  8617  		}
  8618  		x := v_1.Args[0]
  8619  		mem := v_2
  8620  		v.reset(OpPPC64FMOVDstore)
  8621  		v.AuxInt = int32ToAuxInt(off)
  8622  		v.Aux = symToAux(sym)
  8623  		v.AddArg3(ptr, x, mem)
  8624  		return true
  8625  	}
  8626  	// match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
  8627  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8628  	// result: (MOVDstore [off1+int32(off2)] {sym} x val mem)
  8629  	for {
  8630  		off1 := auxIntToInt32(v.AuxInt)
  8631  		sym := auxToSym(v.Aux)
  8632  		if v_0.Op != OpPPC64ADDconst {
  8633  			break
  8634  		}
  8635  		off2 := auxIntToInt64(v_0.AuxInt)
  8636  		x := v_0.Args[0]
  8637  		val := v_1
  8638  		mem := v_2
  8639  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8640  			break
  8641  		}
  8642  		v.reset(OpPPC64MOVDstore)
  8643  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8644  		v.Aux = symToAux(sym)
  8645  		v.AddArg3(x, val, mem)
  8646  		return true
  8647  	}
  8648  	// match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  8649  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8650  	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  8651  	for {
  8652  		off1 := auxIntToInt32(v.AuxInt)
  8653  		sym1 := auxToSym(v.Aux)
  8654  		p := v_0
  8655  		if p.Op != OpPPC64MOVDaddr {
  8656  			break
  8657  		}
  8658  		off2 := auxIntToInt32(p.AuxInt)
  8659  		sym2 := auxToSym(p.Aux)
  8660  		ptr := p.Args[0]
  8661  		val := v_1
  8662  		mem := v_2
  8663  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8664  			break
  8665  		}
  8666  		v.reset(OpPPC64MOVDstore)
  8667  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8668  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8669  		v.AddArg3(ptr, val, mem)
  8670  		return true
  8671  	}
  8672  	// match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
  8673  	// result: (MOVDstorezero [off] {sym} ptr mem)
  8674  	for {
  8675  		off := auxIntToInt32(v.AuxInt)
  8676  		sym := auxToSym(v.Aux)
  8677  		ptr := v_0
  8678  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  8679  			break
  8680  		}
  8681  		mem := v_2
  8682  		v.reset(OpPPC64MOVDstorezero)
  8683  		v.AuxInt = int32ToAuxInt(off)
  8684  		v.Aux = symToAux(sym)
  8685  		v.AddArg2(ptr, mem)
  8686  		return true
  8687  	}
  8688  	// match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem)
  8689  	// cond: sym == nil && p.Uses == 1
  8690  	// result: (MOVDstoreidx ptr idx val mem)
  8691  	for {
  8692  		if auxIntToInt32(v.AuxInt) != 0 {
  8693  			break
  8694  		}
  8695  		sym := auxToSym(v.Aux)
  8696  		p := v_0
  8697  		if p.Op != OpPPC64ADD {
  8698  			break
  8699  		}
  8700  		idx := p.Args[1]
  8701  		ptr := p.Args[0]
  8702  		val := v_1
  8703  		mem := v_2
  8704  		if !(sym == nil && p.Uses == 1) {
  8705  			break
  8706  		}
  8707  		v.reset(OpPPC64MOVDstoreidx)
  8708  		v.AddArg4(ptr, idx, val, mem)
  8709  		return true
  8710  	}
  8711  	// match: (MOVDstore [off] {sym} ptr r:(BRD val) mem)
  8712  	// cond: r.Uses == 1
  8713  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8714  	for {
  8715  		off := auxIntToInt32(v.AuxInt)
  8716  		sym := auxToSym(v.Aux)
  8717  		ptr := v_0
  8718  		r := v_1
  8719  		if r.Op != OpPPC64BRD {
  8720  			break
  8721  		}
  8722  		val := r.Args[0]
  8723  		mem := v_2
  8724  		if !(r.Uses == 1) {
  8725  			break
  8726  		}
  8727  		v.reset(OpPPC64MOVDBRstore)
  8728  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8729  		v0.AuxInt = int32ToAuxInt(off)
  8730  		v0.Aux = symToAux(sym)
  8731  		v0.AddArg(ptr)
  8732  		v.AddArg3(v0, val, mem)
  8733  		return true
  8734  	}
  8735  	// match: (MOVDstore [off] {sym} ptr (Bswap64 val) mem)
  8736  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8737  	for {
  8738  		off := auxIntToInt32(v.AuxInt)
  8739  		sym := auxToSym(v.Aux)
  8740  		ptr := v_0
  8741  		if v_1.Op != OpBswap64 {
  8742  			break
  8743  		}
  8744  		val := v_1.Args[0]
  8745  		mem := v_2
  8746  		v.reset(OpPPC64MOVDBRstore)
  8747  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8748  		v0.AuxInt = int32ToAuxInt(off)
  8749  		v0.Aux = symToAux(sym)
  8750  		v0.AddArg(ptr)
  8751  		v.AddArg3(v0, val, mem)
  8752  		return true
  8753  	}
  8754  	return false
  8755  }
  8756  func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
  8757  	v_3 := v.Args[3]
  8758  	v_2 := v.Args[2]
  8759  	v_1 := v.Args[1]
  8760  	v_0 := v.Args[0]
  8761  	// match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
  8762  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8763  	// result: (MOVDstore [int32(c)] ptr val mem)
  8764  	for {
  8765  		ptr := v_0
  8766  		if v_1.Op != OpPPC64MOVDconst {
  8767  			break
  8768  		}
  8769  		c := auxIntToInt64(v_1.AuxInt)
  8770  		val := v_2
  8771  		mem := v_3
  8772  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8773  			break
  8774  		}
  8775  		v.reset(OpPPC64MOVDstore)
  8776  		v.AuxInt = int32ToAuxInt(int32(c))
  8777  		v.AddArg3(ptr, val, mem)
  8778  		return true
  8779  	}
  8780  	// match: (MOVDstoreidx (MOVDconst [c]) ptr val mem)
  8781  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8782  	// result: (MOVDstore [int32(c)] ptr val mem)
  8783  	for {
  8784  		if v_0.Op != OpPPC64MOVDconst {
  8785  			break
  8786  		}
  8787  		c := auxIntToInt64(v_0.AuxInt)
  8788  		ptr := v_1
  8789  		val := v_2
  8790  		mem := v_3
  8791  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8792  			break
  8793  		}
  8794  		v.reset(OpPPC64MOVDstore)
  8795  		v.AuxInt = int32ToAuxInt(int32(c))
  8796  		v.AddArg3(ptr, val, mem)
  8797  		return true
  8798  	}
  8799  	// match: (MOVDstoreidx ptr idx r:(BRD val) mem)
  8800  	// cond: r.Uses == 1
  8801  	// result: (MOVDBRstoreidx ptr idx val mem)
  8802  	for {
  8803  		ptr := v_0
  8804  		idx := v_1
  8805  		r := v_2
  8806  		if r.Op != OpPPC64BRD {
  8807  			break
  8808  		}
  8809  		val := r.Args[0]
  8810  		mem := v_3
  8811  		if !(r.Uses == 1) {
  8812  			break
  8813  		}
  8814  		v.reset(OpPPC64MOVDBRstoreidx)
  8815  		v.AddArg4(ptr, idx, val, mem)
  8816  		return true
  8817  	}
  8818  	// match: (MOVDstoreidx ptr idx (Bswap64 val) mem)
  8819  	// result: (MOVDBRstoreidx ptr idx val mem)
  8820  	for {
  8821  		ptr := v_0
  8822  		idx := v_1
  8823  		if v_2.Op != OpBswap64 {
  8824  			break
  8825  		}
  8826  		val := v_2.Args[0]
  8827  		mem := v_3
  8828  		v.reset(OpPPC64MOVDBRstoreidx)
  8829  		v.AddArg4(ptr, idx, val, mem)
  8830  		return true
  8831  	}
  8832  	return false
  8833  }
  8834  func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
  8835  	v_1 := v.Args[1]
  8836  	v_0 := v.Args[0]
  8837  	// match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8838  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8839  	// result: (MOVDstorezero [off1+int32(off2)] {sym} x mem)
  8840  	for {
  8841  		off1 := auxIntToInt32(v.AuxInt)
  8842  		sym := auxToSym(v.Aux)
  8843  		if v_0.Op != OpPPC64ADDconst {
  8844  			break
  8845  		}
  8846  		off2 := auxIntToInt64(v_0.AuxInt)
  8847  		x := v_0.Args[0]
  8848  		mem := v_1
  8849  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8850  			break
  8851  		}
  8852  		v.reset(OpPPC64MOVDstorezero)
  8853  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8854  		v.Aux = symToAux(sym)
  8855  		v.AddArg2(x, mem)
  8856  		return true
  8857  	}
  8858  	// match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8859  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8860  	// result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8861  	for {
  8862  		off1 := auxIntToInt32(v.AuxInt)
  8863  		sym1 := auxToSym(v.Aux)
  8864  		p := v_0
  8865  		if p.Op != OpPPC64MOVDaddr {
  8866  			break
  8867  		}
  8868  		off2 := auxIntToInt32(p.AuxInt)
  8869  		sym2 := auxToSym(p.Aux)
  8870  		x := p.Args[0]
  8871  		mem := v_1
  8872  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8873  			break
  8874  		}
  8875  		v.reset(OpPPC64MOVDstorezero)
  8876  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8877  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8878  		v.AddArg2(x, mem)
  8879  		return true
  8880  	}
  8881  	return false
  8882  }
  8883  func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
  8884  	v_2 := v.Args[2]
  8885  	v_1 := v.Args[1]
  8886  	v_0 := v.Args[0]
  8887  	// match: (MOVHBRstore ptr (MOVHreg x) mem)
  8888  	// result: (MOVHBRstore ptr x mem)
  8889  	for {
  8890  		ptr := v_0
  8891  		if v_1.Op != OpPPC64MOVHreg {
  8892  			break
  8893  		}
  8894  		x := v_1.Args[0]
  8895  		mem := v_2
  8896  		v.reset(OpPPC64MOVHBRstore)
  8897  		v.AddArg3(ptr, x, mem)
  8898  		return true
  8899  	}
  8900  	// match: (MOVHBRstore ptr (MOVHZreg x) mem)
  8901  	// result: (MOVHBRstore ptr x mem)
  8902  	for {
  8903  		ptr := v_0
  8904  		if v_1.Op != OpPPC64MOVHZreg {
  8905  			break
  8906  		}
  8907  		x := v_1.Args[0]
  8908  		mem := v_2
  8909  		v.reset(OpPPC64MOVHBRstore)
  8910  		v.AddArg3(ptr, x, mem)
  8911  		return true
  8912  	}
  8913  	// match: (MOVHBRstore ptr (MOVWreg x) mem)
  8914  	// result: (MOVHBRstore ptr x mem)
  8915  	for {
  8916  		ptr := v_0
  8917  		if v_1.Op != OpPPC64MOVWreg {
  8918  			break
  8919  		}
  8920  		x := v_1.Args[0]
  8921  		mem := v_2
  8922  		v.reset(OpPPC64MOVHBRstore)
  8923  		v.AddArg3(ptr, x, mem)
  8924  		return true
  8925  	}
  8926  	// match: (MOVHBRstore ptr (MOVWZreg x) mem)
  8927  	// result: (MOVHBRstore ptr x mem)
  8928  	for {
  8929  		ptr := v_0
  8930  		if v_1.Op != OpPPC64MOVWZreg {
  8931  			break
  8932  		}
  8933  		x := v_1.Args[0]
  8934  		mem := v_2
  8935  		v.reset(OpPPC64MOVHBRstore)
  8936  		v.AddArg3(ptr, x, mem)
  8937  		return true
  8938  	}
  8939  	return false
  8940  }
  8941  func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
  8942  	v_1 := v.Args[1]
  8943  	v_0 := v.Args[0]
  8944  	// match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8945  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8946  	// result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8947  	for {
  8948  		off1 := auxIntToInt32(v.AuxInt)
  8949  		sym1 := auxToSym(v.Aux)
  8950  		p := v_0
  8951  		if p.Op != OpPPC64MOVDaddr {
  8952  			break
  8953  		}
  8954  		off2 := auxIntToInt32(p.AuxInt)
  8955  		sym2 := auxToSym(p.Aux)
  8956  		ptr := p.Args[0]
  8957  		mem := v_1
  8958  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8959  			break
  8960  		}
  8961  		v.reset(OpPPC64MOVHZload)
  8962  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8963  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8964  		v.AddArg2(ptr, mem)
  8965  		return true
  8966  	}
  8967  	// match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
  8968  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8969  	// result: (MOVHZload [off1+int32(off2)] {sym} x mem)
  8970  	for {
  8971  		off1 := auxIntToInt32(v.AuxInt)
  8972  		sym := auxToSym(v.Aux)
  8973  		if v_0.Op != OpPPC64ADDconst {
  8974  			break
  8975  		}
  8976  		off2 := auxIntToInt64(v_0.AuxInt)
  8977  		x := v_0.Args[0]
  8978  		mem := v_1
  8979  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8980  			break
  8981  		}
  8982  		v.reset(OpPPC64MOVHZload)
  8983  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8984  		v.Aux = symToAux(sym)
  8985  		v.AddArg2(x, mem)
  8986  		return true
  8987  	}
  8988  	// match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem)
  8989  	// cond: sym == nil && p.Uses == 1
  8990  	// result: (MOVHZloadidx ptr idx mem)
  8991  	for {
  8992  		if auxIntToInt32(v.AuxInt) != 0 {
  8993  			break
  8994  		}
  8995  		sym := auxToSym(v.Aux)
  8996  		p := v_0
  8997  		if p.Op != OpPPC64ADD {
  8998  			break
  8999  		}
  9000  		idx := p.Args[1]
  9001  		ptr := p.Args[0]
  9002  		mem := v_1
  9003  		if !(sym == nil && p.Uses == 1) {
  9004  			break
  9005  		}
  9006  		v.reset(OpPPC64MOVHZloadidx)
  9007  		v.AddArg3(ptr, idx, mem)
  9008  		return true
  9009  	}
  9010  	return false
  9011  }
  9012  func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
  9013  	v_2 := v.Args[2]
  9014  	v_1 := v.Args[1]
  9015  	v_0 := v.Args[0]
  9016  	// match: (MOVHZloadidx ptr (MOVDconst [c]) mem)
  9017  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9018  	// result: (MOVHZload [int32(c)] ptr mem)
  9019  	for {
  9020  		ptr := v_0
  9021  		if v_1.Op != OpPPC64MOVDconst {
  9022  			break
  9023  		}
  9024  		c := auxIntToInt64(v_1.AuxInt)
  9025  		mem := v_2
  9026  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9027  			break
  9028  		}
  9029  		v.reset(OpPPC64MOVHZload)
  9030  		v.AuxInt = int32ToAuxInt(int32(c))
  9031  		v.AddArg2(ptr, mem)
  9032  		return true
  9033  	}
  9034  	// match: (MOVHZloadidx (MOVDconst [c]) ptr mem)
  9035  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9036  	// result: (MOVHZload [int32(c)] ptr mem)
  9037  	for {
  9038  		if v_0.Op != OpPPC64MOVDconst {
  9039  			break
  9040  		}
  9041  		c := auxIntToInt64(v_0.AuxInt)
  9042  		ptr := v_1
  9043  		mem := v_2
  9044  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9045  			break
  9046  		}
  9047  		v.reset(OpPPC64MOVHZload)
  9048  		v.AuxInt = int32ToAuxInt(int32(c))
  9049  		v.AddArg2(ptr, mem)
  9050  		return true
  9051  	}
  9052  	return false
  9053  }
  9054  func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
  9055  	v_0 := v.Args[0]
  9056  	b := v.Block
  9057  	typ := &b.Func.Config.Types
  9058  	// match: (MOVHZreg y:(ANDconst [c] _))
  9059  	// cond: uint64(c) <= 0xFFFF
  9060  	// result: y
  9061  	for {
  9062  		y := v_0
  9063  		if y.Op != OpPPC64ANDconst {
  9064  			break
  9065  		}
  9066  		c := auxIntToInt64(y.AuxInt)
  9067  		if !(uint64(c) <= 0xFFFF) {
  9068  			break
  9069  		}
  9070  		v.copyOf(y)
  9071  		return true
  9072  	}
  9073  	// match: (MOVHZreg (SRWconst [c] (MOVBZreg x)))
  9074  	// result: (SRWconst [c] (MOVBZreg x))
  9075  	for {
  9076  		if v_0.Op != OpPPC64SRWconst {
  9077  			break
  9078  		}
  9079  		c := auxIntToInt64(v_0.AuxInt)
  9080  		v_0_0 := v_0.Args[0]
  9081  		if v_0_0.Op != OpPPC64MOVBZreg {
  9082  			break
  9083  		}
  9084  		x := v_0_0.Args[0]
  9085  		v.reset(OpPPC64SRWconst)
  9086  		v.AuxInt = int64ToAuxInt(c)
  9087  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  9088  		v0.AddArg(x)
  9089  		v.AddArg(v0)
  9090  		return true
  9091  	}
  9092  	// match: (MOVHZreg (SRWconst [c] (MOVHZreg x)))
  9093  	// result: (SRWconst [c] (MOVHZreg x))
  9094  	for {
  9095  		if v_0.Op != OpPPC64SRWconst {
  9096  			break
  9097  		}
  9098  		c := auxIntToInt64(v_0.AuxInt)
  9099  		v_0_0 := v_0.Args[0]
  9100  		if v_0_0.Op != OpPPC64MOVHZreg {
  9101  			break
  9102  		}
  9103  		x := v_0_0.Args[0]
  9104  		v.reset(OpPPC64SRWconst)
  9105  		v.AuxInt = int64ToAuxInt(c)
  9106  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  9107  		v0.AddArg(x)
  9108  		v.AddArg(v0)
  9109  		return true
  9110  	}
  9111  	// match: (MOVHZreg (SRWconst [c] x))
  9112  	// cond: x.Type.Size() <= 16
  9113  	// result: (SRWconst [c] x)
  9114  	for {
  9115  		if v_0.Op != OpPPC64SRWconst {
  9116  			break
  9117  		}
  9118  		c := auxIntToInt64(v_0.AuxInt)
  9119  		x := v_0.Args[0]
  9120  		if !(x.Type.Size() <= 16) {
  9121  			break
  9122  		}
  9123  		v.reset(OpPPC64SRWconst)
  9124  		v.AuxInt = int64ToAuxInt(c)
  9125  		v.AddArg(x)
  9126  		return true
  9127  	}
  9128  	// match: (MOVHZreg (SRDconst [c] x))
  9129  	// cond: c>=48
  9130  	// result: (SRDconst [c] x)
  9131  	for {
  9132  		if v_0.Op != OpPPC64SRDconst {
  9133  			break
  9134  		}
  9135  		c := auxIntToInt64(v_0.AuxInt)
  9136  		x := v_0.Args[0]
  9137  		if !(c >= 48) {
  9138  			break
  9139  		}
  9140  		v.reset(OpPPC64SRDconst)
  9141  		v.AuxInt = int64ToAuxInt(c)
  9142  		v.AddArg(x)
  9143  		return true
  9144  	}
  9145  	// match: (MOVHZreg (SRWconst [c] x))
  9146  	// cond: c>=16
  9147  	// result: (SRWconst [c] x)
  9148  	for {
  9149  		if v_0.Op != OpPPC64SRWconst {
  9150  			break
  9151  		}
  9152  		c := auxIntToInt64(v_0.AuxInt)
  9153  		x := v_0.Args[0]
  9154  		if !(c >= 16) {
  9155  			break
  9156  		}
  9157  		v.reset(OpPPC64SRWconst)
  9158  		v.AuxInt = int64ToAuxInt(c)
  9159  		v.AddArg(x)
  9160  		return true
  9161  	}
  9162  	// match: (MOVHZreg (RLWINM [r] y))
  9163  	// cond: mergePPC64AndRlwinm(0xFFFF,r) != 0
  9164  	// result: (RLWINM [mergePPC64AndRlwinm(0xFFFF,r)] y)
  9165  	for {
  9166  		if v_0.Op != OpPPC64RLWINM {
  9167  			break
  9168  		}
  9169  		r := auxIntToInt64(v_0.AuxInt)
  9170  		y := v_0.Args[0]
  9171  		if !(mergePPC64AndRlwinm(0xFFFF, r) != 0) {
  9172  			break
  9173  		}
  9174  		v.reset(OpPPC64RLWINM)
  9175  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFFFF, r))
  9176  		v.AddArg(y)
  9177  		return true
  9178  	}
  9179  	// match: (MOVHZreg y:(MOVHZreg _))
  9180  	// result: y
  9181  	for {
  9182  		y := v_0
  9183  		if y.Op != OpPPC64MOVHZreg {
  9184  			break
  9185  		}
  9186  		v.copyOf(y)
  9187  		return true
  9188  	}
  9189  	// match: (MOVHZreg y:(MOVBZreg _))
  9190  	// result: y
  9191  	for {
  9192  		y := v_0
  9193  		if y.Op != OpPPC64MOVBZreg {
  9194  			break
  9195  		}
  9196  		v.copyOf(y)
  9197  		return true
  9198  	}
  9199  	// match: (MOVHZreg y:(MOVHBRload _ _))
  9200  	// result: y
  9201  	for {
  9202  		y := v_0
  9203  		if y.Op != OpPPC64MOVHBRload {
  9204  			break
  9205  		}
  9206  		v.copyOf(y)
  9207  		return true
  9208  	}
  9209  	// match: (MOVHZreg y:(MOVHreg x))
  9210  	// result: (MOVHZreg x)
  9211  	for {
  9212  		y := v_0
  9213  		if y.Op != OpPPC64MOVHreg {
  9214  			break
  9215  		}
  9216  		x := y.Args[0]
  9217  		v.reset(OpPPC64MOVHZreg)
  9218  		v.AddArg(x)
  9219  		return true
  9220  	}
  9221  	// match: (MOVHZreg (OR <t> x (MOVWZreg y)))
  9222  	// result: (MOVHZreg (OR <t> x y))
  9223  	for {
  9224  		if v_0.Op != OpPPC64OR {
  9225  			break
  9226  		}
  9227  		t := v_0.Type
  9228  		_ = v_0.Args[1]
  9229  		v_0_0 := v_0.Args[0]
  9230  		v_0_1 := v_0.Args[1]
  9231  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9232  			x := v_0_0
  9233  			if v_0_1.Op != OpPPC64MOVWZreg {
  9234  				continue
  9235  			}
  9236  			y := v_0_1.Args[0]
  9237  			v.reset(OpPPC64MOVHZreg)
  9238  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9239  			v0.AddArg2(x, y)
  9240  			v.AddArg(v0)
  9241  			return true
  9242  		}
  9243  		break
  9244  	}
  9245  	// match: (MOVHZreg (XOR <t> x (MOVWZreg y)))
  9246  	// result: (MOVHZreg (XOR <t> x y))
  9247  	for {
  9248  		if v_0.Op != OpPPC64XOR {
  9249  			break
  9250  		}
  9251  		t := v_0.Type
  9252  		_ = v_0.Args[1]
  9253  		v_0_0 := v_0.Args[0]
  9254  		v_0_1 := v_0.Args[1]
  9255  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9256  			x := v_0_0
  9257  			if v_0_1.Op != OpPPC64MOVWZreg {
  9258  				continue
  9259  			}
  9260  			y := v_0_1.Args[0]
  9261  			v.reset(OpPPC64MOVHZreg)
  9262  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9263  			v0.AddArg2(x, y)
  9264  			v.AddArg(v0)
  9265  			return true
  9266  		}
  9267  		break
  9268  	}
  9269  	// match: (MOVHZreg (AND <t> x (MOVWZreg y)))
  9270  	// result: (MOVHZreg (AND <t> x y))
  9271  	for {
  9272  		if v_0.Op != OpPPC64AND {
  9273  			break
  9274  		}
  9275  		t := v_0.Type
  9276  		_ = v_0.Args[1]
  9277  		v_0_0 := v_0.Args[0]
  9278  		v_0_1 := v_0.Args[1]
  9279  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9280  			x := v_0_0
  9281  			if v_0_1.Op != OpPPC64MOVWZreg {
  9282  				continue
  9283  			}
  9284  			y := v_0_1.Args[0]
  9285  			v.reset(OpPPC64MOVHZreg)
  9286  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9287  			v0.AddArg2(x, y)
  9288  			v.AddArg(v0)
  9289  			return true
  9290  		}
  9291  		break
  9292  	}
  9293  	// match: (MOVHZreg (OR <t> x (MOVHZreg y)))
  9294  	// result: (MOVHZreg (OR <t> x y))
  9295  	for {
  9296  		if v_0.Op != OpPPC64OR {
  9297  			break
  9298  		}
  9299  		t := v_0.Type
  9300  		_ = v_0.Args[1]
  9301  		v_0_0 := v_0.Args[0]
  9302  		v_0_1 := v_0.Args[1]
  9303  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9304  			x := v_0_0
  9305  			if v_0_1.Op != OpPPC64MOVHZreg {
  9306  				continue
  9307  			}
  9308  			y := v_0_1.Args[0]
  9309  			v.reset(OpPPC64MOVHZreg)
  9310  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9311  			v0.AddArg2(x, y)
  9312  			v.AddArg(v0)
  9313  			return true
  9314  		}
  9315  		break
  9316  	}
  9317  	// match: (MOVHZreg (XOR <t> x (MOVHZreg y)))
  9318  	// result: (MOVHZreg (XOR <t> x y))
  9319  	for {
  9320  		if v_0.Op != OpPPC64XOR {
  9321  			break
  9322  		}
  9323  		t := v_0.Type
  9324  		_ = v_0.Args[1]
  9325  		v_0_0 := v_0.Args[0]
  9326  		v_0_1 := v_0.Args[1]
  9327  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9328  			x := v_0_0
  9329  			if v_0_1.Op != OpPPC64MOVHZreg {
  9330  				continue
  9331  			}
  9332  			y := v_0_1.Args[0]
  9333  			v.reset(OpPPC64MOVHZreg)
  9334  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9335  			v0.AddArg2(x, y)
  9336  			v.AddArg(v0)
  9337  			return true
  9338  		}
  9339  		break
  9340  	}
  9341  	// match: (MOVHZreg (AND <t> x (MOVHZreg y)))
  9342  	// result: (MOVHZreg (AND <t> x y))
  9343  	for {
  9344  		if v_0.Op != OpPPC64AND {
  9345  			break
  9346  		}
  9347  		t := v_0.Type
  9348  		_ = v_0.Args[1]
  9349  		v_0_0 := v_0.Args[0]
  9350  		v_0_1 := v_0.Args[1]
  9351  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9352  			x := v_0_0
  9353  			if v_0_1.Op != OpPPC64MOVHZreg {
  9354  				continue
  9355  			}
  9356  			y := v_0_1.Args[0]
  9357  			v.reset(OpPPC64MOVHZreg)
  9358  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9359  			v0.AddArg2(x, y)
  9360  			v.AddArg(v0)
  9361  			return true
  9362  		}
  9363  		break
  9364  	}
  9365  	// match: (MOVHZreg z:(ANDconst [c] (MOVBZload ptr x)))
  9366  	// result: z
  9367  	for {
  9368  		z := v_0
  9369  		if z.Op != OpPPC64ANDconst {
  9370  			break
  9371  		}
  9372  		z_0 := z.Args[0]
  9373  		if z_0.Op != OpPPC64MOVBZload {
  9374  			break
  9375  		}
  9376  		v.copyOf(z)
  9377  		return true
  9378  	}
  9379  	// match: (MOVHZreg z:(AND y (MOVHZload ptr x)))
  9380  	// result: z
  9381  	for {
  9382  		z := v_0
  9383  		if z.Op != OpPPC64AND {
  9384  			break
  9385  		}
  9386  		_ = z.Args[1]
  9387  		z_0 := z.Args[0]
  9388  		z_1 := z.Args[1]
  9389  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  9390  			if z_1.Op != OpPPC64MOVHZload {
  9391  				continue
  9392  			}
  9393  			v.copyOf(z)
  9394  			return true
  9395  		}
  9396  		break
  9397  	}
  9398  	// match: (MOVHZreg z:(ANDconst [c] (MOVHZload ptr x)))
  9399  	// result: z
  9400  	for {
  9401  		z := v_0
  9402  		if z.Op != OpPPC64ANDconst {
  9403  			break
  9404  		}
  9405  		z_0 := z.Args[0]
  9406  		if z_0.Op != OpPPC64MOVHZload {
  9407  			break
  9408  		}
  9409  		v.copyOf(z)
  9410  		return true
  9411  	}
  9412  	// match: (MOVHZreg x:(MOVBZload _ _))
  9413  	// result: x
  9414  	for {
  9415  		x := v_0
  9416  		if x.Op != OpPPC64MOVBZload {
  9417  			break
  9418  		}
  9419  		v.copyOf(x)
  9420  		return true
  9421  	}
  9422  	// match: (MOVHZreg x:(MOVBZloadidx _ _ _))
  9423  	// result: x
  9424  	for {
  9425  		x := v_0
  9426  		if x.Op != OpPPC64MOVBZloadidx {
  9427  			break
  9428  		}
  9429  		v.copyOf(x)
  9430  		return true
  9431  	}
  9432  	// match: (MOVHZreg x:(MOVHZload _ _))
  9433  	// result: x
  9434  	for {
  9435  		x := v_0
  9436  		if x.Op != OpPPC64MOVHZload {
  9437  			break
  9438  		}
  9439  		v.copyOf(x)
  9440  		return true
  9441  	}
  9442  	// match: (MOVHZreg x:(MOVHZloadidx _ _ _))
  9443  	// result: x
  9444  	for {
  9445  		x := v_0
  9446  		if x.Op != OpPPC64MOVHZloadidx {
  9447  			break
  9448  		}
  9449  		v.copyOf(x)
  9450  		return true
  9451  	}
  9452  	// match: (MOVHZreg x:(Arg <t>))
  9453  	// cond: (is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()
  9454  	// result: x
  9455  	for {
  9456  		x := v_0
  9457  		if x.Op != OpArg {
  9458  			break
  9459  		}
  9460  		t := x.Type
  9461  		if !((is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()) {
  9462  			break
  9463  		}
  9464  		v.copyOf(x)
  9465  		return true
  9466  	}
  9467  	// match: (MOVHZreg (MOVDconst [c]))
  9468  	// result: (MOVDconst [int64(uint16(c))])
  9469  	for {
  9470  		if v_0.Op != OpPPC64MOVDconst {
  9471  			break
  9472  		}
  9473  		c := auxIntToInt64(v_0.AuxInt)
  9474  		v.reset(OpPPC64MOVDconst)
  9475  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  9476  		return true
  9477  	}
  9478  	return false
  9479  }
  9480  func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
  9481  	v_1 := v.Args[1]
  9482  	v_0 := v.Args[0]
  9483  	// match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  9484  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9485  	// result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9486  	for {
  9487  		off1 := auxIntToInt32(v.AuxInt)
  9488  		sym1 := auxToSym(v.Aux)
  9489  		p := v_0
  9490  		if p.Op != OpPPC64MOVDaddr {
  9491  			break
  9492  		}
  9493  		off2 := auxIntToInt32(p.AuxInt)
  9494  		sym2 := auxToSym(p.Aux)
  9495  		ptr := p.Args[0]
  9496  		mem := v_1
  9497  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9498  			break
  9499  		}
  9500  		v.reset(OpPPC64MOVHload)
  9501  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9502  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9503  		v.AddArg2(ptr, mem)
  9504  		return true
  9505  	}
  9506  	// match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
  9507  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9508  	// result: (MOVHload [off1+int32(off2)] {sym} x mem)
  9509  	for {
  9510  		off1 := auxIntToInt32(v.AuxInt)
  9511  		sym := auxToSym(v.Aux)
  9512  		if v_0.Op != OpPPC64ADDconst {
  9513  			break
  9514  		}
  9515  		off2 := auxIntToInt64(v_0.AuxInt)
  9516  		x := v_0.Args[0]
  9517  		mem := v_1
  9518  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9519  			break
  9520  		}
  9521  		v.reset(OpPPC64MOVHload)
  9522  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9523  		v.Aux = symToAux(sym)
  9524  		v.AddArg2(x, mem)
  9525  		return true
  9526  	}
  9527  	// match: (MOVHload [0] {sym} p:(ADD ptr idx) mem)
  9528  	// cond: sym == nil && p.Uses == 1
  9529  	// result: (MOVHloadidx ptr idx mem)
  9530  	for {
  9531  		if auxIntToInt32(v.AuxInt) != 0 {
  9532  			break
  9533  		}
  9534  		sym := auxToSym(v.Aux)
  9535  		p := v_0
  9536  		if p.Op != OpPPC64ADD {
  9537  			break
  9538  		}
  9539  		idx := p.Args[1]
  9540  		ptr := p.Args[0]
  9541  		mem := v_1
  9542  		if !(sym == nil && p.Uses == 1) {
  9543  			break
  9544  		}
  9545  		v.reset(OpPPC64MOVHloadidx)
  9546  		v.AddArg3(ptr, idx, mem)
  9547  		return true
  9548  	}
  9549  	return false
  9550  }
  9551  func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
  9552  	v_2 := v.Args[2]
  9553  	v_1 := v.Args[1]
  9554  	v_0 := v.Args[0]
  9555  	// match: (MOVHloadidx ptr (MOVDconst [c]) mem)
  9556  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9557  	// result: (MOVHload [int32(c)] ptr mem)
  9558  	for {
  9559  		ptr := v_0
  9560  		if v_1.Op != OpPPC64MOVDconst {
  9561  			break
  9562  		}
  9563  		c := auxIntToInt64(v_1.AuxInt)
  9564  		mem := v_2
  9565  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9566  			break
  9567  		}
  9568  		v.reset(OpPPC64MOVHload)
  9569  		v.AuxInt = int32ToAuxInt(int32(c))
  9570  		v.AddArg2(ptr, mem)
  9571  		return true
  9572  	}
  9573  	// match: (MOVHloadidx (MOVDconst [c]) ptr mem)
  9574  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9575  	// result: (MOVHload [int32(c)] ptr mem)
  9576  	for {
  9577  		if v_0.Op != OpPPC64MOVDconst {
  9578  			break
  9579  		}
  9580  		c := auxIntToInt64(v_0.AuxInt)
  9581  		ptr := v_1
  9582  		mem := v_2
  9583  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9584  			break
  9585  		}
  9586  		v.reset(OpPPC64MOVHload)
  9587  		v.AuxInt = int32ToAuxInt(int32(c))
  9588  		v.AddArg2(ptr, mem)
  9589  		return true
  9590  	}
  9591  	return false
  9592  }
  9593  func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
  9594  	v_0 := v.Args[0]
  9595  	b := v.Block
  9596  	typ := &b.Func.Config.Types
  9597  	// match: (MOVHreg y:(ANDconst [c] _))
  9598  	// cond: uint64(c) <= 0x7FFF
  9599  	// result: y
  9600  	for {
  9601  		y := v_0
  9602  		if y.Op != OpPPC64ANDconst {
  9603  			break
  9604  		}
  9605  		c := auxIntToInt64(y.AuxInt)
  9606  		if !(uint64(c) <= 0x7FFF) {
  9607  			break
  9608  		}
  9609  		v.copyOf(y)
  9610  		return true
  9611  	}
  9612  	// match: (MOVHreg (SRAWconst [c] (MOVBreg x)))
  9613  	// result: (SRAWconst [c] (MOVBreg x))
  9614  	for {
  9615  		if v_0.Op != OpPPC64SRAWconst {
  9616  			break
  9617  		}
  9618  		c := auxIntToInt64(v_0.AuxInt)
  9619  		v_0_0 := v_0.Args[0]
  9620  		if v_0_0.Op != OpPPC64MOVBreg {
  9621  			break
  9622  		}
  9623  		x := v_0_0.Args[0]
  9624  		v.reset(OpPPC64SRAWconst)
  9625  		v.AuxInt = int64ToAuxInt(c)
  9626  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  9627  		v0.AddArg(x)
  9628  		v.AddArg(v0)
  9629  		return true
  9630  	}
  9631  	// match: (MOVHreg (SRAWconst [c] (MOVHreg x)))
  9632  	// result: (SRAWconst [c] (MOVHreg x))
  9633  	for {
  9634  		if v_0.Op != OpPPC64SRAWconst {
  9635  			break
  9636  		}
  9637  		c := auxIntToInt64(v_0.AuxInt)
  9638  		v_0_0 := v_0.Args[0]
  9639  		if v_0_0.Op != OpPPC64MOVHreg {
  9640  			break
  9641  		}
  9642  		x := v_0_0.Args[0]
  9643  		v.reset(OpPPC64SRAWconst)
  9644  		v.AuxInt = int64ToAuxInt(c)
  9645  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
  9646  		v0.AddArg(x)
  9647  		v.AddArg(v0)
  9648  		return true
  9649  	}
  9650  	// match: (MOVHreg (SRAWconst [c] x))
  9651  	// cond: x.Type.Size() <= 16
  9652  	// result: (SRAWconst [c] x)
  9653  	for {
  9654  		if v_0.Op != OpPPC64SRAWconst {
  9655  			break
  9656  		}
  9657  		c := auxIntToInt64(v_0.AuxInt)
  9658  		x := v_0.Args[0]
  9659  		if !(x.Type.Size() <= 16) {
  9660  			break
  9661  		}
  9662  		v.reset(OpPPC64SRAWconst)
  9663  		v.AuxInt = int64ToAuxInt(c)
  9664  		v.AddArg(x)
  9665  		return true
  9666  	}
  9667  	// match: (MOVHreg (SRDconst [c] x))
  9668  	// cond: c>48
  9669  	// result: (SRDconst [c] x)
  9670  	for {
  9671  		if v_0.Op != OpPPC64SRDconst {
  9672  			break
  9673  		}
  9674  		c := auxIntToInt64(v_0.AuxInt)
  9675  		x := v_0.Args[0]
  9676  		if !(c > 48) {
  9677  			break
  9678  		}
  9679  		v.reset(OpPPC64SRDconst)
  9680  		v.AuxInt = int64ToAuxInt(c)
  9681  		v.AddArg(x)
  9682  		return true
  9683  	}
  9684  	// match: (MOVHreg (SRDconst [c] x))
  9685  	// cond: c==48
  9686  	// result: (SRADconst [c] x)
  9687  	for {
  9688  		if v_0.Op != OpPPC64SRDconst {
  9689  			break
  9690  		}
  9691  		c := auxIntToInt64(v_0.AuxInt)
  9692  		x := v_0.Args[0]
  9693  		if !(c == 48) {
  9694  			break
  9695  		}
  9696  		v.reset(OpPPC64SRADconst)
  9697  		v.AuxInt = int64ToAuxInt(c)
  9698  		v.AddArg(x)
  9699  		return true
  9700  	}
  9701  	// match: (MOVHreg (SRADconst [c] x))
  9702  	// cond: c>=48
  9703  	// result: (SRADconst [c] x)
  9704  	for {
  9705  		if v_0.Op != OpPPC64SRADconst {
  9706  			break
  9707  		}
  9708  		c := auxIntToInt64(v_0.AuxInt)
  9709  		x := v_0.Args[0]
  9710  		if !(c >= 48) {
  9711  			break
  9712  		}
  9713  		v.reset(OpPPC64SRADconst)
  9714  		v.AuxInt = int64ToAuxInt(c)
  9715  		v.AddArg(x)
  9716  		return true
  9717  	}
  9718  	// match: (MOVHreg (SRWconst [c] x))
  9719  	// cond: c>16
  9720  	// result: (SRWconst [c] x)
  9721  	for {
  9722  		if v_0.Op != OpPPC64SRWconst {
  9723  			break
  9724  		}
  9725  		c := auxIntToInt64(v_0.AuxInt)
  9726  		x := v_0.Args[0]
  9727  		if !(c > 16) {
  9728  			break
  9729  		}
  9730  		v.reset(OpPPC64SRWconst)
  9731  		v.AuxInt = int64ToAuxInt(c)
  9732  		v.AddArg(x)
  9733  		return true
  9734  	}
  9735  	// match: (MOVHreg (SRAWconst [c] x))
  9736  	// cond: c>=16
  9737  	// result: (SRAWconst [c] x)
  9738  	for {
  9739  		if v_0.Op != OpPPC64SRAWconst {
  9740  			break
  9741  		}
  9742  		c := auxIntToInt64(v_0.AuxInt)
  9743  		x := v_0.Args[0]
  9744  		if !(c >= 16) {
  9745  			break
  9746  		}
  9747  		v.reset(OpPPC64SRAWconst)
  9748  		v.AuxInt = int64ToAuxInt(c)
  9749  		v.AddArg(x)
  9750  		return true
  9751  	}
  9752  	// match: (MOVHreg (SRWconst [c] x))
  9753  	// cond: c==16
  9754  	// result: (SRAWconst [c] x)
  9755  	for {
  9756  		if v_0.Op != OpPPC64SRWconst {
  9757  			break
  9758  		}
  9759  		c := auxIntToInt64(v_0.AuxInt)
  9760  		x := v_0.Args[0]
  9761  		if !(c == 16) {
  9762  			break
  9763  		}
  9764  		v.reset(OpPPC64SRAWconst)
  9765  		v.AuxInt = int64ToAuxInt(c)
  9766  		v.AddArg(x)
  9767  		return true
  9768  	}
  9769  	// match: (MOVHreg y:(MOVHreg _))
  9770  	// result: y
  9771  	for {
  9772  		y := v_0
  9773  		if y.Op != OpPPC64MOVHreg {
  9774  			break
  9775  		}
  9776  		v.copyOf(y)
  9777  		return true
  9778  	}
  9779  	// match: (MOVHreg y:(MOVBreg _))
  9780  	// result: y
  9781  	for {
  9782  		y := v_0
  9783  		if y.Op != OpPPC64MOVBreg {
  9784  			break
  9785  		}
  9786  		v.copyOf(y)
  9787  		return true
  9788  	}
  9789  	// match: (MOVHreg y:(MOVHZreg x))
  9790  	// result: (MOVHreg x)
  9791  	for {
  9792  		y := v_0
  9793  		if y.Op != OpPPC64MOVHZreg {
  9794  			break
  9795  		}
  9796  		x := y.Args[0]
  9797  		v.reset(OpPPC64MOVHreg)
  9798  		v.AddArg(x)
  9799  		return true
  9800  	}
  9801  	// match: (MOVHreg x:(MOVHload _ _))
  9802  	// result: x
  9803  	for {
  9804  		x := v_0
  9805  		if x.Op != OpPPC64MOVHload {
  9806  			break
  9807  		}
  9808  		v.copyOf(x)
  9809  		return true
  9810  	}
  9811  	// match: (MOVHreg x:(MOVHloadidx _ _ _))
  9812  	// result: x
  9813  	for {
  9814  		x := v_0
  9815  		if x.Op != OpPPC64MOVHloadidx {
  9816  			break
  9817  		}
  9818  		v.copyOf(x)
  9819  		return true
  9820  	}
  9821  	// match: (MOVHreg x:(Arg <t>))
  9822  	// cond: (is8BitInt(t) || is16BitInt(t)) && t.IsSigned()
  9823  	// result: x
  9824  	for {
  9825  		x := v_0
  9826  		if x.Op != OpArg {
  9827  			break
  9828  		}
  9829  		t := x.Type
  9830  		if !((is8BitInt(t) || is16BitInt(t)) && t.IsSigned()) {
  9831  			break
  9832  		}
  9833  		v.copyOf(x)
  9834  		return true
  9835  	}
  9836  	// match: (MOVHreg (MOVDconst [c]))
  9837  	// result: (MOVDconst [int64(int16(c))])
  9838  	for {
  9839  		if v_0.Op != OpPPC64MOVDconst {
  9840  			break
  9841  		}
  9842  		c := auxIntToInt64(v_0.AuxInt)
  9843  		v.reset(OpPPC64MOVDconst)
  9844  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  9845  		return true
  9846  	}
  9847  	return false
  9848  }
  9849  func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
  9850  	v_2 := v.Args[2]
  9851  	v_1 := v.Args[1]
  9852  	v_0 := v.Args[0]
  9853  	b := v.Block
  9854  	// match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
  9855  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9856  	// result: (MOVHstore [off1+int32(off2)] {sym} x val mem)
  9857  	for {
  9858  		off1 := auxIntToInt32(v.AuxInt)
  9859  		sym := auxToSym(v.Aux)
  9860  		if v_0.Op != OpPPC64ADDconst {
  9861  			break
  9862  		}
  9863  		off2 := auxIntToInt64(v_0.AuxInt)
  9864  		x := v_0.Args[0]
  9865  		val := v_1
  9866  		mem := v_2
  9867  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9868  			break
  9869  		}
  9870  		v.reset(OpPPC64MOVHstore)
  9871  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9872  		v.Aux = symToAux(sym)
  9873  		v.AddArg3(x, val, mem)
  9874  		return true
  9875  	}
  9876  	// match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  9877  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9878  	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9879  	for {
  9880  		off1 := auxIntToInt32(v.AuxInt)
  9881  		sym1 := auxToSym(v.Aux)
  9882  		p := v_0
  9883  		if p.Op != OpPPC64MOVDaddr {
  9884  			break
  9885  		}
  9886  		off2 := auxIntToInt32(p.AuxInt)
  9887  		sym2 := auxToSym(p.Aux)
  9888  		ptr := p.Args[0]
  9889  		val := v_1
  9890  		mem := v_2
  9891  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9892  			break
  9893  		}
  9894  		v.reset(OpPPC64MOVHstore)
  9895  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9896  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9897  		v.AddArg3(ptr, val, mem)
  9898  		return true
  9899  	}
  9900  	// match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
  9901  	// result: (MOVHstorezero [off] {sym} ptr mem)
  9902  	for {
  9903  		off := auxIntToInt32(v.AuxInt)
  9904  		sym := auxToSym(v.Aux)
  9905  		ptr := v_0
  9906  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  9907  			break
  9908  		}
  9909  		mem := v_2
  9910  		v.reset(OpPPC64MOVHstorezero)
  9911  		v.AuxInt = int32ToAuxInt(off)
  9912  		v.Aux = symToAux(sym)
  9913  		v.AddArg2(ptr, mem)
  9914  		return true
  9915  	}
  9916  	// match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem)
  9917  	// cond: sym == nil && p.Uses == 1
  9918  	// result: (MOVHstoreidx ptr idx val mem)
  9919  	for {
  9920  		if auxIntToInt32(v.AuxInt) != 0 {
  9921  			break
  9922  		}
  9923  		sym := auxToSym(v.Aux)
  9924  		p := v_0
  9925  		if p.Op != OpPPC64ADD {
  9926  			break
  9927  		}
  9928  		idx := p.Args[1]
  9929  		ptr := p.Args[0]
  9930  		val := v_1
  9931  		mem := v_2
  9932  		if !(sym == nil && p.Uses == 1) {
  9933  			break
  9934  		}
  9935  		v.reset(OpPPC64MOVHstoreidx)
  9936  		v.AddArg4(ptr, idx, val, mem)
  9937  		return true
  9938  	}
  9939  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  9940  	// result: (MOVHstore [off] {sym} ptr x mem)
  9941  	for {
  9942  		off := auxIntToInt32(v.AuxInt)
  9943  		sym := auxToSym(v.Aux)
  9944  		ptr := v_0
  9945  		if v_1.Op != OpPPC64MOVHreg {
  9946  			break
  9947  		}
  9948  		x := v_1.Args[0]
  9949  		mem := v_2
  9950  		v.reset(OpPPC64MOVHstore)
  9951  		v.AuxInt = int32ToAuxInt(off)
  9952  		v.Aux = symToAux(sym)
  9953  		v.AddArg3(ptr, x, mem)
  9954  		return true
  9955  	}
  9956  	// match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
  9957  	// result: (MOVHstore [off] {sym} ptr x mem)
  9958  	for {
  9959  		off := auxIntToInt32(v.AuxInt)
  9960  		sym := auxToSym(v.Aux)
  9961  		ptr := v_0
  9962  		if v_1.Op != OpPPC64MOVHZreg {
  9963  			break
  9964  		}
  9965  		x := v_1.Args[0]
  9966  		mem := v_2
  9967  		v.reset(OpPPC64MOVHstore)
  9968  		v.AuxInt = int32ToAuxInt(off)
  9969  		v.Aux = symToAux(sym)
  9970  		v.AddArg3(ptr, x, mem)
  9971  		return true
  9972  	}
  9973  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  9974  	// result: (MOVHstore [off] {sym} ptr x mem)
  9975  	for {
  9976  		off := auxIntToInt32(v.AuxInt)
  9977  		sym := auxToSym(v.Aux)
  9978  		ptr := v_0
  9979  		if v_1.Op != OpPPC64MOVWreg {
  9980  			break
  9981  		}
  9982  		x := v_1.Args[0]
  9983  		mem := v_2
  9984  		v.reset(OpPPC64MOVHstore)
  9985  		v.AuxInt = int32ToAuxInt(off)
  9986  		v.Aux = symToAux(sym)
  9987  		v.AddArg3(ptr, x, mem)
  9988  		return true
  9989  	}
  9990  	// match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem)
  9991  	// result: (MOVHstore [off] {sym} ptr x mem)
  9992  	for {
  9993  		off := auxIntToInt32(v.AuxInt)
  9994  		sym := auxToSym(v.Aux)
  9995  		ptr := v_0
  9996  		if v_1.Op != OpPPC64MOVWZreg {
  9997  			break
  9998  		}
  9999  		x := v_1.Args[0]
 10000  		mem := v_2
 10001  		v.reset(OpPPC64MOVHstore)
 10002  		v.AuxInt = int32ToAuxInt(off)
 10003  		v.Aux = symToAux(sym)
 10004  		v.AddArg3(ptr, x, mem)
 10005  		return true
 10006  	}
 10007  	// match: (MOVHstore [off] {sym} ptr r:(BRH val) mem)
 10008  	// cond: r.Uses == 1
 10009  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 10010  	for {
 10011  		off := auxIntToInt32(v.AuxInt)
 10012  		sym := auxToSym(v.Aux)
 10013  		ptr := v_0
 10014  		r := v_1
 10015  		if r.Op != OpPPC64BRH {
 10016  			break
 10017  		}
 10018  		val := r.Args[0]
 10019  		mem := v_2
 10020  		if !(r.Uses == 1) {
 10021  			break
 10022  		}
 10023  		v.reset(OpPPC64MOVHBRstore)
 10024  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 10025  		v0.AuxInt = int32ToAuxInt(off)
 10026  		v0.Aux = symToAux(sym)
 10027  		v0.AddArg(ptr)
 10028  		v.AddArg3(v0, val, mem)
 10029  		return true
 10030  	}
 10031  	// match: (MOVHstore [off] {sym} ptr (Bswap16 val) mem)
 10032  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 10033  	for {
 10034  		off := auxIntToInt32(v.AuxInt)
 10035  		sym := auxToSym(v.Aux)
 10036  		ptr := v_0
 10037  		if v_1.Op != OpBswap16 {
 10038  			break
 10039  		}
 10040  		val := v_1.Args[0]
 10041  		mem := v_2
 10042  		v.reset(OpPPC64MOVHBRstore)
 10043  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 10044  		v0.AuxInt = int32ToAuxInt(off)
 10045  		v0.Aux = symToAux(sym)
 10046  		v0.AddArg(ptr)
 10047  		v.AddArg3(v0, val, mem)
 10048  		return true
 10049  	}
 10050  	return false
 10051  }
 10052  func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
 10053  	v_3 := v.Args[3]
 10054  	v_2 := v.Args[2]
 10055  	v_1 := v.Args[1]
 10056  	v_0 := v.Args[0]
 10057  	// match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
 10058  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10059  	// result: (MOVHstore [int32(c)] ptr val mem)
 10060  	for {
 10061  		ptr := v_0
 10062  		if v_1.Op != OpPPC64MOVDconst {
 10063  			break
 10064  		}
 10065  		c := auxIntToInt64(v_1.AuxInt)
 10066  		val := v_2
 10067  		mem := v_3
 10068  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10069  			break
 10070  		}
 10071  		v.reset(OpPPC64MOVHstore)
 10072  		v.AuxInt = int32ToAuxInt(int32(c))
 10073  		v.AddArg3(ptr, val, mem)
 10074  		return true
 10075  	}
 10076  	// match: (MOVHstoreidx (MOVDconst [c]) ptr val mem)
 10077  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10078  	// result: (MOVHstore [int32(c)] ptr val mem)
 10079  	for {
 10080  		if v_0.Op != OpPPC64MOVDconst {
 10081  			break
 10082  		}
 10083  		c := auxIntToInt64(v_0.AuxInt)
 10084  		ptr := v_1
 10085  		val := v_2
 10086  		mem := v_3
 10087  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10088  			break
 10089  		}
 10090  		v.reset(OpPPC64MOVHstore)
 10091  		v.AuxInt = int32ToAuxInt(int32(c))
 10092  		v.AddArg3(ptr, val, mem)
 10093  		return true
 10094  	}
 10095  	// match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
 10096  	// result: (MOVHstoreidx ptr idx x mem)
 10097  	for {
 10098  		ptr := v_0
 10099  		idx := v_1
 10100  		if v_2.Op != OpPPC64MOVHreg {
 10101  			break
 10102  		}
 10103  		x := v_2.Args[0]
 10104  		mem := v_3
 10105  		v.reset(OpPPC64MOVHstoreidx)
 10106  		v.AddArg4(ptr, idx, x, mem)
 10107  		return true
 10108  	}
 10109  	// match: (MOVHstoreidx ptr idx (MOVHZreg x) mem)
 10110  	// result: (MOVHstoreidx ptr idx x mem)
 10111  	for {
 10112  		ptr := v_0
 10113  		idx := v_1
 10114  		if v_2.Op != OpPPC64MOVHZreg {
 10115  			break
 10116  		}
 10117  		x := v_2.Args[0]
 10118  		mem := v_3
 10119  		v.reset(OpPPC64MOVHstoreidx)
 10120  		v.AddArg4(ptr, idx, x, mem)
 10121  		return true
 10122  	}
 10123  	// match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
 10124  	// result: (MOVHstoreidx ptr idx x mem)
 10125  	for {
 10126  		ptr := v_0
 10127  		idx := v_1
 10128  		if v_2.Op != OpPPC64MOVWreg {
 10129  			break
 10130  		}
 10131  		x := v_2.Args[0]
 10132  		mem := v_3
 10133  		v.reset(OpPPC64MOVHstoreidx)
 10134  		v.AddArg4(ptr, idx, x, mem)
 10135  		return true
 10136  	}
 10137  	// match: (MOVHstoreidx ptr idx (MOVWZreg x) mem)
 10138  	// result: (MOVHstoreidx ptr idx x mem)
 10139  	for {
 10140  		ptr := v_0
 10141  		idx := v_1
 10142  		if v_2.Op != OpPPC64MOVWZreg {
 10143  			break
 10144  		}
 10145  		x := v_2.Args[0]
 10146  		mem := v_3
 10147  		v.reset(OpPPC64MOVHstoreidx)
 10148  		v.AddArg4(ptr, idx, x, mem)
 10149  		return true
 10150  	}
 10151  	// match: (MOVHstoreidx ptr idx r:(BRH val) mem)
 10152  	// cond: r.Uses == 1
 10153  	// result: (MOVHBRstoreidx ptr idx val mem)
 10154  	for {
 10155  		ptr := v_0
 10156  		idx := v_1
 10157  		r := v_2
 10158  		if r.Op != OpPPC64BRH {
 10159  			break
 10160  		}
 10161  		val := r.Args[0]
 10162  		mem := v_3
 10163  		if !(r.Uses == 1) {
 10164  			break
 10165  		}
 10166  		v.reset(OpPPC64MOVHBRstoreidx)
 10167  		v.AddArg4(ptr, idx, val, mem)
 10168  		return true
 10169  	}
 10170  	// match: (MOVHstoreidx ptr idx (Bswap16 val) mem)
 10171  	// result: (MOVHBRstoreidx ptr idx val mem)
 10172  	for {
 10173  		ptr := v_0
 10174  		idx := v_1
 10175  		if v_2.Op != OpBswap16 {
 10176  			break
 10177  		}
 10178  		val := v_2.Args[0]
 10179  		mem := v_3
 10180  		v.reset(OpPPC64MOVHBRstoreidx)
 10181  		v.AddArg4(ptr, idx, val, mem)
 10182  		return true
 10183  	}
 10184  	return false
 10185  }
 10186  func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
 10187  	v_1 := v.Args[1]
 10188  	v_0 := v.Args[0]
 10189  	// match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
 10190  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
 10191  	// result: (MOVHstorezero [off1+int32(off2)] {sym} x mem)
 10192  	for {
 10193  		off1 := auxIntToInt32(v.AuxInt)
 10194  		sym := auxToSym(v.Aux)
 10195  		if v_0.Op != OpPPC64ADDconst {
 10196  			break
 10197  		}
 10198  		off2 := auxIntToInt64(v_0.AuxInt)
 10199  		x := v_0.Args[0]
 10200  		mem := v_1
 10201  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
 10202  			break
 10203  		}
 10204  		v.reset(OpPPC64MOVHstorezero)
 10205  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10206  		v.Aux = symToAux(sym)
 10207  		v.AddArg2(x, mem)
 10208  		return true
 10209  	}
 10210  	// match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 10211  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10212  	// result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 10213  	for {
 10214  		off1 := auxIntToInt32(v.AuxInt)
 10215  		sym1 := auxToSym(v.Aux)
 10216  		p := v_0
 10217  		if p.Op != OpPPC64MOVDaddr {
 10218  			break
 10219  		}
 10220  		off2 := auxIntToInt32(p.AuxInt)
 10221  		sym2 := auxToSym(p.Aux)
 10222  		x := p.Args[0]
 10223  		mem := v_1
 10224  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10225  			break
 10226  		}
 10227  		v.reset(OpPPC64MOVHstorezero)
 10228  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10229  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10230  		v.AddArg2(x, mem)
 10231  		return true
 10232  	}
 10233  	return false
 10234  }
 10235  func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
 10236  	v_2 := v.Args[2]
 10237  	v_1 := v.Args[1]
 10238  	v_0 := v.Args[0]
 10239  	// match: (MOVWBRstore ptr (MOVWreg x) mem)
 10240  	// result: (MOVWBRstore ptr x mem)
 10241  	for {
 10242  		ptr := v_0
 10243  		if v_1.Op != OpPPC64MOVWreg {
 10244  			break
 10245  		}
 10246  		x := v_1.Args[0]
 10247  		mem := v_2
 10248  		v.reset(OpPPC64MOVWBRstore)
 10249  		v.AddArg3(ptr, x, mem)
 10250  		return true
 10251  	}
 10252  	// match: (MOVWBRstore ptr (MOVWZreg x) mem)
 10253  	// result: (MOVWBRstore ptr x mem)
 10254  	for {
 10255  		ptr := v_0
 10256  		if v_1.Op != OpPPC64MOVWZreg {
 10257  			break
 10258  		}
 10259  		x := v_1.Args[0]
 10260  		mem := v_2
 10261  		v.reset(OpPPC64MOVWBRstore)
 10262  		v.AddArg3(ptr, x, mem)
 10263  		return true
 10264  	}
 10265  	return false
 10266  }
 10267  func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
 10268  	v_1 := v.Args[1]
 10269  	v_0 := v.Args[0]
 10270  	// match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10271  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10272  	// result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10273  	for {
 10274  		off1 := auxIntToInt32(v.AuxInt)
 10275  		sym1 := auxToSym(v.Aux)
 10276  		p := v_0
 10277  		if p.Op != OpPPC64MOVDaddr {
 10278  			break
 10279  		}
 10280  		off2 := auxIntToInt32(p.AuxInt)
 10281  		sym2 := auxToSym(p.Aux)
 10282  		ptr := p.Args[0]
 10283  		mem := v_1
 10284  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10285  			break
 10286  		}
 10287  		v.reset(OpPPC64MOVWZload)
 10288  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10289  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10290  		v.AddArg2(ptr, mem)
 10291  		return true
 10292  	}
 10293  	// match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
 10294  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10295  	// result: (MOVWZload [off1+int32(off2)] {sym} x mem)
 10296  	for {
 10297  		off1 := auxIntToInt32(v.AuxInt)
 10298  		sym := auxToSym(v.Aux)
 10299  		if v_0.Op != OpPPC64ADDconst {
 10300  			break
 10301  		}
 10302  		off2 := auxIntToInt64(v_0.AuxInt)
 10303  		x := v_0.Args[0]
 10304  		mem := v_1
 10305  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10306  			break
 10307  		}
 10308  		v.reset(OpPPC64MOVWZload)
 10309  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10310  		v.Aux = symToAux(sym)
 10311  		v.AddArg2(x, mem)
 10312  		return true
 10313  	}
 10314  	// match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem)
 10315  	// cond: sym == nil && p.Uses == 1
 10316  	// result: (MOVWZloadidx ptr idx mem)
 10317  	for {
 10318  		if auxIntToInt32(v.AuxInt) != 0 {
 10319  			break
 10320  		}
 10321  		sym := auxToSym(v.Aux)
 10322  		p := v_0
 10323  		if p.Op != OpPPC64ADD {
 10324  			break
 10325  		}
 10326  		idx := p.Args[1]
 10327  		ptr := p.Args[0]
 10328  		mem := v_1
 10329  		if !(sym == nil && p.Uses == 1) {
 10330  			break
 10331  		}
 10332  		v.reset(OpPPC64MOVWZloadidx)
 10333  		v.AddArg3(ptr, idx, mem)
 10334  		return true
 10335  	}
 10336  	return false
 10337  }
 10338  func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
 10339  	v_2 := v.Args[2]
 10340  	v_1 := v.Args[1]
 10341  	v_0 := v.Args[0]
 10342  	// match: (MOVWZloadidx ptr (MOVDconst [c]) mem)
 10343  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10344  	// result: (MOVWZload [int32(c)] ptr mem)
 10345  	for {
 10346  		ptr := v_0
 10347  		if v_1.Op != OpPPC64MOVDconst {
 10348  			break
 10349  		}
 10350  		c := auxIntToInt64(v_1.AuxInt)
 10351  		mem := v_2
 10352  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10353  			break
 10354  		}
 10355  		v.reset(OpPPC64MOVWZload)
 10356  		v.AuxInt = int32ToAuxInt(int32(c))
 10357  		v.AddArg2(ptr, mem)
 10358  		return true
 10359  	}
 10360  	// match: (MOVWZloadidx (MOVDconst [c]) ptr mem)
 10361  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10362  	// result: (MOVWZload [int32(c)] ptr mem)
 10363  	for {
 10364  		if v_0.Op != OpPPC64MOVDconst {
 10365  			break
 10366  		}
 10367  		c := auxIntToInt64(v_0.AuxInt)
 10368  		ptr := v_1
 10369  		mem := v_2
 10370  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10371  			break
 10372  		}
 10373  		v.reset(OpPPC64MOVWZload)
 10374  		v.AuxInt = int32ToAuxInt(int32(c))
 10375  		v.AddArg2(ptr, mem)
 10376  		return true
 10377  	}
 10378  	return false
 10379  }
 10380  func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
 10381  	v_0 := v.Args[0]
 10382  	b := v.Block
 10383  	typ := &b.Func.Config.Types
 10384  	// match: (MOVWZreg y:(ANDconst [c] _))
 10385  	// cond: uint64(c) <= 0xFFFFFFFF
 10386  	// result: y
 10387  	for {
 10388  		y := v_0
 10389  		if y.Op != OpPPC64ANDconst {
 10390  			break
 10391  		}
 10392  		c := auxIntToInt64(y.AuxInt)
 10393  		if !(uint64(c) <= 0xFFFFFFFF) {
 10394  			break
 10395  		}
 10396  		v.copyOf(y)
 10397  		return true
 10398  	}
 10399  	// match: (MOVWZreg y:(AND (MOVDconst [c]) _))
 10400  	// cond: uint64(c) <= 0xFFFFFFFF
 10401  	// result: y
 10402  	for {
 10403  		y := v_0
 10404  		if y.Op != OpPPC64AND {
 10405  			break
 10406  		}
 10407  		y_0 := y.Args[0]
 10408  		y_1 := y.Args[1]
 10409  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10410  			if y_0.Op != OpPPC64MOVDconst {
 10411  				continue
 10412  			}
 10413  			c := auxIntToInt64(y_0.AuxInt)
 10414  			if !(uint64(c) <= 0xFFFFFFFF) {
 10415  				continue
 10416  			}
 10417  			v.copyOf(y)
 10418  			return true
 10419  		}
 10420  		break
 10421  	}
 10422  	// match: (MOVWZreg (SRWconst [c] (MOVBZreg x)))
 10423  	// result: (SRWconst [c] (MOVBZreg x))
 10424  	for {
 10425  		if v_0.Op != OpPPC64SRWconst {
 10426  			break
 10427  		}
 10428  		c := auxIntToInt64(v_0.AuxInt)
 10429  		v_0_0 := v_0.Args[0]
 10430  		if v_0_0.Op != OpPPC64MOVBZreg {
 10431  			break
 10432  		}
 10433  		x := v_0_0.Args[0]
 10434  		v.reset(OpPPC64SRWconst)
 10435  		v.AuxInt = int64ToAuxInt(c)
 10436  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 10437  		v0.AddArg(x)
 10438  		v.AddArg(v0)
 10439  		return true
 10440  	}
 10441  	// match: (MOVWZreg (SRWconst [c] (MOVHZreg x)))
 10442  	// result: (SRWconst [c] (MOVHZreg x))
 10443  	for {
 10444  		if v_0.Op != OpPPC64SRWconst {
 10445  			break
 10446  		}
 10447  		c := auxIntToInt64(v_0.AuxInt)
 10448  		v_0_0 := v_0.Args[0]
 10449  		if v_0_0.Op != OpPPC64MOVHZreg {
 10450  			break
 10451  		}
 10452  		x := v_0_0.Args[0]
 10453  		v.reset(OpPPC64SRWconst)
 10454  		v.AuxInt = int64ToAuxInt(c)
 10455  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 10456  		v0.AddArg(x)
 10457  		v.AddArg(v0)
 10458  		return true
 10459  	}
 10460  	// match: (MOVWZreg (SRWconst [c] (MOVWZreg x)))
 10461  	// result: (SRWconst [c] (MOVWZreg x))
 10462  	for {
 10463  		if v_0.Op != OpPPC64SRWconst {
 10464  			break
 10465  		}
 10466  		c := auxIntToInt64(v_0.AuxInt)
 10467  		v_0_0 := v_0.Args[0]
 10468  		if v_0_0.Op != OpPPC64MOVWZreg {
 10469  			break
 10470  		}
 10471  		x := v_0_0.Args[0]
 10472  		v.reset(OpPPC64SRWconst)
 10473  		v.AuxInt = int64ToAuxInt(c)
 10474  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 10475  		v0.AddArg(x)
 10476  		v.AddArg(v0)
 10477  		return true
 10478  	}
 10479  	// match: (MOVWZreg (SRWconst [c] x))
 10480  	// cond: x.Type.Size() <= 32
 10481  	// result: (SRWconst [c] x)
 10482  	for {
 10483  		if v_0.Op != OpPPC64SRWconst {
 10484  			break
 10485  		}
 10486  		c := auxIntToInt64(v_0.AuxInt)
 10487  		x := v_0.Args[0]
 10488  		if !(x.Type.Size() <= 32) {
 10489  			break
 10490  		}
 10491  		v.reset(OpPPC64SRWconst)
 10492  		v.AuxInt = int64ToAuxInt(c)
 10493  		v.AddArg(x)
 10494  		return true
 10495  	}
 10496  	// match: (MOVWZreg (SRDconst [c] x))
 10497  	// cond: c>=32
 10498  	// result: (SRDconst [c] x)
 10499  	for {
 10500  		if v_0.Op != OpPPC64SRDconst {
 10501  			break
 10502  		}
 10503  		c := auxIntToInt64(v_0.AuxInt)
 10504  		x := v_0.Args[0]
 10505  		if !(c >= 32) {
 10506  			break
 10507  		}
 10508  		v.reset(OpPPC64SRDconst)
 10509  		v.AuxInt = int64ToAuxInt(c)
 10510  		v.AddArg(x)
 10511  		return true
 10512  	}
 10513  	// match: (MOVWZreg (RLWINM [r] y))
 10514  	// cond: mergePPC64MovwzregRlwinm(r) != 0
 10515  	// result: (RLWINM [mergePPC64MovwzregRlwinm(r)] y)
 10516  	for {
 10517  		if v_0.Op != OpPPC64RLWINM {
 10518  			break
 10519  		}
 10520  		r := auxIntToInt64(v_0.AuxInt)
 10521  		y := v_0.Args[0]
 10522  		if !(mergePPC64MovwzregRlwinm(r) != 0) {
 10523  			break
 10524  		}
 10525  		v.reset(OpPPC64RLWINM)
 10526  		v.AuxInt = int64ToAuxInt(mergePPC64MovwzregRlwinm(r))
 10527  		v.AddArg(y)
 10528  		return true
 10529  	}
 10530  	// match: (MOVWZreg w:(SLWconst u))
 10531  	// result: w
 10532  	for {
 10533  		w := v_0
 10534  		if w.Op != OpPPC64SLWconst {
 10535  			break
 10536  		}
 10537  		v.copyOf(w)
 10538  		return true
 10539  	}
 10540  	// match: (MOVWZreg y:(MOVWZreg _))
 10541  	// result: y
 10542  	for {
 10543  		y := v_0
 10544  		if y.Op != OpPPC64MOVWZreg {
 10545  			break
 10546  		}
 10547  		v.copyOf(y)
 10548  		return true
 10549  	}
 10550  	// match: (MOVWZreg y:(MOVHZreg _))
 10551  	// result: y
 10552  	for {
 10553  		y := v_0
 10554  		if y.Op != OpPPC64MOVHZreg {
 10555  			break
 10556  		}
 10557  		v.copyOf(y)
 10558  		return true
 10559  	}
 10560  	// match: (MOVWZreg y:(MOVBZreg _))
 10561  	// result: y
 10562  	for {
 10563  		y := v_0
 10564  		if y.Op != OpPPC64MOVBZreg {
 10565  			break
 10566  		}
 10567  		v.copyOf(y)
 10568  		return true
 10569  	}
 10570  	// match: (MOVWZreg y:(MOVHBRload _ _))
 10571  	// result: y
 10572  	for {
 10573  		y := v_0
 10574  		if y.Op != OpPPC64MOVHBRload {
 10575  			break
 10576  		}
 10577  		v.copyOf(y)
 10578  		return true
 10579  	}
 10580  	// match: (MOVWZreg y:(MOVWBRload _ _))
 10581  	// result: y
 10582  	for {
 10583  		y := v_0
 10584  		if y.Op != OpPPC64MOVWBRload {
 10585  			break
 10586  		}
 10587  		v.copyOf(y)
 10588  		return true
 10589  	}
 10590  	// match: (MOVWZreg y:(MOVWreg x))
 10591  	// result: (MOVWZreg x)
 10592  	for {
 10593  		y := v_0
 10594  		if y.Op != OpPPC64MOVWreg {
 10595  			break
 10596  		}
 10597  		x := y.Args[0]
 10598  		v.reset(OpPPC64MOVWZreg)
 10599  		v.AddArg(x)
 10600  		return true
 10601  	}
 10602  	// match: (MOVWZreg (OR <t> x (MOVWZreg y)))
 10603  	// result: (MOVWZreg (OR <t> x y))
 10604  	for {
 10605  		if v_0.Op != OpPPC64OR {
 10606  			break
 10607  		}
 10608  		t := v_0.Type
 10609  		_ = v_0.Args[1]
 10610  		v_0_0 := v_0.Args[0]
 10611  		v_0_1 := v_0.Args[1]
 10612  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10613  			x := v_0_0
 10614  			if v_0_1.Op != OpPPC64MOVWZreg {
 10615  				continue
 10616  			}
 10617  			y := v_0_1.Args[0]
 10618  			v.reset(OpPPC64MOVWZreg)
 10619  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
 10620  			v0.AddArg2(x, y)
 10621  			v.AddArg(v0)
 10622  			return true
 10623  		}
 10624  		break
 10625  	}
 10626  	// match: (MOVWZreg (XOR <t> x (MOVWZreg y)))
 10627  	// result: (MOVWZreg (XOR <t> x y))
 10628  	for {
 10629  		if v_0.Op != OpPPC64XOR {
 10630  			break
 10631  		}
 10632  		t := v_0.Type
 10633  		_ = v_0.Args[1]
 10634  		v_0_0 := v_0.Args[0]
 10635  		v_0_1 := v_0.Args[1]
 10636  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10637  			x := v_0_0
 10638  			if v_0_1.Op != OpPPC64MOVWZreg {
 10639  				continue
 10640  			}
 10641  			y := v_0_1.Args[0]
 10642  			v.reset(OpPPC64MOVWZreg)
 10643  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
 10644  			v0.AddArg2(x, y)
 10645  			v.AddArg(v0)
 10646  			return true
 10647  		}
 10648  		break
 10649  	}
 10650  	// match: (MOVWZreg (AND <t> x (MOVWZreg y)))
 10651  	// result: (MOVWZreg (AND <t> x y))
 10652  	for {
 10653  		if v_0.Op != OpPPC64AND {
 10654  			break
 10655  		}
 10656  		t := v_0.Type
 10657  		_ = v_0.Args[1]
 10658  		v_0_0 := v_0.Args[0]
 10659  		v_0_1 := v_0.Args[1]
 10660  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10661  			x := v_0_0
 10662  			if v_0_1.Op != OpPPC64MOVWZreg {
 10663  				continue
 10664  			}
 10665  			y := v_0_1.Args[0]
 10666  			v.reset(OpPPC64MOVWZreg)
 10667  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
 10668  			v0.AddArg2(x, y)
 10669  			v.AddArg(v0)
 10670  			return true
 10671  		}
 10672  		break
 10673  	}
 10674  	// match: (MOVWZreg z:(ANDconst [c] (MOVBZload ptr x)))
 10675  	// result: z
 10676  	for {
 10677  		z := v_0
 10678  		if z.Op != OpPPC64ANDconst {
 10679  			break
 10680  		}
 10681  		z_0 := z.Args[0]
 10682  		if z_0.Op != OpPPC64MOVBZload {
 10683  			break
 10684  		}
 10685  		v.copyOf(z)
 10686  		return true
 10687  	}
 10688  	// match: (MOVWZreg z:(AND y (MOVWZload ptr x)))
 10689  	// result: z
 10690  	for {
 10691  		z := v_0
 10692  		if z.Op != OpPPC64AND {
 10693  			break
 10694  		}
 10695  		_ = z.Args[1]
 10696  		z_0 := z.Args[0]
 10697  		z_1 := z.Args[1]
 10698  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 10699  			if z_1.Op != OpPPC64MOVWZload {
 10700  				continue
 10701  			}
 10702  			v.copyOf(z)
 10703  			return true
 10704  		}
 10705  		break
 10706  	}
 10707  	// match: (MOVWZreg z:(ANDconst [c] (MOVHZload ptr x)))
 10708  	// result: z
 10709  	for {
 10710  		z := v_0
 10711  		if z.Op != OpPPC64ANDconst {
 10712  			break
 10713  		}
 10714  		z_0 := z.Args[0]
 10715  		if z_0.Op != OpPPC64MOVHZload {
 10716  			break
 10717  		}
 10718  		v.copyOf(z)
 10719  		return true
 10720  	}
 10721  	// match: (MOVWZreg z:(ANDconst [c] (MOVWZload ptr x)))
 10722  	// result: z
 10723  	for {
 10724  		z := v_0
 10725  		if z.Op != OpPPC64ANDconst {
 10726  			break
 10727  		}
 10728  		z_0 := z.Args[0]
 10729  		if z_0.Op != OpPPC64MOVWZload {
 10730  			break
 10731  		}
 10732  		v.copyOf(z)
 10733  		return true
 10734  	}
 10735  	// match: (MOVWZreg x:(MOVBZload _ _))
 10736  	// result: x
 10737  	for {
 10738  		x := v_0
 10739  		if x.Op != OpPPC64MOVBZload {
 10740  			break
 10741  		}
 10742  		v.copyOf(x)
 10743  		return true
 10744  	}
 10745  	// match: (MOVWZreg x:(MOVBZloadidx _ _ _))
 10746  	// result: x
 10747  	for {
 10748  		x := v_0
 10749  		if x.Op != OpPPC64MOVBZloadidx {
 10750  			break
 10751  		}
 10752  		v.copyOf(x)
 10753  		return true
 10754  	}
 10755  	// match: (MOVWZreg x:(MOVHZload _ _))
 10756  	// result: x
 10757  	for {
 10758  		x := v_0
 10759  		if x.Op != OpPPC64MOVHZload {
 10760  			break
 10761  		}
 10762  		v.copyOf(x)
 10763  		return true
 10764  	}
 10765  	// match: (MOVWZreg x:(MOVHZloadidx _ _ _))
 10766  	// result: x
 10767  	for {
 10768  		x := v_0
 10769  		if x.Op != OpPPC64MOVHZloadidx {
 10770  			break
 10771  		}
 10772  		v.copyOf(x)
 10773  		return true
 10774  	}
 10775  	// match: (MOVWZreg x:(MOVWZload _ _))
 10776  	// result: x
 10777  	for {
 10778  		x := v_0
 10779  		if x.Op != OpPPC64MOVWZload {
 10780  			break
 10781  		}
 10782  		v.copyOf(x)
 10783  		return true
 10784  	}
 10785  	// match: (MOVWZreg x:(MOVWZloadidx _ _ _))
 10786  	// result: x
 10787  	for {
 10788  		x := v_0
 10789  		if x.Op != OpPPC64MOVWZloadidx {
 10790  			break
 10791  		}
 10792  		v.copyOf(x)
 10793  		return true
 10794  	}
 10795  	// match: (MOVWZreg x:(Select0 (LoweredAtomicLoad32 _ _)))
 10796  	// result: x
 10797  	for {
 10798  		x := v_0
 10799  		if x.Op != OpSelect0 {
 10800  			break
 10801  		}
 10802  		x_0 := x.Args[0]
 10803  		if x_0.Op != OpPPC64LoweredAtomicLoad32 {
 10804  			break
 10805  		}
 10806  		v.copyOf(x)
 10807  		return true
 10808  	}
 10809  	// match: (MOVWZreg x:(Arg <t>))
 10810  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()
 10811  	// result: x
 10812  	for {
 10813  		x := v_0
 10814  		if x.Op != OpArg {
 10815  			break
 10816  		}
 10817  		t := x.Type
 10818  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()) {
 10819  			break
 10820  		}
 10821  		v.copyOf(x)
 10822  		return true
 10823  	}
 10824  	// match: (MOVWZreg (MOVDconst [c]))
 10825  	// result: (MOVDconst [int64(uint32(c))])
 10826  	for {
 10827  		if v_0.Op != OpPPC64MOVDconst {
 10828  			break
 10829  		}
 10830  		c := auxIntToInt64(v_0.AuxInt)
 10831  		v.reset(OpPPC64MOVDconst)
 10832  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
 10833  		return true
 10834  	}
 10835  	return false
 10836  }
 10837  func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
 10838  	v_1 := v.Args[1]
 10839  	v_0 := v.Args[0]
 10840  	// match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10841  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10842  	// result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10843  	for {
 10844  		off1 := auxIntToInt32(v.AuxInt)
 10845  		sym1 := auxToSym(v.Aux)
 10846  		p := v_0
 10847  		if p.Op != OpPPC64MOVDaddr {
 10848  			break
 10849  		}
 10850  		off2 := auxIntToInt32(p.AuxInt)
 10851  		sym2 := auxToSym(p.Aux)
 10852  		ptr := p.Args[0]
 10853  		mem := v_1
 10854  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10855  			break
 10856  		}
 10857  		v.reset(OpPPC64MOVWload)
 10858  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10859  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10860  		v.AddArg2(ptr, mem)
 10861  		return true
 10862  	}
 10863  	// match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
 10864  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10865  	// result: (MOVWload [off1+int32(off2)] {sym} x mem)
 10866  	for {
 10867  		off1 := auxIntToInt32(v.AuxInt)
 10868  		sym := auxToSym(v.Aux)
 10869  		if v_0.Op != OpPPC64ADDconst {
 10870  			break
 10871  		}
 10872  		off2 := auxIntToInt64(v_0.AuxInt)
 10873  		x := v_0.Args[0]
 10874  		mem := v_1
 10875  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10876  			break
 10877  		}
 10878  		v.reset(OpPPC64MOVWload)
 10879  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10880  		v.Aux = symToAux(sym)
 10881  		v.AddArg2(x, mem)
 10882  		return true
 10883  	}
 10884  	// match: (MOVWload [0] {sym} p:(ADD ptr idx) mem)
 10885  	// cond: sym == nil && p.Uses == 1
 10886  	// result: (MOVWloadidx ptr idx mem)
 10887  	for {
 10888  		if auxIntToInt32(v.AuxInt) != 0 {
 10889  			break
 10890  		}
 10891  		sym := auxToSym(v.Aux)
 10892  		p := v_0
 10893  		if p.Op != OpPPC64ADD {
 10894  			break
 10895  		}
 10896  		idx := p.Args[1]
 10897  		ptr := p.Args[0]
 10898  		mem := v_1
 10899  		if !(sym == nil && p.Uses == 1) {
 10900  			break
 10901  		}
 10902  		v.reset(OpPPC64MOVWloadidx)
 10903  		v.AddArg3(ptr, idx, mem)
 10904  		return true
 10905  	}
 10906  	return false
 10907  }
 10908  func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
 10909  	v_2 := v.Args[2]
 10910  	v_1 := v.Args[1]
 10911  	v_0 := v.Args[0]
 10912  	// match: (MOVWloadidx ptr (MOVDconst [c]) mem)
 10913  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10914  	// result: (MOVWload [int32(c)] ptr mem)
 10915  	for {
 10916  		ptr := v_0
 10917  		if v_1.Op != OpPPC64MOVDconst {
 10918  			break
 10919  		}
 10920  		c := auxIntToInt64(v_1.AuxInt)
 10921  		mem := v_2
 10922  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10923  			break
 10924  		}
 10925  		v.reset(OpPPC64MOVWload)
 10926  		v.AuxInt = int32ToAuxInt(int32(c))
 10927  		v.AddArg2(ptr, mem)
 10928  		return true
 10929  	}
 10930  	// match: (MOVWloadidx (MOVDconst [c]) ptr mem)
 10931  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10932  	// result: (MOVWload [int32(c)] ptr mem)
 10933  	for {
 10934  		if v_0.Op != OpPPC64MOVDconst {
 10935  			break
 10936  		}
 10937  		c := auxIntToInt64(v_0.AuxInt)
 10938  		ptr := v_1
 10939  		mem := v_2
 10940  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10941  			break
 10942  		}
 10943  		v.reset(OpPPC64MOVWload)
 10944  		v.AuxInt = int32ToAuxInt(int32(c))
 10945  		v.AddArg2(ptr, mem)
 10946  		return true
 10947  	}
 10948  	return false
 10949  }
 10950  func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
 10951  	v_0 := v.Args[0]
 10952  	b := v.Block
 10953  	typ := &b.Func.Config.Types
 10954  	// match: (MOVWreg y:(ANDconst [c] _))
 10955  	// cond: uint64(c) <= 0xFFFF
 10956  	// result: y
 10957  	for {
 10958  		y := v_0
 10959  		if y.Op != OpPPC64ANDconst {
 10960  			break
 10961  		}
 10962  		c := auxIntToInt64(y.AuxInt)
 10963  		if !(uint64(c) <= 0xFFFF) {
 10964  			break
 10965  		}
 10966  		v.copyOf(y)
 10967  		return true
 10968  	}
 10969  	// match: (MOVWreg y:(AND (MOVDconst [c]) _))
 10970  	// cond: uint64(c) <= 0x7FFFFFFF
 10971  	// result: y
 10972  	for {
 10973  		y := v_0
 10974  		if y.Op != OpPPC64AND {
 10975  			break
 10976  		}
 10977  		y_0 := y.Args[0]
 10978  		y_1 := y.Args[1]
 10979  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10980  			if y_0.Op != OpPPC64MOVDconst {
 10981  				continue
 10982  			}
 10983  			c := auxIntToInt64(y_0.AuxInt)
 10984  			if !(uint64(c) <= 0x7FFFFFFF) {
 10985  				continue
 10986  			}
 10987  			v.copyOf(y)
 10988  			return true
 10989  		}
 10990  		break
 10991  	}
 10992  	// match: (MOVWreg (SRAWconst [c] (MOVBreg x)))
 10993  	// result: (SRAWconst [c] (MOVBreg x))
 10994  	for {
 10995  		if v_0.Op != OpPPC64SRAWconst {
 10996  			break
 10997  		}
 10998  		c := auxIntToInt64(v_0.AuxInt)
 10999  		v_0_0 := v_0.Args[0]
 11000  		if v_0_0.Op != OpPPC64MOVBreg {
 11001  			break
 11002  		}
 11003  		x := v_0_0.Args[0]
 11004  		v.reset(OpPPC64SRAWconst)
 11005  		v.AuxInt = int64ToAuxInt(c)
 11006  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 11007  		v0.AddArg(x)
 11008  		v.AddArg(v0)
 11009  		return true
 11010  	}
 11011  	// match: (MOVWreg (SRAWconst [c] (MOVHreg x)))
 11012  	// result: (SRAWconst [c] (MOVHreg x))
 11013  	for {
 11014  		if v_0.Op != OpPPC64SRAWconst {
 11015  			break
 11016  		}
 11017  		c := auxIntToInt64(v_0.AuxInt)
 11018  		v_0_0 := v_0.Args[0]
 11019  		if v_0_0.Op != OpPPC64MOVHreg {
 11020  			break
 11021  		}
 11022  		x := v_0_0.Args[0]
 11023  		v.reset(OpPPC64SRAWconst)
 11024  		v.AuxInt = int64ToAuxInt(c)
 11025  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 11026  		v0.AddArg(x)
 11027  		v.AddArg(v0)
 11028  		return true
 11029  	}
 11030  	// match: (MOVWreg (SRAWconst [c] (MOVWreg x)))
 11031  	// result: (SRAWconst [c] (MOVWreg x))
 11032  	for {
 11033  		if v_0.Op != OpPPC64SRAWconst {
 11034  			break
 11035  		}
 11036  		c := auxIntToInt64(v_0.AuxInt)
 11037  		v_0_0 := v_0.Args[0]
 11038  		if v_0_0.Op != OpPPC64MOVWreg {
 11039  			break
 11040  		}
 11041  		x := v_0_0.Args[0]
 11042  		v.reset(OpPPC64SRAWconst)
 11043  		v.AuxInt = int64ToAuxInt(c)
 11044  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
 11045  		v0.AddArg(x)
 11046  		v.AddArg(v0)
 11047  		return true
 11048  	}
 11049  	// match: (MOVWreg (SRAWconst [c] x))
 11050  	// cond: x.Type.Size() <= 32
 11051  	// result: (SRAWconst [c] x)
 11052  	for {
 11053  		if v_0.Op != OpPPC64SRAWconst {
 11054  			break
 11055  		}
 11056  		c := auxIntToInt64(v_0.AuxInt)
 11057  		x := v_0.Args[0]
 11058  		if !(x.Type.Size() <= 32) {
 11059  			break
 11060  		}
 11061  		v.reset(OpPPC64SRAWconst)
 11062  		v.AuxInt = int64ToAuxInt(c)
 11063  		v.AddArg(x)
 11064  		return true
 11065  	}
 11066  	// match: (MOVWreg (SRDconst [c] x))
 11067  	// cond: c>32
 11068  	// result: (SRDconst [c] x)
 11069  	for {
 11070  		if v_0.Op != OpPPC64SRDconst {
 11071  			break
 11072  		}
 11073  		c := auxIntToInt64(v_0.AuxInt)
 11074  		x := v_0.Args[0]
 11075  		if !(c > 32) {
 11076  			break
 11077  		}
 11078  		v.reset(OpPPC64SRDconst)
 11079  		v.AuxInt = int64ToAuxInt(c)
 11080  		v.AddArg(x)
 11081  		return true
 11082  	}
 11083  	// match: (MOVWreg (SRADconst [c] x))
 11084  	// cond: c>=32
 11085  	// result: (SRADconst [c] x)
 11086  	for {
 11087  		if v_0.Op != OpPPC64SRADconst {
 11088  			break
 11089  		}
 11090  		c := auxIntToInt64(v_0.AuxInt)
 11091  		x := v_0.Args[0]
 11092  		if !(c >= 32) {
 11093  			break
 11094  		}
 11095  		v.reset(OpPPC64SRADconst)
 11096  		v.AuxInt = int64ToAuxInt(c)
 11097  		v.AddArg(x)
 11098  		return true
 11099  	}
 11100  	// match: (MOVWreg (SRDconst [c] x))
 11101  	// cond: c==32
 11102  	// result: (SRADconst [c] x)
 11103  	for {
 11104  		if v_0.Op != OpPPC64SRDconst {
 11105  			break
 11106  		}
 11107  		c := auxIntToInt64(v_0.AuxInt)
 11108  		x := v_0.Args[0]
 11109  		if !(c == 32) {
 11110  			break
 11111  		}
 11112  		v.reset(OpPPC64SRADconst)
 11113  		v.AuxInt = int64ToAuxInt(c)
 11114  		v.AddArg(x)
 11115  		return true
 11116  	}
 11117  	// match: (MOVWreg y:(MOVWreg _))
 11118  	// result: y
 11119  	for {
 11120  		y := v_0
 11121  		if y.Op != OpPPC64MOVWreg {
 11122  			break
 11123  		}
 11124  		v.copyOf(y)
 11125  		return true
 11126  	}
 11127  	// match: (MOVWreg y:(MOVHreg _))
 11128  	// result: y
 11129  	for {
 11130  		y := v_0
 11131  		if y.Op != OpPPC64MOVHreg {
 11132  			break
 11133  		}
 11134  		v.copyOf(y)
 11135  		return true
 11136  	}
 11137  	// match: (MOVWreg y:(MOVBreg _))
 11138  	// result: y
 11139  	for {
 11140  		y := v_0
 11141  		if y.Op != OpPPC64MOVBreg {
 11142  			break
 11143  		}
 11144  		v.copyOf(y)
 11145  		return true
 11146  	}
 11147  	// match: (MOVWreg y:(MOVWZreg x))
 11148  	// result: (MOVWreg x)
 11149  	for {
 11150  		y := v_0
 11151  		if y.Op != OpPPC64MOVWZreg {
 11152  			break
 11153  		}
 11154  		x := y.Args[0]
 11155  		v.reset(OpPPC64MOVWreg)
 11156  		v.AddArg(x)
 11157  		return true
 11158  	}
 11159  	// match: (MOVWreg x:(MOVHload _ _))
 11160  	// result: x
 11161  	for {
 11162  		x := v_0
 11163  		if x.Op != OpPPC64MOVHload {
 11164  			break
 11165  		}
 11166  		v.copyOf(x)
 11167  		return true
 11168  	}
 11169  	// match: (MOVWreg x:(MOVHloadidx _ _ _))
 11170  	// result: x
 11171  	for {
 11172  		x := v_0
 11173  		if x.Op != OpPPC64MOVHloadidx {
 11174  			break
 11175  		}
 11176  		v.copyOf(x)
 11177  		return true
 11178  	}
 11179  	// match: (MOVWreg x:(MOVWload _ _))
 11180  	// result: x
 11181  	for {
 11182  		x := v_0
 11183  		if x.Op != OpPPC64MOVWload {
 11184  			break
 11185  		}
 11186  		v.copyOf(x)
 11187  		return true
 11188  	}
 11189  	// match: (MOVWreg x:(MOVWloadidx _ _ _))
 11190  	// result: x
 11191  	for {
 11192  		x := v_0
 11193  		if x.Op != OpPPC64MOVWloadidx {
 11194  			break
 11195  		}
 11196  		v.copyOf(x)
 11197  		return true
 11198  	}
 11199  	// match: (MOVWreg x:(Arg <t>))
 11200  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()
 11201  	// result: x
 11202  	for {
 11203  		x := v_0
 11204  		if x.Op != OpArg {
 11205  			break
 11206  		}
 11207  		t := x.Type
 11208  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()) {
 11209  			break
 11210  		}
 11211  		v.copyOf(x)
 11212  		return true
 11213  	}
 11214  	// match: (MOVWreg (MOVDconst [c]))
 11215  	// result: (MOVDconst [int64(int32(c))])
 11216  	for {
 11217  		if v_0.Op != OpPPC64MOVDconst {
 11218  			break
 11219  		}
 11220  		c := auxIntToInt64(v_0.AuxInt)
 11221  		v.reset(OpPPC64MOVDconst)
 11222  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
 11223  		return true
 11224  	}
 11225  	return false
 11226  }
 11227  func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
 11228  	v_2 := v.Args[2]
 11229  	v_1 := v.Args[1]
 11230  	v_0 := v.Args[0]
 11231  	b := v.Block
 11232  	// match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
 11233  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 11234  	// result: (MOVWstore [off1+int32(off2)] {sym} x val mem)
 11235  	for {
 11236  		off1 := auxIntToInt32(v.AuxInt)
 11237  		sym := auxToSym(v.Aux)
 11238  		if v_0.Op != OpPPC64ADDconst {
 11239  			break
 11240  		}
 11241  		off2 := auxIntToInt64(v_0.AuxInt)
 11242  		x := v_0.Args[0]
 11243  		val := v_1
 11244  		mem := v_2
 11245  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 11246  			break
 11247  		}
 11248  		v.reset(OpPPC64MOVWstore)
 11249  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11250  		v.Aux = symToAux(sym)
 11251  		v.AddArg3(x, val, mem)
 11252  		return true
 11253  	}
 11254  	// match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
 11255  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 11256  	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 11257  	for {
 11258  		off1 := auxIntToInt32(v.AuxInt)
 11259  		sym1 := auxToSym(v.Aux)
 11260  		p := v_0
 11261  		if p.Op != OpPPC64MOVDaddr {
 11262  			break
 11263  		}
 11264  		off2 := auxIntToInt32(p.AuxInt)
 11265  		sym2 := auxToSym(p.Aux)
 11266  		ptr := p.Args[0]
 11267  		val := v_1
 11268  		mem := v_2
 11269  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 11270  			break
 11271  		}
 11272  		v.reset(OpPPC64MOVWstore)
 11273  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11274  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11275  		v.AddArg3(ptr, val, mem)
 11276  		return true
 11277  	}
 11278  	// match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
 11279  	// result: (MOVWstorezero [off] {sym} ptr mem)
 11280  	for {
 11281  		off := auxIntToInt32(v.AuxInt)
 11282  		sym := auxToSym(v.Aux)
 11283  		ptr := v_0
 11284  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 11285  			break
 11286  		}
 11287  		mem := v_2
 11288  		v.reset(OpPPC64MOVWstorezero)
 11289  		v.AuxInt = int32ToAuxInt(off)
 11290  		v.Aux = symToAux(sym)
 11291  		v.AddArg2(ptr, mem)
 11292  		return true
 11293  	}
 11294  	// match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem)
 11295  	// cond: sym == nil && p.Uses == 1
 11296  	// result: (MOVWstoreidx ptr idx val mem)
 11297  	for {
 11298  		if auxIntToInt32(v.AuxInt) != 0 {
 11299  			break
 11300  		}
 11301  		sym := auxToSym(v.Aux)
 11302  		p := v_0
 11303  		if p.Op != OpPPC64ADD {
 11304  			break
 11305  		}
 11306  		idx := p.Args[1]
 11307  		ptr := p.Args[0]
 11308  		val := v_1
 11309  		mem := v_2
 11310  		if !(sym == nil && p.Uses == 1) {
 11311  			break
 11312  		}
 11313  		v.reset(OpPPC64MOVWstoreidx)
 11314  		v.AddArg4(ptr, idx, val, mem)
 11315  		return true
 11316  	}
 11317  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
 11318  	// result: (MOVWstore [off] {sym} ptr x mem)
 11319  	for {
 11320  		off := auxIntToInt32(v.AuxInt)
 11321  		sym := auxToSym(v.Aux)
 11322  		ptr := v_0
 11323  		if v_1.Op != OpPPC64MOVWreg {
 11324  			break
 11325  		}
 11326  		x := v_1.Args[0]
 11327  		mem := v_2
 11328  		v.reset(OpPPC64MOVWstore)
 11329  		v.AuxInt = int32ToAuxInt(off)
 11330  		v.Aux = symToAux(sym)
 11331  		v.AddArg3(ptr, x, mem)
 11332  		return true
 11333  	}
 11334  	// match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
 11335  	// result: (MOVWstore [off] {sym} ptr x mem)
 11336  	for {
 11337  		off := auxIntToInt32(v.AuxInt)
 11338  		sym := auxToSym(v.Aux)
 11339  		ptr := v_0
 11340  		if v_1.Op != OpPPC64MOVWZreg {
 11341  			break
 11342  		}
 11343  		x := v_1.Args[0]
 11344  		mem := v_2
 11345  		v.reset(OpPPC64MOVWstore)
 11346  		v.AuxInt = int32ToAuxInt(off)
 11347  		v.Aux = symToAux(sym)
 11348  		v.AddArg3(ptr, x, mem)
 11349  		return true
 11350  	}
 11351  	// match: (MOVWstore [off] {sym} ptr r:(BRW val) mem)
 11352  	// cond: r.Uses == 1
 11353  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 11354  	for {
 11355  		off := auxIntToInt32(v.AuxInt)
 11356  		sym := auxToSym(v.Aux)
 11357  		ptr := v_0
 11358  		r := v_1
 11359  		if r.Op != OpPPC64BRW {
 11360  			break
 11361  		}
 11362  		val := r.Args[0]
 11363  		mem := v_2
 11364  		if !(r.Uses == 1) {
 11365  			break
 11366  		}
 11367  		v.reset(OpPPC64MOVWBRstore)
 11368  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 11369  		v0.AuxInt = int32ToAuxInt(off)
 11370  		v0.Aux = symToAux(sym)
 11371  		v0.AddArg(ptr)
 11372  		v.AddArg3(v0, val, mem)
 11373  		return true
 11374  	}
 11375  	// match: (MOVWstore [off] {sym} ptr (Bswap32 val) mem)
 11376  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 11377  	for {
 11378  		off := auxIntToInt32(v.AuxInt)
 11379  		sym := auxToSym(v.Aux)
 11380  		ptr := v_0
 11381  		if v_1.Op != OpBswap32 {
 11382  			break
 11383  		}
 11384  		val := v_1.Args[0]
 11385  		mem := v_2
 11386  		v.reset(OpPPC64MOVWBRstore)
 11387  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 11388  		v0.AuxInt = int32ToAuxInt(off)
 11389  		v0.Aux = symToAux(sym)
 11390  		v0.AddArg(ptr)
 11391  		v.AddArg3(v0, val, mem)
 11392  		return true
 11393  	}
 11394  	return false
 11395  }
 11396  func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
 11397  	v_3 := v.Args[3]
 11398  	v_2 := v.Args[2]
 11399  	v_1 := v.Args[1]
 11400  	v_0 := v.Args[0]
 11401  	// match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
 11402  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 11403  	// result: (MOVWstore [int32(c)] ptr val mem)
 11404  	for {
 11405  		ptr := v_0
 11406  		if v_1.Op != OpPPC64MOVDconst {
 11407  			break
 11408  		}
 11409  		c := auxIntToInt64(v_1.AuxInt)
 11410  		val := v_2
 11411  		mem := v_3
 11412  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 11413  			break
 11414  		}
 11415  		v.reset(OpPPC64MOVWstore)
 11416  		v.AuxInt = int32ToAuxInt(int32(c))
 11417  		v.AddArg3(ptr, val, mem)
 11418  		return true
 11419  	}
 11420  	// match: (MOVWstoreidx (MOVDconst [c]) ptr val mem)
 11421  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 11422  	// result: (MOVWstore [int32(c)] ptr val mem)
 11423  	for {
 11424  		if v_0.Op != OpPPC64MOVDconst {
 11425  			break
 11426  		}
 11427  		c := auxIntToInt64(v_0.AuxInt)
 11428  		ptr := v_1
 11429  		val := v_2
 11430  		mem := v_3
 11431  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 11432  			break
 11433  		}
 11434  		v.reset(OpPPC64MOVWstore)
 11435  		v.AuxInt = int32ToAuxInt(int32(c))
 11436  		v.AddArg3(ptr, val, mem)
 11437  		return true
 11438  	}
 11439  	// match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
 11440  	// result: (MOVWstoreidx ptr idx x mem)
 11441  	for {
 11442  		ptr := v_0
 11443  		idx := v_1
 11444  		if v_2.Op != OpPPC64MOVWreg {
 11445  			break
 11446  		}
 11447  		x := v_2.Args[0]
 11448  		mem := v_3
 11449  		v.reset(OpPPC64MOVWstoreidx)
 11450  		v.AddArg4(ptr, idx, x, mem)
 11451  		return true
 11452  	}
 11453  	// match: (MOVWstoreidx ptr idx (MOVWZreg x) mem)
 11454  	// result: (MOVWstoreidx ptr idx x mem)
 11455  	for {
 11456  		ptr := v_0
 11457  		idx := v_1
 11458  		if v_2.Op != OpPPC64MOVWZreg {
 11459  			break
 11460  		}
 11461  		x := v_2.Args[0]
 11462  		mem := v_3
 11463  		v.reset(OpPPC64MOVWstoreidx)
 11464  		v.AddArg4(ptr, idx, x, mem)
 11465  		return true
 11466  	}
 11467  	// match: (MOVWstoreidx ptr idx r:(BRW val) mem)
 11468  	// cond: r.Uses == 1
 11469  	// result: (MOVWBRstoreidx ptr idx val mem)
 11470  	for {
 11471  		ptr := v_0
 11472  		idx := v_1
 11473  		r := v_2
 11474  		if r.Op != OpPPC64BRW {
 11475  			break
 11476  		}
 11477  		val := r.Args[0]
 11478  		mem := v_3
 11479  		if !(r.Uses == 1) {
 11480  			break
 11481  		}
 11482  		v.reset(OpPPC64MOVWBRstoreidx)
 11483  		v.AddArg4(ptr, idx, val, mem)
 11484  		return true
 11485  	}
 11486  	// match: (MOVWstoreidx ptr idx (Bswap32 val) mem)
 11487  	// result: (MOVWBRstoreidx ptr idx val mem)
 11488  	for {
 11489  		ptr := v_0
 11490  		idx := v_1
 11491  		if v_2.Op != OpBswap32 {
 11492  			break
 11493  		}
 11494  		val := v_2.Args[0]
 11495  		mem := v_3
 11496  		v.reset(OpPPC64MOVWBRstoreidx)
 11497  		v.AddArg4(ptr, idx, val, mem)
 11498  		return true
 11499  	}
 11500  	return false
 11501  }
 11502  func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
 11503  	v_1 := v.Args[1]
 11504  	v_0 := v.Args[0]
 11505  	// match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
 11506  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
 11507  	// result: (MOVWstorezero [off1+int32(off2)] {sym} x mem)
 11508  	for {
 11509  		off1 := auxIntToInt32(v.AuxInt)
 11510  		sym := auxToSym(v.Aux)
 11511  		if v_0.Op != OpPPC64ADDconst {
 11512  			break
 11513  		}
 11514  		off2 := auxIntToInt64(v_0.AuxInt)
 11515  		x := v_0.Args[0]
 11516  		mem := v_1
 11517  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
 11518  			break
 11519  		}
 11520  		v.reset(OpPPC64MOVWstorezero)
 11521  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11522  		v.Aux = symToAux(sym)
 11523  		v.AddArg2(x, mem)
 11524  		return true
 11525  	}
 11526  	// match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 11527  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 11528  	// result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 11529  	for {
 11530  		off1 := auxIntToInt32(v.AuxInt)
 11531  		sym1 := auxToSym(v.Aux)
 11532  		p := v_0
 11533  		if p.Op != OpPPC64MOVDaddr {
 11534  			break
 11535  		}
 11536  		off2 := auxIntToInt32(p.AuxInt)
 11537  		sym2 := auxToSym(p.Aux)
 11538  		x := p.Args[0]
 11539  		mem := v_1
 11540  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 11541  			break
 11542  		}
 11543  		v.reset(OpPPC64MOVWstorezero)
 11544  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11545  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11546  		v.AddArg2(x, mem)
 11547  		return true
 11548  	}
 11549  	return false
 11550  }
 11551  func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
 11552  	v_0 := v.Args[0]
 11553  	b := v.Block
 11554  	typ := &b.Func.Config.Types
 11555  	// match: (MTVSRD (MOVDconst [c]))
 11556  	// cond: !math.IsNaN(math.Float64frombits(uint64(c)))
 11557  	// result: (FMOVDconst [math.Float64frombits(uint64(c))])
 11558  	for {
 11559  		if v_0.Op != OpPPC64MOVDconst {
 11560  			break
 11561  		}
 11562  		c := auxIntToInt64(v_0.AuxInt)
 11563  		if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
 11564  			break
 11565  		}
 11566  		v.reset(OpPPC64FMOVDconst)
 11567  		v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
 11568  		return true
 11569  	}
 11570  	// match: (MTVSRD x:(MOVDload [off] {sym} ptr mem))
 11571  	// cond: x.Uses == 1 && clobber(x)
 11572  	// result: @x.Block (FMOVDload [off] {sym} ptr mem)
 11573  	for {
 11574  		x := v_0
 11575  		if x.Op != OpPPC64MOVDload {
 11576  			break
 11577  		}
 11578  		off := auxIntToInt32(x.AuxInt)
 11579  		sym := auxToSym(x.Aux)
 11580  		mem := x.Args[1]
 11581  		ptr := x.Args[0]
 11582  		if !(x.Uses == 1 && clobber(x)) {
 11583  			break
 11584  		}
 11585  		b = x.Block
 11586  		v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
 11587  		v.copyOf(v0)
 11588  		v0.AuxInt = int32ToAuxInt(off)
 11589  		v0.Aux = symToAux(sym)
 11590  		v0.AddArg2(ptr, mem)
 11591  		return true
 11592  	}
 11593  	return false
 11594  }
 11595  func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
 11596  	v_1 := v.Args[1]
 11597  	v_0 := v.Args[0]
 11598  	// match: (MULLD x (MOVDconst [c]))
 11599  	// cond: is16Bit(c)
 11600  	// result: (MULLDconst [int32(c)] x)
 11601  	for {
 11602  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11603  			x := v_0
 11604  			if v_1.Op != OpPPC64MOVDconst {
 11605  				continue
 11606  			}
 11607  			c := auxIntToInt64(v_1.AuxInt)
 11608  			if !(is16Bit(c)) {
 11609  				continue
 11610  			}
 11611  			v.reset(OpPPC64MULLDconst)
 11612  			v.AuxInt = int32ToAuxInt(int32(c))
 11613  			v.AddArg(x)
 11614  			return true
 11615  		}
 11616  		break
 11617  	}
 11618  	return false
 11619  }
 11620  func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
 11621  	v_1 := v.Args[1]
 11622  	v_0 := v.Args[0]
 11623  	// match: (MULLW x (MOVDconst [c]))
 11624  	// cond: is16Bit(c)
 11625  	// result: (MULLWconst [int32(c)] x)
 11626  	for {
 11627  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11628  			x := v_0
 11629  			if v_1.Op != OpPPC64MOVDconst {
 11630  				continue
 11631  			}
 11632  			c := auxIntToInt64(v_1.AuxInt)
 11633  			if !(is16Bit(c)) {
 11634  				continue
 11635  			}
 11636  			v.reset(OpPPC64MULLWconst)
 11637  			v.AuxInt = int32ToAuxInt(int32(c))
 11638  			v.AddArg(x)
 11639  			return true
 11640  		}
 11641  		break
 11642  	}
 11643  	return false
 11644  }
 11645  func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
 11646  	v_0 := v.Args[0]
 11647  	// match: (NEG (ADDconst [c] x))
 11648  	// cond: is32Bit(-c)
 11649  	// result: (SUBFCconst [-c] x)
 11650  	for {
 11651  		if v_0.Op != OpPPC64ADDconst {
 11652  			break
 11653  		}
 11654  		c := auxIntToInt64(v_0.AuxInt)
 11655  		x := v_0.Args[0]
 11656  		if !(is32Bit(-c)) {
 11657  			break
 11658  		}
 11659  		v.reset(OpPPC64SUBFCconst)
 11660  		v.AuxInt = int64ToAuxInt(-c)
 11661  		v.AddArg(x)
 11662  		return true
 11663  	}
 11664  	// match: (NEG (SUBFCconst [c] x))
 11665  	// cond: is32Bit(-c)
 11666  	// result: (ADDconst [-c] x)
 11667  	for {
 11668  		if v_0.Op != OpPPC64SUBFCconst {
 11669  			break
 11670  		}
 11671  		c := auxIntToInt64(v_0.AuxInt)
 11672  		x := v_0.Args[0]
 11673  		if !(is32Bit(-c)) {
 11674  			break
 11675  		}
 11676  		v.reset(OpPPC64ADDconst)
 11677  		v.AuxInt = int64ToAuxInt(-c)
 11678  		v.AddArg(x)
 11679  		return true
 11680  	}
 11681  	// match: (NEG (SUB x y))
 11682  	// result: (SUB y x)
 11683  	for {
 11684  		if v_0.Op != OpPPC64SUB {
 11685  			break
 11686  		}
 11687  		y := v_0.Args[1]
 11688  		x := v_0.Args[0]
 11689  		v.reset(OpPPC64SUB)
 11690  		v.AddArg2(y, x)
 11691  		return true
 11692  	}
 11693  	// match: (NEG (NEG x))
 11694  	// result: x
 11695  	for {
 11696  		if v_0.Op != OpPPC64NEG {
 11697  			break
 11698  		}
 11699  		x := v_0.Args[0]
 11700  		v.copyOf(x)
 11701  		return true
 11702  	}
 11703  	return false
 11704  }
 11705  func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
 11706  	v_1 := v.Args[1]
 11707  	v_0 := v.Args[0]
 11708  	// match: (NOR (MOVDconst [c]) (MOVDconst [d]))
 11709  	// result: (MOVDconst [^(c|d)])
 11710  	for {
 11711  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11712  			if v_0.Op != OpPPC64MOVDconst {
 11713  				continue
 11714  			}
 11715  			c := auxIntToInt64(v_0.AuxInt)
 11716  			if v_1.Op != OpPPC64MOVDconst {
 11717  				continue
 11718  			}
 11719  			d := auxIntToInt64(v_1.AuxInt)
 11720  			v.reset(OpPPC64MOVDconst)
 11721  			v.AuxInt = int64ToAuxInt(^(c | d))
 11722  			return true
 11723  		}
 11724  		break
 11725  	}
 11726  	return false
 11727  }
 11728  func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
 11729  	v_0 := v.Args[0]
 11730  	// match: (NotEqual (FlagEQ))
 11731  	// result: (MOVDconst [0])
 11732  	for {
 11733  		if v_0.Op != OpPPC64FlagEQ {
 11734  			break
 11735  		}
 11736  		v.reset(OpPPC64MOVDconst)
 11737  		v.AuxInt = int64ToAuxInt(0)
 11738  		return true
 11739  	}
 11740  	// match: (NotEqual (FlagLT))
 11741  	// result: (MOVDconst [1])
 11742  	for {
 11743  		if v_0.Op != OpPPC64FlagLT {
 11744  			break
 11745  		}
 11746  		v.reset(OpPPC64MOVDconst)
 11747  		v.AuxInt = int64ToAuxInt(1)
 11748  		return true
 11749  	}
 11750  	// match: (NotEqual (FlagGT))
 11751  	// result: (MOVDconst [1])
 11752  	for {
 11753  		if v_0.Op != OpPPC64FlagGT {
 11754  			break
 11755  		}
 11756  		v.reset(OpPPC64MOVDconst)
 11757  		v.AuxInt = int64ToAuxInt(1)
 11758  		return true
 11759  	}
 11760  	// match: (NotEqual (InvertFlags x))
 11761  	// result: (NotEqual x)
 11762  	for {
 11763  		if v_0.Op != OpPPC64InvertFlags {
 11764  			break
 11765  		}
 11766  		x := v_0.Args[0]
 11767  		v.reset(OpPPC64NotEqual)
 11768  		v.AddArg(x)
 11769  		return true
 11770  	}
 11771  	// match: (NotEqual cmp)
 11772  	// result: (SETBCR [2] cmp)
 11773  	for {
 11774  		cmp := v_0
 11775  		v.reset(OpPPC64SETBCR)
 11776  		v.AuxInt = int32ToAuxInt(2)
 11777  		v.AddArg(cmp)
 11778  		return true
 11779  	}
 11780  }
 11781  func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
 11782  	v_1 := v.Args[1]
 11783  	v_0 := v.Args[0]
 11784  	// match: (OR <t> x (MOVDconst [m]))
 11785  	// cond: t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))
 11786  	// result: (ORconst [int64(uint8(m))] x)
 11787  	for {
 11788  		t := v.Type
 11789  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11790  			x := v_0
 11791  			if v_1.Op != OpPPC64MOVDconst {
 11792  				continue
 11793  			}
 11794  			m := auxIntToInt64(v_1.AuxInt)
 11795  			if !(t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))) {
 11796  				continue
 11797  			}
 11798  			v.reset(OpPPC64ORconst)
 11799  			v.AuxInt = int64ToAuxInt(int64(uint8(m)))
 11800  			v.AddArg(x)
 11801  			return true
 11802  		}
 11803  		break
 11804  	}
 11805  	// match: (OR <t> x (MOVDconst [m]))
 11806  	// cond: t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))
 11807  	// result: (ORconst [int64(uint16(m))] x)
 11808  	for {
 11809  		t := v.Type
 11810  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11811  			x := v_0
 11812  			if v_1.Op != OpPPC64MOVDconst {
 11813  				continue
 11814  			}
 11815  			m := auxIntToInt64(v_1.AuxInt)
 11816  			if !(t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))) {
 11817  				continue
 11818  			}
 11819  			v.reset(OpPPC64ORconst)
 11820  			v.AuxInt = int64ToAuxInt(int64(uint16(m)))
 11821  			v.AddArg(x)
 11822  			return true
 11823  		}
 11824  		break
 11825  	}
 11826  	// match: (OR x (NOR y y))
 11827  	// result: (ORN x y)
 11828  	for {
 11829  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11830  			x := v_0
 11831  			if v_1.Op != OpPPC64NOR {
 11832  				continue
 11833  			}
 11834  			y := v_1.Args[1]
 11835  			if y != v_1.Args[0] {
 11836  				continue
 11837  			}
 11838  			v.reset(OpPPC64ORN)
 11839  			v.AddArg2(x, y)
 11840  			return true
 11841  		}
 11842  		break
 11843  	}
 11844  	// match: (OR (MOVDconst [c]) (MOVDconst [d]))
 11845  	// result: (MOVDconst [c|d])
 11846  	for {
 11847  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11848  			if v_0.Op != OpPPC64MOVDconst {
 11849  				continue
 11850  			}
 11851  			c := auxIntToInt64(v_0.AuxInt)
 11852  			if v_1.Op != OpPPC64MOVDconst {
 11853  				continue
 11854  			}
 11855  			d := auxIntToInt64(v_1.AuxInt)
 11856  			v.reset(OpPPC64MOVDconst)
 11857  			v.AuxInt = int64ToAuxInt(c | d)
 11858  			return true
 11859  		}
 11860  		break
 11861  	}
 11862  	// match: (OR x (MOVDconst [c]))
 11863  	// cond: isU32Bit(c)
 11864  	// result: (ORconst [c] x)
 11865  	for {
 11866  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11867  			x := v_0
 11868  			if v_1.Op != OpPPC64MOVDconst {
 11869  				continue
 11870  			}
 11871  			c := auxIntToInt64(v_1.AuxInt)
 11872  			if !(isU32Bit(c)) {
 11873  				continue
 11874  			}
 11875  			v.reset(OpPPC64ORconst)
 11876  			v.AuxInt = int64ToAuxInt(c)
 11877  			v.AddArg(x)
 11878  			return true
 11879  		}
 11880  		break
 11881  	}
 11882  	return false
 11883  }
 11884  func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
 11885  	v_1 := v.Args[1]
 11886  	v_0 := v.Args[0]
 11887  	// match: (ORN x (MOVDconst [-1]))
 11888  	// result: x
 11889  	for {
 11890  		x := v_0
 11891  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
 11892  			break
 11893  		}
 11894  		v.copyOf(x)
 11895  		return true
 11896  	}
 11897  	// match: (ORN (MOVDconst [c]) (MOVDconst [d]))
 11898  	// result: (MOVDconst [c|^d])
 11899  	for {
 11900  		if v_0.Op != OpPPC64MOVDconst {
 11901  			break
 11902  		}
 11903  		c := auxIntToInt64(v_0.AuxInt)
 11904  		if v_1.Op != OpPPC64MOVDconst {
 11905  			break
 11906  		}
 11907  		d := auxIntToInt64(v_1.AuxInt)
 11908  		v.reset(OpPPC64MOVDconst)
 11909  		v.AuxInt = int64ToAuxInt(c | ^d)
 11910  		return true
 11911  	}
 11912  	return false
 11913  }
 11914  func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
 11915  	v_0 := v.Args[0]
 11916  	// match: (ORconst [c] (ORconst [d] x))
 11917  	// result: (ORconst [c|d] x)
 11918  	for {
 11919  		c := auxIntToInt64(v.AuxInt)
 11920  		if v_0.Op != OpPPC64ORconst {
 11921  			break
 11922  		}
 11923  		d := auxIntToInt64(v_0.AuxInt)
 11924  		x := v_0.Args[0]
 11925  		v.reset(OpPPC64ORconst)
 11926  		v.AuxInt = int64ToAuxInt(c | d)
 11927  		v.AddArg(x)
 11928  		return true
 11929  	}
 11930  	// match: (ORconst [-1] _)
 11931  	// result: (MOVDconst [-1])
 11932  	for {
 11933  		if auxIntToInt64(v.AuxInt) != -1 {
 11934  			break
 11935  		}
 11936  		v.reset(OpPPC64MOVDconst)
 11937  		v.AuxInt = int64ToAuxInt(-1)
 11938  		return true
 11939  	}
 11940  	// match: (ORconst [0] x)
 11941  	// result: x
 11942  	for {
 11943  		if auxIntToInt64(v.AuxInt) != 0 {
 11944  			break
 11945  		}
 11946  		x := v_0
 11947  		v.copyOf(x)
 11948  		return true
 11949  	}
 11950  	return false
 11951  }
 11952  func rewriteValuePPC64_OpPPC64RLWINM(v *Value) bool {
 11953  	v_0 := v.Args[0]
 11954  	// match: (RLWINM [r] (MOVHZreg u))
 11955  	// cond: mergePPC64RlwinmAnd(r,0xFFFF) != 0
 11956  	// result: (RLWINM [mergePPC64RlwinmAnd(r,0xFFFF)] u)
 11957  	for {
 11958  		r := auxIntToInt64(v.AuxInt)
 11959  		if v_0.Op != OpPPC64MOVHZreg {
 11960  			break
 11961  		}
 11962  		u := v_0.Args[0]
 11963  		if !(mergePPC64RlwinmAnd(r, 0xFFFF) != 0) {
 11964  			break
 11965  		}
 11966  		v.reset(OpPPC64RLWINM)
 11967  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, 0xFFFF))
 11968  		v.AddArg(u)
 11969  		return true
 11970  	}
 11971  	// match: (RLWINM [r] (ANDconst [a] u))
 11972  	// cond: mergePPC64RlwinmAnd(r,uint32(a)) != 0
 11973  	// result: (RLWINM [mergePPC64RlwinmAnd(r,uint32(a))] u)
 11974  	for {
 11975  		r := auxIntToInt64(v.AuxInt)
 11976  		if v_0.Op != OpPPC64ANDconst {
 11977  			break
 11978  		}
 11979  		a := auxIntToInt64(v_0.AuxInt)
 11980  		u := v_0.Args[0]
 11981  		if !(mergePPC64RlwinmAnd(r, uint32(a)) != 0) {
 11982  			break
 11983  		}
 11984  		v.reset(OpPPC64RLWINM)
 11985  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, uint32(a)))
 11986  		v.AddArg(u)
 11987  		return true
 11988  	}
 11989  	return false
 11990  }
 11991  func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
 11992  	v_1 := v.Args[1]
 11993  	v_0 := v.Args[0]
 11994  	// match: (ROTL x (MOVDconst [c]))
 11995  	// result: (ROTLconst x [c&63])
 11996  	for {
 11997  		x := v_0
 11998  		if v_1.Op != OpPPC64MOVDconst {
 11999  			break
 12000  		}
 12001  		c := auxIntToInt64(v_1.AuxInt)
 12002  		v.reset(OpPPC64ROTLconst)
 12003  		v.AuxInt = int64ToAuxInt(c & 63)
 12004  		v.AddArg(x)
 12005  		return true
 12006  	}
 12007  	return false
 12008  }
 12009  func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
 12010  	v_1 := v.Args[1]
 12011  	v_0 := v.Args[0]
 12012  	// match: (ROTLW x (MOVDconst [c]))
 12013  	// result: (ROTLWconst x [c&31])
 12014  	for {
 12015  		x := v_0
 12016  		if v_1.Op != OpPPC64MOVDconst {
 12017  			break
 12018  		}
 12019  		c := auxIntToInt64(v_1.AuxInt)
 12020  		v.reset(OpPPC64ROTLWconst)
 12021  		v.AuxInt = int64ToAuxInt(c & 31)
 12022  		v.AddArg(x)
 12023  		return true
 12024  	}
 12025  	return false
 12026  }
 12027  func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
 12028  	v_0 := v.Args[0]
 12029  	// match: (ROTLWconst [r] (AND (MOVDconst [m]) x))
 12030  	// cond: isPPC64WordRotateMask(m)
 12031  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 12032  	for {
 12033  		r := auxIntToInt64(v.AuxInt)
 12034  		if v_0.Op != OpPPC64AND {
 12035  			break
 12036  		}
 12037  		_ = v_0.Args[1]
 12038  		v_0_0 := v_0.Args[0]
 12039  		v_0_1 := v_0.Args[1]
 12040  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 12041  			if v_0_0.Op != OpPPC64MOVDconst {
 12042  				continue
 12043  			}
 12044  			m := auxIntToInt64(v_0_0.AuxInt)
 12045  			x := v_0_1
 12046  			if !(isPPC64WordRotateMask(m)) {
 12047  				continue
 12048  			}
 12049  			v.reset(OpPPC64RLWINM)
 12050  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 12051  			v.AddArg(x)
 12052  			return true
 12053  		}
 12054  		break
 12055  	}
 12056  	// match: (ROTLWconst [r] (ANDconst [m] x))
 12057  	// cond: isPPC64WordRotateMask(m)
 12058  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 12059  	for {
 12060  		r := auxIntToInt64(v.AuxInt)
 12061  		if v_0.Op != OpPPC64ANDconst {
 12062  			break
 12063  		}
 12064  		m := auxIntToInt64(v_0.AuxInt)
 12065  		x := v_0.Args[0]
 12066  		if !(isPPC64WordRotateMask(m)) {
 12067  			break
 12068  		}
 12069  		v.reset(OpPPC64RLWINM)
 12070  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 12071  		v.AddArg(x)
 12072  		return true
 12073  	}
 12074  	return false
 12075  }
 12076  func rewriteValuePPC64_OpPPC64SETBC(v *Value) bool {
 12077  	v_0 := v.Args[0]
 12078  	b := v.Block
 12079  	typ := &b.Func.Config.Types
 12080  	// match: (SETBC [0] (FlagLT))
 12081  	// result: (MOVDconst [1])
 12082  	for {
 12083  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 12084  			break
 12085  		}
 12086  		v.reset(OpPPC64MOVDconst)
 12087  		v.AuxInt = int64ToAuxInt(1)
 12088  		return true
 12089  	}
 12090  	// match: (SETBC [0] (FlagGT))
 12091  	// result: (MOVDconst [0])
 12092  	for {
 12093  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 12094  			break
 12095  		}
 12096  		v.reset(OpPPC64MOVDconst)
 12097  		v.AuxInt = int64ToAuxInt(0)
 12098  		return true
 12099  	}
 12100  	// match: (SETBC [0] (FlagEQ))
 12101  	// result: (MOVDconst [0])
 12102  	for {
 12103  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 12104  			break
 12105  		}
 12106  		v.reset(OpPPC64MOVDconst)
 12107  		v.AuxInt = int64ToAuxInt(0)
 12108  		return true
 12109  	}
 12110  	// match: (SETBC [1] (FlagGT))
 12111  	// result: (MOVDconst [1])
 12112  	for {
 12113  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 12114  			break
 12115  		}
 12116  		v.reset(OpPPC64MOVDconst)
 12117  		v.AuxInt = int64ToAuxInt(1)
 12118  		return true
 12119  	}
 12120  	// match: (SETBC [1] (FlagLT))
 12121  	// result: (MOVDconst [0])
 12122  	for {
 12123  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 12124  			break
 12125  		}
 12126  		v.reset(OpPPC64MOVDconst)
 12127  		v.AuxInt = int64ToAuxInt(0)
 12128  		return true
 12129  	}
 12130  	// match: (SETBC [1] (FlagEQ))
 12131  	// result: (MOVDconst [0])
 12132  	for {
 12133  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 12134  			break
 12135  		}
 12136  		v.reset(OpPPC64MOVDconst)
 12137  		v.AuxInt = int64ToAuxInt(0)
 12138  		return true
 12139  	}
 12140  	// match: (SETBC [2] (FlagEQ))
 12141  	// result: (MOVDconst [1])
 12142  	for {
 12143  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 12144  			break
 12145  		}
 12146  		v.reset(OpPPC64MOVDconst)
 12147  		v.AuxInt = int64ToAuxInt(1)
 12148  		return true
 12149  	}
 12150  	// match: (SETBC [2] (FlagLT))
 12151  	// result: (MOVDconst [0])
 12152  	for {
 12153  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 12154  			break
 12155  		}
 12156  		v.reset(OpPPC64MOVDconst)
 12157  		v.AuxInt = int64ToAuxInt(0)
 12158  		return true
 12159  	}
 12160  	// match: (SETBC [2] (FlagGT))
 12161  	// result: (MOVDconst [0])
 12162  	for {
 12163  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 12164  			break
 12165  		}
 12166  		v.reset(OpPPC64MOVDconst)
 12167  		v.AuxInt = int64ToAuxInt(0)
 12168  		return true
 12169  	}
 12170  	// match: (SETBC [0] (InvertFlags bool))
 12171  	// result: (SETBC [1] bool)
 12172  	for {
 12173  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 12174  			break
 12175  		}
 12176  		bool := v_0.Args[0]
 12177  		v.reset(OpPPC64SETBC)
 12178  		v.AuxInt = int32ToAuxInt(1)
 12179  		v.AddArg(bool)
 12180  		return true
 12181  	}
 12182  	// match: (SETBC [1] (InvertFlags bool))
 12183  	// result: (SETBC [0] bool)
 12184  	for {
 12185  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 12186  			break
 12187  		}
 12188  		bool := v_0.Args[0]
 12189  		v.reset(OpPPC64SETBC)
 12190  		v.AuxInt = int32ToAuxInt(0)
 12191  		v.AddArg(bool)
 12192  		return true
 12193  	}
 12194  	// match: (SETBC [2] (InvertFlags bool))
 12195  	// result: (SETBC [2] bool)
 12196  	for {
 12197  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 12198  			break
 12199  		}
 12200  		bool := v_0.Args[0]
 12201  		v.reset(OpPPC64SETBC)
 12202  		v.AuxInt = int32ToAuxInt(2)
 12203  		v.AddArg(bool)
 12204  		return true
 12205  	}
 12206  	// match: (SETBC [n] (InvertFlags bool))
 12207  	// result: (SETBCR [n] bool)
 12208  	for {
 12209  		n := auxIntToInt32(v.AuxInt)
 12210  		if v_0.Op != OpPPC64InvertFlags {
 12211  			break
 12212  		}
 12213  		bool := v_0.Args[0]
 12214  		v.reset(OpPPC64SETBCR)
 12215  		v.AuxInt = int32ToAuxInt(n)
 12216  		v.AddArg(bool)
 12217  		return true
 12218  	}
 12219  	// match: (SETBC [2] (CMPconst [0] a:(ANDconst [1] _)))
 12220  	// result: (XORconst [1] a)
 12221  	for {
 12222  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12223  			break
 12224  		}
 12225  		a := v_0.Args[0]
 12226  		if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
 12227  			break
 12228  		}
 12229  		v.reset(OpPPC64XORconst)
 12230  		v.AuxInt = int64ToAuxInt(1)
 12231  		v.AddArg(a)
 12232  		return true
 12233  	}
 12234  	// match: (SETBC [2] (CMPconst [0] a:(AND y z)))
 12235  	// cond: a.Uses == 1
 12236  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 12237  	for {
 12238  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12239  			break
 12240  		}
 12241  		a := v_0.Args[0]
 12242  		if a.Op != OpPPC64AND {
 12243  			break
 12244  		}
 12245  		z := a.Args[1]
 12246  		y := a.Args[0]
 12247  		if !(a.Uses == 1) {
 12248  			break
 12249  		}
 12250  		v.reset(OpPPC64SETBC)
 12251  		v.AuxInt = int32ToAuxInt(2)
 12252  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12253  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 12254  		v1.AddArg2(y, z)
 12255  		v0.AddArg(v1)
 12256  		v.AddArg(v0)
 12257  		return true
 12258  	}
 12259  	// match: (SETBC [2] (CMPconst [0] o:(OR y z)))
 12260  	// cond: o.Uses == 1
 12261  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ORCC y z )))
 12262  	for {
 12263  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12264  			break
 12265  		}
 12266  		o := v_0.Args[0]
 12267  		if o.Op != OpPPC64OR {
 12268  			break
 12269  		}
 12270  		z := o.Args[1]
 12271  		y := o.Args[0]
 12272  		if !(o.Uses == 1) {
 12273  			break
 12274  		}
 12275  		v.reset(OpPPC64SETBC)
 12276  		v.AuxInt = int32ToAuxInt(2)
 12277  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12278  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12279  		v1.AddArg2(y, z)
 12280  		v0.AddArg(v1)
 12281  		v.AddArg(v0)
 12282  		return true
 12283  	}
 12284  	// match: (SETBC [2] (CMPconst [0] a:(XOR y z)))
 12285  	// cond: a.Uses == 1
 12286  	// result: (SETBC [2] (Select1 <types.TypeFlags> (XORCC y z )))
 12287  	for {
 12288  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12289  			break
 12290  		}
 12291  		a := v_0.Args[0]
 12292  		if a.Op != OpPPC64XOR {
 12293  			break
 12294  		}
 12295  		z := a.Args[1]
 12296  		y := a.Args[0]
 12297  		if !(a.Uses == 1) {
 12298  			break
 12299  		}
 12300  		v.reset(OpPPC64SETBC)
 12301  		v.AuxInt = int32ToAuxInt(2)
 12302  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12303  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12304  		v1.AddArg2(y, z)
 12305  		v0.AddArg(v1)
 12306  		v.AddArg(v0)
 12307  		return true
 12308  	}
 12309  	return false
 12310  }
 12311  func rewriteValuePPC64_OpPPC64SETBCR(v *Value) bool {
 12312  	v_0 := v.Args[0]
 12313  	b := v.Block
 12314  	typ := &b.Func.Config.Types
 12315  	// match: (SETBCR [0] (FlagLT))
 12316  	// result: (MOVDconst [0])
 12317  	for {
 12318  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 12319  			break
 12320  		}
 12321  		v.reset(OpPPC64MOVDconst)
 12322  		v.AuxInt = int64ToAuxInt(0)
 12323  		return true
 12324  	}
 12325  	// match: (SETBCR [0] (FlagGT))
 12326  	// result: (MOVDconst [1])
 12327  	for {
 12328  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 12329  			break
 12330  		}
 12331  		v.reset(OpPPC64MOVDconst)
 12332  		v.AuxInt = int64ToAuxInt(1)
 12333  		return true
 12334  	}
 12335  	// match: (SETBCR [0] (FlagEQ))
 12336  	// result: (MOVDconst [1])
 12337  	for {
 12338  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 12339  			break
 12340  		}
 12341  		v.reset(OpPPC64MOVDconst)
 12342  		v.AuxInt = int64ToAuxInt(1)
 12343  		return true
 12344  	}
 12345  	// match: (SETBCR [1] (FlagGT))
 12346  	// result: (MOVDconst [0])
 12347  	for {
 12348  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 12349  			break
 12350  		}
 12351  		v.reset(OpPPC64MOVDconst)
 12352  		v.AuxInt = int64ToAuxInt(0)
 12353  		return true
 12354  	}
 12355  	// match: (SETBCR [1] (FlagLT))
 12356  	// result: (MOVDconst [1])
 12357  	for {
 12358  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 12359  			break
 12360  		}
 12361  		v.reset(OpPPC64MOVDconst)
 12362  		v.AuxInt = int64ToAuxInt(1)
 12363  		return true
 12364  	}
 12365  	// match: (SETBCR [1] (FlagEQ))
 12366  	// result: (MOVDconst [1])
 12367  	for {
 12368  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 12369  			break
 12370  		}
 12371  		v.reset(OpPPC64MOVDconst)
 12372  		v.AuxInt = int64ToAuxInt(1)
 12373  		return true
 12374  	}
 12375  	// match: (SETBCR [2] (FlagEQ))
 12376  	// result: (MOVDconst [0])
 12377  	for {
 12378  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 12379  			break
 12380  		}
 12381  		v.reset(OpPPC64MOVDconst)
 12382  		v.AuxInt = int64ToAuxInt(0)
 12383  		return true
 12384  	}
 12385  	// match: (SETBCR [2] (FlagLT))
 12386  	// result: (MOVDconst [1])
 12387  	for {
 12388  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 12389  			break
 12390  		}
 12391  		v.reset(OpPPC64MOVDconst)
 12392  		v.AuxInt = int64ToAuxInt(1)
 12393  		return true
 12394  	}
 12395  	// match: (SETBCR [2] (FlagGT))
 12396  	// result: (MOVDconst [1])
 12397  	for {
 12398  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 12399  			break
 12400  		}
 12401  		v.reset(OpPPC64MOVDconst)
 12402  		v.AuxInt = int64ToAuxInt(1)
 12403  		return true
 12404  	}
 12405  	// match: (SETBCR [0] (InvertFlags bool))
 12406  	// result: (SETBCR [1] bool)
 12407  	for {
 12408  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 12409  			break
 12410  		}
 12411  		bool := v_0.Args[0]
 12412  		v.reset(OpPPC64SETBCR)
 12413  		v.AuxInt = int32ToAuxInt(1)
 12414  		v.AddArg(bool)
 12415  		return true
 12416  	}
 12417  	// match: (SETBCR [1] (InvertFlags bool))
 12418  	// result: (SETBCR [0] bool)
 12419  	for {
 12420  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 12421  			break
 12422  		}
 12423  		bool := v_0.Args[0]
 12424  		v.reset(OpPPC64SETBCR)
 12425  		v.AuxInt = int32ToAuxInt(0)
 12426  		v.AddArg(bool)
 12427  		return true
 12428  	}
 12429  	// match: (SETBCR [2] (InvertFlags bool))
 12430  	// result: (SETBCR [2] bool)
 12431  	for {
 12432  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 12433  			break
 12434  		}
 12435  		bool := v_0.Args[0]
 12436  		v.reset(OpPPC64SETBCR)
 12437  		v.AuxInt = int32ToAuxInt(2)
 12438  		v.AddArg(bool)
 12439  		return true
 12440  	}
 12441  	// match: (SETBCR [n] (InvertFlags bool))
 12442  	// result: (SETBC [n] bool)
 12443  	for {
 12444  		n := auxIntToInt32(v.AuxInt)
 12445  		if v_0.Op != OpPPC64InvertFlags {
 12446  			break
 12447  		}
 12448  		bool := v_0.Args[0]
 12449  		v.reset(OpPPC64SETBC)
 12450  		v.AuxInt = int32ToAuxInt(n)
 12451  		v.AddArg(bool)
 12452  		return true
 12453  	}
 12454  	// match: (SETBCR [2] (CMPconst [0] a:(ANDconst [1] _)))
 12455  	// result: a
 12456  	for {
 12457  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12458  			break
 12459  		}
 12460  		a := v_0.Args[0]
 12461  		if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
 12462  			break
 12463  		}
 12464  		v.copyOf(a)
 12465  		return true
 12466  	}
 12467  	// match: (SETBCR [2] (CMPconst [0] a:(AND y z)))
 12468  	// cond: a.Uses == 1
 12469  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 12470  	for {
 12471  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12472  			break
 12473  		}
 12474  		a := v_0.Args[0]
 12475  		if a.Op != OpPPC64AND {
 12476  			break
 12477  		}
 12478  		z := a.Args[1]
 12479  		y := a.Args[0]
 12480  		if !(a.Uses == 1) {
 12481  			break
 12482  		}
 12483  		v.reset(OpPPC64SETBCR)
 12484  		v.AuxInt = int32ToAuxInt(2)
 12485  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12486  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 12487  		v1.AddArg2(y, z)
 12488  		v0.AddArg(v1)
 12489  		v.AddArg(v0)
 12490  		return true
 12491  	}
 12492  	// match: (SETBCR [2] (CMPconst [0] o:(OR y z)))
 12493  	// cond: o.Uses == 1
 12494  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ORCC y z )))
 12495  	for {
 12496  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12497  			break
 12498  		}
 12499  		o := v_0.Args[0]
 12500  		if o.Op != OpPPC64OR {
 12501  			break
 12502  		}
 12503  		z := o.Args[1]
 12504  		y := o.Args[0]
 12505  		if !(o.Uses == 1) {
 12506  			break
 12507  		}
 12508  		v.reset(OpPPC64SETBCR)
 12509  		v.AuxInt = int32ToAuxInt(2)
 12510  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12511  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12512  		v1.AddArg2(y, z)
 12513  		v0.AddArg(v1)
 12514  		v.AddArg(v0)
 12515  		return true
 12516  	}
 12517  	// match: (SETBCR [2] (CMPconst [0] a:(XOR y z)))
 12518  	// cond: a.Uses == 1
 12519  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (XORCC y z )))
 12520  	for {
 12521  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12522  			break
 12523  		}
 12524  		a := v_0.Args[0]
 12525  		if a.Op != OpPPC64XOR {
 12526  			break
 12527  		}
 12528  		z := a.Args[1]
 12529  		y := a.Args[0]
 12530  		if !(a.Uses == 1) {
 12531  			break
 12532  		}
 12533  		v.reset(OpPPC64SETBCR)
 12534  		v.AuxInt = int32ToAuxInt(2)
 12535  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12536  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12537  		v1.AddArg2(y, z)
 12538  		v0.AddArg(v1)
 12539  		v.AddArg(v0)
 12540  		return true
 12541  	}
 12542  	return false
 12543  }
 12544  func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
 12545  	v_1 := v.Args[1]
 12546  	v_0 := v.Args[0]
 12547  	// match: (SLD x (MOVDconst [c]))
 12548  	// result: (SLDconst [c&63 | (c>>6&1*63)] x)
 12549  	for {
 12550  		x := v_0
 12551  		if v_1.Op != OpPPC64MOVDconst {
 12552  			break
 12553  		}
 12554  		c := auxIntToInt64(v_1.AuxInt)
 12555  		v.reset(OpPPC64SLDconst)
 12556  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12557  		v.AddArg(x)
 12558  		return true
 12559  	}
 12560  	return false
 12561  }
 12562  func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
 12563  	v_0 := v.Args[0]
 12564  	// match: (SLDconst [l] (SRWconst [r] x))
 12565  	// cond: mergePPC64SldiSrw(l,r) != 0
 12566  	// result: (RLWINM [mergePPC64SldiSrw(l,r)] x)
 12567  	for {
 12568  		l := auxIntToInt64(v.AuxInt)
 12569  		if v_0.Op != OpPPC64SRWconst {
 12570  			break
 12571  		}
 12572  		r := auxIntToInt64(v_0.AuxInt)
 12573  		x := v_0.Args[0]
 12574  		if !(mergePPC64SldiSrw(l, r) != 0) {
 12575  			break
 12576  		}
 12577  		v.reset(OpPPC64RLWINM)
 12578  		v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
 12579  		v.AddArg(x)
 12580  		return true
 12581  	}
 12582  	// match: (SLDconst [s] (RLWINM [r] y))
 12583  	// cond: mergePPC64SldiRlwinm(s,r) != 0
 12584  	// result: (RLWINM [mergePPC64SldiRlwinm(s,r)] y)
 12585  	for {
 12586  		s := auxIntToInt64(v.AuxInt)
 12587  		if v_0.Op != OpPPC64RLWINM {
 12588  			break
 12589  		}
 12590  		r := auxIntToInt64(v_0.AuxInt)
 12591  		y := v_0.Args[0]
 12592  		if !(mergePPC64SldiRlwinm(s, r) != 0) {
 12593  			break
 12594  		}
 12595  		v.reset(OpPPC64RLWINM)
 12596  		v.AuxInt = int64ToAuxInt(mergePPC64SldiRlwinm(s, r))
 12597  		v.AddArg(y)
 12598  		return true
 12599  	}
 12600  	// match: (SLDconst [c] z:(MOVBZreg x))
 12601  	// cond: c < 8 && z.Uses == 1
 12602  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,56,63,64)] x)
 12603  	for {
 12604  		c := auxIntToInt64(v.AuxInt)
 12605  		z := v_0
 12606  		if z.Op != OpPPC64MOVBZreg {
 12607  			break
 12608  		}
 12609  		x := z.Args[0]
 12610  		if !(c < 8 && z.Uses == 1) {
 12611  			break
 12612  		}
 12613  		v.reset(OpPPC64CLRLSLDI)
 12614  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
 12615  		v.AddArg(x)
 12616  		return true
 12617  	}
 12618  	// match: (SLDconst [c] z:(MOVHZreg x))
 12619  	// cond: c < 16 && z.Uses == 1
 12620  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,48,63,64)] x)
 12621  	for {
 12622  		c := auxIntToInt64(v.AuxInt)
 12623  		z := v_0
 12624  		if z.Op != OpPPC64MOVHZreg {
 12625  			break
 12626  		}
 12627  		x := z.Args[0]
 12628  		if !(c < 16 && z.Uses == 1) {
 12629  			break
 12630  		}
 12631  		v.reset(OpPPC64CLRLSLDI)
 12632  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
 12633  		v.AddArg(x)
 12634  		return true
 12635  	}
 12636  	// match: (SLDconst [c] z:(MOVWZreg x))
 12637  	// cond: c < 32 && z.Uses == 1
 12638  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,32,63,64)] x)
 12639  	for {
 12640  		c := auxIntToInt64(v.AuxInt)
 12641  		z := v_0
 12642  		if z.Op != OpPPC64MOVWZreg {
 12643  			break
 12644  		}
 12645  		x := z.Args[0]
 12646  		if !(c < 32 && z.Uses == 1) {
 12647  			break
 12648  		}
 12649  		v.reset(OpPPC64CLRLSLDI)
 12650  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
 12651  		v.AddArg(x)
 12652  		return true
 12653  	}
 12654  	// match: (SLDconst [c] z:(ANDconst [d] x))
 12655  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))
 12656  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12657  	for {
 12658  		c := auxIntToInt64(v.AuxInt)
 12659  		z := v_0
 12660  		if z.Op != OpPPC64ANDconst {
 12661  			break
 12662  		}
 12663  		d := auxIntToInt64(z.AuxInt)
 12664  		x := z.Args[0]
 12665  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12666  			break
 12667  		}
 12668  		v.reset(OpPPC64CLRLSLDI)
 12669  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12670  		v.AddArg(x)
 12671  		return true
 12672  	}
 12673  	// match: (SLDconst [c] z:(AND (MOVDconst [d]) x))
 12674  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(64-getPPC64ShiftMaskLength(d))
 12675  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12676  	for {
 12677  		c := auxIntToInt64(v.AuxInt)
 12678  		z := v_0
 12679  		if z.Op != OpPPC64AND {
 12680  			break
 12681  		}
 12682  		_ = z.Args[1]
 12683  		z_0 := z.Args[0]
 12684  		z_1 := z.Args[1]
 12685  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12686  			if z_0.Op != OpPPC64MOVDconst {
 12687  				continue
 12688  			}
 12689  			d := auxIntToInt64(z_0.AuxInt)
 12690  			x := z_1
 12691  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12692  				continue
 12693  			}
 12694  			v.reset(OpPPC64CLRLSLDI)
 12695  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12696  			v.AddArg(x)
 12697  			return true
 12698  		}
 12699  		break
 12700  	}
 12701  	// match: (SLDconst [c] (ADD x x))
 12702  	// cond: c < 63
 12703  	// result: (SLDconst [c+1] x)
 12704  	for {
 12705  		c := auxIntToInt64(v.AuxInt)
 12706  		if v_0.Op != OpPPC64ADD {
 12707  			break
 12708  		}
 12709  		x := v_0.Args[1]
 12710  		if x != v_0.Args[0] || !(c < 63) {
 12711  			break
 12712  		}
 12713  		v.reset(OpPPC64SLDconst)
 12714  		v.AuxInt = int64ToAuxInt(c + 1)
 12715  		v.AddArg(x)
 12716  		return true
 12717  	}
 12718  	// match: (SLDconst [c] z:(MOVWreg x))
 12719  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12720  	// result: (EXTSWSLconst [c] x)
 12721  	for {
 12722  		c := auxIntToInt64(v.AuxInt)
 12723  		z := v_0
 12724  		if z.Op != OpPPC64MOVWreg {
 12725  			break
 12726  		}
 12727  		x := z.Args[0]
 12728  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12729  			break
 12730  		}
 12731  		v.reset(OpPPC64EXTSWSLconst)
 12732  		v.AuxInt = int64ToAuxInt(c)
 12733  		v.AddArg(x)
 12734  		return true
 12735  	}
 12736  	return false
 12737  }
 12738  func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
 12739  	v_1 := v.Args[1]
 12740  	v_0 := v.Args[0]
 12741  	// match: (SLW x (MOVDconst [c]))
 12742  	// result: (SLWconst [c&31 | (c>>5&1*31)] x)
 12743  	for {
 12744  		x := v_0
 12745  		if v_1.Op != OpPPC64MOVDconst {
 12746  			break
 12747  		}
 12748  		c := auxIntToInt64(v_1.AuxInt)
 12749  		v.reset(OpPPC64SLWconst)
 12750  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12751  		v.AddArg(x)
 12752  		return true
 12753  	}
 12754  	return false
 12755  }
 12756  func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
 12757  	v_0 := v.Args[0]
 12758  	// match: (SLWconst [s] (MOVWZreg w))
 12759  	// result: (SLWconst [s] w)
 12760  	for {
 12761  		s := auxIntToInt64(v.AuxInt)
 12762  		if v_0.Op != OpPPC64MOVWZreg {
 12763  			break
 12764  		}
 12765  		w := v_0.Args[0]
 12766  		v.reset(OpPPC64SLWconst)
 12767  		v.AuxInt = int64ToAuxInt(s)
 12768  		v.AddArg(w)
 12769  		return true
 12770  	}
 12771  	// match: (SLWconst [c] z:(MOVBZreg x))
 12772  	// cond: z.Uses == 1 && c < 8
 12773  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,24,31,32)] x)
 12774  	for {
 12775  		c := auxIntToInt64(v.AuxInt)
 12776  		z := v_0
 12777  		if z.Op != OpPPC64MOVBZreg {
 12778  			break
 12779  		}
 12780  		x := z.Args[0]
 12781  		if !(z.Uses == 1 && c < 8) {
 12782  			break
 12783  		}
 12784  		v.reset(OpPPC64CLRLSLWI)
 12785  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
 12786  		v.AddArg(x)
 12787  		return true
 12788  	}
 12789  	// match: (SLWconst [c] z:(MOVHZreg x))
 12790  	// cond: z.Uses == 1 && c < 16
 12791  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,16,31,32)] x)
 12792  	for {
 12793  		c := auxIntToInt64(v.AuxInt)
 12794  		z := v_0
 12795  		if z.Op != OpPPC64MOVHZreg {
 12796  			break
 12797  		}
 12798  		x := z.Args[0]
 12799  		if !(z.Uses == 1 && c < 16) {
 12800  			break
 12801  		}
 12802  		v.reset(OpPPC64CLRLSLWI)
 12803  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
 12804  		v.AddArg(x)
 12805  		return true
 12806  	}
 12807  	// match: (SLWconst [c] z:(ANDconst [d] x))
 12808  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12809  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12810  	for {
 12811  		c := auxIntToInt64(v.AuxInt)
 12812  		z := v_0
 12813  		if z.Op != OpPPC64ANDconst {
 12814  			break
 12815  		}
 12816  		d := auxIntToInt64(z.AuxInt)
 12817  		x := z.Args[0]
 12818  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12819  			break
 12820  		}
 12821  		v.reset(OpPPC64CLRLSLWI)
 12822  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12823  		v.AddArg(x)
 12824  		return true
 12825  	}
 12826  	// match: (SLWconst [c] z:(AND (MOVDconst [d]) x))
 12827  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12828  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12829  	for {
 12830  		c := auxIntToInt64(v.AuxInt)
 12831  		z := v_0
 12832  		if z.Op != OpPPC64AND {
 12833  			break
 12834  		}
 12835  		_ = z.Args[1]
 12836  		z_0 := z.Args[0]
 12837  		z_1 := z.Args[1]
 12838  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12839  			if z_0.Op != OpPPC64MOVDconst {
 12840  				continue
 12841  			}
 12842  			d := auxIntToInt64(z_0.AuxInt)
 12843  			x := z_1
 12844  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12845  				continue
 12846  			}
 12847  			v.reset(OpPPC64CLRLSLWI)
 12848  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12849  			v.AddArg(x)
 12850  			return true
 12851  		}
 12852  		break
 12853  	}
 12854  	// match: (SLWconst [c] (ADD x x))
 12855  	// cond: c < 31
 12856  	// result: (SLWconst [c+1] x)
 12857  	for {
 12858  		c := auxIntToInt64(v.AuxInt)
 12859  		if v_0.Op != OpPPC64ADD {
 12860  			break
 12861  		}
 12862  		x := v_0.Args[1]
 12863  		if x != v_0.Args[0] || !(c < 31) {
 12864  			break
 12865  		}
 12866  		v.reset(OpPPC64SLWconst)
 12867  		v.AuxInt = int64ToAuxInt(c + 1)
 12868  		v.AddArg(x)
 12869  		return true
 12870  	}
 12871  	// match: (SLWconst [c] z:(MOVWreg x))
 12872  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12873  	// result: (EXTSWSLconst [c] x)
 12874  	for {
 12875  		c := auxIntToInt64(v.AuxInt)
 12876  		z := v_0
 12877  		if z.Op != OpPPC64MOVWreg {
 12878  			break
 12879  		}
 12880  		x := z.Args[0]
 12881  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12882  			break
 12883  		}
 12884  		v.reset(OpPPC64EXTSWSLconst)
 12885  		v.AuxInt = int64ToAuxInt(c)
 12886  		v.AddArg(x)
 12887  		return true
 12888  	}
 12889  	return false
 12890  }
 12891  func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
 12892  	v_1 := v.Args[1]
 12893  	v_0 := v.Args[0]
 12894  	// match: (SRAD x (MOVDconst [c]))
 12895  	// result: (SRADconst [c&63 | (c>>6&1*63)] x)
 12896  	for {
 12897  		x := v_0
 12898  		if v_1.Op != OpPPC64MOVDconst {
 12899  			break
 12900  		}
 12901  		c := auxIntToInt64(v_1.AuxInt)
 12902  		v.reset(OpPPC64SRADconst)
 12903  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12904  		v.AddArg(x)
 12905  		return true
 12906  	}
 12907  	return false
 12908  }
 12909  func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
 12910  	v_1 := v.Args[1]
 12911  	v_0 := v.Args[0]
 12912  	// match: (SRAW x (MOVDconst [c]))
 12913  	// result: (SRAWconst [c&31 | (c>>5&1*31)] x)
 12914  	for {
 12915  		x := v_0
 12916  		if v_1.Op != OpPPC64MOVDconst {
 12917  			break
 12918  		}
 12919  		c := auxIntToInt64(v_1.AuxInt)
 12920  		v.reset(OpPPC64SRAWconst)
 12921  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12922  		v.AddArg(x)
 12923  		return true
 12924  	}
 12925  	return false
 12926  }
 12927  func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
 12928  	v_1 := v.Args[1]
 12929  	v_0 := v.Args[0]
 12930  	// match: (SRD x (MOVDconst [c]))
 12931  	// result: (SRDconst [c&63 | (c>>6&1*63)] x)
 12932  	for {
 12933  		x := v_0
 12934  		if v_1.Op != OpPPC64MOVDconst {
 12935  			break
 12936  		}
 12937  		c := auxIntToInt64(v_1.AuxInt)
 12938  		v.reset(OpPPC64SRDconst)
 12939  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12940  		v.AddArg(x)
 12941  		return true
 12942  	}
 12943  	return false
 12944  }
 12945  func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
 12946  	v_1 := v.Args[1]
 12947  	v_0 := v.Args[0]
 12948  	// match: (SRW x (MOVDconst [c]))
 12949  	// result: (SRWconst [c&31 | (c>>5&1*31)] x)
 12950  	for {
 12951  		x := v_0
 12952  		if v_1.Op != OpPPC64MOVDconst {
 12953  			break
 12954  		}
 12955  		c := auxIntToInt64(v_1.AuxInt)
 12956  		v.reset(OpPPC64SRWconst)
 12957  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12958  		v.AddArg(x)
 12959  		return true
 12960  	}
 12961  	return false
 12962  }
 12963  func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
 12964  	v_0 := v.Args[0]
 12965  	// match: (SRWconst (ANDconst [m] x) [s])
 12966  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 12967  	// result: (MOVDconst [0])
 12968  	for {
 12969  		s := auxIntToInt64(v.AuxInt)
 12970  		if v_0.Op != OpPPC64ANDconst {
 12971  			break
 12972  		}
 12973  		m := auxIntToInt64(v_0.AuxInt)
 12974  		if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 12975  			break
 12976  		}
 12977  		v.reset(OpPPC64MOVDconst)
 12978  		v.AuxInt = int64ToAuxInt(0)
 12979  		return true
 12980  	}
 12981  	// match: (SRWconst (ANDconst [m] x) [s])
 12982  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 12983  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 12984  	for {
 12985  		s := auxIntToInt64(v.AuxInt)
 12986  		if v_0.Op != OpPPC64ANDconst {
 12987  			break
 12988  		}
 12989  		m := auxIntToInt64(v_0.AuxInt)
 12990  		x := v_0.Args[0]
 12991  		if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 12992  			break
 12993  		}
 12994  		v.reset(OpPPC64RLWINM)
 12995  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 12996  		v.AddArg(x)
 12997  		return true
 12998  	}
 12999  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 13000  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 13001  	// result: (MOVDconst [0])
 13002  	for {
 13003  		s := auxIntToInt64(v.AuxInt)
 13004  		if v_0.Op != OpPPC64AND {
 13005  			break
 13006  		}
 13007  		_ = v_0.Args[1]
 13008  		v_0_0 := v_0.Args[0]
 13009  		v_0_1 := v_0.Args[1]
 13010  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 13011  			if v_0_0.Op != OpPPC64MOVDconst {
 13012  				continue
 13013  			}
 13014  			m := auxIntToInt64(v_0_0.AuxInt)
 13015  			if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 13016  				continue
 13017  			}
 13018  			v.reset(OpPPC64MOVDconst)
 13019  			v.AuxInt = int64ToAuxInt(0)
 13020  			return true
 13021  		}
 13022  		break
 13023  	}
 13024  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 13025  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 13026  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 13027  	for {
 13028  		s := auxIntToInt64(v.AuxInt)
 13029  		if v_0.Op != OpPPC64AND {
 13030  			break
 13031  		}
 13032  		_ = v_0.Args[1]
 13033  		v_0_0 := v_0.Args[0]
 13034  		v_0_1 := v_0.Args[1]
 13035  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 13036  			if v_0_0.Op != OpPPC64MOVDconst {
 13037  				continue
 13038  			}
 13039  			m := auxIntToInt64(v_0_0.AuxInt)
 13040  			x := v_0_1
 13041  			if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 13042  				continue
 13043  			}
 13044  			v.reset(OpPPC64RLWINM)
 13045  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 13046  			v.AddArg(x)
 13047  			return true
 13048  		}
 13049  		break
 13050  	}
 13051  	return false
 13052  }
 13053  func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
 13054  	v_1 := v.Args[1]
 13055  	v_0 := v.Args[0]
 13056  	// match: (SUB x (MOVDconst [c]))
 13057  	// cond: is32Bit(-c)
 13058  	// result: (ADDconst [-c] x)
 13059  	for {
 13060  		x := v_0
 13061  		if v_1.Op != OpPPC64MOVDconst {
 13062  			break
 13063  		}
 13064  		c := auxIntToInt64(v_1.AuxInt)
 13065  		if !(is32Bit(-c)) {
 13066  			break
 13067  		}
 13068  		v.reset(OpPPC64ADDconst)
 13069  		v.AuxInt = int64ToAuxInt(-c)
 13070  		v.AddArg(x)
 13071  		return true
 13072  	}
 13073  	// match: (SUB (MOVDconst [c]) x)
 13074  	// cond: is32Bit(c)
 13075  	// result: (SUBFCconst [c] x)
 13076  	for {
 13077  		if v_0.Op != OpPPC64MOVDconst {
 13078  			break
 13079  		}
 13080  		c := auxIntToInt64(v_0.AuxInt)
 13081  		x := v_1
 13082  		if !(is32Bit(c)) {
 13083  			break
 13084  		}
 13085  		v.reset(OpPPC64SUBFCconst)
 13086  		v.AuxInt = int64ToAuxInt(c)
 13087  		v.AddArg(x)
 13088  		return true
 13089  	}
 13090  	return false
 13091  }
 13092  func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
 13093  	v_2 := v.Args[2]
 13094  	v_1 := v.Args[1]
 13095  	v_0 := v.Args[0]
 13096  	b := v.Block
 13097  	typ := &b.Func.Config.Types
 13098  	// match: (SUBE x y (Select1 <typ.UInt64> (SUBCconst (MOVDconst [0]) [0])))
 13099  	// result: (SUBC x y)
 13100  	for {
 13101  		x := v_0
 13102  		y := v_1
 13103  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
 13104  			break
 13105  		}
 13106  		v_2_0 := v_2.Args[0]
 13107  		if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
 13108  			break
 13109  		}
 13110  		v_2_0_0 := v_2_0.Args[0]
 13111  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
 13112  			break
 13113  		}
 13114  		v.reset(OpPPC64SUBC)
 13115  		v.AddArg2(x, y)
 13116  		return true
 13117  	}
 13118  	return false
 13119  }
 13120  func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
 13121  	v_0 := v.Args[0]
 13122  	// match: (SUBFCconst [c] (NEG x))
 13123  	// result: (ADDconst [c] x)
 13124  	for {
 13125  		c := auxIntToInt64(v.AuxInt)
 13126  		if v_0.Op != OpPPC64NEG {
 13127  			break
 13128  		}
 13129  		x := v_0.Args[0]
 13130  		v.reset(OpPPC64ADDconst)
 13131  		v.AuxInt = int64ToAuxInt(c)
 13132  		v.AddArg(x)
 13133  		return true
 13134  	}
 13135  	// match: (SUBFCconst [c] (SUBFCconst [d] x))
 13136  	// cond: is32Bit(c-d)
 13137  	// result: (ADDconst [c-d] x)
 13138  	for {
 13139  		c := auxIntToInt64(v.AuxInt)
 13140  		if v_0.Op != OpPPC64SUBFCconst {
 13141  			break
 13142  		}
 13143  		d := auxIntToInt64(v_0.AuxInt)
 13144  		x := v_0.Args[0]
 13145  		if !(is32Bit(c - d)) {
 13146  			break
 13147  		}
 13148  		v.reset(OpPPC64ADDconst)
 13149  		v.AuxInt = int64ToAuxInt(c - d)
 13150  		v.AddArg(x)
 13151  		return true
 13152  	}
 13153  	// match: (SUBFCconst [0] x)
 13154  	// result: (NEG x)
 13155  	for {
 13156  		if auxIntToInt64(v.AuxInt) != 0 {
 13157  			break
 13158  		}
 13159  		x := v_0
 13160  		v.reset(OpPPC64NEG)
 13161  		v.AddArg(x)
 13162  		return true
 13163  	}
 13164  	return false
 13165  }
 13166  func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
 13167  	v_1 := v.Args[1]
 13168  	v_0 := v.Args[0]
 13169  	// match: (XOR <t> x (MOVDconst [m]))
 13170  	// cond: t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))
 13171  	// result: (XORconst [int64(uint8(m))] x)
 13172  	for {
 13173  		t := v.Type
 13174  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13175  			x := v_0
 13176  			if v_1.Op != OpPPC64MOVDconst {
 13177  				continue
 13178  			}
 13179  			m := auxIntToInt64(v_1.AuxInt)
 13180  			if !(t.IsUnsigned() && t.Size() == 1 && m != int64(uint8(m))) {
 13181  				continue
 13182  			}
 13183  			v.reset(OpPPC64XORconst)
 13184  			v.AuxInt = int64ToAuxInt(int64(uint8(m)))
 13185  			v.AddArg(x)
 13186  			return true
 13187  		}
 13188  		break
 13189  	}
 13190  	// match: (XOR <t> x (MOVDconst [m]))
 13191  	// cond: t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))
 13192  	// result: (XORconst [int64(uint16(m))] x)
 13193  	for {
 13194  		t := v.Type
 13195  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13196  			x := v_0
 13197  			if v_1.Op != OpPPC64MOVDconst {
 13198  				continue
 13199  			}
 13200  			m := auxIntToInt64(v_1.AuxInt)
 13201  			if !(t.IsUnsigned() && t.Size() == 2 && m != int64(uint16(m))) {
 13202  				continue
 13203  			}
 13204  			v.reset(OpPPC64XORconst)
 13205  			v.AuxInt = int64ToAuxInt(int64(uint16(m)))
 13206  			v.AddArg(x)
 13207  			return true
 13208  		}
 13209  		break
 13210  	}
 13211  	// match: (XOR (MOVDconst [c]) (MOVDconst [d]))
 13212  	// result: (MOVDconst [c^d])
 13213  	for {
 13214  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13215  			if v_0.Op != OpPPC64MOVDconst {
 13216  				continue
 13217  			}
 13218  			c := auxIntToInt64(v_0.AuxInt)
 13219  			if v_1.Op != OpPPC64MOVDconst {
 13220  				continue
 13221  			}
 13222  			d := auxIntToInt64(v_1.AuxInt)
 13223  			v.reset(OpPPC64MOVDconst)
 13224  			v.AuxInt = int64ToAuxInt(c ^ d)
 13225  			return true
 13226  		}
 13227  		break
 13228  	}
 13229  	// match: (XOR x (MOVDconst [c]))
 13230  	// cond: isU32Bit(c)
 13231  	// result: (XORconst [c] x)
 13232  	for {
 13233  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 13234  			x := v_0
 13235  			if v_1.Op != OpPPC64MOVDconst {
 13236  				continue
 13237  			}
 13238  			c := auxIntToInt64(v_1.AuxInt)
 13239  			if !(isU32Bit(c)) {
 13240  				continue
 13241  			}
 13242  			v.reset(OpPPC64XORconst)
 13243  			v.AuxInt = int64ToAuxInt(c)
 13244  			v.AddArg(x)
 13245  			return true
 13246  		}
 13247  		break
 13248  	}
 13249  	return false
 13250  }
 13251  func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
 13252  	v_0 := v.Args[0]
 13253  	// match: (XORconst [c] (XORconst [d] x))
 13254  	// result: (XORconst [c^d] x)
 13255  	for {
 13256  		c := auxIntToInt64(v.AuxInt)
 13257  		if v_0.Op != OpPPC64XORconst {
 13258  			break
 13259  		}
 13260  		d := auxIntToInt64(v_0.AuxInt)
 13261  		x := v_0.Args[0]
 13262  		v.reset(OpPPC64XORconst)
 13263  		v.AuxInt = int64ToAuxInt(c ^ d)
 13264  		v.AddArg(x)
 13265  		return true
 13266  	}
 13267  	// match: (XORconst [0] x)
 13268  	// result: x
 13269  	for {
 13270  		if auxIntToInt64(v.AuxInt) != 0 {
 13271  			break
 13272  		}
 13273  		x := v_0
 13274  		v.copyOf(x)
 13275  		return true
 13276  	}
 13277  	// match: (XORconst [1] (SETBCR [n] cmp))
 13278  	// result: (SETBC [n] cmp)
 13279  	for {
 13280  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
 13281  			break
 13282  		}
 13283  		n := auxIntToInt32(v_0.AuxInt)
 13284  		cmp := v_0.Args[0]
 13285  		v.reset(OpPPC64SETBC)
 13286  		v.AuxInt = int32ToAuxInt(n)
 13287  		v.AddArg(cmp)
 13288  		return true
 13289  	}
 13290  	// match: (XORconst [1] (SETBC [n] cmp))
 13291  	// result: (SETBCR [n] cmp)
 13292  	for {
 13293  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
 13294  			break
 13295  		}
 13296  		n := auxIntToInt32(v_0.AuxInt)
 13297  		cmp := v_0.Args[0]
 13298  		v.reset(OpPPC64SETBCR)
 13299  		v.AuxInt = int32ToAuxInt(n)
 13300  		v.AddArg(cmp)
 13301  		return true
 13302  	}
 13303  	return false
 13304  }
 13305  func rewriteValuePPC64_OpPopCount16(v *Value) bool {
 13306  	v_0 := v.Args[0]
 13307  	b := v.Block
 13308  	typ := &b.Func.Config.Types
 13309  	// match: (PopCount16 x)
 13310  	// result: (POPCNTW (MOVHZreg x))
 13311  	for {
 13312  		x := v_0
 13313  		v.reset(OpPPC64POPCNTW)
 13314  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13315  		v0.AddArg(x)
 13316  		v.AddArg(v0)
 13317  		return true
 13318  	}
 13319  }
 13320  func rewriteValuePPC64_OpPopCount32(v *Value) bool {
 13321  	v_0 := v.Args[0]
 13322  	b := v.Block
 13323  	typ := &b.Func.Config.Types
 13324  	// match: (PopCount32 x)
 13325  	// result: (POPCNTW (MOVWZreg x))
 13326  	for {
 13327  		x := v_0
 13328  		v.reset(OpPPC64POPCNTW)
 13329  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 13330  		v0.AddArg(x)
 13331  		v.AddArg(v0)
 13332  		return true
 13333  	}
 13334  }
 13335  func rewriteValuePPC64_OpPopCount8(v *Value) bool {
 13336  	v_0 := v.Args[0]
 13337  	b := v.Block
 13338  	typ := &b.Func.Config.Types
 13339  	// match: (PopCount8 x)
 13340  	// result: (POPCNTB (MOVBZreg x))
 13341  	for {
 13342  		x := v_0
 13343  		v.reset(OpPPC64POPCNTB)
 13344  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 13345  		v0.AddArg(x)
 13346  		v.AddArg(v0)
 13347  		return true
 13348  	}
 13349  }
 13350  func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
 13351  	v_1 := v.Args[1]
 13352  	v_0 := v.Args[0]
 13353  	// match: (PrefetchCache ptr mem)
 13354  	// result: (DCBT ptr mem [0])
 13355  	for {
 13356  		ptr := v_0
 13357  		mem := v_1
 13358  		v.reset(OpPPC64DCBT)
 13359  		v.AuxInt = int64ToAuxInt(0)
 13360  		v.AddArg2(ptr, mem)
 13361  		return true
 13362  	}
 13363  }
 13364  func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
 13365  	v_1 := v.Args[1]
 13366  	v_0 := v.Args[0]
 13367  	// match: (PrefetchCacheStreamed ptr mem)
 13368  	// result: (DCBT ptr mem [16])
 13369  	for {
 13370  		ptr := v_0
 13371  		mem := v_1
 13372  		v.reset(OpPPC64DCBT)
 13373  		v.AuxInt = int64ToAuxInt(16)
 13374  		v.AddArg2(ptr, mem)
 13375  		return true
 13376  	}
 13377  }
 13378  func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
 13379  	v_1 := v.Args[1]
 13380  	v_0 := v.Args[0]
 13381  	b := v.Block
 13382  	typ := &b.Func.Config.Types
 13383  	// match: (RotateLeft16 <t> x (MOVDconst [c]))
 13384  	// result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
 13385  	for {
 13386  		t := v.Type
 13387  		x := v_0
 13388  		if v_1.Op != OpPPC64MOVDconst {
 13389  			break
 13390  		}
 13391  		c := auxIntToInt64(v_1.AuxInt)
 13392  		v.reset(OpOr16)
 13393  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 13394  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13395  		v1.AuxInt = int64ToAuxInt(c & 15)
 13396  		v0.AddArg2(x, v1)
 13397  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 13398  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13399  		v3.AuxInt = int64ToAuxInt(-c & 15)
 13400  		v2.AddArg2(x, v3)
 13401  		v.AddArg2(v0, v2)
 13402  		return true
 13403  	}
 13404  	return false
 13405  }
 13406  func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
 13407  	v_1 := v.Args[1]
 13408  	v_0 := v.Args[0]
 13409  	b := v.Block
 13410  	typ := &b.Func.Config.Types
 13411  	// match: (RotateLeft8 <t> x (MOVDconst [c]))
 13412  	// result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
 13413  	for {
 13414  		t := v.Type
 13415  		x := v_0
 13416  		if v_1.Op != OpPPC64MOVDconst {
 13417  			break
 13418  		}
 13419  		c := auxIntToInt64(v_1.AuxInt)
 13420  		v.reset(OpOr8)
 13421  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 13422  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13423  		v1.AuxInt = int64ToAuxInt(c & 7)
 13424  		v0.AddArg2(x, v1)
 13425  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 13426  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13427  		v3.AuxInt = int64ToAuxInt(-c & 7)
 13428  		v2.AddArg2(x, v3)
 13429  		v.AddArg2(v0, v2)
 13430  		return true
 13431  	}
 13432  	return false
 13433  }
 13434  func rewriteValuePPC64_OpRsh16Ux16(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: (Rsh16Ux16 x y)
 13440  	// cond: shiftIsBounded(v)
 13441  	// result: (SRD (MOVHZreg x) y)
 13442  	for {
 13443  		x := v_0
 13444  		y := v_1
 13445  		if !(shiftIsBounded(v)) {
 13446  			break
 13447  		}
 13448  		v.reset(OpPPC64SRD)
 13449  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13450  		v0.AddArg(x)
 13451  		v.AddArg2(v0, y)
 13452  		return true
 13453  	}
 13454  	// match: (Rsh16Ux16 <t> x y)
 13455  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF0] y)))
 13456  	for {
 13457  		t := v.Type
 13458  		x := v_0
 13459  		y := v_1
 13460  		v.reset(OpPPC64ISEL)
 13461  		v.AuxInt = int32ToAuxInt(2)
 13462  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13463  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13464  		v1.AddArg(x)
 13465  		v0.AddArg2(v1, y)
 13466  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13467  		v2.AuxInt = int64ToAuxInt(0)
 13468  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13469  		v3.AuxInt = int64ToAuxInt(0)
 13470  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13471  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13472  		v4.AddArg(y)
 13473  		v3.AddArg(v4)
 13474  		v.AddArg3(v0, v2, v3)
 13475  		return true
 13476  	}
 13477  }
 13478  func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
 13479  	v_1 := v.Args[1]
 13480  	v_0 := v.Args[0]
 13481  	b := v.Block
 13482  	typ := &b.Func.Config.Types
 13483  	// match: (Rsh16Ux32 x y)
 13484  	// cond: shiftIsBounded(v)
 13485  	// result: (SRD (MOVHZreg x) y)
 13486  	for {
 13487  		x := v_0
 13488  		y := v_1
 13489  		if !(shiftIsBounded(v)) {
 13490  			break
 13491  		}
 13492  		v.reset(OpPPC64SRD)
 13493  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13494  		v0.AddArg(x)
 13495  		v.AddArg2(v0, y)
 13496  		return true
 13497  	}
 13498  	// match: (Rsh16Ux32 <t> x y)
 13499  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
 13500  	for {
 13501  		t := v.Type
 13502  		x := v_0
 13503  		y := v_1
 13504  		v.reset(OpPPC64ISEL)
 13505  		v.AuxInt = int32ToAuxInt(0)
 13506  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13507  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13508  		v1.AddArg(x)
 13509  		v0.AddArg2(v1, y)
 13510  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13511  		v2.AuxInt = int64ToAuxInt(0)
 13512  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13513  		v3.AuxInt = int32ToAuxInt(16)
 13514  		v3.AddArg(y)
 13515  		v.AddArg3(v0, v2, v3)
 13516  		return true
 13517  	}
 13518  }
 13519  func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
 13520  	v_1 := v.Args[1]
 13521  	v_0 := v.Args[0]
 13522  	b := v.Block
 13523  	typ := &b.Func.Config.Types
 13524  	// match: (Rsh16Ux64 x (MOVDconst [c]))
 13525  	// cond: uint64(c) < 16
 13526  	// result: (SRWconst (ZeroExt16to32 x) [c])
 13527  	for {
 13528  		x := v_0
 13529  		if v_1.Op != OpPPC64MOVDconst {
 13530  			break
 13531  		}
 13532  		c := auxIntToInt64(v_1.AuxInt)
 13533  		if !(uint64(c) < 16) {
 13534  			break
 13535  		}
 13536  		v.reset(OpPPC64SRWconst)
 13537  		v.AuxInt = int64ToAuxInt(c)
 13538  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 13539  		v0.AddArg(x)
 13540  		v.AddArg(v0)
 13541  		return true
 13542  	}
 13543  	// match: (Rsh16Ux64 x y)
 13544  	// cond: shiftIsBounded(v)
 13545  	// result: (SRD (MOVHZreg x) y)
 13546  	for {
 13547  		x := v_0
 13548  		y := v_1
 13549  		if !(shiftIsBounded(v)) {
 13550  			break
 13551  		}
 13552  		v.reset(OpPPC64SRD)
 13553  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13554  		v0.AddArg(x)
 13555  		v.AddArg2(v0, y)
 13556  		return true
 13557  	}
 13558  	// match: (Rsh16Ux64 <t> x y)
 13559  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
 13560  	for {
 13561  		t := v.Type
 13562  		x := v_0
 13563  		y := v_1
 13564  		v.reset(OpPPC64ISEL)
 13565  		v.AuxInt = int32ToAuxInt(0)
 13566  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13567  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13568  		v1.AddArg(x)
 13569  		v0.AddArg2(v1, y)
 13570  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13571  		v2.AuxInt = int64ToAuxInt(0)
 13572  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13573  		v3.AuxInt = int64ToAuxInt(16)
 13574  		v3.AddArg(y)
 13575  		v.AddArg3(v0, v2, v3)
 13576  		return true
 13577  	}
 13578  }
 13579  func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
 13580  	v_1 := v.Args[1]
 13581  	v_0 := v.Args[0]
 13582  	b := v.Block
 13583  	typ := &b.Func.Config.Types
 13584  	// match: (Rsh16Ux8 x y)
 13585  	// cond: shiftIsBounded(v)
 13586  	// result: (SRD (MOVHZreg x) y)
 13587  	for {
 13588  		x := v_0
 13589  		y := v_1
 13590  		if !(shiftIsBounded(v)) {
 13591  			break
 13592  		}
 13593  		v.reset(OpPPC64SRD)
 13594  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13595  		v0.AddArg(x)
 13596  		v.AddArg2(v0, y)
 13597  		return true
 13598  	}
 13599  	// match: (Rsh16Ux8 <t> x y)
 13600  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F0] y)))
 13601  	for {
 13602  		t := v.Type
 13603  		x := v_0
 13604  		y := v_1
 13605  		v.reset(OpPPC64ISEL)
 13606  		v.AuxInt = int32ToAuxInt(2)
 13607  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13608  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13609  		v1.AddArg(x)
 13610  		v0.AddArg2(v1, y)
 13611  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13612  		v2.AuxInt = int64ToAuxInt(0)
 13613  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13614  		v3.AuxInt = int64ToAuxInt(0)
 13615  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13616  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13617  		v4.AddArg(y)
 13618  		v3.AddArg(v4)
 13619  		v.AddArg3(v0, v2, v3)
 13620  		return true
 13621  	}
 13622  }
 13623  func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
 13624  	v_1 := v.Args[1]
 13625  	v_0 := v.Args[0]
 13626  	b := v.Block
 13627  	typ := &b.Func.Config.Types
 13628  	// match: (Rsh16x16 x y)
 13629  	// cond: shiftIsBounded(v)
 13630  	// result: (SRAD (MOVHreg x) y)
 13631  	for {
 13632  		x := v_0
 13633  		y := v_1
 13634  		if !(shiftIsBounded(v)) {
 13635  			break
 13636  		}
 13637  		v.reset(OpPPC64SRAD)
 13638  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13639  		v0.AddArg(x)
 13640  		v.AddArg2(v0, y)
 13641  		return true
 13642  	}
 13643  	// match: (Rsh16x16 <t> x y)
 13644  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPconst [0] (ANDconst [0xFFF0] y)))
 13645  	for {
 13646  		t := v.Type
 13647  		x := v_0
 13648  		y := v_1
 13649  		v.reset(OpPPC64ISEL)
 13650  		v.AuxInt = int32ToAuxInt(2)
 13651  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13652  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13653  		v1.AddArg(x)
 13654  		v0.AddArg2(v1, y)
 13655  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13656  		v2.AuxInt = int64ToAuxInt(15)
 13657  		v2.AddArg(v1)
 13658  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13659  		v3.AuxInt = int64ToAuxInt(0)
 13660  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13661  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13662  		v4.AddArg(y)
 13663  		v3.AddArg(v4)
 13664  		v.AddArg3(v0, v2, v3)
 13665  		return true
 13666  	}
 13667  }
 13668  func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
 13669  	v_1 := v.Args[1]
 13670  	v_0 := v.Args[0]
 13671  	b := v.Block
 13672  	typ := &b.Func.Config.Types
 13673  	// match: (Rsh16x32 x y)
 13674  	// cond: shiftIsBounded(v)
 13675  	// result: (SRAD (MOVHreg x) y)
 13676  	for {
 13677  		x := v_0
 13678  		y := v_1
 13679  		if !(shiftIsBounded(v)) {
 13680  			break
 13681  		}
 13682  		v.reset(OpPPC64SRAD)
 13683  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13684  		v0.AddArg(x)
 13685  		v.AddArg2(v0, y)
 13686  		return true
 13687  	}
 13688  	// match: (Rsh16x32 <t> x y)
 13689  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPWUconst y [16]))
 13690  	for {
 13691  		t := v.Type
 13692  		x := v_0
 13693  		y := v_1
 13694  		v.reset(OpPPC64ISEL)
 13695  		v.AuxInt = int32ToAuxInt(0)
 13696  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13697  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13698  		v1.AddArg(x)
 13699  		v0.AddArg2(v1, y)
 13700  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13701  		v2.AuxInt = int64ToAuxInt(15)
 13702  		v2.AddArg(v1)
 13703  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13704  		v3.AuxInt = int32ToAuxInt(16)
 13705  		v3.AddArg(y)
 13706  		v.AddArg3(v0, v2, v3)
 13707  		return true
 13708  	}
 13709  }
 13710  func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
 13711  	v_1 := v.Args[1]
 13712  	v_0 := v.Args[0]
 13713  	b := v.Block
 13714  	typ := &b.Func.Config.Types
 13715  	// match: (Rsh16x64 x (MOVDconst [c]))
 13716  	// cond: uint64(c) >= 16
 13717  	// result: (SRAWconst (SignExt16to32 x) [63])
 13718  	for {
 13719  		x := v_0
 13720  		if v_1.Op != OpPPC64MOVDconst {
 13721  			break
 13722  		}
 13723  		c := auxIntToInt64(v_1.AuxInt)
 13724  		if !(uint64(c) >= 16) {
 13725  			break
 13726  		}
 13727  		v.reset(OpPPC64SRAWconst)
 13728  		v.AuxInt = int64ToAuxInt(63)
 13729  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13730  		v0.AddArg(x)
 13731  		v.AddArg(v0)
 13732  		return true
 13733  	}
 13734  	// match: (Rsh16x64 x (MOVDconst [c]))
 13735  	// cond: uint64(c) < 16
 13736  	// result: (SRAWconst (SignExt16to32 x) [c])
 13737  	for {
 13738  		x := v_0
 13739  		if v_1.Op != OpPPC64MOVDconst {
 13740  			break
 13741  		}
 13742  		c := auxIntToInt64(v_1.AuxInt)
 13743  		if !(uint64(c) < 16) {
 13744  			break
 13745  		}
 13746  		v.reset(OpPPC64SRAWconst)
 13747  		v.AuxInt = int64ToAuxInt(c)
 13748  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13749  		v0.AddArg(x)
 13750  		v.AddArg(v0)
 13751  		return true
 13752  	}
 13753  	// match: (Rsh16x64 x y)
 13754  	// cond: shiftIsBounded(v)
 13755  	// result: (SRAD (MOVHreg x) y)
 13756  	for {
 13757  		x := v_0
 13758  		y := v_1
 13759  		if !(shiftIsBounded(v)) {
 13760  			break
 13761  		}
 13762  		v.reset(OpPPC64SRAD)
 13763  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13764  		v0.AddArg(x)
 13765  		v.AddArg2(v0, y)
 13766  		return true
 13767  	}
 13768  	// match: (Rsh16x64 <t> x y)
 13769  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPUconst y [16]))
 13770  	for {
 13771  		t := v.Type
 13772  		x := v_0
 13773  		y := v_1
 13774  		v.reset(OpPPC64ISEL)
 13775  		v.AuxInt = int32ToAuxInt(0)
 13776  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13777  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13778  		v1.AddArg(x)
 13779  		v0.AddArg2(v1, y)
 13780  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13781  		v2.AuxInt = int64ToAuxInt(15)
 13782  		v2.AddArg(v1)
 13783  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13784  		v3.AuxInt = int64ToAuxInt(16)
 13785  		v3.AddArg(y)
 13786  		v.AddArg3(v0, v2, v3)
 13787  		return true
 13788  	}
 13789  }
 13790  func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
 13791  	v_1 := v.Args[1]
 13792  	v_0 := v.Args[0]
 13793  	b := v.Block
 13794  	typ := &b.Func.Config.Types
 13795  	// match: (Rsh16x8 x y)
 13796  	// cond: shiftIsBounded(v)
 13797  	// result: (SRAD (MOVHreg x) y)
 13798  	for {
 13799  		x := v_0
 13800  		y := v_1
 13801  		if !(shiftIsBounded(v)) {
 13802  			break
 13803  		}
 13804  		v.reset(OpPPC64SRAD)
 13805  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13806  		v0.AddArg(x)
 13807  		v.AddArg2(v0, y)
 13808  		return true
 13809  	}
 13810  	// match: (Rsh16x8 <t> x y)
 13811  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPconst [0] (ANDconst [0x00F0] y)))
 13812  	for {
 13813  		t := v.Type
 13814  		x := v_0
 13815  		y := v_1
 13816  		v.reset(OpPPC64ISEL)
 13817  		v.AuxInt = int32ToAuxInt(2)
 13818  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13819  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13820  		v1.AddArg(x)
 13821  		v0.AddArg2(v1, y)
 13822  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13823  		v2.AuxInt = int64ToAuxInt(15)
 13824  		v2.AddArg(v1)
 13825  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13826  		v3.AuxInt = int64ToAuxInt(0)
 13827  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13828  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13829  		v4.AddArg(y)
 13830  		v3.AddArg(v4)
 13831  		v.AddArg3(v0, v2, v3)
 13832  		return true
 13833  	}
 13834  }
 13835  func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
 13836  	v_1 := v.Args[1]
 13837  	v_0 := v.Args[0]
 13838  	b := v.Block
 13839  	typ := &b.Func.Config.Types
 13840  	// match: (Rsh32Ux16 x y)
 13841  	// cond: shiftIsBounded(v)
 13842  	// result: (SRW x y)
 13843  	for {
 13844  		x := v_0
 13845  		y := v_1
 13846  		if !(shiftIsBounded(v)) {
 13847  			break
 13848  		}
 13849  		v.reset(OpPPC64SRW)
 13850  		v.AddArg2(x, y)
 13851  		return true
 13852  	}
 13853  	// match: (Rsh32Ux16 <t> x y)
 13854  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFE0] y)))
 13855  	for {
 13856  		t := v.Type
 13857  		x := v_0
 13858  		y := v_1
 13859  		v.reset(OpPPC64ISEL)
 13860  		v.AuxInt = int32ToAuxInt(2)
 13861  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13862  		v0.AddArg2(x, y)
 13863  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13864  		v1.AuxInt = int64ToAuxInt(0)
 13865  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13866  		v2.AuxInt = int64ToAuxInt(0)
 13867  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13868  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 13869  		v3.AddArg(y)
 13870  		v2.AddArg(v3)
 13871  		v.AddArg3(v0, v1, v2)
 13872  		return true
 13873  	}
 13874  }
 13875  func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
 13876  	v_1 := v.Args[1]
 13877  	v_0 := v.Args[0]
 13878  	b := v.Block
 13879  	typ := &b.Func.Config.Types
 13880  	// match: (Rsh32Ux32 x y)
 13881  	// cond: shiftIsBounded(v)
 13882  	// result: (SRW x y)
 13883  	for {
 13884  		x := v_0
 13885  		y := v_1
 13886  		if !(shiftIsBounded(v)) {
 13887  			break
 13888  		}
 13889  		v.reset(OpPPC64SRW)
 13890  		v.AddArg2(x, y)
 13891  		return true
 13892  	}
 13893  	// match: (Rsh32Ux32 <t> x y)
 13894  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
 13895  	for {
 13896  		t := v.Type
 13897  		x := v_0
 13898  		y := v_1
 13899  		v.reset(OpPPC64ISEL)
 13900  		v.AuxInt = int32ToAuxInt(0)
 13901  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13902  		v0.AddArg2(x, y)
 13903  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13904  		v1.AuxInt = int64ToAuxInt(0)
 13905  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13906  		v2.AuxInt = int32ToAuxInt(32)
 13907  		v2.AddArg(y)
 13908  		v.AddArg3(v0, v1, v2)
 13909  		return true
 13910  	}
 13911  }
 13912  func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
 13913  	v_1 := v.Args[1]
 13914  	v_0 := v.Args[0]
 13915  	b := v.Block
 13916  	typ := &b.Func.Config.Types
 13917  	// match: (Rsh32Ux64 x (MOVDconst [c]))
 13918  	// cond: uint64(c) < 32
 13919  	// result: (SRWconst x [c])
 13920  	for {
 13921  		x := v_0
 13922  		if v_1.Op != OpPPC64MOVDconst {
 13923  			break
 13924  		}
 13925  		c := auxIntToInt64(v_1.AuxInt)
 13926  		if !(uint64(c) < 32) {
 13927  			break
 13928  		}
 13929  		v.reset(OpPPC64SRWconst)
 13930  		v.AuxInt = int64ToAuxInt(c)
 13931  		v.AddArg(x)
 13932  		return true
 13933  	}
 13934  	// match: (Rsh32Ux64 x y)
 13935  	// cond: shiftIsBounded(v)
 13936  	// result: (SRW x y)
 13937  	for {
 13938  		x := v_0
 13939  		y := v_1
 13940  		if !(shiftIsBounded(v)) {
 13941  			break
 13942  		}
 13943  		v.reset(OpPPC64SRW)
 13944  		v.AddArg2(x, y)
 13945  		return true
 13946  	}
 13947  	// match: (Rsh32Ux64 <t> x y)
 13948  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
 13949  	for {
 13950  		t := v.Type
 13951  		x := v_0
 13952  		y := v_1
 13953  		v.reset(OpPPC64ISEL)
 13954  		v.AuxInt = int32ToAuxInt(0)
 13955  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13956  		v0.AddArg2(x, y)
 13957  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13958  		v1.AuxInt = int64ToAuxInt(0)
 13959  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13960  		v2.AuxInt = int64ToAuxInt(32)
 13961  		v2.AddArg(y)
 13962  		v.AddArg3(v0, v1, v2)
 13963  		return true
 13964  	}
 13965  }
 13966  func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
 13967  	v_1 := v.Args[1]
 13968  	v_0 := v.Args[0]
 13969  	b := v.Block
 13970  	typ := &b.Func.Config.Types
 13971  	// match: (Rsh32Ux8 x y)
 13972  	// cond: shiftIsBounded(v)
 13973  	// result: (SRW x y)
 13974  	for {
 13975  		x := v_0
 13976  		y := v_1
 13977  		if !(shiftIsBounded(v)) {
 13978  			break
 13979  		}
 13980  		v.reset(OpPPC64SRW)
 13981  		v.AddArg2(x, y)
 13982  		return true
 13983  	}
 13984  	// match: (Rsh32Ux8 <t> x y)
 13985  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00E0] y)))
 13986  	for {
 13987  		t := v.Type
 13988  		x := v_0
 13989  		y := v_1
 13990  		v.reset(OpPPC64ISEL)
 13991  		v.AuxInt = int32ToAuxInt(2)
 13992  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13993  		v0.AddArg2(x, y)
 13994  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13995  		v1.AuxInt = int64ToAuxInt(0)
 13996  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13997  		v2.AuxInt = int64ToAuxInt(0)
 13998  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13999  		v3.AuxInt = int64ToAuxInt(0x00E0)
 14000  		v3.AddArg(y)
 14001  		v2.AddArg(v3)
 14002  		v.AddArg3(v0, v1, v2)
 14003  		return true
 14004  	}
 14005  }
 14006  func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
 14007  	v_1 := v.Args[1]
 14008  	v_0 := v.Args[0]
 14009  	b := v.Block
 14010  	typ := &b.Func.Config.Types
 14011  	// match: (Rsh32x16 x y)
 14012  	// cond: shiftIsBounded(v)
 14013  	// result: (SRAW x y)
 14014  	for {
 14015  		x := v_0
 14016  		y := v_1
 14017  		if !(shiftIsBounded(v)) {
 14018  			break
 14019  		}
 14020  		v.reset(OpPPC64SRAW)
 14021  		v.AddArg2(x, y)
 14022  		return true
 14023  	}
 14024  	// match: (Rsh32x16 <t> x y)
 14025  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPconst [0] (ANDconst [0xFFE0] y)))
 14026  	for {
 14027  		t := v.Type
 14028  		x := v_0
 14029  		y := v_1
 14030  		v.reset(OpPPC64ISEL)
 14031  		v.AuxInt = int32ToAuxInt(2)
 14032  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 14033  		v0.AddArg2(x, y)
 14034  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 14035  		v1.AuxInt = int64ToAuxInt(31)
 14036  		v1.AddArg(x)
 14037  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14038  		v2.AuxInt = int64ToAuxInt(0)
 14039  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14040  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 14041  		v3.AddArg(y)
 14042  		v2.AddArg(v3)
 14043  		v.AddArg3(v0, v1, v2)
 14044  		return true
 14045  	}
 14046  }
 14047  func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
 14048  	v_1 := v.Args[1]
 14049  	v_0 := v.Args[0]
 14050  	b := v.Block
 14051  	// match: (Rsh32x32 x y)
 14052  	// cond: shiftIsBounded(v)
 14053  	// result: (SRAW x y)
 14054  	for {
 14055  		x := v_0
 14056  		y := v_1
 14057  		if !(shiftIsBounded(v)) {
 14058  			break
 14059  		}
 14060  		v.reset(OpPPC64SRAW)
 14061  		v.AddArg2(x, y)
 14062  		return true
 14063  	}
 14064  	// match: (Rsh32x32 <t> x y)
 14065  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPWUconst y [32]))
 14066  	for {
 14067  		t := v.Type
 14068  		x := v_0
 14069  		y := v_1
 14070  		v.reset(OpPPC64ISEL)
 14071  		v.AuxInt = int32ToAuxInt(0)
 14072  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 14073  		v0.AddArg2(x, y)
 14074  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 14075  		v1.AuxInt = int64ToAuxInt(31)
 14076  		v1.AddArg(x)
 14077  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14078  		v2.AuxInt = int32ToAuxInt(32)
 14079  		v2.AddArg(y)
 14080  		v.AddArg3(v0, v1, v2)
 14081  		return true
 14082  	}
 14083  }
 14084  func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
 14085  	v_1 := v.Args[1]
 14086  	v_0 := v.Args[0]
 14087  	b := v.Block
 14088  	// match: (Rsh32x64 x (MOVDconst [c]))
 14089  	// cond: uint64(c) >= 32
 14090  	// result: (SRAWconst x [63])
 14091  	for {
 14092  		x := v_0
 14093  		if v_1.Op != OpPPC64MOVDconst {
 14094  			break
 14095  		}
 14096  		c := auxIntToInt64(v_1.AuxInt)
 14097  		if !(uint64(c) >= 32) {
 14098  			break
 14099  		}
 14100  		v.reset(OpPPC64SRAWconst)
 14101  		v.AuxInt = int64ToAuxInt(63)
 14102  		v.AddArg(x)
 14103  		return true
 14104  	}
 14105  	// match: (Rsh32x64 x (MOVDconst [c]))
 14106  	// cond: uint64(c) < 32
 14107  	// result: (SRAWconst x [c])
 14108  	for {
 14109  		x := v_0
 14110  		if v_1.Op != OpPPC64MOVDconst {
 14111  			break
 14112  		}
 14113  		c := auxIntToInt64(v_1.AuxInt)
 14114  		if !(uint64(c) < 32) {
 14115  			break
 14116  		}
 14117  		v.reset(OpPPC64SRAWconst)
 14118  		v.AuxInt = int64ToAuxInt(c)
 14119  		v.AddArg(x)
 14120  		return true
 14121  	}
 14122  	// match: (Rsh32x64 x y)
 14123  	// cond: shiftIsBounded(v)
 14124  	// result: (SRAW x y)
 14125  	for {
 14126  		x := v_0
 14127  		y := v_1
 14128  		if !(shiftIsBounded(v)) {
 14129  			break
 14130  		}
 14131  		v.reset(OpPPC64SRAW)
 14132  		v.AddArg2(x, y)
 14133  		return true
 14134  	}
 14135  	// match: (Rsh32x64 <t> x y)
 14136  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPUconst y [32]))
 14137  	for {
 14138  		t := v.Type
 14139  		x := v_0
 14140  		y := v_1
 14141  		v.reset(OpPPC64ISEL)
 14142  		v.AuxInt = int32ToAuxInt(0)
 14143  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 14144  		v0.AddArg2(x, y)
 14145  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 14146  		v1.AuxInt = int64ToAuxInt(31)
 14147  		v1.AddArg(x)
 14148  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14149  		v2.AuxInt = int64ToAuxInt(32)
 14150  		v2.AddArg(y)
 14151  		v.AddArg3(v0, v1, v2)
 14152  		return true
 14153  	}
 14154  }
 14155  func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
 14156  	v_1 := v.Args[1]
 14157  	v_0 := v.Args[0]
 14158  	b := v.Block
 14159  	typ := &b.Func.Config.Types
 14160  	// match: (Rsh32x8 x y)
 14161  	// cond: shiftIsBounded(v)
 14162  	// result: (SRAW x y)
 14163  	for {
 14164  		x := v_0
 14165  		y := v_1
 14166  		if !(shiftIsBounded(v)) {
 14167  			break
 14168  		}
 14169  		v.reset(OpPPC64SRAW)
 14170  		v.AddArg2(x, y)
 14171  		return true
 14172  	}
 14173  	// match: (Rsh32x8 <t> x y)
 14174  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPconst [0] (ANDconst [0x00E0] y)))
 14175  	for {
 14176  		t := v.Type
 14177  		x := v_0
 14178  		y := v_1
 14179  		v.reset(OpPPC64ISEL)
 14180  		v.AuxInt = int32ToAuxInt(2)
 14181  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 14182  		v0.AddArg2(x, y)
 14183  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 14184  		v1.AuxInt = int64ToAuxInt(31)
 14185  		v1.AddArg(x)
 14186  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14187  		v2.AuxInt = int64ToAuxInt(0)
 14188  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14189  		v3.AuxInt = int64ToAuxInt(0x00E0)
 14190  		v3.AddArg(y)
 14191  		v2.AddArg(v3)
 14192  		v.AddArg3(v0, v1, v2)
 14193  		return true
 14194  	}
 14195  }
 14196  func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
 14197  	v_1 := v.Args[1]
 14198  	v_0 := v.Args[0]
 14199  	b := v.Block
 14200  	typ := &b.Func.Config.Types
 14201  	// match: (Rsh64Ux16 x y)
 14202  	// cond: shiftIsBounded(v)
 14203  	// result: (SRD x y)
 14204  	for {
 14205  		x := v_0
 14206  		y := v_1
 14207  		if !(shiftIsBounded(v)) {
 14208  			break
 14209  		}
 14210  		v.reset(OpPPC64SRD)
 14211  		v.AddArg2(x, y)
 14212  		return true
 14213  	}
 14214  	// match: (Rsh64Ux16 <t> x y)
 14215  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFC0] y)))
 14216  	for {
 14217  		t := v.Type
 14218  		x := v_0
 14219  		y := v_1
 14220  		v.reset(OpPPC64ISEL)
 14221  		v.AuxInt = int32ToAuxInt(2)
 14222  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14223  		v0.AddArg2(x, y)
 14224  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14225  		v1.AuxInt = int64ToAuxInt(0)
 14226  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14227  		v2.AuxInt = int64ToAuxInt(0)
 14228  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14229  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 14230  		v3.AddArg(y)
 14231  		v2.AddArg(v3)
 14232  		v.AddArg3(v0, v1, v2)
 14233  		return true
 14234  	}
 14235  }
 14236  func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
 14237  	v_1 := v.Args[1]
 14238  	v_0 := v.Args[0]
 14239  	b := v.Block
 14240  	typ := &b.Func.Config.Types
 14241  	// match: (Rsh64Ux32 x y)
 14242  	// cond: shiftIsBounded(v)
 14243  	// result: (SRD x y)
 14244  	for {
 14245  		x := v_0
 14246  		y := v_1
 14247  		if !(shiftIsBounded(v)) {
 14248  			break
 14249  		}
 14250  		v.reset(OpPPC64SRD)
 14251  		v.AddArg2(x, y)
 14252  		return true
 14253  	}
 14254  	// match: (Rsh64Ux32 <t> x y)
 14255  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
 14256  	for {
 14257  		t := v.Type
 14258  		x := v_0
 14259  		y := v_1
 14260  		v.reset(OpPPC64ISEL)
 14261  		v.AuxInt = int32ToAuxInt(0)
 14262  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14263  		v0.AddArg2(x, y)
 14264  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14265  		v1.AuxInt = int64ToAuxInt(0)
 14266  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14267  		v2.AuxInt = int32ToAuxInt(64)
 14268  		v2.AddArg(y)
 14269  		v.AddArg3(v0, v1, v2)
 14270  		return true
 14271  	}
 14272  }
 14273  func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
 14274  	v_1 := v.Args[1]
 14275  	v_0 := v.Args[0]
 14276  	b := v.Block
 14277  	typ := &b.Func.Config.Types
 14278  	// match: (Rsh64Ux64 x (MOVDconst [c]))
 14279  	// cond: uint64(c) < 64
 14280  	// result: (SRDconst x [c])
 14281  	for {
 14282  		x := v_0
 14283  		if v_1.Op != OpPPC64MOVDconst {
 14284  			break
 14285  		}
 14286  		c := auxIntToInt64(v_1.AuxInt)
 14287  		if !(uint64(c) < 64) {
 14288  			break
 14289  		}
 14290  		v.reset(OpPPC64SRDconst)
 14291  		v.AuxInt = int64ToAuxInt(c)
 14292  		v.AddArg(x)
 14293  		return true
 14294  	}
 14295  	// match: (Rsh64Ux64 x y)
 14296  	// cond: shiftIsBounded(v)
 14297  	// result: (SRD x y)
 14298  	for {
 14299  		x := v_0
 14300  		y := v_1
 14301  		if !(shiftIsBounded(v)) {
 14302  			break
 14303  		}
 14304  		v.reset(OpPPC64SRD)
 14305  		v.AddArg2(x, y)
 14306  		return true
 14307  	}
 14308  	// match: (Rsh64Ux64 <t> x y)
 14309  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
 14310  	for {
 14311  		t := v.Type
 14312  		x := v_0
 14313  		y := v_1
 14314  		v.reset(OpPPC64ISEL)
 14315  		v.AuxInt = int32ToAuxInt(0)
 14316  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14317  		v0.AddArg2(x, y)
 14318  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14319  		v1.AuxInt = int64ToAuxInt(0)
 14320  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14321  		v2.AuxInt = int64ToAuxInt(64)
 14322  		v2.AddArg(y)
 14323  		v.AddArg3(v0, v1, v2)
 14324  		return true
 14325  	}
 14326  }
 14327  func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
 14328  	v_1 := v.Args[1]
 14329  	v_0 := v.Args[0]
 14330  	b := v.Block
 14331  	typ := &b.Func.Config.Types
 14332  	// match: (Rsh64Ux8 x y)
 14333  	// cond: shiftIsBounded(v)
 14334  	// result: (SRD x y)
 14335  	for {
 14336  		x := v_0
 14337  		y := v_1
 14338  		if !(shiftIsBounded(v)) {
 14339  			break
 14340  		}
 14341  		v.reset(OpPPC64SRD)
 14342  		v.AddArg2(x, y)
 14343  		return true
 14344  	}
 14345  	// match: (Rsh64Ux8 <t> x y)
 14346  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00C0] y)))
 14347  	for {
 14348  		t := v.Type
 14349  		x := v_0
 14350  		y := v_1
 14351  		v.reset(OpPPC64ISEL)
 14352  		v.AuxInt = int32ToAuxInt(2)
 14353  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14354  		v0.AddArg2(x, y)
 14355  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14356  		v1.AuxInt = int64ToAuxInt(0)
 14357  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14358  		v2.AuxInt = int64ToAuxInt(0)
 14359  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14360  		v3.AuxInt = int64ToAuxInt(0x00C0)
 14361  		v3.AddArg(y)
 14362  		v2.AddArg(v3)
 14363  		v.AddArg3(v0, v1, v2)
 14364  		return true
 14365  	}
 14366  }
 14367  func rewriteValuePPC64_OpRsh64x16(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: (Rsh64x16 x y)
 14373  	// cond: shiftIsBounded(v)
 14374  	// result: (SRAD x y)
 14375  	for {
 14376  		x := v_0
 14377  		y := v_1
 14378  		if !(shiftIsBounded(v)) {
 14379  			break
 14380  		}
 14381  		v.reset(OpPPC64SRAD)
 14382  		v.AddArg2(x, y)
 14383  		return true
 14384  	}
 14385  	// match: (Rsh64x16 <t> x y)
 14386  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPconst [0] (ANDconst [0xFFC0] y)))
 14387  	for {
 14388  		t := v.Type
 14389  		x := v_0
 14390  		y := v_1
 14391  		v.reset(OpPPC64ISEL)
 14392  		v.AuxInt = int32ToAuxInt(2)
 14393  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14394  		v0.AddArg2(x, y)
 14395  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14396  		v1.AuxInt = int64ToAuxInt(63)
 14397  		v1.AddArg(x)
 14398  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14399  		v2.AuxInt = int64ToAuxInt(0)
 14400  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14401  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 14402  		v3.AddArg(y)
 14403  		v2.AddArg(v3)
 14404  		v.AddArg3(v0, v1, v2)
 14405  		return true
 14406  	}
 14407  }
 14408  func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
 14409  	v_1 := v.Args[1]
 14410  	v_0 := v.Args[0]
 14411  	b := v.Block
 14412  	// match: (Rsh64x32 x y)
 14413  	// cond: shiftIsBounded(v)
 14414  	// result: (SRAD x y)
 14415  	for {
 14416  		x := v_0
 14417  		y := v_1
 14418  		if !(shiftIsBounded(v)) {
 14419  			break
 14420  		}
 14421  		v.reset(OpPPC64SRAD)
 14422  		v.AddArg2(x, y)
 14423  		return true
 14424  	}
 14425  	// match: (Rsh64x32 <t> x y)
 14426  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPWUconst y [64]))
 14427  	for {
 14428  		t := v.Type
 14429  		x := v_0
 14430  		y := v_1
 14431  		v.reset(OpPPC64ISEL)
 14432  		v.AuxInt = int32ToAuxInt(0)
 14433  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14434  		v0.AddArg2(x, y)
 14435  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14436  		v1.AuxInt = int64ToAuxInt(63)
 14437  		v1.AddArg(x)
 14438  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14439  		v2.AuxInt = int32ToAuxInt(64)
 14440  		v2.AddArg(y)
 14441  		v.AddArg3(v0, v1, v2)
 14442  		return true
 14443  	}
 14444  }
 14445  func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
 14446  	v_1 := v.Args[1]
 14447  	v_0 := v.Args[0]
 14448  	b := v.Block
 14449  	// match: (Rsh64x64 x (MOVDconst [c]))
 14450  	// cond: uint64(c) >= 64
 14451  	// result: (SRADconst x [63])
 14452  	for {
 14453  		x := v_0
 14454  		if v_1.Op != OpPPC64MOVDconst {
 14455  			break
 14456  		}
 14457  		c := auxIntToInt64(v_1.AuxInt)
 14458  		if !(uint64(c) >= 64) {
 14459  			break
 14460  		}
 14461  		v.reset(OpPPC64SRADconst)
 14462  		v.AuxInt = int64ToAuxInt(63)
 14463  		v.AddArg(x)
 14464  		return true
 14465  	}
 14466  	// match: (Rsh64x64 x (MOVDconst [c]))
 14467  	// cond: uint64(c) < 64
 14468  	// result: (SRADconst x [c])
 14469  	for {
 14470  		x := v_0
 14471  		if v_1.Op != OpPPC64MOVDconst {
 14472  			break
 14473  		}
 14474  		c := auxIntToInt64(v_1.AuxInt)
 14475  		if !(uint64(c) < 64) {
 14476  			break
 14477  		}
 14478  		v.reset(OpPPC64SRADconst)
 14479  		v.AuxInt = int64ToAuxInt(c)
 14480  		v.AddArg(x)
 14481  		return true
 14482  	}
 14483  	// match: (Rsh64x64 x y)
 14484  	// cond: shiftIsBounded(v)
 14485  	// result: (SRAD x y)
 14486  	for {
 14487  		x := v_0
 14488  		y := v_1
 14489  		if !(shiftIsBounded(v)) {
 14490  			break
 14491  		}
 14492  		v.reset(OpPPC64SRAD)
 14493  		v.AddArg2(x, y)
 14494  		return true
 14495  	}
 14496  	// match: (Rsh64x64 <t> x y)
 14497  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPUconst y [64]))
 14498  	for {
 14499  		t := v.Type
 14500  		x := v_0
 14501  		y := v_1
 14502  		v.reset(OpPPC64ISEL)
 14503  		v.AuxInt = int32ToAuxInt(0)
 14504  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14505  		v0.AddArg2(x, y)
 14506  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14507  		v1.AuxInt = int64ToAuxInt(63)
 14508  		v1.AddArg(x)
 14509  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14510  		v2.AuxInt = int64ToAuxInt(64)
 14511  		v2.AddArg(y)
 14512  		v.AddArg3(v0, v1, v2)
 14513  		return true
 14514  	}
 14515  }
 14516  func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
 14517  	v_1 := v.Args[1]
 14518  	v_0 := v.Args[0]
 14519  	b := v.Block
 14520  	typ := &b.Func.Config.Types
 14521  	// match: (Rsh64x8 x y)
 14522  	// cond: shiftIsBounded(v)
 14523  	// result: (SRAD x y)
 14524  	for {
 14525  		x := v_0
 14526  		y := v_1
 14527  		if !(shiftIsBounded(v)) {
 14528  			break
 14529  		}
 14530  		v.reset(OpPPC64SRAD)
 14531  		v.AddArg2(x, y)
 14532  		return true
 14533  	}
 14534  	// match: (Rsh64x8 <t> x y)
 14535  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPconst [0] (ANDconst [0x00C0] y)))
 14536  	for {
 14537  		t := v.Type
 14538  		x := v_0
 14539  		y := v_1
 14540  		v.reset(OpPPC64ISEL)
 14541  		v.AuxInt = int32ToAuxInt(2)
 14542  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14543  		v0.AddArg2(x, y)
 14544  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14545  		v1.AuxInt = int64ToAuxInt(63)
 14546  		v1.AddArg(x)
 14547  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14548  		v2.AuxInt = int64ToAuxInt(0)
 14549  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14550  		v3.AuxInt = int64ToAuxInt(0x00C0)
 14551  		v3.AddArg(y)
 14552  		v2.AddArg(v3)
 14553  		v.AddArg3(v0, v1, v2)
 14554  		return true
 14555  	}
 14556  }
 14557  func rewriteValuePPC64_OpRsh8Ux16(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: (Rsh8Ux16 x y)
 14563  	// cond: shiftIsBounded(v)
 14564  	// result: (SRD (MOVBZreg x) y)
 14565  	for {
 14566  		x := v_0
 14567  		y := v_1
 14568  		if !(shiftIsBounded(v)) {
 14569  			break
 14570  		}
 14571  		v.reset(OpPPC64SRD)
 14572  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14573  		v0.AddArg(x)
 14574  		v.AddArg2(v0, y)
 14575  		return true
 14576  	}
 14577  	// match: (Rsh8Ux16 <t> x y)
 14578  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF8] y)))
 14579  	for {
 14580  		t := v.Type
 14581  		x := v_0
 14582  		y := v_1
 14583  		v.reset(OpPPC64ISEL)
 14584  		v.AuxInt = int32ToAuxInt(2)
 14585  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14586  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14587  		v1.AddArg(x)
 14588  		v0.AddArg2(v1, y)
 14589  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14590  		v2.AuxInt = int64ToAuxInt(0)
 14591  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14592  		v3.AuxInt = int64ToAuxInt(0)
 14593  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14594  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14595  		v4.AddArg(y)
 14596  		v3.AddArg(v4)
 14597  		v.AddArg3(v0, v2, v3)
 14598  		return true
 14599  	}
 14600  }
 14601  func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
 14602  	v_1 := v.Args[1]
 14603  	v_0 := v.Args[0]
 14604  	b := v.Block
 14605  	typ := &b.Func.Config.Types
 14606  	// match: (Rsh8Ux32 x y)
 14607  	// cond: shiftIsBounded(v)
 14608  	// result: (SRD (MOVBZreg x) y)
 14609  	for {
 14610  		x := v_0
 14611  		y := v_1
 14612  		if !(shiftIsBounded(v)) {
 14613  			break
 14614  		}
 14615  		v.reset(OpPPC64SRD)
 14616  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14617  		v0.AddArg(x)
 14618  		v.AddArg2(v0, y)
 14619  		return true
 14620  	}
 14621  	// match: (Rsh8Ux32 <t> x y)
 14622  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
 14623  	for {
 14624  		t := v.Type
 14625  		x := v_0
 14626  		y := v_1
 14627  		v.reset(OpPPC64ISEL)
 14628  		v.AuxInt = int32ToAuxInt(0)
 14629  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14630  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14631  		v1.AddArg(x)
 14632  		v0.AddArg2(v1, y)
 14633  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14634  		v2.AuxInt = int64ToAuxInt(0)
 14635  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14636  		v3.AuxInt = int32ToAuxInt(8)
 14637  		v3.AddArg(y)
 14638  		v.AddArg3(v0, v2, v3)
 14639  		return true
 14640  	}
 14641  }
 14642  func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
 14643  	v_1 := v.Args[1]
 14644  	v_0 := v.Args[0]
 14645  	b := v.Block
 14646  	typ := &b.Func.Config.Types
 14647  	// match: (Rsh8Ux64 x (MOVDconst [c]))
 14648  	// cond: uint64(c) < 8
 14649  	// result: (SRWconst (ZeroExt8to32 x) [c])
 14650  	for {
 14651  		x := v_0
 14652  		if v_1.Op != OpPPC64MOVDconst {
 14653  			break
 14654  		}
 14655  		c := auxIntToInt64(v_1.AuxInt)
 14656  		if !(uint64(c) < 8) {
 14657  			break
 14658  		}
 14659  		v.reset(OpPPC64SRWconst)
 14660  		v.AuxInt = int64ToAuxInt(c)
 14661  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 14662  		v0.AddArg(x)
 14663  		v.AddArg(v0)
 14664  		return true
 14665  	}
 14666  	// match: (Rsh8Ux64 x y)
 14667  	// cond: shiftIsBounded(v)
 14668  	// result: (SRD (MOVBZreg x) y)
 14669  	for {
 14670  		x := v_0
 14671  		y := v_1
 14672  		if !(shiftIsBounded(v)) {
 14673  			break
 14674  		}
 14675  		v.reset(OpPPC64SRD)
 14676  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14677  		v0.AddArg(x)
 14678  		v.AddArg2(v0, y)
 14679  		return true
 14680  	}
 14681  	// match: (Rsh8Ux64 <t> x y)
 14682  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
 14683  	for {
 14684  		t := v.Type
 14685  		x := v_0
 14686  		y := v_1
 14687  		v.reset(OpPPC64ISEL)
 14688  		v.AuxInt = int32ToAuxInt(0)
 14689  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14690  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14691  		v1.AddArg(x)
 14692  		v0.AddArg2(v1, y)
 14693  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14694  		v2.AuxInt = int64ToAuxInt(0)
 14695  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14696  		v3.AuxInt = int64ToAuxInt(8)
 14697  		v3.AddArg(y)
 14698  		v.AddArg3(v0, v2, v3)
 14699  		return true
 14700  	}
 14701  }
 14702  func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
 14703  	v_1 := v.Args[1]
 14704  	v_0 := v.Args[0]
 14705  	b := v.Block
 14706  	typ := &b.Func.Config.Types
 14707  	// match: (Rsh8Ux8 x y)
 14708  	// cond: shiftIsBounded(v)
 14709  	// result: (SRD (MOVBZreg x) y)
 14710  	for {
 14711  		x := v_0
 14712  		y := v_1
 14713  		if !(shiftIsBounded(v)) {
 14714  			break
 14715  		}
 14716  		v.reset(OpPPC64SRD)
 14717  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14718  		v0.AddArg(x)
 14719  		v.AddArg2(v0, y)
 14720  		return true
 14721  	}
 14722  	// match: (Rsh8Ux8 <t> x y)
 14723  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F8] y)))
 14724  	for {
 14725  		t := v.Type
 14726  		x := v_0
 14727  		y := v_1
 14728  		v.reset(OpPPC64ISEL)
 14729  		v.AuxInt = int32ToAuxInt(2)
 14730  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14731  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14732  		v1.AddArg(x)
 14733  		v0.AddArg2(v1, y)
 14734  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14735  		v2.AuxInt = int64ToAuxInt(0)
 14736  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14737  		v3.AuxInt = int64ToAuxInt(0)
 14738  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14739  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14740  		v4.AddArg(y)
 14741  		v3.AddArg(v4)
 14742  		v.AddArg3(v0, v2, v3)
 14743  		return true
 14744  	}
 14745  }
 14746  func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
 14747  	v_1 := v.Args[1]
 14748  	v_0 := v.Args[0]
 14749  	b := v.Block
 14750  	typ := &b.Func.Config.Types
 14751  	// match: (Rsh8x16 x y)
 14752  	// cond: shiftIsBounded(v)
 14753  	// result: (SRAD (MOVBreg x) y)
 14754  	for {
 14755  		x := v_0
 14756  		y := v_1
 14757  		if !(shiftIsBounded(v)) {
 14758  			break
 14759  		}
 14760  		v.reset(OpPPC64SRAD)
 14761  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14762  		v0.AddArg(x)
 14763  		v.AddArg2(v0, y)
 14764  		return true
 14765  	}
 14766  	// match: (Rsh8x16 <t> x y)
 14767  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPconst [0] (ANDconst [0xFFF8] y)))
 14768  	for {
 14769  		t := v.Type
 14770  		x := v_0
 14771  		y := v_1
 14772  		v.reset(OpPPC64ISEL)
 14773  		v.AuxInt = int32ToAuxInt(2)
 14774  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14775  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14776  		v1.AddArg(x)
 14777  		v0.AddArg2(v1, y)
 14778  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14779  		v2.AuxInt = int64ToAuxInt(7)
 14780  		v2.AddArg(v1)
 14781  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14782  		v3.AuxInt = int64ToAuxInt(0)
 14783  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14784  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14785  		v4.AddArg(y)
 14786  		v3.AddArg(v4)
 14787  		v.AddArg3(v0, v2, v3)
 14788  		return true
 14789  	}
 14790  }
 14791  func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
 14792  	v_1 := v.Args[1]
 14793  	v_0 := v.Args[0]
 14794  	b := v.Block
 14795  	typ := &b.Func.Config.Types
 14796  	// match: (Rsh8x32 x y)
 14797  	// cond: shiftIsBounded(v)
 14798  	// result: (SRAD (MOVBreg x) y)
 14799  	for {
 14800  		x := v_0
 14801  		y := v_1
 14802  		if !(shiftIsBounded(v)) {
 14803  			break
 14804  		}
 14805  		v.reset(OpPPC64SRAD)
 14806  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14807  		v0.AddArg(x)
 14808  		v.AddArg2(v0, y)
 14809  		return true
 14810  	}
 14811  	// match: (Rsh8x32 <t> x y)
 14812  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPWUconst y [8]))
 14813  	for {
 14814  		t := v.Type
 14815  		x := v_0
 14816  		y := v_1
 14817  		v.reset(OpPPC64ISEL)
 14818  		v.AuxInt = int32ToAuxInt(0)
 14819  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14820  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14821  		v1.AddArg(x)
 14822  		v0.AddArg2(v1, y)
 14823  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14824  		v2.AuxInt = int64ToAuxInt(7)
 14825  		v2.AddArg(v1)
 14826  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14827  		v3.AuxInt = int32ToAuxInt(8)
 14828  		v3.AddArg(y)
 14829  		v.AddArg3(v0, v2, v3)
 14830  		return true
 14831  	}
 14832  }
 14833  func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
 14834  	v_1 := v.Args[1]
 14835  	v_0 := v.Args[0]
 14836  	b := v.Block
 14837  	typ := &b.Func.Config.Types
 14838  	// match: (Rsh8x64 x (MOVDconst [c]))
 14839  	// cond: uint64(c) >= 8
 14840  	// result: (SRAWconst (SignExt8to32 x) [63])
 14841  	for {
 14842  		x := v_0
 14843  		if v_1.Op != OpPPC64MOVDconst {
 14844  			break
 14845  		}
 14846  		c := auxIntToInt64(v_1.AuxInt)
 14847  		if !(uint64(c) >= 8) {
 14848  			break
 14849  		}
 14850  		v.reset(OpPPC64SRAWconst)
 14851  		v.AuxInt = int64ToAuxInt(63)
 14852  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14853  		v0.AddArg(x)
 14854  		v.AddArg(v0)
 14855  		return true
 14856  	}
 14857  	// match: (Rsh8x64 x (MOVDconst [c]))
 14858  	// cond: uint64(c) < 8
 14859  	// result: (SRAWconst (SignExt8to32 x) [c])
 14860  	for {
 14861  		x := v_0
 14862  		if v_1.Op != OpPPC64MOVDconst {
 14863  			break
 14864  		}
 14865  		c := auxIntToInt64(v_1.AuxInt)
 14866  		if !(uint64(c) < 8) {
 14867  			break
 14868  		}
 14869  		v.reset(OpPPC64SRAWconst)
 14870  		v.AuxInt = int64ToAuxInt(c)
 14871  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14872  		v0.AddArg(x)
 14873  		v.AddArg(v0)
 14874  		return true
 14875  	}
 14876  	// match: (Rsh8x64 x y)
 14877  	// cond: shiftIsBounded(v)
 14878  	// result: (SRAD (MOVBreg x) y)
 14879  	for {
 14880  		x := v_0
 14881  		y := v_1
 14882  		if !(shiftIsBounded(v)) {
 14883  			break
 14884  		}
 14885  		v.reset(OpPPC64SRAD)
 14886  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14887  		v0.AddArg(x)
 14888  		v.AddArg2(v0, y)
 14889  		return true
 14890  	}
 14891  	// match: (Rsh8x64 <t> x y)
 14892  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPUconst y [8]))
 14893  	for {
 14894  		t := v.Type
 14895  		x := v_0
 14896  		y := v_1
 14897  		v.reset(OpPPC64ISEL)
 14898  		v.AuxInt = int32ToAuxInt(0)
 14899  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14900  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14901  		v1.AddArg(x)
 14902  		v0.AddArg2(v1, y)
 14903  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14904  		v2.AuxInt = int64ToAuxInt(7)
 14905  		v2.AddArg(v1)
 14906  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14907  		v3.AuxInt = int64ToAuxInt(8)
 14908  		v3.AddArg(y)
 14909  		v.AddArg3(v0, v2, v3)
 14910  		return true
 14911  	}
 14912  }
 14913  func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
 14914  	v_1 := v.Args[1]
 14915  	v_0 := v.Args[0]
 14916  	b := v.Block
 14917  	typ := &b.Func.Config.Types
 14918  	// match: (Rsh8x8 x y)
 14919  	// cond: shiftIsBounded(v)
 14920  	// result: (SRAD (MOVBreg x) y)
 14921  	for {
 14922  		x := v_0
 14923  		y := v_1
 14924  		if !(shiftIsBounded(v)) {
 14925  			break
 14926  		}
 14927  		v.reset(OpPPC64SRAD)
 14928  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14929  		v0.AddArg(x)
 14930  		v.AddArg2(v0, y)
 14931  		return true
 14932  	}
 14933  	// match: (Rsh8x8 <t> x y)
 14934  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPconst [0] (ANDconst [0x00F8] y)))
 14935  	for {
 14936  		t := v.Type
 14937  		x := v_0
 14938  		y := v_1
 14939  		v.reset(OpPPC64ISEL)
 14940  		v.AuxInt = int32ToAuxInt(2)
 14941  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14942  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14943  		v1.AddArg(x)
 14944  		v0.AddArg2(v1, y)
 14945  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14946  		v2.AuxInt = int64ToAuxInt(7)
 14947  		v2.AddArg(v1)
 14948  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14949  		v3.AuxInt = int64ToAuxInt(0)
 14950  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14951  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14952  		v4.AddArg(y)
 14953  		v3.AddArg(v4)
 14954  		v.AddArg3(v0, v2, v3)
 14955  		return true
 14956  	}
 14957  }
 14958  func rewriteValuePPC64_OpSelect0(v *Value) bool {
 14959  	v_0 := v.Args[0]
 14960  	b := v.Block
 14961  	typ := &b.Func.Config.Types
 14962  	// match: (Select0 (Mul64uhilo x y))
 14963  	// result: (MULHDU x y)
 14964  	for {
 14965  		if v_0.Op != OpMul64uhilo {
 14966  			break
 14967  		}
 14968  		y := v_0.Args[1]
 14969  		x := v_0.Args[0]
 14970  		v.reset(OpPPC64MULHDU)
 14971  		v.AddArg2(x, y)
 14972  		return true
 14973  	}
 14974  	// match: (Select0 (Mul64uover x y))
 14975  	// result: (MULLD x y)
 14976  	for {
 14977  		if v_0.Op != OpMul64uover {
 14978  			break
 14979  		}
 14980  		y := v_0.Args[1]
 14981  		x := v_0.Args[0]
 14982  		v.reset(OpPPC64MULLD)
 14983  		v.AddArg2(x, y)
 14984  		return true
 14985  	}
 14986  	// match: (Select0 (Add64carry x y c))
 14987  	// result: (Select0 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1]))))
 14988  	for {
 14989  		if v_0.Op != OpAdd64carry {
 14990  			break
 14991  		}
 14992  		c := v_0.Args[2]
 14993  		x := v_0.Args[0]
 14994  		y := v_0.Args[1]
 14995  		v.reset(OpSelect0)
 14996  		v.Type = typ.UInt64
 14997  		v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 14998  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14999  		v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 15000  		v2.AuxInt = int64ToAuxInt(-1)
 15001  		v2.AddArg(c)
 15002  		v1.AddArg(v2)
 15003  		v0.AddArg3(x, y, v1)
 15004  		v.AddArg(v0)
 15005  		return true
 15006  	}
 15007  	// match: (Select0 (Sub64borrow x y c))
 15008  	// result: (Select0 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))
 15009  	for {
 15010  		if v_0.Op != OpSub64borrow {
 15011  			break
 15012  		}
 15013  		c := v_0.Args[2]
 15014  		x := v_0.Args[0]
 15015  		y := v_0.Args[1]
 15016  		v.reset(OpSelect0)
 15017  		v.Type = typ.UInt64
 15018  		v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 15019  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15020  		v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 15021  		v2.AuxInt = int64ToAuxInt(0)
 15022  		v2.AddArg(c)
 15023  		v1.AddArg(v2)
 15024  		v0.AddArg3(x, y, v1)
 15025  		v.AddArg(v0)
 15026  		return true
 15027  	}
 15028  	return false
 15029  }
 15030  func rewriteValuePPC64_OpSelect1(v *Value) bool {
 15031  	v_0 := v.Args[0]
 15032  	b := v.Block
 15033  	typ := &b.Func.Config.Types
 15034  	// match: (Select1 (Mul64uhilo x y))
 15035  	// result: (MULLD x y)
 15036  	for {
 15037  		if v_0.Op != OpMul64uhilo {
 15038  			break
 15039  		}
 15040  		y := v_0.Args[1]
 15041  		x := v_0.Args[0]
 15042  		v.reset(OpPPC64MULLD)
 15043  		v.AddArg2(x, y)
 15044  		return true
 15045  	}
 15046  	// match: (Select1 (Mul64uover x y))
 15047  	// result: (SETBCR [2] (CMPconst [0] (MULHDU <x.Type> x y)))
 15048  	for {
 15049  		if v_0.Op != OpMul64uover {
 15050  			break
 15051  		}
 15052  		y := v_0.Args[1]
 15053  		x := v_0.Args[0]
 15054  		v.reset(OpPPC64SETBCR)
 15055  		v.AuxInt = int32ToAuxInt(2)
 15056  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 15057  		v0.AuxInt = int64ToAuxInt(0)
 15058  		v1 := b.NewValue0(v.Pos, OpPPC64MULHDU, x.Type)
 15059  		v1.AddArg2(x, y)
 15060  		v0.AddArg(v1)
 15061  		v.AddArg(v0)
 15062  		return true
 15063  	}
 15064  	// match: (Select1 (Add64carry x y c))
 15065  	// result: (ADDZEzero (Select1 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1])))))
 15066  	for {
 15067  		if v_0.Op != OpAdd64carry {
 15068  			break
 15069  		}
 15070  		c := v_0.Args[2]
 15071  		x := v_0.Args[0]
 15072  		y := v_0.Args[1]
 15073  		v.reset(OpPPC64ADDZEzero)
 15074  		v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15075  		v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 15076  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15077  		v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 15078  		v3.AuxInt = int64ToAuxInt(-1)
 15079  		v3.AddArg(c)
 15080  		v2.AddArg(v3)
 15081  		v1.AddArg3(x, y, v2)
 15082  		v0.AddArg(v1)
 15083  		v.AddArg(v0)
 15084  		return true
 15085  	}
 15086  	// match: (Select1 (ADDCconst n:(ADDZEzero x) [-1]))
 15087  	// cond: n.Uses <= 2
 15088  	// result: x
 15089  	for {
 15090  		if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
 15091  			break
 15092  		}
 15093  		n := v_0.Args[0]
 15094  		if n.Op != OpPPC64ADDZEzero {
 15095  			break
 15096  		}
 15097  		x := n.Args[0]
 15098  		if !(n.Uses <= 2) {
 15099  			break
 15100  		}
 15101  		v.copyOf(x)
 15102  		return true
 15103  	}
 15104  	// match: (Select1 (Sub64borrow x y c))
 15105  	// result: (NEG (SUBZEzero (Select1 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))))
 15106  	for {
 15107  		if v_0.Op != OpSub64borrow {
 15108  			break
 15109  		}
 15110  		c := v_0.Args[2]
 15111  		x := v_0.Args[0]
 15112  		y := v_0.Args[1]
 15113  		v.reset(OpPPC64NEG)
 15114  		v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
 15115  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15116  		v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 15117  		v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 15118  		v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 15119  		v4.AuxInt = int64ToAuxInt(0)
 15120  		v4.AddArg(c)
 15121  		v3.AddArg(v4)
 15122  		v2.AddArg3(x, y, v3)
 15123  		v1.AddArg(v2)
 15124  		v0.AddArg(v1)
 15125  		v.AddArg(v0)
 15126  		return true
 15127  	}
 15128  	// match: (Select1 (SUBCconst n:(NEG (SUBZEzero x)) [0]))
 15129  	// cond: n.Uses <= 2
 15130  	// result: x
 15131  	for {
 15132  		if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
 15133  			break
 15134  		}
 15135  		n := v_0.Args[0]
 15136  		if n.Op != OpPPC64NEG {
 15137  			break
 15138  		}
 15139  		n_0 := n.Args[0]
 15140  		if n_0.Op != OpPPC64SUBZEzero {
 15141  			break
 15142  		}
 15143  		x := n_0.Args[0]
 15144  		if !(n.Uses <= 2) {
 15145  			break
 15146  		}
 15147  		v.copyOf(x)
 15148  		return true
 15149  	}
 15150  	return false
 15151  }
 15152  func rewriteValuePPC64_OpSelectN(v *Value) bool {
 15153  	v_0 := v.Args[0]
 15154  	b := v.Block
 15155  	config := b.Func.Config
 15156  	// match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
 15157  	// 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)
 15158  	// result: (Move [sz] dst src mem)
 15159  	for {
 15160  		if auxIntToInt64(v.AuxInt) != 0 {
 15161  			break
 15162  		}
 15163  		call := v_0
 15164  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
 15165  			break
 15166  		}
 15167  		sym := auxToCall(call.Aux)
 15168  		s1 := call.Args[0]
 15169  		if s1.Op != OpPPC64MOVDstore {
 15170  			break
 15171  		}
 15172  		_ = s1.Args[2]
 15173  		s1_1 := s1.Args[1]
 15174  		if s1_1.Op != OpPPC64MOVDconst {
 15175  			break
 15176  		}
 15177  		sz := auxIntToInt64(s1_1.AuxInt)
 15178  		s2 := s1.Args[2]
 15179  		if s2.Op != OpPPC64MOVDstore {
 15180  			break
 15181  		}
 15182  		_ = s2.Args[2]
 15183  		src := s2.Args[1]
 15184  		s3 := s2.Args[2]
 15185  		if s3.Op != OpPPC64MOVDstore {
 15186  			break
 15187  		}
 15188  		mem := s3.Args[2]
 15189  		dst := s3.Args[1]
 15190  		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)) {
 15191  			break
 15192  		}
 15193  		v.reset(OpMove)
 15194  		v.AuxInt = int64ToAuxInt(sz)
 15195  		v.AddArg3(dst, src, mem)
 15196  		return true
 15197  	}
 15198  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
 15199  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 15200  	// result: (Move [sz] dst src mem)
 15201  	for {
 15202  		if auxIntToInt64(v.AuxInt) != 0 {
 15203  			break
 15204  		}
 15205  		call := v_0
 15206  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
 15207  			break
 15208  		}
 15209  		sym := auxToCall(call.Aux)
 15210  		mem := call.Args[3]
 15211  		dst := call.Args[0]
 15212  		src := call.Args[1]
 15213  		call_2 := call.Args[2]
 15214  		if call_2.Op != OpPPC64MOVDconst {
 15215  			break
 15216  		}
 15217  		sz := auxIntToInt64(call_2.AuxInt)
 15218  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 15219  			break
 15220  		}
 15221  		v.reset(OpMove)
 15222  		v.AuxInt = int64ToAuxInt(sz)
 15223  		v.AddArg3(dst, src, mem)
 15224  		return true
 15225  	}
 15226  	return false
 15227  }
 15228  func rewriteValuePPC64_OpSlicemask(v *Value) bool {
 15229  	v_0 := v.Args[0]
 15230  	b := v.Block
 15231  	// match: (Slicemask <t> x)
 15232  	// result: (SRADconst (NEG <t> x) [63])
 15233  	for {
 15234  		t := v.Type
 15235  		x := v_0
 15236  		v.reset(OpPPC64SRADconst)
 15237  		v.AuxInt = int64ToAuxInt(63)
 15238  		v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
 15239  		v0.AddArg(x)
 15240  		v.AddArg(v0)
 15241  		return true
 15242  	}
 15243  }
 15244  func rewriteValuePPC64_OpStore(v *Value) bool {
 15245  	v_2 := v.Args[2]
 15246  	v_1 := v.Args[1]
 15247  	v_0 := v.Args[0]
 15248  	// match: (Store {t} ptr val mem)
 15249  	// cond: t.Size() == 8 && t.IsFloat()
 15250  	// result: (FMOVDstore ptr val mem)
 15251  	for {
 15252  		t := auxToType(v.Aux)
 15253  		ptr := v_0
 15254  		val := v_1
 15255  		mem := v_2
 15256  		if !(t.Size() == 8 && t.IsFloat()) {
 15257  			break
 15258  		}
 15259  		v.reset(OpPPC64FMOVDstore)
 15260  		v.AddArg3(ptr, val, mem)
 15261  		return true
 15262  	}
 15263  	// match: (Store {t} ptr val mem)
 15264  	// cond: t.Size() == 4 && t.IsFloat()
 15265  	// result: (FMOVSstore ptr val mem)
 15266  	for {
 15267  		t := auxToType(v.Aux)
 15268  		ptr := v_0
 15269  		val := v_1
 15270  		mem := v_2
 15271  		if !(t.Size() == 4 && t.IsFloat()) {
 15272  			break
 15273  		}
 15274  		v.reset(OpPPC64FMOVSstore)
 15275  		v.AddArg3(ptr, val, mem)
 15276  		return true
 15277  	}
 15278  	// match: (Store {t} ptr val mem)
 15279  	// cond: t.Size() == 8 && !t.IsFloat()
 15280  	// result: (MOVDstore ptr val mem)
 15281  	for {
 15282  		t := auxToType(v.Aux)
 15283  		ptr := v_0
 15284  		val := v_1
 15285  		mem := v_2
 15286  		if !(t.Size() == 8 && !t.IsFloat()) {
 15287  			break
 15288  		}
 15289  		v.reset(OpPPC64MOVDstore)
 15290  		v.AddArg3(ptr, val, mem)
 15291  		return true
 15292  	}
 15293  	// match: (Store {t} ptr val mem)
 15294  	// cond: t.Size() == 4 && !t.IsFloat()
 15295  	// result: (MOVWstore ptr val mem)
 15296  	for {
 15297  		t := auxToType(v.Aux)
 15298  		ptr := v_0
 15299  		val := v_1
 15300  		mem := v_2
 15301  		if !(t.Size() == 4 && !t.IsFloat()) {
 15302  			break
 15303  		}
 15304  		v.reset(OpPPC64MOVWstore)
 15305  		v.AddArg3(ptr, val, mem)
 15306  		return true
 15307  	}
 15308  	// match: (Store {t} ptr val mem)
 15309  	// cond: t.Size() == 2
 15310  	// result: (MOVHstore ptr val mem)
 15311  	for {
 15312  		t := auxToType(v.Aux)
 15313  		ptr := v_0
 15314  		val := v_1
 15315  		mem := v_2
 15316  		if !(t.Size() == 2) {
 15317  			break
 15318  		}
 15319  		v.reset(OpPPC64MOVHstore)
 15320  		v.AddArg3(ptr, val, mem)
 15321  		return true
 15322  	}
 15323  	// match: (Store {t} ptr val mem)
 15324  	// cond: t.Size() == 1
 15325  	// result: (MOVBstore ptr val mem)
 15326  	for {
 15327  		t := auxToType(v.Aux)
 15328  		ptr := v_0
 15329  		val := v_1
 15330  		mem := v_2
 15331  		if !(t.Size() == 1) {
 15332  			break
 15333  		}
 15334  		v.reset(OpPPC64MOVBstore)
 15335  		v.AddArg3(ptr, val, mem)
 15336  		return true
 15337  	}
 15338  	return false
 15339  }
 15340  func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
 15341  	v_0 := v.Args[0]
 15342  	// match: (Trunc16to8 <t> x)
 15343  	// cond: t.IsSigned()
 15344  	// result: (MOVBreg x)
 15345  	for {
 15346  		t := v.Type
 15347  		x := v_0
 15348  		if !(t.IsSigned()) {
 15349  			break
 15350  		}
 15351  		v.reset(OpPPC64MOVBreg)
 15352  		v.AddArg(x)
 15353  		return true
 15354  	}
 15355  	// match: (Trunc16to8 x)
 15356  	// result: (MOVBZreg x)
 15357  	for {
 15358  		x := v_0
 15359  		v.reset(OpPPC64MOVBZreg)
 15360  		v.AddArg(x)
 15361  		return true
 15362  	}
 15363  }
 15364  func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
 15365  	v_0 := v.Args[0]
 15366  	// match: (Trunc32to16 <t> x)
 15367  	// cond: t.IsSigned()
 15368  	// result: (MOVHreg x)
 15369  	for {
 15370  		t := v.Type
 15371  		x := v_0
 15372  		if !(t.IsSigned()) {
 15373  			break
 15374  		}
 15375  		v.reset(OpPPC64MOVHreg)
 15376  		v.AddArg(x)
 15377  		return true
 15378  	}
 15379  	// match: (Trunc32to16 x)
 15380  	// result: (MOVHZreg x)
 15381  	for {
 15382  		x := v_0
 15383  		v.reset(OpPPC64MOVHZreg)
 15384  		v.AddArg(x)
 15385  		return true
 15386  	}
 15387  }
 15388  func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
 15389  	v_0 := v.Args[0]
 15390  	// match: (Trunc32to8 <t> x)
 15391  	// cond: t.IsSigned()
 15392  	// result: (MOVBreg x)
 15393  	for {
 15394  		t := v.Type
 15395  		x := v_0
 15396  		if !(t.IsSigned()) {
 15397  			break
 15398  		}
 15399  		v.reset(OpPPC64MOVBreg)
 15400  		v.AddArg(x)
 15401  		return true
 15402  	}
 15403  	// match: (Trunc32to8 x)
 15404  	// result: (MOVBZreg x)
 15405  	for {
 15406  		x := v_0
 15407  		v.reset(OpPPC64MOVBZreg)
 15408  		v.AddArg(x)
 15409  		return true
 15410  	}
 15411  }
 15412  func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
 15413  	v_0 := v.Args[0]
 15414  	// match: (Trunc64to16 <t> x)
 15415  	// cond: t.IsSigned()
 15416  	// result: (MOVHreg x)
 15417  	for {
 15418  		t := v.Type
 15419  		x := v_0
 15420  		if !(t.IsSigned()) {
 15421  			break
 15422  		}
 15423  		v.reset(OpPPC64MOVHreg)
 15424  		v.AddArg(x)
 15425  		return true
 15426  	}
 15427  	// match: (Trunc64to16 x)
 15428  	// result: (MOVHZreg x)
 15429  	for {
 15430  		x := v_0
 15431  		v.reset(OpPPC64MOVHZreg)
 15432  		v.AddArg(x)
 15433  		return true
 15434  	}
 15435  }
 15436  func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
 15437  	v_0 := v.Args[0]
 15438  	// match: (Trunc64to32 <t> x)
 15439  	// cond: t.IsSigned()
 15440  	// result: (MOVWreg x)
 15441  	for {
 15442  		t := v.Type
 15443  		x := v_0
 15444  		if !(t.IsSigned()) {
 15445  			break
 15446  		}
 15447  		v.reset(OpPPC64MOVWreg)
 15448  		v.AddArg(x)
 15449  		return true
 15450  	}
 15451  	// match: (Trunc64to32 x)
 15452  	// result: (MOVWZreg x)
 15453  	for {
 15454  		x := v_0
 15455  		v.reset(OpPPC64MOVWZreg)
 15456  		v.AddArg(x)
 15457  		return true
 15458  	}
 15459  }
 15460  func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
 15461  	v_0 := v.Args[0]
 15462  	// match: (Trunc64to8 <t> x)
 15463  	// cond: t.IsSigned()
 15464  	// result: (MOVBreg x)
 15465  	for {
 15466  		t := v.Type
 15467  		x := v_0
 15468  		if !(t.IsSigned()) {
 15469  			break
 15470  		}
 15471  		v.reset(OpPPC64MOVBreg)
 15472  		v.AddArg(x)
 15473  		return true
 15474  	}
 15475  	// match: (Trunc64to8 x)
 15476  	// result: (MOVBZreg x)
 15477  	for {
 15478  		x := v_0
 15479  		v.reset(OpPPC64MOVBZreg)
 15480  		v.AddArg(x)
 15481  		return true
 15482  	}
 15483  }
 15484  func rewriteValuePPC64_OpZero(v *Value) bool {
 15485  	v_1 := v.Args[1]
 15486  	v_0 := v.Args[0]
 15487  	b := v.Block
 15488  	// match: (Zero [0] _ mem)
 15489  	// result: mem
 15490  	for {
 15491  		if auxIntToInt64(v.AuxInt) != 0 {
 15492  			break
 15493  		}
 15494  		mem := v_1
 15495  		v.copyOf(mem)
 15496  		return true
 15497  	}
 15498  	// match: (Zero [1] destptr mem)
 15499  	// result: (MOVBstorezero destptr mem)
 15500  	for {
 15501  		if auxIntToInt64(v.AuxInt) != 1 {
 15502  			break
 15503  		}
 15504  		destptr := v_0
 15505  		mem := v_1
 15506  		v.reset(OpPPC64MOVBstorezero)
 15507  		v.AddArg2(destptr, mem)
 15508  		return true
 15509  	}
 15510  	// match: (Zero [2] destptr mem)
 15511  	// result: (MOVHstorezero destptr mem)
 15512  	for {
 15513  		if auxIntToInt64(v.AuxInt) != 2 {
 15514  			break
 15515  		}
 15516  		destptr := v_0
 15517  		mem := v_1
 15518  		v.reset(OpPPC64MOVHstorezero)
 15519  		v.AddArg2(destptr, mem)
 15520  		return true
 15521  	}
 15522  	// match: (Zero [3] destptr mem)
 15523  	// result: (MOVBstorezero [2] destptr (MOVHstorezero destptr mem))
 15524  	for {
 15525  		if auxIntToInt64(v.AuxInt) != 3 {
 15526  			break
 15527  		}
 15528  		destptr := v_0
 15529  		mem := v_1
 15530  		v.reset(OpPPC64MOVBstorezero)
 15531  		v.AuxInt = int32ToAuxInt(2)
 15532  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15533  		v0.AddArg2(destptr, mem)
 15534  		v.AddArg2(destptr, v0)
 15535  		return true
 15536  	}
 15537  	// match: (Zero [4] destptr mem)
 15538  	// result: (MOVWstorezero destptr mem)
 15539  	for {
 15540  		if auxIntToInt64(v.AuxInt) != 4 {
 15541  			break
 15542  		}
 15543  		destptr := v_0
 15544  		mem := v_1
 15545  		v.reset(OpPPC64MOVWstorezero)
 15546  		v.AddArg2(destptr, mem)
 15547  		return true
 15548  	}
 15549  	// match: (Zero [5] destptr mem)
 15550  	// result: (MOVBstorezero [4] destptr (MOVWstorezero destptr mem))
 15551  	for {
 15552  		if auxIntToInt64(v.AuxInt) != 5 {
 15553  			break
 15554  		}
 15555  		destptr := v_0
 15556  		mem := v_1
 15557  		v.reset(OpPPC64MOVBstorezero)
 15558  		v.AuxInt = int32ToAuxInt(4)
 15559  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15560  		v0.AddArg2(destptr, mem)
 15561  		v.AddArg2(destptr, v0)
 15562  		return true
 15563  	}
 15564  	// match: (Zero [6] destptr mem)
 15565  	// result: (MOVHstorezero [4] destptr (MOVWstorezero destptr mem))
 15566  	for {
 15567  		if auxIntToInt64(v.AuxInt) != 6 {
 15568  			break
 15569  		}
 15570  		destptr := v_0
 15571  		mem := v_1
 15572  		v.reset(OpPPC64MOVHstorezero)
 15573  		v.AuxInt = int32ToAuxInt(4)
 15574  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15575  		v0.AddArg2(destptr, mem)
 15576  		v.AddArg2(destptr, v0)
 15577  		return true
 15578  	}
 15579  	// match: (Zero [7] destptr mem)
 15580  	// result: (MOVBstorezero [6] destptr (MOVHstorezero [4] destptr (MOVWstorezero destptr mem)))
 15581  	for {
 15582  		if auxIntToInt64(v.AuxInt) != 7 {
 15583  			break
 15584  		}
 15585  		destptr := v_0
 15586  		mem := v_1
 15587  		v.reset(OpPPC64MOVBstorezero)
 15588  		v.AuxInt = int32ToAuxInt(6)
 15589  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15590  		v0.AuxInt = int32ToAuxInt(4)
 15591  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15592  		v1.AddArg2(destptr, mem)
 15593  		v0.AddArg2(destptr, v1)
 15594  		v.AddArg2(destptr, v0)
 15595  		return true
 15596  	}
 15597  	// match: (Zero [8] {t} destptr mem)
 15598  	// result: (MOVDstorezero destptr mem)
 15599  	for {
 15600  		if auxIntToInt64(v.AuxInt) != 8 {
 15601  			break
 15602  		}
 15603  		destptr := v_0
 15604  		mem := v_1
 15605  		v.reset(OpPPC64MOVDstorezero)
 15606  		v.AddArg2(destptr, mem)
 15607  		return true
 15608  	}
 15609  	// match: (Zero [12] {t} destptr mem)
 15610  	// result: (MOVWstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15611  	for {
 15612  		if auxIntToInt64(v.AuxInt) != 12 {
 15613  			break
 15614  		}
 15615  		destptr := v_0
 15616  		mem := v_1
 15617  		v.reset(OpPPC64MOVWstorezero)
 15618  		v.AuxInt = int32ToAuxInt(8)
 15619  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15620  		v0.AuxInt = int32ToAuxInt(0)
 15621  		v0.AddArg2(destptr, mem)
 15622  		v.AddArg2(destptr, v0)
 15623  		return true
 15624  	}
 15625  	// match: (Zero [16] {t} destptr mem)
 15626  	// result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15627  	for {
 15628  		if auxIntToInt64(v.AuxInt) != 16 {
 15629  			break
 15630  		}
 15631  		destptr := v_0
 15632  		mem := v_1
 15633  		v.reset(OpPPC64MOVDstorezero)
 15634  		v.AuxInt = int32ToAuxInt(8)
 15635  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15636  		v0.AuxInt = int32ToAuxInt(0)
 15637  		v0.AddArg2(destptr, mem)
 15638  		v.AddArg2(destptr, v0)
 15639  		return true
 15640  	}
 15641  	// match: (Zero [24] {t} destptr mem)
 15642  	// result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))
 15643  	for {
 15644  		if auxIntToInt64(v.AuxInt) != 24 {
 15645  			break
 15646  		}
 15647  		destptr := v_0
 15648  		mem := v_1
 15649  		v.reset(OpPPC64MOVDstorezero)
 15650  		v.AuxInt = int32ToAuxInt(16)
 15651  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15652  		v0.AuxInt = int32ToAuxInt(8)
 15653  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15654  		v1.AuxInt = int32ToAuxInt(0)
 15655  		v1.AddArg2(destptr, mem)
 15656  		v0.AddArg2(destptr, v1)
 15657  		v.AddArg2(destptr, v0)
 15658  		return true
 15659  	}
 15660  	// match: (Zero [32] {t} destptr mem)
 15661  	// result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))))
 15662  	for {
 15663  		if auxIntToInt64(v.AuxInt) != 32 {
 15664  			break
 15665  		}
 15666  		destptr := v_0
 15667  		mem := v_1
 15668  		v.reset(OpPPC64MOVDstorezero)
 15669  		v.AuxInt = int32ToAuxInt(24)
 15670  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15671  		v0.AuxInt = int32ToAuxInt(16)
 15672  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15673  		v1.AuxInt = int32ToAuxInt(8)
 15674  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15675  		v2.AuxInt = int32ToAuxInt(0)
 15676  		v2.AddArg2(destptr, mem)
 15677  		v1.AddArg2(destptr, v2)
 15678  		v0.AddArg2(destptr, v1)
 15679  		v.AddArg2(destptr, v0)
 15680  		return true
 15681  	}
 15682  	// match: (Zero [s] ptr mem)
 15683  	// cond: buildcfg.GOPPC64 <= 8 && s < 64
 15684  	// result: (LoweredZeroShort [s] ptr mem)
 15685  	for {
 15686  		s := auxIntToInt64(v.AuxInt)
 15687  		ptr := v_0
 15688  		mem := v_1
 15689  		if !(buildcfg.GOPPC64 <= 8 && s < 64) {
 15690  			break
 15691  		}
 15692  		v.reset(OpPPC64LoweredZeroShort)
 15693  		v.AuxInt = int64ToAuxInt(s)
 15694  		v.AddArg2(ptr, mem)
 15695  		return true
 15696  	}
 15697  	// match: (Zero [s] ptr mem)
 15698  	// cond: buildcfg.GOPPC64 <= 8
 15699  	// result: (LoweredZero [s] ptr mem)
 15700  	for {
 15701  		s := auxIntToInt64(v.AuxInt)
 15702  		ptr := v_0
 15703  		mem := v_1
 15704  		if !(buildcfg.GOPPC64 <= 8) {
 15705  			break
 15706  		}
 15707  		v.reset(OpPPC64LoweredZero)
 15708  		v.AuxInt = int64ToAuxInt(s)
 15709  		v.AddArg2(ptr, mem)
 15710  		return true
 15711  	}
 15712  	// match: (Zero [s] ptr mem)
 15713  	// cond: s < 128 && buildcfg.GOPPC64 >= 9
 15714  	// result: (LoweredQuadZeroShort [s] ptr mem)
 15715  	for {
 15716  		s := auxIntToInt64(v.AuxInt)
 15717  		ptr := v_0
 15718  		mem := v_1
 15719  		if !(s < 128 && buildcfg.GOPPC64 >= 9) {
 15720  			break
 15721  		}
 15722  		v.reset(OpPPC64LoweredQuadZeroShort)
 15723  		v.AuxInt = int64ToAuxInt(s)
 15724  		v.AddArg2(ptr, mem)
 15725  		return true
 15726  	}
 15727  	// match: (Zero [s] ptr mem)
 15728  	// cond: buildcfg.GOPPC64 >= 9
 15729  	// result: (LoweredQuadZero [s] ptr mem)
 15730  	for {
 15731  		s := auxIntToInt64(v.AuxInt)
 15732  		ptr := v_0
 15733  		mem := v_1
 15734  		if !(buildcfg.GOPPC64 >= 9) {
 15735  			break
 15736  		}
 15737  		v.reset(OpPPC64LoweredQuadZero)
 15738  		v.AuxInt = int64ToAuxInt(s)
 15739  		v.AddArg2(ptr, mem)
 15740  		return true
 15741  	}
 15742  	return false
 15743  }
 15744  func rewriteBlockPPC64(b *Block) bool {
 15745  	typ := &b.Func.Config.Types
 15746  	switch b.Kind {
 15747  	case BlockPPC64EQ:
 15748  		// match: (EQ (FlagEQ) yes no)
 15749  		// result: (First yes no)
 15750  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15751  			b.Reset(BlockFirst)
 15752  			return true
 15753  		}
 15754  		// match: (EQ (FlagLT) yes no)
 15755  		// result: (First no yes)
 15756  		for b.Controls[0].Op == OpPPC64FlagLT {
 15757  			b.Reset(BlockFirst)
 15758  			b.swapSuccessors()
 15759  			return true
 15760  		}
 15761  		// match: (EQ (FlagGT) yes no)
 15762  		// result: (First no yes)
 15763  		for b.Controls[0].Op == OpPPC64FlagGT {
 15764  			b.Reset(BlockFirst)
 15765  			b.swapSuccessors()
 15766  			return true
 15767  		}
 15768  		// match: (EQ (InvertFlags cmp) yes no)
 15769  		// result: (EQ cmp yes no)
 15770  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15771  			v_0 := b.Controls[0]
 15772  			cmp := v_0.Args[0]
 15773  			b.resetWithControl(BlockPPC64EQ, cmp)
 15774  			return true
 15775  		}
 15776  		// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
 15777  		// cond: z.Uses == 1
 15778  		// result: (EQ (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15779  		for b.Controls[0].Op == OpPPC64CMPconst {
 15780  			v_0 := b.Controls[0]
 15781  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15782  				break
 15783  			}
 15784  			z := v_0.Args[0]
 15785  			if z.Op != OpPPC64AND {
 15786  				break
 15787  			}
 15788  			_ = z.Args[1]
 15789  			z_0 := z.Args[0]
 15790  			z_1 := z.Args[1]
 15791  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15792  				x := z_0
 15793  				y := z_1
 15794  				if !(z.Uses == 1) {
 15795  					continue
 15796  				}
 15797  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15798  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15799  				v1.AddArg2(x, y)
 15800  				v0.AddArg(v1)
 15801  				b.resetWithControl(BlockPPC64EQ, v0)
 15802  				return true
 15803  			}
 15804  			break
 15805  		}
 15806  		// match: (EQ (CMPconst [0] z:(OR x y)) yes no)
 15807  		// cond: z.Uses == 1
 15808  		// result: (EQ (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15809  		for b.Controls[0].Op == OpPPC64CMPconst {
 15810  			v_0 := b.Controls[0]
 15811  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15812  				break
 15813  			}
 15814  			z := v_0.Args[0]
 15815  			if z.Op != OpPPC64OR {
 15816  				break
 15817  			}
 15818  			_ = z.Args[1]
 15819  			z_0 := z.Args[0]
 15820  			z_1 := z.Args[1]
 15821  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15822  				x := z_0
 15823  				y := z_1
 15824  				if !(z.Uses == 1) {
 15825  					continue
 15826  				}
 15827  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15828  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15829  				v1.AddArg2(x, y)
 15830  				v0.AddArg(v1)
 15831  				b.resetWithControl(BlockPPC64EQ, v0)
 15832  				return true
 15833  			}
 15834  			break
 15835  		}
 15836  		// match: (EQ (CMPconst [0] z:(XOR x y)) yes no)
 15837  		// cond: z.Uses == 1
 15838  		// result: (EQ (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15839  		for b.Controls[0].Op == OpPPC64CMPconst {
 15840  			v_0 := b.Controls[0]
 15841  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15842  				break
 15843  			}
 15844  			z := v_0.Args[0]
 15845  			if z.Op != OpPPC64XOR {
 15846  				break
 15847  			}
 15848  			_ = z.Args[1]
 15849  			z_0 := z.Args[0]
 15850  			z_1 := z.Args[1]
 15851  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15852  				x := z_0
 15853  				y := z_1
 15854  				if !(z.Uses == 1) {
 15855  					continue
 15856  				}
 15857  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15858  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15859  				v1.AddArg2(x, y)
 15860  				v0.AddArg(v1)
 15861  				b.resetWithControl(BlockPPC64EQ, v0)
 15862  				return true
 15863  			}
 15864  			break
 15865  		}
 15866  	case BlockPPC64GE:
 15867  		// match: (GE (FlagEQ) yes no)
 15868  		// result: (First yes no)
 15869  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15870  			b.Reset(BlockFirst)
 15871  			return true
 15872  		}
 15873  		// match: (GE (FlagLT) yes no)
 15874  		// result: (First no yes)
 15875  		for b.Controls[0].Op == OpPPC64FlagLT {
 15876  			b.Reset(BlockFirst)
 15877  			b.swapSuccessors()
 15878  			return true
 15879  		}
 15880  		// match: (GE (FlagGT) yes no)
 15881  		// result: (First yes no)
 15882  		for b.Controls[0].Op == OpPPC64FlagGT {
 15883  			b.Reset(BlockFirst)
 15884  			return true
 15885  		}
 15886  		// match: (GE (InvertFlags cmp) yes no)
 15887  		// result: (LE cmp yes no)
 15888  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15889  			v_0 := b.Controls[0]
 15890  			cmp := v_0.Args[0]
 15891  			b.resetWithControl(BlockPPC64LE, cmp)
 15892  			return true
 15893  		}
 15894  		// match: (GE (CMPconst [0] z:(AND x y)) yes no)
 15895  		// cond: z.Uses == 1
 15896  		// result: (GE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15897  		for b.Controls[0].Op == OpPPC64CMPconst {
 15898  			v_0 := b.Controls[0]
 15899  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15900  				break
 15901  			}
 15902  			z := v_0.Args[0]
 15903  			if z.Op != OpPPC64AND {
 15904  				break
 15905  			}
 15906  			_ = z.Args[1]
 15907  			z_0 := z.Args[0]
 15908  			z_1 := z.Args[1]
 15909  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15910  				x := z_0
 15911  				y := z_1
 15912  				if !(z.Uses == 1) {
 15913  					continue
 15914  				}
 15915  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15916  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15917  				v1.AddArg2(x, y)
 15918  				v0.AddArg(v1)
 15919  				b.resetWithControl(BlockPPC64GE, v0)
 15920  				return true
 15921  			}
 15922  			break
 15923  		}
 15924  		// match: (GE (CMPconst [0] z:(OR x y)) yes no)
 15925  		// cond: z.Uses == 1
 15926  		// result: (GE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15927  		for b.Controls[0].Op == OpPPC64CMPconst {
 15928  			v_0 := b.Controls[0]
 15929  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15930  				break
 15931  			}
 15932  			z := v_0.Args[0]
 15933  			if z.Op != OpPPC64OR {
 15934  				break
 15935  			}
 15936  			_ = z.Args[1]
 15937  			z_0 := z.Args[0]
 15938  			z_1 := z.Args[1]
 15939  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15940  				x := z_0
 15941  				y := z_1
 15942  				if !(z.Uses == 1) {
 15943  					continue
 15944  				}
 15945  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15946  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15947  				v1.AddArg2(x, y)
 15948  				v0.AddArg(v1)
 15949  				b.resetWithControl(BlockPPC64GE, v0)
 15950  				return true
 15951  			}
 15952  			break
 15953  		}
 15954  		// match: (GE (CMPconst [0] z:(XOR x y)) yes no)
 15955  		// cond: z.Uses == 1
 15956  		// result: (GE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15957  		for b.Controls[0].Op == OpPPC64CMPconst {
 15958  			v_0 := b.Controls[0]
 15959  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15960  				break
 15961  			}
 15962  			z := v_0.Args[0]
 15963  			if z.Op != OpPPC64XOR {
 15964  				break
 15965  			}
 15966  			_ = z.Args[1]
 15967  			z_0 := z.Args[0]
 15968  			z_1 := z.Args[1]
 15969  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15970  				x := z_0
 15971  				y := z_1
 15972  				if !(z.Uses == 1) {
 15973  					continue
 15974  				}
 15975  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15976  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15977  				v1.AddArg2(x, y)
 15978  				v0.AddArg(v1)
 15979  				b.resetWithControl(BlockPPC64GE, v0)
 15980  				return true
 15981  			}
 15982  			break
 15983  		}
 15984  	case BlockPPC64GT:
 15985  		// match: (GT (FlagEQ) yes no)
 15986  		// result: (First no yes)
 15987  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15988  			b.Reset(BlockFirst)
 15989  			b.swapSuccessors()
 15990  			return true
 15991  		}
 15992  		// match: (GT (FlagLT) yes no)
 15993  		// result: (First no yes)
 15994  		for b.Controls[0].Op == OpPPC64FlagLT {
 15995  			b.Reset(BlockFirst)
 15996  			b.swapSuccessors()
 15997  			return true
 15998  		}
 15999  		// match: (GT (FlagGT) yes no)
 16000  		// result: (First yes no)
 16001  		for b.Controls[0].Op == OpPPC64FlagGT {
 16002  			b.Reset(BlockFirst)
 16003  			return true
 16004  		}
 16005  		// match: (GT (InvertFlags cmp) yes no)
 16006  		// result: (LT cmp yes no)
 16007  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16008  			v_0 := b.Controls[0]
 16009  			cmp := v_0.Args[0]
 16010  			b.resetWithControl(BlockPPC64LT, cmp)
 16011  			return true
 16012  		}
 16013  		// match: (GT (CMPconst [0] z:(AND x y)) yes no)
 16014  		// cond: z.Uses == 1
 16015  		// result: (GT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16016  		for b.Controls[0].Op == OpPPC64CMPconst {
 16017  			v_0 := b.Controls[0]
 16018  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16019  				break
 16020  			}
 16021  			z := v_0.Args[0]
 16022  			if z.Op != OpPPC64AND {
 16023  				break
 16024  			}
 16025  			_ = z.Args[1]
 16026  			z_0 := z.Args[0]
 16027  			z_1 := z.Args[1]
 16028  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16029  				x := z_0
 16030  				y := z_1
 16031  				if !(z.Uses == 1) {
 16032  					continue
 16033  				}
 16034  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16035  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16036  				v1.AddArg2(x, y)
 16037  				v0.AddArg(v1)
 16038  				b.resetWithControl(BlockPPC64GT, v0)
 16039  				return true
 16040  			}
 16041  			break
 16042  		}
 16043  		// match: (GT (CMPconst [0] z:(OR x y)) yes no)
 16044  		// cond: z.Uses == 1
 16045  		// result: (GT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16046  		for b.Controls[0].Op == OpPPC64CMPconst {
 16047  			v_0 := b.Controls[0]
 16048  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16049  				break
 16050  			}
 16051  			z := v_0.Args[0]
 16052  			if z.Op != OpPPC64OR {
 16053  				break
 16054  			}
 16055  			_ = z.Args[1]
 16056  			z_0 := z.Args[0]
 16057  			z_1 := z.Args[1]
 16058  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16059  				x := z_0
 16060  				y := z_1
 16061  				if !(z.Uses == 1) {
 16062  					continue
 16063  				}
 16064  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16065  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16066  				v1.AddArg2(x, y)
 16067  				v0.AddArg(v1)
 16068  				b.resetWithControl(BlockPPC64GT, v0)
 16069  				return true
 16070  			}
 16071  			break
 16072  		}
 16073  		// match: (GT (CMPconst [0] z:(XOR x y)) yes no)
 16074  		// cond: z.Uses == 1
 16075  		// result: (GT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16076  		for b.Controls[0].Op == OpPPC64CMPconst {
 16077  			v_0 := b.Controls[0]
 16078  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16079  				break
 16080  			}
 16081  			z := v_0.Args[0]
 16082  			if z.Op != OpPPC64XOR {
 16083  				break
 16084  			}
 16085  			_ = z.Args[1]
 16086  			z_0 := z.Args[0]
 16087  			z_1 := z.Args[1]
 16088  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16089  				x := z_0
 16090  				y := z_1
 16091  				if !(z.Uses == 1) {
 16092  					continue
 16093  				}
 16094  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16095  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16096  				v1.AddArg2(x, y)
 16097  				v0.AddArg(v1)
 16098  				b.resetWithControl(BlockPPC64GT, v0)
 16099  				return true
 16100  			}
 16101  			break
 16102  		}
 16103  	case BlockIf:
 16104  		// match: (If (Equal cc) yes no)
 16105  		// result: (EQ cc yes no)
 16106  		for b.Controls[0].Op == OpPPC64Equal {
 16107  			v_0 := b.Controls[0]
 16108  			cc := v_0.Args[0]
 16109  			b.resetWithControl(BlockPPC64EQ, cc)
 16110  			return true
 16111  		}
 16112  		// match: (If (NotEqual cc) yes no)
 16113  		// result: (NE cc yes no)
 16114  		for b.Controls[0].Op == OpPPC64NotEqual {
 16115  			v_0 := b.Controls[0]
 16116  			cc := v_0.Args[0]
 16117  			b.resetWithControl(BlockPPC64NE, cc)
 16118  			return true
 16119  		}
 16120  		// match: (If (LessThan cc) yes no)
 16121  		// result: (LT cc yes no)
 16122  		for b.Controls[0].Op == OpPPC64LessThan {
 16123  			v_0 := b.Controls[0]
 16124  			cc := v_0.Args[0]
 16125  			b.resetWithControl(BlockPPC64LT, cc)
 16126  			return true
 16127  		}
 16128  		// match: (If (LessEqual cc) yes no)
 16129  		// result: (LE cc yes no)
 16130  		for b.Controls[0].Op == OpPPC64LessEqual {
 16131  			v_0 := b.Controls[0]
 16132  			cc := v_0.Args[0]
 16133  			b.resetWithControl(BlockPPC64LE, cc)
 16134  			return true
 16135  		}
 16136  		// match: (If (GreaterThan cc) yes no)
 16137  		// result: (GT cc yes no)
 16138  		for b.Controls[0].Op == OpPPC64GreaterThan {
 16139  			v_0 := b.Controls[0]
 16140  			cc := v_0.Args[0]
 16141  			b.resetWithControl(BlockPPC64GT, cc)
 16142  			return true
 16143  		}
 16144  		// match: (If (GreaterEqual cc) yes no)
 16145  		// result: (GE cc yes no)
 16146  		for b.Controls[0].Op == OpPPC64GreaterEqual {
 16147  			v_0 := b.Controls[0]
 16148  			cc := v_0.Args[0]
 16149  			b.resetWithControl(BlockPPC64GE, cc)
 16150  			return true
 16151  		}
 16152  		// match: (If (FLessThan cc) yes no)
 16153  		// result: (FLT cc yes no)
 16154  		for b.Controls[0].Op == OpPPC64FLessThan {
 16155  			v_0 := b.Controls[0]
 16156  			cc := v_0.Args[0]
 16157  			b.resetWithControl(BlockPPC64FLT, cc)
 16158  			return true
 16159  		}
 16160  		// match: (If (FLessEqual cc) yes no)
 16161  		// result: (FLE cc yes no)
 16162  		for b.Controls[0].Op == OpPPC64FLessEqual {
 16163  			v_0 := b.Controls[0]
 16164  			cc := v_0.Args[0]
 16165  			b.resetWithControl(BlockPPC64FLE, cc)
 16166  			return true
 16167  		}
 16168  		// match: (If (FGreaterThan cc) yes no)
 16169  		// result: (FGT cc yes no)
 16170  		for b.Controls[0].Op == OpPPC64FGreaterThan {
 16171  			v_0 := b.Controls[0]
 16172  			cc := v_0.Args[0]
 16173  			b.resetWithControl(BlockPPC64FGT, cc)
 16174  			return true
 16175  		}
 16176  		// match: (If (FGreaterEqual cc) yes no)
 16177  		// result: (FGE cc yes no)
 16178  		for b.Controls[0].Op == OpPPC64FGreaterEqual {
 16179  			v_0 := b.Controls[0]
 16180  			cc := v_0.Args[0]
 16181  			b.resetWithControl(BlockPPC64FGE, cc)
 16182  			return true
 16183  		}
 16184  		// match: (If cond yes no)
 16185  		// result: (NE (CMPconst [0] (ANDconst [1] cond)) yes no)
 16186  		for {
 16187  			cond := b.Controls[0]
 16188  			v0 := b.NewValue0(cond.Pos, OpPPC64CMPconst, types.TypeFlags)
 16189  			v0.AuxInt = int64ToAuxInt(0)
 16190  			v1 := b.NewValue0(cond.Pos, OpPPC64ANDconst, typ.Int)
 16191  			v1.AuxInt = int64ToAuxInt(1)
 16192  			v1.AddArg(cond)
 16193  			v0.AddArg(v1)
 16194  			b.resetWithControl(BlockPPC64NE, v0)
 16195  			return true
 16196  		}
 16197  	case BlockPPC64LE:
 16198  		// match: (LE (FlagEQ) yes no)
 16199  		// result: (First yes no)
 16200  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16201  			b.Reset(BlockFirst)
 16202  			return true
 16203  		}
 16204  		// match: (LE (FlagLT) yes no)
 16205  		// result: (First yes no)
 16206  		for b.Controls[0].Op == OpPPC64FlagLT {
 16207  			b.Reset(BlockFirst)
 16208  			return true
 16209  		}
 16210  		// match: (LE (FlagGT) yes no)
 16211  		// result: (First no yes)
 16212  		for b.Controls[0].Op == OpPPC64FlagGT {
 16213  			b.Reset(BlockFirst)
 16214  			b.swapSuccessors()
 16215  			return true
 16216  		}
 16217  		// match: (LE (InvertFlags cmp) yes no)
 16218  		// result: (GE cmp yes no)
 16219  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16220  			v_0 := b.Controls[0]
 16221  			cmp := v_0.Args[0]
 16222  			b.resetWithControl(BlockPPC64GE, cmp)
 16223  			return true
 16224  		}
 16225  		// match: (LE (CMPconst [0] z:(AND x y)) yes no)
 16226  		// cond: z.Uses == 1
 16227  		// result: (LE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16228  		for b.Controls[0].Op == OpPPC64CMPconst {
 16229  			v_0 := b.Controls[0]
 16230  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16231  				break
 16232  			}
 16233  			z := v_0.Args[0]
 16234  			if z.Op != OpPPC64AND {
 16235  				break
 16236  			}
 16237  			_ = z.Args[1]
 16238  			z_0 := z.Args[0]
 16239  			z_1 := z.Args[1]
 16240  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16241  				x := z_0
 16242  				y := z_1
 16243  				if !(z.Uses == 1) {
 16244  					continue
 16245  				}
 16246  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16247  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16248  				v1.AddArg2(x, y)
 16249  				v0.AddArg(v1)
 16250  				b.resetWithControl(BlockPPC64LE, v0)
 16251  				return true
 16252  			}
 16253  			break
 16254  		}
 16255  		// match: (LE (CMPconst [0] z:(OR x y)) yes no)
 16256  		// cond: z.Uses == 1
 16257  		// result: (LE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16258  		for b.Controls[0].Op == OpPPC64CMPconst {
 16259  			v_0 := b.Controls[0]
 16260  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16261  				break
 16262  			}
 16263  			z := v_0.Args[0]
 16264  			if z.Op != OpPPC64OR {
 16265  				break
 16266  			}
 16267  			_ = z.Args[1]
 16268  			z_0 := z.Args[0]
 16269  			z_1 := z.Args[1]
 16270  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16271  				x := z_0
 16272  				y := z_1
 16273  				if !(z.Uses == 1) {
 16274  					continue
 16275  				}
 16276  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16277  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16278  				v1.AddArg2(x, y)
 16279  				v0.AddArg(v1)
 16280  				b.resetWithControl(BlockPPC64LE, v0)
 16281  				return true
 16282  			}
 16283  			break
 16284  		}
 16285  		// match: (LE (CMPconst [0] z:(XOR x y)) yes no)
 16286  		// cond: z.Uses == 1
 16287  		// result: (LE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16288  		for b.Controls[0].Op == OpPPC64CMPconst {
 16289  			v_0 := b.Controls[0]
 16290  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16291  				break
 16292  			}
 16293  			z := v_0.Args[0]
 16294  			if z.Op != OpPPC64XOR {
 16295  				break
 16296  			}
 16297  			_ = z.Args[1]
 16298  			z_0 := z.Args[0]
 16299  			z_1 := z.Args[1]
 16300  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16301  				x := z_0
 16302  				y := z_1
 16303  				if !(z.Uses == 1) {
 16304  					continue
 16305  				}
 16306  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16307  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16308  				v1.AddArg2(x, y)
 16309  				v0.AddArg(v1)
 16310  				b.resetWithControl(BlockPPC64LE, v0)
 16311  				return true
 16312  			}
 16313  			break
 16314  		}
 16315  	case BlockPPC64LT:
 16316  		// match: (LT (FlagEQ) yes no)
 16317  		// result: (First no yes)
 16318  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16319  			b.Reset(BlockFirst)
 16320  			b.swapSuccessors()
 16321  			return true
 16322  		}
 16323  		// match: (LT (FlagLT) yes no)
 16324  		// result: (First yes no)
 16325  		for b.Controls[0].Op == OpPPC64FlagLT {
 16326  			b.Reset(BlockFirst)
 16327  			return true
 16328  		}
 16329  		// match: (LT (FlagGT) yes no)
 16330  		// result: (First no yes)
 16331  		for b.Controls[0].Op == OpPPC64FlagGT {
 16332  			b.Reset(BlockFirst)
 16333  			b.swapSuccessors()
 16334  			return true
 16335  		}
 16336  		// match: (LT (InvertFlags cmp) yes no)
 16337  		// result: (GT cmp yes no)
 16338  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16339  			v_0 := b.Controls[0]
 16340  			cmp := v_0.Args[0]
 16341  			b.resetWithControl(BlockPPC64GT, cmp)
 16342  			return true
 16343  		}
 16344  		// match: (LT (CMPconst [0] z:(AND x y)) yes no)
 16345  		// cond: z.Uses == 1
 16346  		// result: (LT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16347  		for b.Controls[0].Op == OpPPC64CMPconst {
 16348  			v_0 := b.Controls[0]
 16349  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16350  				break
 16351  			}
 16352  			z := v_0.Args[0]
 16353  			if z.Op != OpPPC64AND {
 16354  				break
 16355  			}
 16356  			_ = z.Args[1]
 16357  			z_0 := z.Args[0]
 16358  			z_1 := z.Args[1]
 16359  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16360  				x := z_0
 16361  				y := z_1
 16362  				if !(z.Uses == 1) {
 16363  					continue
 16364  				}
 16365  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16366  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16367  				v1.AddArg2(x, y)
 16368  				v0.AddArg(v1)
 16369  				b.resetWithControl(BlockPPC64LT, v0)
 16370  				return true
 16371  			}
 16372  			break
 16373  		}
 16374  		// match: (LT (CMPconst [0] z:(OR x y)) yes no)
 16375  		// cond: z.Uses == 1
 16376  		// result: (LT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16377  		for b.Controls[0].Op == OpPPC64CMPconst {
 16378  			v_0 := b.Controls[0]
 16379  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16380  				break
 16381  			}
 16382  			z := v_0.Args[0]
 16383  			if z.Op != OpPPC64OR {
 16384  				break
 16385  			}
 16386  			_ = z.Args[1]
 16387  			z_0 := z.Args[0]
 16388  			z_1 := z.Args[1]
 16389  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16390  				x := z_0
 16391  				y := z_1
 16392  				if !(z.Uses == 1) {
 16393  					continue
 16394  				}
 16395  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16396  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16397  				v1.AddArg2(x, y)
 16398  				v0.AddArg(v1)
 16399  				b.resetWithControl(BlockPPC64LT, v0)
 16400  				return true
 16401  			}
 16402  			break
 16403  		}
 16404  		// match: (LT (CMPconst [0] z:(XOR x y)) yes no)
 16405  		// cond: z.Uses == 1
 16406  		// result: (LT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16407  		for b.Controls[0].Op == OpPPC64CMPconst {
 16408  			v_0 := b.Controls[0]
 16409  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16410  				break
 16411  			}
 16412  			z := v_0.Args[0]
 16413  			if z.Op != OpPPC64XOR {
 16414  				break
 16415  			}
 16416  			_ = z.Args[1]
 16417  			z_0 := z.Args[0]
 16418  			z_1 := z.Args[1]
 16419  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16420  				x := z_0
 16421  				y := z_1
 16422  				if !(z.Uses == 1) {
 16423  					continue
 16424  				}
 16425  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16426  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16427  				v1.AddArg2(x, y)
 16428  				v0.AddArg(v1)
 16429  				b.resetWithControl(BlockPPC64LT, v0)
 16430  				return true
 16431  			}
 16432  			break
 16433  		}
 16434  	case BlockPPC64NE:
 16435  		// match: (NE (CMPconst [0] (ANDconst [1] (Equal cc))) yes no)
 16436  		// result: (EQ cc yes no)
 16437  		for b.Controls[0].Op == OpPPC64CMPconst {
 16438  			v_0 := b.Controls[0]
 16439  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16440  				break
 16441  			}
 16442  			v_0_0 := v_0.Args[0]
 16443  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16444  				break
 16445  			}
 16446  			v_0_0_0 := v_0_0.Args[0]
 16447  			if v_0_0_0.Op != OpPPC64Equal {
 16448  				break
 16449  			}
 16450  			cc := v_0_0_0.Args[0]
 16451  			b.resetWithControl(BlockPPC64EQ, cc)
 16452  			return true
 16453  		}
 16454  		// match: (NE (CMPconst [0] (ANDconst [1] (NotEqual cc))) yes no)
 16455  		// result: (NE cc yes no)
 16456  		for b.Controls[0].Op == OpPPC64CMPconst {
 16457  			v_0 := b.Controls[0]
 16458  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16459  				break
 16460  			}
 16461  			v_0_0 := v_0.Args[0]
 16462  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16463  				break
 16464  			}
 16465  			v_0_0_0 := v_0_0.Args[0]
 16466  			if v_0_0_0.Op != OpPPC64NotEqual {
 16467  				break
 16468  			}
 16469  			cc := v_0_0_0.Args[0]
 16470  			b.resetWithControl(BlockPPC64NE, cc)
 16471  			return true
 16472  		}
 16473  		// match: (NE (CMPconst [0] (ANDconst [1] (LessThan cc))) yes no)
 16474  		// result: (LT cc yes no)
 16475  		for b.Controls[0].Op == OpPPC64CMPconst {
 16476  			v_0 := b.Controls[0]
 16477  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16478  				break
 16479  			}
 16480  			v_0_0 := v_0.Args[0]
 16481  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16482  				break
 16483  			}
 16484  			v_0_0_0 := v_0_0.Args[0]
 16485  			if v_0_0_0.Op != OpPPC64LessThan {
 16486  				break
 16487  			}
 16488  			cc := v_0_0_0.Args[0]
 16489  			b.resetWithControl(BlockPPC64LT, cc)
 16490  			return true
 16491  		}
 16492  		// match: (NE (CMPconst [0] (ANDconst [1] (LessEqual cc))) yes no)
 16493  		// result: (LE cc yes no)
 16494  		for b.Controls[0].Op == OpPPC64CMPconst {
 16495  			v_0 := b.Controls[0]
 16496  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16497  				break
 16498  			}
 16499  			v_0_0 := v_0.Args[0]
 16500  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16501  				break
 16502  			}
 16503  			v_0_0_0 := v_0_0.Args[0]
 16504  			if v_0_0_0.Op != OpPPC64LessEqual {
 16505  				break
 16506  			}
 16507  			cc := v_0_0_0.Args[0]
 16508  			b.resetWithControl(BlockPPC64LE, cc)
 16509  			return true
 16510  		}
 16511  		// match: (NE (CMPconst [0] (ANDconst [1] (GreaterThan cc))) yes no)
 16512  		// result: (GT cc yes no)
 16513  		for b.Controls[0].Op == OpPPC64CMPconst {
 16514  			v_0 := b.Controls[0]
 16515  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16516  				break
 16517  			}
 16518  			v_0_0 := v_0.Args[0]
 16519  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16520  				break
 16521  			}
 16522  			v_0_0_0 := v_0_0.Args[0]
 16523  			if v_0_0_0.Op != OpPPC64GreaterThan {
 16524  				break
 16525  			}
 16526  			cc := v_0_0_0.Args[0]
 16527  			b.resetWithControl(BlockPPC64GT, cc)
 16528  			return true
 16529  		}
 16530  		// match: (NE (CMPconst [0] (ANDconst [1] (GreaterEqual cc))) yes no)
 16531  		// result: (GE cc yes no)
 16532  		for b.Controls[0].Op == OpPPC64CMPconst {
 16533  			v_0 := b.Controls[0]
 16534  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16535  				break
 16536  			}
 16537  			v_0_0 := v_0.Args[0]
 16538  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16539  				break
 16540  			}
 16541  			v_0_0_0 := v_0_0.Args[0]
 16542  			if v_0_0_0.Op != OpPPC64GreaterEqual {
 16543  				break
 16544  			}
 16545  			cc := v_0_0_0.Args[0]
 16546  			b.resetWithControl(BlockPPC64GE, cc)
 16547  			return true
 16548  		}
 16549  		// match: (NE (CMPconst [0] (ANDconst [1] (FLessThan cc))) yes no)
 16550  		// result: (FLT cc yes no)
 16551  		for b.Controls[0].Op == OpPPC64CMPconst {
 16552  			v_0 := b.Controls[0]
 16553  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16554  				break
 16555  			}
 16556  			v_0_0 := v_0.Args[0]
 16557  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16558  				break
 16559  			}
 16560  			v_0_0_0 := v_0_0.Args[0]
 16561  			if v_0_0_0.Op != OpPPC64FLessThan {
 16562  				break
 16563  			}
 16564  			cc := v_0_0_0.Args[0]
 16565  			b.resetWithControl(BlockPPC64FLT, cc)
 16566  			return true
 16567  		}
 16568  		// match: (NE (CMPconst [0] (ANDconst [1] (FLessEqual cc))) yes no)
 16569  		// result: (FLE cc yes no)
 16570  		for b.Controls[0].Op == OpPPC64CMPconst {
 16571  			v_0 := b.Controls[0]
 16572  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16573  				break
 16574  			}
 16575  			v_0_0 := v_0.Args[0]
 16576  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16577  				break
 16578  			}
 16579  			v_0_0_0 := v_0_0.Args[0]
 16580  			if v_0_0_0.Op != OpPPC64FLessEqual {
 16581  				break
 16582  			}
 16583  			cc := v_0_0_0.Args[0]
 16584  			b.resetWithControl(BlockPPC64FLE, cc)
 16585  			return true
 16586  		}
 16587  		// match: (NE (CMPconst [0] (ANDconst [1] (FGreaterThan cc))) yes no)
 16588  		// result: (FGT cc yes no)
 16589  		for b.Controls[0].Op == OpPPC64CMPconst {
 16590  			v_0 := b.Controls[0]
 16591  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16592  				break
 16593  			}
 16594  			v_0_0 := v_0.Args[0]
 16595  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16596  				break
 16597  			}
 16598  			v_0_0_0 := v_0_0.Args[0]
 16599  			if v_0_0_0.Op != OpPPC64FGreaterThan {
 16600  				break
 16601  			}
 16602  			cc := v_0_0_0.Args[0]
 16603  			b.resetWithControl(BlockPPC64FGT, cc)
 16604  			return true
 16605  		}
 16606  		// match: (NE (CMPconst [0] (ANDconst [1] (FGreaterEqual cc))) yes no)
 16607  		// result: (FGE cc yes no)
 16608  		for b.Controls[0].Op == OpPPC64CMPconst {
 16609  			v_0 := b.Controls[0]
 16610  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16611  				break
 16612  			}
 16613  			v_0_0 := v_0.Args[0]
 16614  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16615  				break
 16616  			}
 16617  			v_0_0_0 := v_0_0.Args[0]
 16618  			if v_0_0_0.Op != OpPPC64FGreaterEqual {
 16619  				break
 16620  			}
 16621  			cc := v_0_0_0.Args[0]
 16622  			b.resetWithControl(BlockPPC64FGE, cc)
 16623  			return true
 16624  		}
 16625  		// match: (NE (FlagEQ) yes no)
 16626  		// result: (First no yes)
 16627  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16628  			b.Reset(BlockFirst)
 16629  			b.swapSuccessors()
 16630  			return true
 16631  		}
 16632  		// match: (NE (FlagLT) yes no)
 16633  		// result: (First yes no)
 16634  		for b.Controls[0].Op == OpPPC64FlagLT {
 16635  			b.Reset(BlockFirst)
 16636  			return true
 16637  		}
 16638  		// match: (NE (FlagGT) yes no)
 16639  		// result: (First yes no)
 16640  		for b.Controls[0].Op == OpPPC64FlagGT {
 16641  			b.Reset(BlockFirst)
 16642  			return true
 16643  		}
 16644  		// match: (NE (InvertFlags cmp) yes no)
 16645  		// result: (NE cmp yes no)
 16646  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16647  			v_0 := b.Controls[0]
 16648  			cmp := v_0.Args[0]
 16649  			b.resetWithControl(BlockPPC64NE, cmp)
 16650  			return true
 16651  		}
 16652  		// match: (NE (CMPconst [0] z:(AND x y)) yes no)
 16653  		// cond: z.Uses == 1
 16654  		// result: (NE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16655  		for b.Controls[0].Op == OpPPC64CMPconst {
 16656  			v_0 := b.Controls[0]
 16657  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16658  				break
 16659  			}
 16660  			z := v_0.Args[0]
 16661  			if z.Op != OpPPC64AND {
 16662  				break
 16663  			}
 16664  			_ = z.Args[1]
 16665  			z_0 := z.Args[0]
 16666  			z_1 := z.Args[1]
 16667  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16668  				x := z_0
 16669  				y := z_1
 16670  				if !(z.Uses == 1) {
 16671  					continue
 16672  				}
 16673  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16674  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16675  				v1.AddArg2(x, y)
 16676  				v0.AddArg(v1)
 16677  				b.resetWithControl(BlockPPC64NE, v0)
 16678  				return true
 16679  			}
 16680  			break
 16681  		}
 16682  		// match: (NE (CMPconst [0] z:(OR x y)) yes no)
 16683  		// cond: z.Uses == 1
 16684  		// result: (NE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16685  		for b.Controls[0].Op == OpPPC64CMPconst {
 16686  			v_0 := b.Controls[0]
 16687  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16688  				break
 16689  			}
 16690  			z := v_0.Args[0]
 16691  			if z.Op != OpPPC64OR {
 16692  				break
 16693  			}
 16694  			_ = z.Args[1]
 16695  			z_0 := z.Args[0]
 16696  			z_1 := z.Args[1]
 16697  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16698  				x := z_0
 16699  				y := z_1
 16700  				if !(z.Uses == 1) {
 16701  					continue
 16702  				}
 16703  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16704  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16705  				v1.AddArg2(x, y)
 16706  				v0.AddArg(v1)
 16707  				b.resetWithControl(BlockPPC64NE, v0)
 16708  				return true
 16709  			}
 16710  			break
 16711  		}
 16712  		// match: (NE (CMPconst [0] z:(XOR x y)) yes no)
 16713  		// cond: z.Uses == 1
 16714  		// result: (NE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16715  		for b.Controls[0].Op == OpPPC64CMPconst {
 16716  			v_0 := b.Controls[0]
 16717  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16718  				break
 16719  			}
 16720  			z := v_0.Args[0]
 16721  			if z.Op != OpPPC64XOR {
 16722  				break
 16723  			}
 16724  			_ = z.Args[1]
 16725  			z_0 := z.Args[0]
 16726  			z_1 := z.Args[1]
 16727  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16728  				x := z_0
 16729  				y := z_1
 16730  				if !(z.Uses == 1) {
 16731  					continue
 16732  				}
 16733  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16734  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16735  				v1.AddArg2(x, y)
 16736  				v0.AddArg(v1)
 16737  				b.resetWithControl(BlockPPC64NE, v0)
 16738  				return true
 16739  			}
 16740  			break
 16741  		}
 16742  	}
 16743  	return false
 16744  }
 16745  

View as plain text