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 OpAtomicLoad32:
    77  		return rewriteValuePPC64_OpAtomicLoad32(v)
    78  	case OpAtomicLoad64:
    79  		return rewriteValuePPC64_OpAtomicLoad64(v)
    80  	case OpAtomicLoad8:
    81  		return rewriteValuePPC64_OpAtomicLoad8(v)
    82  	case OpAtomicLoadAcq32:
    83  		return rewriteValuePPC64_OpAtomicLoadAcq32(v)
    84  	case OpAtomicLoadAcq64:
    85  		return rewriteValuePPC64_OpAtomicLoadAcq64(v)
    86  	case OpAtomicLoadPtr:
    87  		return rewriteValuePPC64_OpAtomicLoadPtr(v)
    88  	case OpAtomicOr32:
    89  		v.Op = OpPPC64LoweredAtomicOr32
    90  		return true
    91  	case OpAtomicOr8:
    92  		v.Op = OpPPC64LoweredAtomicOr8
    93  		return true
    94  	case OpAtomicStore32:
    95  		return rewriteValuePPC64_OpAtomicStore32(v)
    96  	case OpAtomicStore64:
    97  		return rewriteValuePPC64_OpAtomicStore64(v)
    98  	case OpAtomicStore8:
    99  		return rewriteValuePPC64_OpAtomicStore8(v)
   100  	case OpAtomicStoreRel32:
   101  		return rewriteValuePPC64_OpAtomicStoreRel32(v)
   102  	case OpAtomicStoreRel64:
   103  		return rewriteValuePPC64_OpAtomicStoreRel64(v)
   104  	case OpAvg64u:
   105  		return rewriteValuePPC64_OpAvg64u(v)
   106  	case OpBitLen32:
   107  		return rewriteValuePPC64_OpBitLen32(v)
   108  	case OpBitLen64:
   109  		return rewriteValuePPC64_OpBitLen64(v)
   110  	case OpBswap16:
   111  		return rewriteValuePPC64_OpBswap16(v)
   112  	case OpBswap32:
   113  		return rewriteValuePPC64_OpBswap32(v)
   114  	case OpBswap64:
   115  		return rewriteValuePPC64_OpBswap64(v)
   116  	case OpCeil:
   117  		v.Op = OpPPC64FCEIL
   118  		return true
   119  	case OpClosureCall:
   120  		v.Op = OpPPC64CALLclosure
   121  		return true
   122  	case OpCom16:
   123  		return rewriteValuePPC64_OpCom16(v)
   124  	case OpCom32:
   125  		return rewriteValuePPC64_OpCom32(v)
   126  	case OpCom64:
   127  		return rewriteValuePPC64_OpCom64(v)
   128  	case OpCom8:
   129  		return rewriteValuePPC64_OpCom8(v)
   130  	case OpCondSelect:
   131  		return rewriteValuePPC64_OpCondSelect(v)
   132  	case OpConst16:
   133  		return rewriteValuePPC64_OpConst16(v)
   134  	case OpConst32:
   135  		return rewriteValuePPC64_OpConst32(v)
   136  	case OpConst32F:
   137  		v.Op = OpPPC64FMOVSconst
   138  		return true
   139  	case OpConst64:
   140  		return rewriteValuePPC64_OpConst64(v)
   141  	case OpConst64F:
   142  		v.Op = OpPPC64FMOVDconst
   143  		return true
   144  	case OpConst8:
   145  		return rewriteValuePPC64_OpConst8(v)
   146  	case OpConstBool:
   147  		return rewriteValuePPC64_OpConstBool(v)
   148  	case OpConstNil:
   149  		return rewriteValuePPC64_OpConstNil(v)
   150  	case OpCopysign:
   151  		return rewriteValuePPC64_OpCopysign(v)
   152  	case OpCtz16:
   153  		return rewriteValuePPC64_OpCtz16(v)
   154  	case OpCtz32:
   155  		return rewriteValuePPC64_OpCtz32(v)
   156  	case OpCtz32NonZero:
   157  		v.Op = OpCtz32
   158  		return true
   159  	case OpCtz64:
   160  		return rewriteValuePPC64_OpCtz64(v)
   161  	case OpCtz64NonZero:
   162  		v.Op = OpCtz64
   163  		return true
   164  	case OpCtz8:
   165  		return rewriteValuePPC64_OpCtz8(v)
   166  	case OpCvt32Fto32:
   167  		return rewriteValuePPC64_OpCvt32Fto32(v)
   168  	case OpCvt32Fto64:
   169  		return rewriteValuePPC64_OpCvt32Fto64(v)
   170  	case OpCvt32Fto64F:
   171  		v.Op = OpCopy
   172  		return true
   173  	case OpCvt32to32F:
   174  		return rewriteValuePPC64_OpCvt32to32F(v)
   175  	case OpCvt32to64F:
   176  		return rewriteValuePPC64_OpCvt32to64F(v)
   177  	case OpCvt64Fto32:
   178  		return rewriteValuePPC64_OpCvt64Fto32(v)
   179  	case OpCvt64Fto32F:
   180  		v.Op = OpPPC64FRSP
   181  		return true
   182  	case OpCvt64Fto64:
   183  		return rewriteValuePPC64_OpCvt64Fto64(v)
   184  	case OpCvt64to32F:
   185  		return rewriteValuePPC64_OpCvt64to32F(v)
   186  	case OpCvt64to64F:
   187  		return rewriteValuePPC64_OpCvt64to64F(v)
   188  	case OpCvtBoolToUint8:
   189  		v.Op = OpCopy
   190  		return true
   191  	case OpDiv16:
   192  		return rewriteValuePPC64_OpDiv16(v)
   193  	case OpDiv16u:
   194  		return rewriteValuePPC64_OpDiv16u(v)
   195  	case OpDiv32:
   196  		return rewriteValuePPC64_OpDiv32(v)
   197  	case OpDiv32F:
   198  		v.Op = OpPPC64FDIVS
   199  		return true
   200  	case OpDiv32u:
   201  		v.Op = OpPPC64DIVWU
   202  		return true
   203  	case OpDiv64:
   204  		return rewriteValuePPC64_OpDiv64(v)
   205  	case OpDiv64F:
   206  		v.Op = OpPPC64FDIV
   207  		return true
   208  	case OpDiv64u:
   209  		v.Op = OpPPC64DIVDU
   210  		return true
   211  	case OpDiv8:
   212  		return rewriteValuePPC64_OpDiv8(v)
   213  	case OpDiv8u:
   214  		return rewriteValuePPC64_OpDiv8u(v)
   215  	case OpEq16:
   216  		return rewriteValuePPC64_OpEq16(v)
   217  	case OpEq32:
   218  		return rewriteValuePPC64_OpEq32(v)
   219  	case OpEq32F:
   220  		return rewriteValuePPC64_OpEq32F(v)
   221  	case OpEq64:
   222  		return rewriteValuePPC64_OpEq64(v)
   223  	case OpEq64F:
   224  		return rewriteValuePPC64_OpEq64F(v)
   225  	case OpEq8:
   226  		return rewriteValuePPC64_OpEq8(v)
   227  	case OpEqB:
   228  		return rewriteValuePPC64_OpEqB(v)
   229  	case OpEqPtr:
   230  		return rewriteValuePPC64_OpEqPtr(v)
   231  	case OpFMA:
   232  		v.Op = OpPPC64FMADD
   233  		return true
   234  	case OpFloor:
   235  		v.Op = OpPPC64FFLOOR
   236  		return true
   237  	case OpGetCallerPC:
   238  		v.Op = OpPPC64LoweredGetCallerPC
   239  		return true
   240  	case OpGetCallerSP:
   241  		v.Op = OpPPC64LoweredGetCallerSP
   242  		return true
   243  	case OpGetClosurePtr:
   244  		v.Op = OpPPC64LoweredGetClosurePtr
   245  		return true
   246  	case OpHmul32:
   247  		v.Op = OpPPC64MULHW
   248  		return true
   249  	case OpHmul32u:
   250  		v.Op = OpPPC64MULHWU
   251  		return true
   252  	case OpHmul64:
   253  		v.Op = OpPPC64MULHD
   254  		return true
   255  	case OpHmul64u:
   256  		v.Op = OpPPC64MULHDU
   257  		return true
   258  	case OpInterCall:
   259  		v.Op = OpPPC64CALLinter
   260  		return true
   261  	case OpIsInBounds:
   262  		return rewriteValuePPC64_OpIsInBounds(v)
   263  	case OpIsNonNil:
   264  		return rewriteValuePPC64_OpIsNonNil(v)
   265  	case OpIsSliceInBounds:
   266  		return rewriteValuePPC64_OpIsSliceInBounds(v)
   267  	case OpLeq16:
   268  		return rewriteValuePPC64_OpLeq16(v)
   269  	case OpLeq16U:
   270  		return rewriteValuePPC64_OpLeq16U(v)
   271  	case OpLeq32:
   272  		return rewriteValuePPC64_OpLeq32(v)
   273  	case OpLeq32F:
   274  		return rewriteValuePPC64_OpLeq32F(v)
   275  	case OpLeq32U:
   276  		return rewriteValuePPC64_OpLeq32U(v)
   277  	case OpLeq64:
   278  		return rewriteValuePPC64_OpLeq64(v)
   279  	case OpLeq64F:
   280  		return rewriteValuePPC64_OpLeq64F(v)
   281  	case OpLeq64U:
   282  		return rewriteValuePPC64_OpLeq64U(v)
   283  	case OpLeq8:
   284  		return rewriteValuePPC64_OpLeq8(v)
   285  	case OpLeq8U:
   286  		return rewriteValuePPC64_OpLeq8U(v)
   287  	case OpLess16:
   288  		return rewriteValuePPC64_OpLess16(v)
   289  	case OpLess16U:
   290  		return rewriteValuePPC64_OpLess16U(v)
   291  	case OpLess32:
   292  		return rewriteValuePPC64_OpLess32(v)
   293  	case OpLess32F:
   294  		return rewriteValuePPC64_OpLess32F(v)
   295  	case OpLess32U:
   296  		return rewriteValuePPC64_OpLess32U(v)
   297  	case OpLess64:
   298  		return rewriteValuePPC64_OpLess64(v)
   299  	case OpLess64F:
   300  		return rewriteValuePPC64_OpLess64F(v)
   301  	case OpLess64U:
   302  		return rewriteValuePPC64_OpLess64U(v)
   303  	case OpLess8:
   304  		return rewriteValuePPC64_OpLess8(v)
   305  	case OpLess8U:
   306  		return rewriteValuePPC64_OpLess8U(v)
   307  	case OpLoad:
   308  		return rewriteValuePPC64_OpLoad(v)
   309  	case OpLocalAddr:
   310  		return rewriteValuePPC64_OpLocalAddr(v)
   311  	case OpLsh16x16:
   312  		return rewriteValuePPC64_OpLsh16x16(v)
   313  	case OpLsh16x32:
   314  		return rewriteValuePPC64_OpLsh16x32(v)
   315  	case OpLsh16x64:
   316  		return rewriteValuePPC64_OpLsh16x64(v)
   317  	case OpLsh16x8:
   318  		return rewriteValuePPC64_OpLsh16x8(v)
   319  	case OpLsh32x16:
   320  		return rewriteValuePPC64_OpLsh32x16(v)
   321  	case OpLsh32x32:
   322  		return rewriteValuePPC64_OpLsh32x32(v)
   323  	case OpLsh32x64:
   324  		return rewriteValuePPC64_OpLsh32x64(v)
   325  	case OpLsh32x8:
   326  		return rewriteValuePPC64_OpLsh32x8(v)
   327  	case OpLsh64x16:
   328  		return rewriteValuePPC64_OpLsh64x16(v)
   329  	case OpLsh64x32:
   330  		return rewriteValuePPC64_OpLsh64x32(v)
   331  	case OpLsh64x64:
   332  		return rewriteValuePPC64_OpLsh64x64(v)
   333  	case OpLsh64x8:
   334  		return rewriteValuePPC64_OpLsh64x8(v)
   335  	case OpLsh8x16:
   336  		return rewriteValuePPC64_OpLsh8x16(v)
   337  	case OpLsh8x32:
   338  		return rewriteValuePPC64_OpLsh8x32(v)
   339  	case OpLsh8x64:
   340  		return rewriteValuePPC64_OpLsh8x64(v)
   341  	case OpLsh8x8:
   342  		return rewriteValuePPC64_OpLsh8x8(v)
   343  	case OpMax32F:
   344  		return rewriteValuePPC64_OpMax32F(v)
   345  	case OpMax64F:
   346  		return rewriteValuePPC64_OpMax64F(v)
   347  	case OpMin32F:
   348  		return rewriteValuePPC64_OpMin32F(v)
   349  	case OpMin64F:
   350  		return rewriteValuePPC64_OpMin64F(v)
   351  	case OpMod16:
   352  		return rewriteValuePPC64_OpMod16(v)
   353  	case OpMod16u:
   354  		return rewriteValuePPC64_OpMod16u(v)
   355  	case OpMod32:
   356  		return rewriteValuePPC64_OpMod32(v)
   357  	case OpMod32u:
   358  		return rewriteValuePPC64_OpMod32u(v)
   359  	case OpMod64:
   360  		return rewriteValuePPC64_OpMod64(v)
   361  	case OpMod64u:
   362  		return rewriteValuePPC64_OpMod64u(v)
   363  	case OpMod8:
   364  		return rewriteValuePPC64_OpMod8(v)
   365  	case OpMod8u:
   366  		return rewriteValuePPC64_OpMod8u(v)
   367  	case OpMove:
   368  		return rewriteValuePPC64_OpMove(v)
   369  	case OpMul16:
   370  		v.Op = OpPPC64MULLW
   371  		return true
   372  	case OpMul32:
   373  		v.Op = OpPPC64MULLW
   374  		return true
   375  	case OpMul32F:
   376  		v.Op = OpPPC64FMULS
   377  		return true
   378  	case OpMul64:
   379  		v.Op = OpPPC64MULLD
   380  		return true
   381  	case OpMul64F:
   382  		v.Op = OpPPC64FMUL
   383  		return true
   384  	case OpMul8:
   385  		v.Op = OpPPC64MULLW
   386  		return true
   387  	case OpNeg16:
   388  		v.Op = OpPPC64NEG
   389  		return true
   390  	case OpNeg32:
   391  		v.Op = OpPPC64NEG
   392  		return true
   393  	case OpNeg32F:
   394  		v.Op = OpPPC64FNEG
   395  		return true
   396  	case OpNeg64:
   397  		v.Op = OpPPC64NEG
   398  		return true
   399  	case OpNeg64F:
   400  		v.Op = OpPPC64FNEG
   401  		return true
   402  	case OpNeg8:
   403  		v.Op = OpPPC64NEG
   404  		return true
   405  	case OpNeq16:
   406  		return rewriteValuePPC64_OpNeq16(v)
   407  	case OpNeq32:
   408  		return rewriteValuePPC64_OpNeq32(v)
   409  	case OpNeq32F:
   410  		return rewriteValuePPC64_OpNeq32F(v)
   411  	case OpNeq64:
   412  		return rewriteValuePPC64_OpNeq64(v)
   413  	case OpNeq64F:
   414  		return rewriteValuePPC64_OpNeq64F(v)
   415  	case OpNeq8:
   416  		return rewriteValuePPC64_OpNeq8(v)
   417  	case OpNeqB:
   418  		v.Op = OpPPC64XOR
   419  		return true
   420  	case OpNeqPtr:
   421  		return rewriteValuePPC64_OpNeqPtr(v)
   422  	case OpNilCheck:
   423  		v.Op = OpPPC64LoweredNilCheck
   424  		return true
   425  	case OpNot:
   426  		return rewriteValuePPC64_OpNot(v)
   427  	case OpOffPtr:
   428  		return rewriteValuePPC64_OpOffPtr(v)
   429  	case OpOr16:
   430  		v.Op = OpPPC64OR
   431  		return true
   432  	case OpOr32:
   433  		v.Op = OpPPC64OR
   434  		return true
   435  	case OpOr64:
   436  		v.Op = OpPPC64OR
   437  		return true
   438  	case OpOr8:
   439  		v.Op = OpPPC64OR
   440  		return true
   441  	case OpOrB:
   442  		v.Op = OpPPC64OR
   443  		return true
   444  	case OpPPC64ADD:
   445  		return rewriteValuePPC64_OpPPC64ADD(v)
   446  	case OpPPC64ADDE:
   447  		return rewriteValuePPC64_OpPPC64ADDE(v)
   448  	case OpPPC64ADDconst:
   449  		return rewriteValuePPC64_OpPPC64ADDconst(v)
   450  	case OpPPC64AND:
   451  		return rewriteValuePPC64_OpPPC64AND(v)
   452  	case OpPPC64ANDCCconst:
   453  		return rewriteValuePPC64_OpPPC64ANDCCconst(v)
   454  	case OpPPC64ANDN:
   455  		return rewriteValuePPC64_OpPPC64ANDN(v)
   456  	case OpPPC64BRD:
   457  		return rewriteValuePPC64_OpPPC64BRD(v)
   458  	case OpPPC64BRH:
   459  		return rewriteValuePPC64_OpPPC64BRH(v)
   460  	case OpPPC64BRW:
   461  		return rewriteValuePPC64_OpPPC64BRW(v)
   462  	case OpPPC64CLRLSLDI:
   463  		return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
   464  	case OpPPC64CMP:
   465  		return rewriteValuePPC64_OpPPC64CMP(v)
   466  	case OpPPC64CMPU:
   467  		return rewriteValuePPC64_OpPPC64CMPU(v)
   468  	case OpPPC64CMPUconst:
   469  		return rewriteValuePPC64_OpPPC64CMPUconst(v)
   470  	case OpPPC64CMPW:
   471  		return rewriteValuePPC64_OpPPC64CMPW(v)
   472  	case OpPPC64CMPWU:
   473  		return rewriteValuePPC64_OpPPC64CMPWU(v)
   474  	case OpPPC64CMPWUconst:
   475  		return rewriteValuePPC64_OpPPC64CMPWUconst(v)
   476  	case OpPPC64CMPWconst:
   477  		return rewriteValuePPC64_OpPPC64CMPWconst(v)
   478  	case OpPPC64CMPconst:
   479  		return rewriteValuePPC64_OpPPC64CMPconst(v)
   480  	case OpPPC64Equal:
   481  		return rewriteValuePPC64_OpPPC64Equal(v)
   482  	case OpPPC64FABS:
   483  		return rewriteValuePPC64_OpPPC64FABS(v)
   484  	case OpPPC64FADD:
   485  		return rewriteValuePPC64_OpPPC64FADD(v)
   486  	case OpPPC64FADDS:
   487  		return rewriteValuePPC64_OpPPC64FADDS(v)
   488  	case OpPPC64FCEIL:
   489  		return rewriteValuePPC64_OpPPC64FCEIL(v)
   490  	case OpPPC64FFLOOR:
   491  		return rewriteValuePPC64_OpPPC64FFLOOR(v)
   492  	case OpPPC64FGreaterEqual:
   493  		return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
   494  	case OpPPC64FGreaterThan:
   495  		return rewriteValuePPC64_OpPPC64FGreaterThan(v)
   496  	case OpPPC64FLessEqual:
   497  		return rewriteValuePPC64_OpPPC64FLessEqual(v)
   498  	case OpPPC64FLessThan:
   499  		return rewriteValuePPC64_OpPPC64FLessThan(v)
   500  	case OpPPC64FMOVDload:
   501  		return rewriteValuePPC64_OpPPC64FMOVDload(v)
   502  	case OpPPC64FMOVDstore:
   503  		return rewriteValuePPC64_OpPPC64FMOVDstore(v)
   504  	case OpPPC64FMOVSload:
   505  		return rewriteValuePPC64_OpPPC64FMOVSload(v)
   506  	case OpPPC64FMOVSstore:
   507  		return rewriteValuePPC64_OpPPC64FMOVSstore(v)
   508  	case OpPPC64FNEG:
   509  		return rewriteValuePPC64_OpPPC64FNEG(v)
   510  	case OpPPC64FSQRT:
   511  		return rewriteValuePPC64_OpPPC64FSQRT(v)
   512  	case OpPPC64FSUB:
   513  		return rewriteValuePPC64_OpPPC64FSUB(v)
   514  	case OpPPC64FSUBS:
   515  		return rewriteValuePPC64_OpPPC64FSUBS(v)
   516  	case OpPPC64FTRUNC:
   517  		return rewriteValuePPC64_OpPPC64FTRUNC(v)
   518  	case OpPPC64GreaterEqual:
   519  		return rewriteValuePPC64_OpPPC64GreaterEqual(v)
   520  	case OpPPC64GreaterThan:
   521  		return rewriteValuePPC64_OpPPC64GreaterThan(v)
   522  	case OpPPC64ISEL:
   523  		return rewriteValuePPC64_OpPPC64ISEL(v)
   524  	case OpPPC64LessEqual:
   525  		return rewriteValuePPC64_OpPPC64LessEqual(v)
   526  	case OpPPC64LessThan:
   527  		return rewriteValuePPC64_OpPPC64LessThan(v)
   528  	case OpPPC64MFVSRD:
   529  		return rewriteValuePPC64_OpPPC64MFVSRD(v)
   530  	case OpPPC64MOVBZload:
   531  		return rewriteValuePPC64_OpPPC64MOVBZload(v)
   532  	case OpPPC64MOVBZloadidx:
   533  		return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
   534  	case OpPPC64MOVBZreg:
   535  		return rewriteValuePPC64_OpPPC64MOVBZreg(v)
   536  	case OpPPC64MOVBreg:
   537  		return rewriteValuePPC64_OpPPC64MOVBreg(v)
   538  	case OpPPC64MOVBstore:
   539  		return rewriteValuePPC64_OpPPC64MOVBstore(v)
   540  	case OpPPC64MOVBstoreidx:
   541  		return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
   542  	case OpPPC64MOVBstorezero:
   543  		return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
   544  	case OpPPC64MOVDaddr:
   545  		return rewriteValuePPC64_OpPPC64MOVDaddr(v)
   546  	case OpPPC64MOVDload:
   547  		return rewriteValuePPC64_OpPPC64MOVDload(v)
   548  	case OpPPC64MOVDloadidx:
   549  		return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
   550  	case OpPPC64MOVDstore:
   551  		return rewriteValuePPC64_OpPPC64MOVDstore(v)
   552  	case OpPPC64MOVDstoreidx:
   553  		return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
   554  	case OpPPC64MOVDstorezero:
   555  		return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
   556  	case OpPPC64MOVHBRstore:
   557  		return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
   558  	case OpPPC64MOVHZload:
   559  		return rewriteValuePPC64_OpPPC64MOVHZload(v)
   560  	case OpPPC64MOVHZloadidx:
   561  		return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
   562  	case OpPPC64MOVHZreg:
   563  		return rewriteValuePPC64_OpPPC64MOVHZreg(v)
   564  	case OpPPC64MOVHload:
   565  		return rewriteValuePPC64_OpPPC64MOVHload(v)
   566  	case OpPPC64MOVHloadidx:
   567  		return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
   568  	case OpPPC64MOVHreg:
   569  		return rewriteValuePPC64_OpPPC64MOVHreg(v)
   570  	case OpPPC64MOVHstore:
   571  		return rewriteValuePPC64_OpPPC64MOVHstore(v)
   572  	case OpPPC64MOVHstoreidx:
   573  		return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
   574  	case OpPPC64MOVHstorezero:
   575  		return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
   576  	case OpPPC64MOVWBRstore:
   577  		return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
   578  	case OpPPC64MOVWZload:
   579  		return rewriteValuePPC64_OpPPC64MOVWZload(v)
   580  	case OpPPC64MOVWZloadidx:
   581  		return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
   582  	case OpPPC64MOVWZreg:
   583  		return rewriteValuePPC64_OpPPC64MOVWZreg(v)
   584  	case OpPPC64MOVWload:
   585  		return rewriteValuePPC64_OpPPC64MOVWload(v)
   586  	case OpPPC64MOVWloadidx:
   587  		return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
   588  	case OpPPC64MOVWreg:
   589  		return rewriteValuePPC64_OpPPC64MOVWreg(v)
   590  	case OpPPC64MOVWstore:
   591  		return rewriteValuePPC64_OpPPC64MOVWstore(v)
   592  	case OpPPC64MOVWstoreidx:
   593  		return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
   594  	case OpPPC64MOVWstorezero:
   595  		return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
   596  	case OpPPC64MTVSRD:
   597  		return rewriteValuePPC64_OpPPC64MTVSRD(v)
   598  	case OpPPC64MULLD:
   599  		return rewriteValuePPC64_OpPPC64MULLD(v)
   600  	case OpPPC64MULLW:
   601  		return rewriteValuePPC64_OpPPC64MULLW(v)
   602  	case OpPPC64NEG:
   603  		return rewriteValuePPC64_OpPPC64NEG(v)
   604  	case OpPPC64NOR:
   605  		return rewriteValuePPC64_OpPPC64NOR(v)
   606  	case OpPPC64NotEqual:
   607  		return rewriteValuePPC64_OpPPC64NotEqual(v)
   608  	case OpPPC64OR:
   609  		return rewriteValuePPC64_OpPPC64OR(v)
   610  	case OpPPC64ORN:
   611  		return rewriteValuePPC64_OpPPC64ORN(v)
   612  	case OpPPC64ORconst:
   613  		return rewriteValuePPC64_OpPPC64ORconst(v)
   614  	case OpPPC64RLWINM:
   615  		return rewriteValuePPC64_OpPPC64RLWINM(v)
   616  	case OpPPC64ROTL:
   617  		return rewriteValuePPC64_OpPPC64ROTL(v)
   618  	case OpPPC64ROTLW:
   619  		return rewriteValuePPC64_OpPPC64ROTLW(v)
   620  	case OpPPC64ROTLWconst:
   621  		return rewriteValuePPC64_OpPPC64ROTLWconst(v)
   622  	case OpPPC64SETBC:
   623  		return rewriteValuePPC64_OpPPC64SETBC(v)
   624  	case OpPPC64SETBCR:
   625  		return rewriteValuePPC64_OpPPC64SETBCR(v)
   626  	case OpPPC64SLD:
   627  		return rewriteValuePPC64_OpPPC64SLD(v)
   628  	case OpPPC64SLDconst:
   629  		return rewriteValuePPC64_OpPPC64SLDconst(v)
   630  	case OpPPC64SLW:
   631  		return rewriteValuePPC64_OpPPC64SLW(v)
   632  	case OpPPC64SLWconst:
   633  		return rewriteValuePPC64_OpPPC64SLWconst(v)
   634  	case OpPPC64SRAD:
   635  		return rewriteValuePPC64_OpPPC64SRAD(v)
   636  	case OpPPC64SRAW:
   637  		return rewriteValuePPC64_OpPPC64SRAW(v)
   638  	case OpPPC64SRD:
   639  		return rewriteValuePPC64_OpPPC64SRD(v)
   640  	case OpPPC64SRW:
   641  		return rewriteValuePPC64_OpPPC64SRW(v)
   642  	case OpPPC64SRWconst:
   643  		return rewriteValuePPC64_OpPPC64SRWconst(v)
   644  	case OpPPC64SUB:
   645  		return rewriteValuePPC64_OpPPC64SUB(v)
   646  	case OpPPC64SUBE:
   647  		return rewriteValuePPC64_OpPPC64SUBE(v)
   648  	case OpPPC64SUBFCconst:
   649  		return rewriteValuePPC64_OpPPC64SUBFCconst(v)
   650  	case OpPPC64XOR:
   651  		return rewriteValuePPC64_OpPPC64XOR(v)
   652  	case OpPPC64XORconst:
   653  		return rewriteValuePPC64_OpPPC64XORconst(v)
   654  	case OpPanicBounds:
   655  		return rewriteValuePPC64_OpPanicBounds(v)
   656  	case OpPopCount16:
   657  		return rewriteValuePPC64_OpPopCount16(v)
   658  	case OpPopCount32:
   659  		return rewriteValuePPC64_OpPopCount32(v)
   660  	case OpPopCount64:
   661  		v.Op = OpPPC64POPCNTD
   662  		return true
   663  	case OpPopCount8:
   664  		return rewriteValuePPC64_OpPopCount8(v)
   665  	case OpPrefetchCache:
   666  		return rewriteValuePPC64_OpPrefetchCache(v)
   667  	case OpPrefetchCacheStreamed:
   668  		return rewriteValuePPC64_OpPrefetchCacheStreamed(v)
   669  	case OpPubBarrier:
   670  		v.Op = OpPPC64LoweredPubBarrier
   671  		return true
   672  	case OpRotateLeft16:
   673  		return rewriteValuePPC64_OpRotateLeft16(v)
   674  	case OpRotateLeft32:
   675  		v.Op = OpPPC64ROTLW
   676  		return true
   677  	case OpRotateLeft64:
   678  		v.Op = OpPPC64ROTL
   679  		return true
   680  	case OpRotateLeft8:
   681  		return rewriteValuePPC64_OpRotateLeft8(v)
   682  	case OpRound:
   683  		v.Op = OpPPC64FROUND
   684  		return true
   685  	case OpRound32F:
   686  		v.Op = OpPPC64LoweredRound32F
   687  		return true
   688  	case OpRound64F:
   689  		v.Op = OpPPC64LoweredRound64F
   690  		return true
   691  	case OpRsh16Ux16:
   692  		return rewriteValuePPC64_OpRsh16Ux16(v)
   693  	case OpRsh16Ux32:
   694  		return rewriteValuePPC64_OpRsh16Ux32(v)
   695  	case OpRsh16Ux64:
   696  		return rewriteValuePPC64_OpRsh16Ux64(v)
   697  	case OpRsh16Ux8:
   698  		return rewriteValuePPC64_OpRsh16Ux8(v)
   699  	case OpRsh16x16:
   700  		return rewriteValuePPC64_OpRsh16x16(v)
   701  	case OpRsh16x32:
   702  		return rewriteValuePPC64_OpRsh16x32(v)
   703  	case OpRsh16x64:
   704  		return rewriteValuePPC64_OpRsh16x64(v)
   705  	case OpRsh16x8:
   706  		return rewriteValuePPC64_OpRsh16x8(v)
   707  	case OpRsh32Ux16:
   708  		return rewriteValuePPC64_OpRsh32Ux16(v)
   709  	case OpRsh32Ux32:
   710  		return rewriteValuePPC64_OpRsh32Ux32(v)
   711  	case OpRsh32Ux64:
   712  		return rewriteValuePPC64_OpRsh32Ux64(v)
   713  	case OpRsh32Ux8:
   714  		return rewriteValuePPC64_OpRsh32Ux8(v)
   715  	case OpRsh32x16:
   716  		return rewriteValuePPC64_OpRsh32x16(v)
   717  	case OpRsh32x32:
   718  		return rewriteValuePPC64_OpRsh32x32(v)
   719  	case OpRsh32x64:
   720  		return rewriteValuePPC64_OpRsh32x64(v)
   721  	case OpRsh32x8:
   722  		return rewriteValuePPC64_OpRsh32x8(v)
   723  	case OpRsh64Ux16:
   724  		return rewriteValuePPC64_OpRsh64Ux16(v)
   725  	case OpRsh64Ux32:
   726  		return rewriteValuePPC64_OpRsh64Ux32(v)
   727  	case OpRsh64Ux64:
   728  		return rewriteValuePPC64_OpRsh64Ux64(v)
   729  	case OpRsh64Ux8:
   730  		return rewriteValuePPC64_OpRsh64Ux8(v)
   731  	case OpRsh64x16:
   732  		return rewriteValuePPC64_OpRsh64x16(v)
   733  	case OpRsh64x32:
   734  		return rewriteValuePPC64_OpRsh64x32(v)
   735  	case OpRsh64x64:
   736  		return rewriteValuePPC64_OpRsh64x64(v)
   737  	case OpRsh64x8:
   738  		return rewriteValuePPC64_OpRsh64x8(v)
   739  	case OpRsh8Ux16:
   740  		return rewriteValuePPC64_OpRsh8Ux16(v)
   741  	case OpRsh8Ux32:
   742  		return rewriteValuePPC64_OpRsh8Ux32(v)
   743  	case OpRsh8Ux64:
   744  		return rewriteValuePPC64_OpRsh8Ux64(v)
   745  	case OpRsh8Ux8:
   746  		return rewriteValuePPC64_OpRsh8Ux8(v)
   747  	case OpRsh8x16:
   748  		return rewriteValuePPC64_OpRsh8x16(v)
   749  	case OpRsh8x32:
   750  		return rewriteValuePPC64_OpRsh8x32(v)
   751  	case OpRsh8x64:
   752  		return rewriteValuePPC64_OpRsh8x64(v)
   753  	case OpRsh8x8:
   754  		return rewriteValuePPC64_OpRsh8x8(v)
   755  	case OpSelect0:
   756  		return rewriteValuePPC64_OpSelect0(v)
   757  	case OpSelect1:
   758  		return rewriteValuePPC64_OpSelect1(v)
   759  	case OpSelectN:
   760  		return rewriteValuePPC64_OpSelectN(v)
   761  	case OpSignExt16to32:
   762  		v.Op = OpPPC64MOVHreg
   763  		return true
   764  	case OpSignExt16to64:
   765  		v.Op = OpPPC64MOVHreg
   766  		return true
   767  	case OpSignExt32to64:
   768  		v.Op = OpPPC64MOVWreg
   769  		return true
   770  	case OpSignExt8to16:
   771  		v.Op = OpPPC64MOVBreg
   772  		return true
   773  	case OpSignExt8to32:
   774  		v.Op = OpPPC64MOVBreg
   775  		return true
   776  	case OpSignExt8to64:
   777  		v.Op = OpPPC64MOVBreg
   778  		return true
   779  	case OpSlicemask:
   780  		return rewriteValuePPC64_OpSlicemask(v)
   781  	case OpSqrt:
   782  		v.Op = OpPPC64FSQRT
   783  		return true
   784  	case OpSqrt32:
   785  		v.Op = OpPPC64FSQRTS
   786  		return true
   787  	case OpStaticCall:
   788  		v.Op = OpPPC64CALLstatic
   789  		return true
   790  	case OpStore:
   791  		return rewriteValuePPC64_OpStore(v)
   792  	case OpSub16:
   793  		v.Op = OpPPC64SUB
   794  		return true
   795  	case OpSub32:
   796  		v.Op = OpPPC64SUB
   797  		return true
   798  	case OpSub32F:
   799  		v.Op = OpPPC64FSUBS
   800  		return true
   801  	case OpSub64:
   802  		v.Op = OpPPC64SUB
   803  		return true
   804  	case OpSub64F:
   805  		v.Op = OpPPC64FSUB
   806  		return true
   807  	case OpSub8:
   808  		v.Op = OpPPC64SUB
   809  		return true
   810  	case OpSubPtr:
   811  		v.Op = OpPPC64SUB
   812  		return true
   813  	case OpTailCall:
   814  		v.Op = OpPPC64CALLtail
   815  		return true
   816  	case OpTrunc:
   817  		v.Op = OpPPC64FTRUNC
   818  		return true
   819  	case OpTrunc16to8:
   820  		return rewriteValuePPC64_OpTrunc16to8(v)
   821  	case OpTrunc32to16:
   822  		return rewriteValuePPC64_OpTrunc32to16(v)
   823  	case OpTrunc32to8:
   824  		return rewriteValuePPC64_OpTrunc32to8(v)
   825  	case OpTrunc64to16:
   826  		return rewriteValuePPC64_OpTrunc64to16(v)
   827  	case OpTrunc64to32:
   828  		return rewriteValuePPC64_OpTrunc64to32(v)
   829  	case OpTrunc64to8:
   830  		return rewriteValuePPC64_OpTrunc64to8(v)
   831  	case OpWB:
   832  		v.Op = OpPPC64LoweredWB
   833  		return true
   834  	case OpXor16:
   835  		v.Op = OpPPC64XOR
   836  		return true
   837  	case OpXor32:
   838  		v.Op = OpPPC64XOR
   839  		return true
   840  	case OpXor64:
   841  		v.Op = OpPPC64XOR
   842  		return true
   843  	case OpXor8:
   844  		v.Op = OpPPC64XOR
   845  		return true
   846  	case OpZero:
   847  		return rewriteValuePPC64_OpZero(v)
   848  	case OpZeroExt16to32:
   849  		v.Op = OpPPC64MOVHZreg
   850  		return true
   851  	case OpZeroExt16to64:
   852  		v.Op = OpPPC64MOVHZreg
   853  		return true
   854  	case OpZeroExt32to64:
   855  		v.Op = OpPPC64MOVWZreg
   856  		return true
   857  	case OpZeroExt8to16:
   858  		v.Op = OpPPC64MOVBZreg
   859  		return true
   860  	case OpZeroExt8to32:
   861  		v.Op = OpPPC64MOVBZreg
   862  		return true
   863  	case OpZeroExt8to64:
   864  		v.Op = OpPPC64MOVBZreg
   865  		return true
   866  	}
   867  	return false
   868  }
   869  func rewriteValuePPC64_OpAddr(v *Value) bool {
   870  	v_0 := v.Args[0]
   871  	// match: (Addr {sym} base)
   872  	// result: (MOVDaddr {sym} [0] base)
   873  	for {
   874  		sym := auxToSym(v.Aux)
   875  		base := v_0
   876  		v.reset(OpPPC64MOVDaddr)
   877  		v.AuxInt = int32ToAuxInt(0)
   878  		v.Aux = symToAux(sym)
   879  		v.AddArg(base)
   880  		return true
   881  	}
   882  }
   883  func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
   884  	v_3 := v.Args[3]
   885  	v_2 := v.Args[2]
   886  	v_1 := v.Args[1]
   887  	v_0 := v.Args[0]
   888  	// match: (AtomicCompareAndSwap32 ptr old new_ mem)
   889  	// result: (LoweredAtomicCas32 [1] ptr old new_ mem)
   890  	for {
   891  		ptr := v_0
   892  		old := v_1
   893  		new_ := v_2
   894  		mem := v_3
   895  		v.reset(OpPPC64LoweredAtomicCas32)
   896  		v.AuxInt = int64ToAuxInt(1)
   897  		v.AddArg4(ptr, old, new_, mem)
   898  		return true
   899  	}
   900  }
   901  func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
   902  	v_3 := v.Args[3]
   903  	v_2 := v.Args[2]
   904  	v_1 := v.Args[1]
   905  	v_0 := v.Args[0]
   906  	// match: (AtomicCompareAndSwap64 ptr old new_ mem)
   907  	// result: (LoweredAtomicCas64 [1] ptr old new_ mem)
   908  	for {
   909  		ptr := v_0
   910  		old := v_1
   911  		new_ := v_2
   912  		mem := v_3
   913  		v.reset(OpPPC64LoweredAtomicCas64)
   914  		v.AuxInt = int64ToAuxInt(1)
   915  		v.AddArg4(ptr, old, new_, mem)
   916  		return true
   917  	}
   918  }
   919  func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
   920  	v_3 := v.Args[3]
   921  	v_2 := v.Args[2]
   922  	v_1 := v.Args[1]
   923  	v_0 := v.Args[0]
   924  	// match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
   925  	// result: (LoweredAtomicCas32 [0] ptr old new_ mem)
   926  	for {
   927  		ptr := v_0
   928  		old := v_1
   929  		new_ := v_2
   930  		mem := v_3
   931  		v.reset(OpPPC64LoweredAtomicCas32)
   932  		v.AuxInt = int64ToAuxInt(0)
   933  		v.AddArg4(ptr, old, new_, mem)
   934  		return true
   935  	}
   936  }
   937  func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
   938  	v_1 := v.Args[1]
   939  	v_0 := v.Args[0]
   940  	// match: (AtomicLoad32 ptr mem)
   941  	// result: (LoweredAtomicLoad32 [1] ptr mem)
   942  	for {
   943  		ptr := v_0
   944  		mem := v_1
   945  		v.reset(OpPPC64LoweredAtomicLoad32)
   946  		v.AuxInt = int64ToAuxInt(1)
   947  		v.AddArg2(ptr, mem)
   948  		return true
   949  	}
   950  }
   951  func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
   952  	v_1 := v.Args[1]
   953  	v_0 := v.Args[0]
   954  	// match: (AtomicLoad64 ptr mem)
   955  	// result: (LoweredAtomicLoad64 [1] ptr mem)
   956  	for {
   957  		ptr := v_0
   958  		mem := v_1
   959  		v.reset(OpPPC64LoweredAtomicLoad64)
   960  		v.AuxInt = int64ToAuxInt(1)
   961  		v.AddArg2(ptr, mem)
   962  		return true
   963  	}
   964  }
   965  func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
   966  	v_1 := v.Args[1]
   967  	v_0 := v.Args[0]
   968  	// match: (AtomicLoad8 ptr mem)
   969  	// result: (LoweredAtomicLoad8 [1] ptr mem)
   970  	for {
   971  		ptr := v_0
   972  		mem := v_1
   973  		v.reset(OpPPC64LoweredAtomicLoad8)
   974  		v.AuxInt = int64ToAuxInt(1)
   975  		v.AddArg2(ptr, mem)
   976  		return true
   977  	}
   978  }
   979  func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
   980  	v_1 := v.Args[1]
   981  	v_0 := v.Args[0]
   982  	// match: (AtomicLoadAcq32 ptr mem)
   983  	// result: (LoweredAtomicLoad32 [0] ptr mem)
   984  	for {
   985  		ptr := v_0
   986  		mem := v_1
   987  		v.reset(OpPPC64LoweredAtomicLoad32)
   988  		v.AuxInt = int64ToAuxInt(0)
   989  		v.AddArg2(ptr, mem)
   990  		return true
   991  	}
   992  }
   993  func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
   994  	v_1 := v.Args[1]
   995  	v_0 := v.Args[0]
   996  	// match: (AtomicLoadAcq64 ptr mem)
   997  	// result: (LoweredAtomicLoad64 [0] ptr mem)
   998  	for {
   999  		ptr := v_0
  1000  		mem := v_1
  1001  		v.reset(OpPPC64LoweredAtomicLoad64)
  1002  		v.AuxInt = int64ToAuxInt(0)
  1003  		v.AddArg2(ptr, mem)
  1004  		return true
  1005  	}
  1006  }
  1007  func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
  1008  	v_1 := v.Args[1]
  1009  	v_0 := v.Args[0]
  1010  	// match: (AtomicLoadPtr ptr mem)
  1011  	// result: (LoweredAtomicLoadPtr [1] ptr mem)
  1012  	for {
  1013  		ptr := v_0
  1014  		mem := v_1
  1015  		v.reset(OpPPC64LoweredAtomicLoadPtr)
  1016  		v.AuxInt = int64ToAuxInt(1)
  1017  		v.AddArg2(ptr, mem)
  1018  		return true
  1019  	}
  1020  }
  1021  func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
  1022  	v_2 := v.Args[2]
  1023  	v_1 := v.Args[1]
  1024  	v_0 := v.Args[0]
  1025  	// match: (AtomicStore32 ptr val mem)
  1026  	// result: (LoweredAtomicStore32 [1] ptr val mem)
  1027  	for {
  1028  		ptr := v_0
  1029  		val := v_1
  1030  		mem := v_2
  1031  		v.reset(OpPPC64LoweredAtomicStore32)
  1032  		v.AuxInt = int64ToAuxInt(1)
  1033  		v.AddArg3(ptr, val, mem)
  1034  		return true
  1035  	}
  1036  }
  1037  func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
  1038  	v_2 := v.Args[2]
  1039  	v_1 := v.Args[1]
  1040  	v_0 := v.Args[0]
  1041  	// match: (AtomicStore64 ptr val mem)
  1042  	// result: (LoweredAtomicStore64 [1] ptr val mem)
  1043  	for {
  1044  		ptr := v_0
  1045  		val := v_1
  1046  		mem := v_2
  1047  		v.reset(OpPPC64LoweredAtomicStore64)
  1048  		v.AuxInt = int64ToAuxInt(1)
  1049  		v.AddArg3(ptr, val, mem)
  1050  		return true
  1051  	}
  1052  }
  1053  func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
  1054  	v_2 := v.Args[2]
  1055  	v_1 := v.Args[1]
  1056  	v_0 := v.Args[0]
  1057  	// match: (AtomicStore8 ptr val mem)
  1058  	// result: (LoweredAtomicStore8 [1] ptr val mem)
  1059  	for {
  1060  		ptr := v_0
  1061  		val := v_1
  1062  		mem := v_2
  1063  		v.reset(OpPPC64LoweredAtomicStore8)
  1064  		v.AuxInt = int64ToAuxInt(1)
  1065  		v.AddArg3(ptr, val, mem)
  1066  		return true
  1067  	}
  1068  }
  1069  func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
  1070  	v_2 := v.Args[2]
  1071  	v_1 := v.Args[1]
  1072  	v_0 := v.Args[0]
  1073  	// match: (AtomicStoreRel32 ptr val mem)
  1074  	// result: (LoweredAtomicStore32 [0] ptr val mem)
  1075  	for {
  1076  		ptr := v_0
  1077  		val := v_1
  1078  		mem := v_2
  1079  		v.reset(OpPPC64LoweredAtomicStore32)
  1080  		v.AuxInt = int64ToAuxInt(0)
  1081  		v.AddArg3(ptr, val, mem)
  1082  		return true
  1083  	}
  1084  }
  1085  func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
  1086  	v_2 := v.Args[2]
  1087  	v_1 := v.Args[1]
  1088  	v_0 := v.Args[0]
  1089  	// match: (AtomicStoreRel64 ptr val mem)
  1090  	// result: (LoweredAtomicStore64 [0] ptr val mem)
  1091  	for {
  1092  		ptr := v_0
  1093  		val := v_1
  1094  		mem := v_2
  1095  		v.reset(OpPPC64LoweredAtomicStore64)
  1096  		v.AuxInt = int64ToAuxInt(0)
  1097  		v.AddArg3(ptr, val, mem)
  1098  		return true
  1099  	}
  1100  }
  1101  func rewriteValuePPC64_OpAvg64u(v *Value) bool {
  1102  	v_1 := v.Args[1]
  1103  	v_0 := v.Args[0]
  1104  	b := v.Block
  1105  	// match: (Avg64u <t> x y)
  1106  	// result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y)
  1107  	for {
  1108  		t := v.Type
  1109  		x := v_0
  1110  		y := v_1
  1111  		v.reset(OpPPC64ADD)
  1112  		v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
  1113  		v0.AuxInt = int64ToAuxInt(1)
  1114  		v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
  1115  		v1.AddArg2(x, y)
  1116  		v0.AddArg(v1)
  1117  		v.AddArg2(v0, y)
  1118  		return true
  1119  	}
  1120  }
  1121  func rewriteValuePPC64_OpBitLen32(v *Value) bool {
  1122  	v_0 := v.Args[0]
  1123  	b := v.Block
  1124  	typ := &b.Func.Config.Types
  1125  	// match: (BitLen32 x)
  1126  	// result: (SUBFCconst [32] (CNTLZW <typ.Int> x))
  1127  	for {
  1128  		x := v_0
  1129  		v.reset(OpPPC64SUBFCconst)
  1130  		v.AuxInt = int64ToAuxInt(32)
  1131  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
  1132  		v0.AddArg(x)
  1133  		v.AddArg(v0)
  1134  		return true
  1135  	}
  1136  }
  1137  func rewriteValuePPC64_OpBitLen64(v *Value) bool {
  1138  	v_0 := v.Args[0]
  1139  	b := v.Block
  1140  	typ := &b.Func.Config.Types
  1141  	// match: (BitLen64 x)
  1142  	// result: (SUBFCconst [64] (CNTLZD <typ.Int> x))
  1143  	for {
  1144  		x := v_0
  1145  		v.reset(OpPPC64SUBFCconst)
  1146  		v.AuxInt = int64ToAuxInt(64)
  1147  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
  1148  		v0.AddArg(x)
  1149  		v.AddArg(v0)
  1150  		return true
  1151  	}
  1152  }
  1153  func rewriteValuePPC64_OpBswap16(v *Value) bool {
  1154  	v_0 := v.Args[0]
  1155  	b := v.Block
  1156  	typ := &b.Func.Config.Types
  1157  	// match: (Bswap16 x)
  1158  	// cond: buildcfg.GOPPC64>=10
  1159  	// result: (BRH x)
  1160  	for {
  1161  		x := v_0
  1162  		if !(buildcfg.GOPPC64 >= 10) {
  1163  			break
  1164  		}
  1165  		v.reset(OpPPC64BRH)
  1166  		v.AddArg(x)
  1167  		return true
  1168  	}
  1169  	// match: (Bswap16 x:(MOVHZload [off] {sym} ptr mem))
  1170  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1171  	for {
  1172  		x := v_0
  1173  		if x.Op != OpPPC64MOVHZload {
  1174  			break
  1175  		}
  1176  		off := auxIntToInt32(x.AuxInt)
  1177  		sym := auxToSym(x.Aux)
  1178  		mem := x.Args[1]
  1179  		ptr := x.Args[0]
  1180  		b = x.Block
  1181  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  1182  		v.copyOf(v0)
  1183  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1184  		v1.AuxInt = int32ToAuxInt(off)
  1185  		v1.Aux = symToAux(sym)
  1186  		v1.AddArg(ptr)
  1187  		v0.AddArg2(v1, mem)
  1188  		return true
  1189  	}
  1190  	// match: (Bswap16 x:(MOVHZloadidx ptr idx mem))
  1191  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  1192  	for {
  1193  		x := v_0
  1194  		if x.Op != OpPPC64MOVHZloadidx {
  1195  			break
  1196  		}
  1197  		mem := x.Args[2]
  1198  		ptr := x.Args[0]
  1199  		idx := x.Args[1]
  1200  		b = x.Block
  1201  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  1202  		v.copyOf(v0)
  1203  		v0.AddArg3(ptr, idx, mem)
  1204  		return true
  1205  	}
  1206  	return false
  1207  }
  1208  func rewriteValuePPC64_OpBswap32(v *Value) bool {
  1209  	v_0 := v.Args[0]
  1210  	b := v.Block
  1211  	typ := &b.Func.Config.Types
  1212  	// match: (Bswap32 x)
  1213  	// cond: buildcfg.GOPPC64>=10
  1214  	// result: (BRW x)
  1215  	for {
  1216  		x := v_0
  1217  		if !(buildcfg.GOPPC64 >= 10) {
  1218  			break
  1219  		}
  1220  		v.reset(OpPPC64BRW)
  1221  		v.AddArg(x)
  1222  		return true
  1223  	}
  1224  	// match: (Bswap32 x:(MOVWZload [off] {sym} ptr mem))
  1225  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1226  	for {
  1227  		x := v_0
  1228  		if x.Op != OpPPC64MOVWZload {
  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, OpPPC64MOVWBRload, typ.UInt32)
  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: (Bswap32 x:(MOVWZloadidx ptr idx mem))
  1246  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  1247  	for {
  1248  		x := v_0
  1249  		if x.Op != OpPPC64MOVWZloadidx {
  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, OpPPC64MOVWBRloadidx, typ.Int32)
  1257  		v.copyOf(v0)
  1258  		v0.AddArg3(ptr, idx, mem)
  1259  		return true
  1260  	}
  1261  	return false
  1262  }
  1263  func rewriteValuePPC64_OpBswap64(v *Value) bool {
  1264  	v_0 := v.Args[0]
  1265  	b := v.Block
  1266  	typ := &b.Func.Config.Types
  1267  	// match: (Bswap64 x)
  1268  	// cond: buildcfg.GOPPC64>=10
  1269  	// result: (BRD x)
  1270  	for {
  1271  		x := v_0
  1272  		if !(buildcfg.GOPPC64 >= 10) {
  1273  			break
  1274  		}
  1275  		v.reset(OpPPC64BRD)
  1276  		v.AddArg(x)
  1277  		return true
  1278  	}
  1279  	// match: (Bswap64 x:(MOVDload [off] {sym} ptr mem))
  1280  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1281  	for {
  1282  		x := v_0
  1283  		if x.Op != OpPPC64MOVDload {
  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, OpPPC64MOVDBRload, typ.UInt64)
  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: (Bswap64 x:(MOVDloadidx ptr idx mem))
  1301  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  1302  	for {
  1303  		x := v_0
  1304  		if x.Op != OpPPC64MOVDloadidx {
  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, OpPPC64MOVDBRloadidx, typ.Int64)
  1312  		v.copyOf(v0)
  1313  		v0.AddArg3(ptr, idx, mem)
  1314  		return true
  1315  	}
  1316  	return false
  1317  }
  1318  func rewriteValuePPC64_OpCom16(v *Value) bool {
  1319  	v_0 := v.Args[0]
  1320  	// match: (Com16 x)
  1321  	// result: (NOR x x)
  1322  	for {
  1323  		x := v_0
  1324  		v.reset(OpPPC64NOR)
  1325  		v.AddArg2(x, x)
  1326  		return true
  1327  	}
  1328  }
  1329  func rewriteValuePPC64_OpCom32(v *Value) bool {
  1330  	v_0 := v.Args[0]
  1331  	// match: (Com32 x)
  1332  	// result: (NOR x x)
  1333  	for {
  1334  		x := v_0
  1335  		v.reset(OpPPC64NOR)
  1336  		v.AddArg2(x, x)
  1337  		return true
  1338  	}
  1339  }
  1340  func rewriteValuePPC64_OpCom64(v *Value) bool {
  1341  	v_0 := v.Args[0]
  1342  	// match: (Com64 x)
  1343  	// result: (NOR x x)
  1344  	for {
  1345  		x := v_0
  1346  		v.reset(OpPPC64NOR)
  1347  		v.AddArg2(x, x)
  1348  		return true
  1349  	}
  1350  }
  1351  func rewriteValuePPC64_OpCom8(v *Value) bool {
  1352  	v_0 := v.Args[0]
  1353  	// match: (Com8 x)
  1354  	// result: (NOR x x)
  1355  	for {
  1356  		x := v_0
  1357  		v.reset(OpPPC64NOR)
  1358  		v.AddArg2(x, x)
  1359  		return true
  1360  	}
  1361  }
  1362  func rewriteValuePPC64_OpCondSelect(v *Value) bool {
  1363  	v_2 := v.Args[2]
  1364  	v_1 := v.Args[1]
  1365  	v_0 := v.Args[0]
  1366  	b := v.Block
  1367  	typ := &b.Func.Config.Types
  1368  	// match: (CondSelect x y (SETBC [a] cmp))
  1369  	// result: (ISEL [a] x y cmp)
  1370  	for {
  1371  		x := v_0
  1372  		y := v_1
  1373  		if v_2.Op != OpPPC64SETBC {
  1374  			break
  1375  		}
  1376  		a := auxIntToInt32(v_2.AuxInt)
  1377  		cmp := v_2.Args[0]
  1378  		v.reset(OpPPC64ISEL)
  1379  		v.AuxInt = int32ToAuxInt(a)
  1380  		v.AddArg3(x, y, cmp)
  1381  		return true
  1382  	}
  1383  	// match: (CondSelect x y (SETBCR [a] cmp))
  1384  	// result: (ISEL [a+4] x y cmp)
  1385  	for {
  1386  		x := v_0
  1387  		y := v_1
  1388  		if v_2.Op != OpPPC64SETBCR {
  1389  			break
  1390  		}
  1391  		a := auxIntToInt32(v_2.AuxInt)
  1392  		cmp := v_2.Args[0]
  1393  		v.reset(OpPPC64ISEL)
  1394  		v.AuxInt = int32ToAuxInt(a + 4)
  1395  		v.AddArg3(x, y, cmp)
  1396  		return true
  1397  	}
  1398  	// match: (CondSelect x y bool)
  1399  	// cond: flagArg(bool) == nil
  1400  	// result: (ISEL [6] x y (Select1 <types.TypeFlags> (ANDCCconst [1] bool)))
  1401  	for {
  1402  		x := v_0
  1403  		y := v_1
  1404  		bool := v_2
  1405  		if !(flagArg(bool) == nil) {
  1406  			break
  1407  		}
  1408  		v.reset(OpPPC64ISEL)
  1409  		v.AuxInt = int32ToAuxInt(6)
  1410  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
  1411  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  1412  		v1.AuxInt = int64ToAuxInt(1)
  1413  		v1.AddArg(bool)
  1414  		v0.AddArg(v1)
  1415  		v.AddArg3(x, y, v0)
  1416  		return true
  1417  	}
  1418  	return false
  1419  }
  1420  func rewriteValuePPC64_OpConst16(v *Value) bool {
  1421  	// match: (Const16 [val])
  1422  	// result: (MOVDconst [int64(val)])
  1423  	for {
  1424  		val := auxIntToInt16(v.AuxInt)
  1425  		v.reset(OpPPC64MOVDconst)
  1426  		v.AuxInt = int64ToAuxInt(int64(val))
  1427  		return true
  1428  	}
  1429  }
  1430  func rewriteValuePPC64_OpConst32(v *Value) bool {
  1431  	// match: (Const32 [val])
  1432  	// result: (MOVDconst [int64(val)])
  1433  	for {
  1434  		val := auxIntToInt32(v.AuxInt)
  1435  		v.reset(OpPPC64MOVDconst)
  1436  		v.AuxInt = int64ToAuxInt(int64(val))
  1437  		return true
  1438  	}
  1439  }
  1440  func rewriteValuePPC64_OpConst64(v *Value) bool {
  1441  	// match: (Const64 [val])
  1442  	// result: (MOVDconst [int64(val)])
  1443  	for {
  1444  		val := auxIntToInt64(v.AuxInt)
  1445  		v.reset(OpPPC64MOVDconst)
  1446  		v.AuxInt = int64ToAuxInt(int64(val))
  1447  		return true
  1448  	}
  1449  }
  1450  func rewriteValuePPC64_OpConst8(v *Value) bool {
  1451  	// match: (Const8 [val])
  1452  	// result: (MOVDconst [int64(val)])
  1453  	for {
  1454  		val := auxIntToInt8(v.AuxInt)
  1455  		v.reset(OpPPC64MOVDconst)
  1456  		v.AuxInt = int64ToAuxInt(int64(val))
  1457  		return true
  1458  	}
  1459  }
  1460  func rewriteValuePPC64_OpConstBool(v *Value) bool {
  1461  	// match: (ConstBool [t])
  1462  	// result: (MOVDconst [b2i(t)])
  1463  	for {
  1464  		t := auxIntToBool(v.AuxInt)
  1465  		v.reset(OpPPC64MOVDconst)
  1466  		v.AuxInt = int64ToAuxInt(b2i(t))
  1467  		return true
  1468  	}
  1469  }
  1470  func rewriteValuePPC64_OpConstNil(v *Value) bool {
  1471  	// match: (ConstNil)
  1472  	// result: (MOVDconst [0])
  1473  	for {
  1474  		v.reset(OpPPC64MOVDconst)
  1475  		v.AuxInt = int64ToAuxInt(0)
  1476  		return true
  1477  	}
  1478  }
  1479  func rewriteValuePPC64_OpCopysign(v *Value) bool {
  1480  	v_1 := v.Args[1]
  1481  	v_0 := v.Args[0]
  1482  	// match: (Copysign x y)
  1483  	// result: (FCPSGN y x)
  1484  	for {
  1485  		x := v_0
  1486  		y := v_1
  1487  		v.reset(OpPPC64FCPSGN)
  1488  		v.AddArg2(y, x)
  1489  		return true
  1490  	}
  1491  }
  1492  func rewriteValuePPC64_OpCtz16(v *Value) bool {
  1493  	v_0 := v.Args[0]
  1494  	b := v.Block
  1495  	typ := &b.Func.Config.Types
  1496  	// match: (Ctz16 x)
  1497  	// result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x)))
  1498  	for {
  1499  		x := v_0
  1500  		v.reset(OpPPC64POPCNTW)
  1501  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  1502  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
  1503  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
  1504  		v2.AuxInt = int64ToAuxInt(-1)
  1505  		v2.AddArg(x)
  1506  		v1.AddArg2(v2, x)
  1507  		v0.AddArg(v1)
  1508  		v.AddArg(v0)
  1509  		return true
  1510  	}
  1511  }
  1512  func rewriteValuePPC64_OpCtz32(v *Value) bool {
  1513  	v_0 := v.Args[0]
  1514  	b := v.Block
  1515  	typ := &b.Func.Config.Types
  1516  	// match: (Ctz32 x)
  1517  	// cond: buildcfg.GOPPC64<=8
  1518  	// result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x)))
  1519  	for {
  1520  		x := v_0
  1521  		if !(buildcfg.GOPPC64 <= 8) {
  1522  			break
  1523  		}
  1524  		v.reset(OpPPC64POPCNTW)
  1525  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1526  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
  1527  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
  1528  		v2.AuxInt = int64ToAuxInt(-1)
  1529  		v2.AddArg(x)
  1530  		v1.AddArg2(v2, x)
  1531  		v0.AddArg(v1)
  1532  		v.AddArg(v0)
  1533  		return true
  1534  	}
  1535  	// match: (Ctz32 x)
  1536  	// result: (CNTTZW (MOVWZreg x))
  1537  	for {
  1538  		x := v_0
  1539  		v.reset(OpPPC64CNTTZW)
  1540  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1541  		v0.AddArg(x)
  1542  		v.AddArg(v0)
  1543  		return true
  1544  	}
  1545  }
  1546  func rewriteValuePPC64_OpCtz64(v *Value) bool {
  1547  	v_0 := v.Args[0]
  1548  	b := v.Block
  1549  	typ := &b.Func.Config.Types
  1550  	// match: (Ctz64 x)
  1551  	// cond: buildcfg.GOPPC64<=8
  1552  	// result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x))
  1553  	for {
  1554  		x := v_0
  1555  		if !(buildcfg.GOPPC64 <= 8) {
  1556  			break
  1557  		}
  1558  		v.reset(OpPPC64POPCNTD)
  1559  		v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
  1560  		v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
  1561  		v1.AuxInt = int64ToAuxInt(-1)
  1562  		v1.AddArg(x)
  1563  		v0.AddArg2(v1, x)
  1564  		v.AddArg(v0)
  1565  		return true
  1566  	}
  1567  	// match: (Ctz64 x)
  1568  	// result: (CNTTZD x)
  1569  	for {
  1570  		x := v_0
  1571  		v.reset(OpPPC64CNTTZD)
  1572  		v.AddArg(x)
  1573  		return true
  1574  	}
  1575  }
  1576  func rewriteValuePPC64_OpCtz8(v *Value) bool {
  1577  	v_0 := v.Args[0]
  1578  	b := v.Block
  1579  	typ := &b.Func.Config.Types
  1580  	// match: (Ctz8 x)
  1581  	// result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x)))
  1582  	for {
  1583  		x := v_0
  1584  		v.reset(OpPPC64POPCNTB)
  1585  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  1586  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
  1587  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
  1588  		v2.AuxInt = int64ToAuxInt(-1)
  1589  		v2.AddArg(x)
  1590  		v1.AddArg2(v2, x)
  1591  		v0.AddArg(v1)
  1592  		v.AddArg(v0)
  1593  		return true
  1594  	}
  1595  }
  1596  func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
  1597  	v_0 := v.Args[0]
  1598  	b := v.Block
  1599  	typ := &b.Func.Config.Types
  1600  	// match: (Cvt32Fto32 x)
  1601  	// result: (MFVSRD (FCTIWZ x))
  1602  	for {
  1603  		x := v_0
  1604  		v.reset(OpPPC64MFVSRD)
  1605  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1606  		v0.AddArg(x)
  1607  		v.AddArg(v0)
  1608  		return true
  1609  	}
  1610  }
  1611  func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
  1612  	v_0 := v.Args[0]
  1613  	b := v.Block
  1614  	typ := &b.Func.Config.Types
  1615  	// match: (Cvt32Fto64 x)
  1616  	// result: (MFVSRD (FCTIDZ x))
  1617  	for {
  1618  		x := v_0
  1619  		v.reset(OpPPC64MFVSRD)
  1620  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1621  		v0.AddArg(x)
  1622  		v.AddArg(v0)
  1623  		return true
  1624  	}
  1625  }
  1626  func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
  1627  	v_0 := v.Args[0]
  1628  	b := v.Block
  1629  	typ := &b.Func.Config.Types
  1630  	// match: (Cvt32to32F x)
  1631  	// result: (FCFIDS (MTVSRD (SignExt32to64 x)))
  1632  	for {
  1633  		x := v_0
  1634  		v.reset(OpPPC64FCFIDS)
  1635  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1636  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1637  		v1.AddArg(x)
  1638  		v0.AddArg(v1)
  1639  		v.AddArg(v0)
  1640  		return true
  1641  	}
  1642  }
  1643  func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
  1644  	v_0 := v.Args[0]
  1645  	b := v.Block
  1646  	typ := &b.Func.Config.Types
  1647  	// match: (Cvt32to64F x)
  1648  	// result: (FCFID (MTVSRD (SignExt32to64 x)))
  1649  	for {
  1650  		x := v_0
  1651  		v.reset(OpPPC64FCFID)
  1652  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1653  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1654  		v1.AddArg(x)
  1655  		v0.AddArg(v1)
  1656  		v.AddArg(v0)
  1657  		return true
  1658  	}
  1659  }
  1660  func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
  1661  	v_0 := v.Args[0]
  1662  	b := v.Block
  1663  	typ := &b.Func.Config.Types
  1664  	// match: (Cvt64Fto32 x)
  1665  	// result: (MFVSRD (FCTIWZ x))
  1666  	for {
  1667  		x := v_0
  1668  		v.reset(OpPPC64MFVSRD)
  1669  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1670  		v0.AddArg(x)
  1671  		v.AddArg(v0)
  1672  		return true
  1673  	}
  1674  }
  1675  func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
  1676  	v_0 := v.Args[0]
  1677  	b := v.Block
  1678  	typ := &b.Func.Config.Types
  1679  	// match: (Cvt64Fto64 x)
  1680  	// result: (MFVSRD (FCTIDZ x))
  1681  	for {
  1682  		x := v_0
  1683  		v.reset(OpPPC64MFVSRD)
  1684  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1685  		v0.AddArg(x)
  1686  		v.AddArg(v0)
  1687  		return true
  1688  	}
  1689  }
  1690  func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
  1691  	v_0 := v.Args[0]
  1692  	b := v.Block
  1693  	typ := &b.Func.Config.Types
  1694  	// match: (Cvt64to32F x)
  1695  	// result: (FCFIDS (MTVSRD x))
  1696  	for {
  1697  		x := v_0
  1698  		v.reset(OpPPC64FCFIDS)
  1699  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1700  		v0.AddArg(x)
  1701  		v.AddArg(v0)
  1702  		return true
  1703  	}
  1704  }
  1705  func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
  1706  	v_0 := v.Args[0]
  1707  	b := v.Block
  1708  	typ := &b.Func.Config.Types
  1709  	// match: (Cvt64to64F x)
  1710  	// result: (FCFID (MTVSRD x))
  1711  	for {
  1712  		x := v_0
  1713  		v.reset(OpPPC64FCFID)
  1714  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1715  		v0.AddArg(x)
  1716  		v.AddArg(v0)
  1717  		return true
  1718  	}
  1719  }
  1720  func rewriteValuePPC64_OpDiv16(v *Value) bool {
  1721  	v_1 := v.Args[1]
  1722  	v_0 := v.Args[0]
  1723  	b := v.Block
  1724  	typ := &b.Func.Config.Types
  1725  	// match: (Div16 [false] x y)
  1726  	// result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
  1727  	for {
  1728  		if auxIntToBool(v.AuxInt) != false {
  1729  			break
  1730  		}
  1731  		x := v_0
  1732  		y := v_1
  1733  		v.reset(OpPPC64DIVW)
  1734  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1735  		v0.AddArg(x)
  1736  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1737  		v1.AddArg(y)
  1738  		v.AddArg2(v0, v1)
  1739  		return true
  1740  	}
  1741  	return false
  1742  }
  1743  func rewriteValuePPC64_OpDiv16u(v *Value) bool {
  1744  	v_1 := v.Args[1]
  1745  	v_0 := v.Args[0]
  1746  	b := v.Block
  1747  	typ := &b.Func.Config.Types
  1748  	// match: (Div16u x y)
  1749  	// result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
  1750  	for {
  1751  		x := v_0
  1752  		y := v_1
  1753  		v.reset(OpPPC64DIVWU)
  1754  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1755  		v0.AddArg(x)
  1756  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1757  		v1.AddArg(y)
  1758  		v.AddArg2(v0, v1)
  1759  		return true
  1760  	}
  1761  }
  1762  func rewriteValuePPC64_OpDiv32(v *Value) bool {
  1763  	v_1 := v.Args[1]
  1764  	v_0 := v.Args[0]
  1765  	// match: (Div32 [false] x y)
  1766  	// result: (DIVW x y)
  1767  	for {
  1768  		if auxIntToBool(v.AuxInt) != false {
  1769  			break
  1770  		}
  1771  		x := v_0
  1772  		y := v_1
  1773  		v.reset(OpPPC64DIVW)
  1774  		v.AddArg2(x, y)
  1775  		return true
  1776  	}
  1777  	return false
  1778  }
  1779  func rewriteValuePPC64_OpDiv64(v *Value) bool {
  1780  	v_1 := v.Args[1]
  1781  	v_0 := v.Args[0]
  1782  	// match: (Div64 [false] x y)
  1783  	// result: (DIVD x y)
  1784  	for {
  1785  		if auxIntToBool(v.AuxInt) != false {
  1786  			break
  1787  		}
  1788  		x := v_0
  1789  		y := v_1
  1790  		v.reset(OpPPC64DIVD)
  1791  		v.AddArg2(x, y)
  1792  		return true
  1793  	}
  1794  	return false
  1795  }
  1796  func rewriteValuePPC64_OpDiv8(v *Value) bool {
  1797  	v_1 := v.Args[1]
  1798  	v_0 := v.Args[0]
  1799  	b := v.Block
  1800  	typ := &b.Func.Config.Types
  1801  	// match: (Div8 x y)
  1802  	// result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
  1803  	for {
  1804  		x := v_0
  1805  		y := v_1
  1806  		v.reset(OpPPC64DIVW)
  1807  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1808  		v0.AddArg(x)
  1809  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1810  		v1.AddArg(y)
  1811  		v.AddArg2(v0, v1)
  1812  		return true
  1813  	}
  1814  }
  1815  func rewriteValuePPC64_OpDiv8u(v *Value) bool {
  1816  	v_1 := v.Args[1]
  1817  	v_0 := v.Args[0]
  1818  	b := v.Block
  1819  	typ := &b.Func.Config.Types
  1820  	// match: (Div8u x y)
  1821  	// result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
  1822  	for {
  1823  		x := v_0
  1824  		y := v_1
  1825  		v.reset(OpPPC64DIVWU)
  1826  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1827  		v0.AddArg(x)
  1828  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1829  		v1.AddArg(y)
  1830  		v.AddArg2(v0, v1)
  1831  		return true
  1832  	}
  1833  }
  1834  func rewriteValuePPC64_OpEq16(v *Value) bool {
  1835  	v_1 := v.Args[1]
  1836  	v_0 := v.Args[0]
  1837  	b := v.Block
  1838  	typ := &b.Func.Config.Types
  1839  	// match: (Eq16 x y)
  1840  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  1841  	// result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  1842  	for {
  1843  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1844  			x := v_0
  1845  			y := v_1
  1846  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  1847  				continue
  1848  			}
  1849  			v.reset(OpPPC64Equal)
  1850  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1851  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1852  			v1.AddArg(x)
  1853  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1854  			v2.AddArg(y)
  1855  			v0.AddArg2(v1, v2)
  1856  			v.AddArg(v0)
  1857  			return true
  1858  		}
  1859  		break
  1860  	}
  1861  	// match: (Eq16 x y)
  1862  	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1863  	for {
  1864  		x := v_0
  1865  		y := v_1
  1866  		v.reset(OpPPC64Equal)
  1867  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1868  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1869  		v1.AddArg(x)
  1870  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1871  		v2.AddArg(y)
  1872  		v0.AddArg2(v1, v2)
  1873  		v.AddArg(v0)
  1874  		return true
  1875  	}
  1876  }
  1877  func rewriteValuePPC64_OpEq32(v *Value) bool {
  1878  	v_1 := v.Args[1]
  1879  	v_0 := v.Args[0]
  1880  	b := v.Block
  1881  	// match: (Eq32 x y)
  1882  	// result: (Equal (CMPW x y))
  1883  	for {
  1884  		x := v_0
  1885  		y := v_1
  1886  		v.reset(OpPPC64Equal)
  1887  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1888  		v0.AddArg2(x, y)
  1889  		v.AddArg(v0)
  1890  		return true
  1891  	}
  1892  }
  1893  func rewriteValuePPC64_OpEq32F(v *Value) bool {
  1894  	v_1 := v.Args[1]
  1895  	v_0 := v.Args[0]
  1896  	b := v.Block
  1897  	// match: (Eq32F x y)
  1898  	// result: (Equal (FCMPU x y))
  1899  	for {
  1900  		x := v_0
  1901  		y := v_1
  1902  		v.reset(OpPPC64Equal)
  1903  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  1904  		v0.AddArg2(x, y)
  1905  		v.AddArg(v0)
  1906  		return true
  1907  	}
  1908  }
  1909  func rewriteValuePPC64_OpEq64(v *Value) bool {
  1910  	v_1 := v.Args[1]
  1911  	v_0 := v.Args[0]
  1912  	b := v.Block
  1913  	// match: (Eq64 x y)
  1914  	// result: (Equal (CMP x y))
  1915  	for {
  1916  		x := v_0
  1917  		y := v_1
  1918  		v.reset(OpPPC64Equal)
  1919  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  1920  		v0.AddArg2(x, y)
  1921  		v.AddArg(v0)
  1922  		return true
  1923  	}
  1924  }
  1925  func rewriteValuePPC64_OpEq64F(v *Value) bool {
  1926  	v_1 := v.Args[1]
  1927  	v_0 := v.Args[0]
  1928  	b := v.Block
  1929  	// match: (Eq64F x y)
  1930  	// result: (Equal (FCMPU x y))
  1931  	for {
  1932  		x := v_0
  1933  		y := v_1
  1934  		v.reset(OpPPC64Equal)
  1935  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  1936  		v0.AddArg2(x, y)
  1937  		v.AddArg(v0)
  1938  		return true
  1939  	}
  1940  }
  1941  func rewriteValuePPC64_OpEq8(v *Value) bool {
  1942  	v_1 := v.Args[1]
  1943  	v_0 := v.Args[0]
  1944  	b := v.Block
  1945  	typ := &b.Func.Config.Types
  1946  	// match: (Eq8 x y)
  1947  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  1948  	// result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  1949  	for {
  1950  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1951  			x := v_0
  1952  			y := v_1
  1953  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  1954  				continue
  1955  			}
  1956  			v.reset(OpPPC64Equal)
  1957  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1958  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1959  			v1.AddArg(x)
  1960  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1961  			v2.AddArg(y)
  1962  			v0.AddArg2(v1, v2)
  1963  			v.AddArg(v0)
  1964  			return true
  1965  		}
  1966  		break
  1967  	}
  1968  	// match: (Eq8 x y)
  1969  	// result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  1970  	for {
  1971  		x := v_0
  1972  		y := v_1
  1973  		v.reset(OpPPC64Equal)
  1974  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1975  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1976  		v1.AddArg(x)
  1977  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1978  		v2.AddArg(y)
  1979  		v0.AddArg2(v1, v2)
  1980  		v.AddArg(v0)
  1981  		return true
  1982  	}
  1983  }
  1984  func rewriteValuePPC64_OpEqB(v *Value) bool {
  1985  	v_1 := v.Args[1]
  1986  	v_0 := v.Args[0]
  1987  	b := v.Block
  1988  	typ := &b.Func.Config.Types
  1989  	// match: (EqB x y)
  1990  	// result: (Select0 <typ.Int> (ANDCCconst [1] (EQV x y)))
  1991  	for {
  1992  		x := v_0
  1993  		y := v_1
  1994  		v.reset(OpSelect0)
  1995  		v.Type = typ.Int
  1996  		v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  1997  		v0.AuxInt = int64ToAuxInt(1)
  1998  		v1 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
  1999  		v1.AddArg2(x, y)
  2000  		v0.AddArg(v1)
  2001  		v.AddArg(v0)
  2002  		return true
  2003  	}
  2004  }
  2005  func rewriteValuePPC64_OpEqPtr(v *Value) bool {
  2006  	v_1 := v.Args[1]
  2007  	v_0 := v.Args[0]
  2008  	b := v.Block
  2009  	// match: (EqPtr x y)
  2010  	// result: (Equal (CMP x y))
  2011  	for {
  2012  		x := v_0
  2013  		y := v_1
  2014  		v.reset(OpPPC64Equal)
  2015  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2016  		v0.AddArg2(x, y)
  2017  		v.AddArg(v0)
  2018  		return true
  2019  	}
  2020  }
  2021  func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
  2022  	v_1 := v.Args[1]
  2023  	v_0 := v.Args[0]
  2024  	b := v.Block
  2025  	// match: (IsInBounds idx len)
  2026  	// result: (LessThan (CMPU idx len))
  2027  	for {
  2028  		idx := v_0
  2029  		len := v_1
  2030  		v.reset(OpPPC64LessThan)
  2031  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2032  		v0.AddArg2(idx, len)
  2033  		v.AddArg(v0)
  2034  		return true
  2035  	}
  2036  }
  2037  func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
  2038  	v_0 := v.Args[0]
  2039  	b := v.Block
  2040  	// match: (IsNonNil ptr)
  2041  	// result: (NotEqual (CMPconst [0] ptr))
  2042  	for {
  2043  		ptr := v_0
  2044  		v.reset(OpPPC64NotEqual)
  2045  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2046  		v0.AuxInt = int64ToAuxInt(0)
  2047  		v0.AddArg(ptr)
  2048  		v.AddArg(v0)
  2049  		return true
  2050  	}
  2051  }
  2052  func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
  2053  	v_1 := v.Args[1]
  2054  	v_0 := v.Args[0]
  2055  	b := v.Block
  2056  	// match: (IsSliceInBounds idx len)
  2057  	// result: (LessEqual (CMPU idx len))
  2058  	for {
  2059  		idx := v_0
  2060  		len := v_1
  2061  		v.reset(OpPPC64LessEqual)
  2062  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2063  		v0.AddArg2(idx, len)
  2064  		v.AddArg(v0)
  2065  		return true
  2066  	}
  2067  }
  2068  func rewriteValuePPC64_OpLeq16(v *Value) bool {
  2069  	v_1 := v.Args[1]
  2070  	v_0 := v.Args[0]
  2071  	b := v.Block
  2072  	typ := &b.Func.Config.Types
  2073  	// match: (Leq16 x y)
  2074  	// result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2075  	for {
  2076  		x := v_0
  2077  		y := v_1
  2078  		v.reset(OpPPC64LessEqual)
  2079  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2080  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2081  		v1.AddArg(x)
  2082  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2083  		v2.AddArg(y)
  2084  		v0.AddArg2(v1, v2)
  2085  		v.AddArg(v0)
  2086  		return true
  2087  	}
  2088  }
  2089  func rewriteValuePPC64_OpLeq16U(v *Value) bool {
  2090  	v_1 := v.Args[1]
  2091  	v_0 := v.Args[0]
  2092  	b := v.Block
  2093  	typ := &b.Func.Config.Types
  2094  	// match: (Leq16U x y)
  2095  	// result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2096  	for {
  2097  		x := v_0
  2098  		y := v_1
  2099  		v.reset(OpPPC64LessEqual)
  2100  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2101  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2102  		v1.AddArg(x)
  2103  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2104  		v2.AddArg(y)
  2105  		v0.AddArg2(v1, v2)
  2106  		v.AddArg(v0)
  2107  		return true
  2108  	}
  2109  }
  2110  func rewriteValuePPC64_OpLeq32(v *Value) bool {
  2111  	v_1 := v.Args[1]
  2112  	v_0 := v.Args[0]
  2113  	b := v.Block
  2114  	// match: (Leq32 x y)
  2115  	// result: (LessEqual (CMPW x y))
  2116  	for {
  2117  		x := v_0
  2118  		y := v_1
  2119  		v.reset(OpPPC64LessEqual)
  2120  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2121  		v0.AddArg2(x, y)
  2122  		v.AddArg(v0)
  2123  		return true
  2124  	}
  2125  }
  2126  func rewriteValuePPC64_OpLeq32F(v *Value) bool {
  2127  	v_1 := v.Args[1]
  2128  	v_0 := v.Args[0]
  2129  	b := v.Block
  2130  	// match: (Leq32F x y)
  2131  	// result: (FLessEqual (FCMPU x y))
  2132  	for {
  2133  		x := v_0
  2134  		y := v_1
  2135  		v.reset(OpPPC64FLessEqual)
  2136  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2137  		v0.AddArg2(x, y)
  2138  		v.AddArg(v0)
  2139  		return true
  2140  	}
  2141  }
  2142  func rewriteValuePPC64_OpLeq32U(v *Value) bool {
  2143  	v_1 := v.Args[1]
  2144  	v_0 := v.Args[0]
  2145  	b := v.Block
  2146  	// match: (Leq32U x y)
  2147  	// result: (LessEqual (CMPWU x y))
  2148  	for {
  2149  		x := v_0
  2150  		y := v_1
  2151  		v.reset(OpPPC64LessEqual)
  2152  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2153  		v0.AddArg2(x, y)
  2154  		v.AddArg(v0)
  2155  		return true
  2156  	}
  2157  }
  2158  func rewriteValuePPC64_OpLeq64(v *Value) bool {
  2159  	v_1 := v.Args[1]
  2160  	v_0 := v.Args[0]
  2161  	b := v.Block
  2162  	// match: (Leq64 x y)
  2163  	// result: (LessEqual (CMP x y))
  2164  	for {
  2165  		x := v_0
  2166  		y := v_1
  2167  		v.reset(OpPPC64LessEqual)
  2168  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2169  		v0.AddArg2(x, y)
  2170  		v.AddArg(v0)
  2171  		return true
  2172  	}
  2173  }
  2174  func rewriteValuePPC64_OpLeq64F(v *Value) bool {
  2175  	v_1 := v.Args[1]
  2176  	v_0 := v.Args[0]
  2177  	b := v.Block
  2178  	// match: (Leq64F x y)
  2179  	// result: (FLessEqual (FCMPU x y))
  2180  	for {
  2181  		x := v_0
  2182  		y := v_1
  2183  		v.reset(OpPPC64FLessEqual)
  2184  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2185  		v0.AddArg2(x, y)
  2186  		v.AddArg(v0)
  2187  		return true
  2188  	}
  2189  }
  2190  func rewriteValuePPC64_OpLeq64U(v *Value) bool {
  2191  	v_1 := v.Args[1]
  2192  	v_0 := v.Args[0]
  2193  	b := v.Block
  2194  	// match: (Leq64U x y)
  2195  	// result: (LessEqual (CMPU x y))
  2196  	for {
  2197  		x := v_0
  2198  		y := v_1
  2199  		v.reset(OpPPC64LessEqual)
  2200  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2201  		v0.AddArg2(x, y)
  2202  		v.AddArg(v0)
  2203  		return true
  2204  	}
  2205  }
  2206  func rewriteValuePPC64_OpLeq8(v *Value) bool {
  2207  	v_1 := v.Args[1]
  2208  	v_0 := v.Args[0]
  2209  	b := v.Block
  2210  	typ := &b.Func.Config.Types
  2211  	// match: (Leq8 x y)
  2212  	// result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2213  	for {
  2214  		x := v_0
  2215  		y := v_1
  2216  		v.reset(OpPPC64LessEqual)
  2217  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2218  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2219  		v1.AddArg(x)
  2220  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2221  		v2.AddArg(y)
  2222  		v0.AddArg2(v1, v2)
  2223  		v.AddArg(v0)
  2224  		return true
  2225  	}
  2226  }
  2227  func rewriteValuePPC64_OpLeq8U(v *Value) bool {
  2228  	v_1 := v.Args[1]
  2229  	v_0 := v.Args[0]
  2230  	b := v.Block
  2231  	typ := &b.Func.Config.Types
  2232  	// match: (Leq8U x y)
  2233  	// result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2234  	for {
  2235  		x := v_0
  2236  		y := v_1
  2237  		v.reset(OpPPC64LessEqual)
  2238  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2239  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2240  		v1.AddArg(x)
  2241  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2242  		v2.AddArg(y)
  2243  		v0.AddArg2(v1, v2)
  2244  		v.AddArg(v0)
  2245  		return true
  2246  	}
  2247  }
  2248  func rewriteValuePPC64_OpLess16(v *Value) bool {
  2249  	v_1 := v.Args[1]
  2250  	v_0 := v.Args[0]
  2251  	b := v.Block
  2252  	typ := &b.Func.Config.Types
  2253  	// match: (Less16 x y)
  2254  	// result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2255  	for {
  2256  		x := v_0
  2257  		y := v_1
  2258  		v.reset(OpPPC64LessThan)
  2259  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2260  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2261  		v1.AddArg(x)
  2262  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2263  		v2.AddArg(y)
  2264  		v0.AddArg2(v1, v2)
  2265  		v.AddArg(v0)
  2266  		return true
  2267  	}
  2268  }
  2269  func rewriteValuePPC64_OpLess16U(v *Value) bool {
  2270  	v_1 := v.Args[1]
  2271  	v_0 := v.Args[0]
  2272  	b := v.Block
  2273  	typ := &b.Func.Config.Types
  2274  	// match: (Less16U x y)
  2275  	// result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2276  	for {
  2277  		x := v_0
  2278  		y := v_1
  2279  		v.reset(OpPPC64LessThan)
  2280  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2281  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2282  		v1.AddArg(x)
  2283  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2284  		v2.AddArg(y)
  2285  		v0.AddArg2(v1, v2)
  2286  		v.AddArg(v0)
  2287  		return true
  2288  	}
  2289  }
  2290  func rewriteValuePPC64_OpLess32(v *Value) bool {
  2291  	v_1 := v.Args[1]
  2292  	v_0 := v.Args[0]
  2293  	b := v.Block
  2294  	// match: (Less32 x y)
  2295  	// result: (LessThan (CMPW x y))
  2296  	for {
  2297  		x := v_0
  2298  		y := v_1
  2299  		v.reset(OpPPC64LessThan)
  2300  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2301  		v0.AddArg2(x, y)
  2302  		v.AddArg(v0)
  2303  		return true
  2304  	}
  2305  }
  2306  func rewriteValuePPC64_OpLess32F(v *Value) bool {
  2307  	v_1 := v.Args[1]
  2308  	v_0 := v.Args[0]
  2309  	b := v.Block
  2310  	// match: (Less32F x y)
  2311  	// result: (FLessThan (FCMPU x y))
  2312  	for {
  2313  		x := v_0
  2314  		y := v_1
  2315  		v.reset(OpPPC64FLessThan)
  2316  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2317  		v0.AddArg2(x, y)
  2318  		v.AddArg(v0)
  2319  		return true
  2320  	}
  2321  }
  2322  func rewriteValuePPC64_OpLess32U(v *Value) bool {
  2323  	v_1 := v.Args[1]
  2324  	v_0 := v.Args[0]
  2325  	b := v.Block
  2326  	// match: (Less32U x y)
  2327  	// result: (LessThan (CMPWU x y))
  2328  	for {
  2329  		x := v_0
  2330  		y := v_1
  2331  		v.reset(OpPPC64LessThan)
  2332  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2333  		v0.AddArg2(x, y)
  2334  		v.AddArg(v0)
  2335  		return true
  2336  	}
  2337  }
  2338  func rewriteValuePPC64_OpLess64(v *Value) bool {
  2339  	v_1 := v.Args[1]
  2340  	v_0 := v.Args[0]
  2341  	b := v.Block
  2342  	// match: (Less64 x y)
  2343  	// result: (LessThan (CMP x y))
  2344  	for {
  2345  		x := v_0
  2346  		y := v_1
  2347  		v.reset(OpPPC64LessThan)
  2348  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2349  		v0.AddArg2(x, y)
  2350  		v.AddArg(v0)
  2351  		return true
  2352  	}
  2353  }
  2354  func rewriteValuePPC64_OpLess64F(v *Value) bool {
  2355  	v_1 := v.Args[1]
  2356  	v_0 := v.Args[0]
  2357  	b := v.Block
  2358  	// match: (Less64F x y)
  2359  	// result: (FLessThan (FCMPU x y))
  2360  	for {
  2361  		x := v_0
  2362  		y := v_1
  2363  		v.reset(OpPPC64FLessThan)
  2364  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2365  		v0.AddArg2(x, y)
  2366  		v.AddArg(v0)
  2367  		return true
  2368  	}
  2369  }
  2370  func rewriteValuePPC64_OpLess64U(v *Value) bool {
  2371  	v_1 := v.Args[1]
  2372  	v_0 := v.Args[0]
  2373  	b := v.Block
  2374  	// match: (Less64U x y)
  2375  	// result: (LessThan (CMPU x y))
  2376  	for {
  2377  		x := v_0
  2378  		y := v_1
  2379  		v.reset(OpPPC64LessThan)
  2380  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2381  		v0.AddArg2(x, y)
  2382  		v.AddArg(v0)
  2383  		return true
  2384  	}
  2385  }
  2386  func rewriteValuePPC64_OpLess8(v *Value) bool {
  2387  	v_1 := v.Args[1]
  2388  	v_0 := v.Args[0]
  2389  	b := v.Block
  2390  	typ := &b.Func.Config.Types
  2391  	// match: (Less8 x y)
  2392  	// result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2393  	for {
  2394  		x := v_0
  2395  		y := v_1
  2396  		v.reset(OpPPC64LessThan)
  2397  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2398  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2399  		v1.AddArg(x)
  2400  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2401  		v2.AddArg(y)
  2402  		v0.AddArg2(v1, v2)
  2403  		v.AddArg(v0)
  2404  		return true
  2405  	}
  2406  }
  2407  func rewriteValuePPC64_OpLess8U(v *Value) bool {
  2408  	v_1 := v.Args[1]
  2409  	v_0 := v.Args[0]
  2410  	b := v.Block
  2411  	typ := &b.Func.Config.Types
  2412  	// match: (Less8U x y)
  2413  	// result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2414  	for {
  2415  		x := v_0
  2416  		y := v_1
  2417  		v.reset(OpPPC64LessThan)
  2418  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2419  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2420  		v1.AddArg(x)
  2421  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2422  		v2.AddArg(y)
  2423  		v0.AddArg2(v1, v2)
  2424  		v.AddArg(v0)
  2425  		return true
  2426  	}
  2427  }
  2428  func rewriteValuePPC64_OpLoad(v *Value) bool {
  2429  	v_1 := v.Args[1]
  2430  	v_0 := v.Args[0]
  2431  	b := v.Block
  2432  	typ := &b.Func.Config.Types
  2433  	// match: (Load <t> ptr mem)
  2434  	// cond: (is64BitInt(t) || isPtr(t))
  2435  	// result: (MOVDload ptr mem)
  2436  	for {
  2437  		t := v.Type
  2438  		ptr := v_0
  2439  		mem := v_1
  2440  		if !(is64BitInt(t) || isPtr(t)) {
  2441  			break
  2442  		}
  2443  		v.reset(OpPPC64MOVDload)
  2444  		v.AddArg2(ptr, mem)
  2445  		return true
  2446  	}
  2447  	// match: (Load <t> ptr mem)
  2448  	// cond: is32BitInt(t) && t.IsSigned()
  2449  	// result: (MOVWload ptr mem)
  2450  	for {
  2451  		t := v.Type
  2452  		ptr := v_0
  2453  		mem := v_1
  2454  		if !(is32BitInt(t) && t.IsSigned()) {
  2455  			break
  2456  		}
  2457  		v.reset(OpPPC64MOVWload)
  2458  		v.AddArg2(ptr, mem)
  2459  		return true
  2460  	}
  2461  	// match: (Load <t> ptr mem)
  2462  	// cond: is32BitInt(t) && !t.IsSigned()
  2463  	// result: (MOVWZload ptr mem)
  2464  	for {
  2465  		t := v.Type
  2466  		ptr := v_0
  2467  		mem := v_1
  2468  		if !(is32BitInt(t) && !t.IsSigned()) {
  2469  			break
  2470  		}
  2471  		v.reset(OpPPC64MOVWZload)
  2472  		v.AddArg2(ptr, mem)
  2473  		return true
  2474  	}
  2475  	// match: (Load <t> ptr mem)
  2476  	// cond: is16BitInt(t) && t.IsSigned()
  2477  	// result: (MOVHload ptr mem)
  2478  	for {
  2479  		t := v.Type
  2480  		ptr := v_0
  2481  		mem := v_1
  2482  		if !(is16BitInt(t) && t.IsSigned()) {
  2483  			break
  2484  		}
  2485  		v.reset(OpPPC64MOVHload)
  2486  		v.AddArg2(ptr, mem)
  2487  		return true
  2488  	}
  2489  	// match: (Load <t> ptr mem)
  2490  	// cond: is16BitInt(t) && !t.IsSigned()
  2491  	// result: (MOVHZload ptr mem)
  2492  	for {
  2493  		t := v.Type
  2494  		ptr := v_0
  2495  		mem := v_1
  2496  		if !(is16BitInt(t) && !t.IsSigned()) {
  2497  			break
  2498  		}
  2499  		v.reset(OpPPC64MOVHZload)
  2500  		v.AddArg2(ptr, mem)
  2501  		return true
  2502  	}
  2503  	// match: (Load <t> ptr mem)
  2504  	// cond: t.IsBoolean()
  2505  	// result: (MOVBZload ptr mem)
  2506  	for {
  2507  		t := v.Type
  2508  		ptr := v_0
  2509  		mem := v_1
  2510  		if !(t.IsBoolean()) {
  2511  			break
  2512  		}
  2513  		v.reset(OpPPC64MOVBZload)
  2514  		v.AddArg2(ptr, mem)
  2515  		return true
  2516  	}
  2517  	// match: (Load <t> ptr mem)
  2518  	// cond: is8BitInt(t) && t.IsSigned()
  2519  	// result: (MOVBreg (MOVBZload ptr mem))
  2520  	for {
  2521  		t := v.Type
  2522  		ptr := v_0
  2523  		mem := v_1
  2524  		if !(is8BitInt(t) && t.IsSigned()) {
  2525  			break
  2526  		}
  2527  		v.reset(OpPPC64MOVBreg)
  2528  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  2529  		v0.AddArg2(ptr, mem)
  2530  		v.AddArg(v0)
  2531  		return true
  2532  	}
  2533  	// match: (Load <t> ptr mem)
  2534  	// cond: is8BitInt(t) && !t.IsSigned()
  2535  	// result: (MOVBZload ptr mem)
  2536  	for {
  2537  		t := v.Type
  2538  		ptr := v_0
  2539  		mem := v_1
  2540  		if !(is8BitInt(t) && !t.IsSigned()) {
  2541  			break
  2542  		}
  2543  		v.reset(OpPPC64MOVBZload)
  2544  		v.AddArg2(ptr, mem)
  2545  		return true
  2546  	}
  2547  	// match: (Load <t> ptr mem)
  2548  	// cond: is32BitFloat(t)
  2549  	// result: (FMOVSload ptr mem)
  2550  	for {
  2551  		t := v.Type
  2552  		ptr := v_0
  2553  		mem := v_1
  2554  		if !(is32BitFloat(t)) {
  2555  			break
  2556  		}
  2557  		v.reset(OpPPC64FMOVSload)
  2558  		v.AddArg2(ptr, mem)
  2559  		return true
  2560  	}
  2561  	// match: (Load <t> ptr mem)
  2562  	// cond: is64BitFloat(t)
  2563  	// result: (FMOVDload ptr mem)
  2564  	for {
  2565  		t := v.Type
  2566  		ptr := v_0
  2567  		mem := v_1
  2568  		if !(is64BitFloat(t)) {
  2569  			break
  2570  		}
  2571  		v.reset(OpPPC64FMOVDload)
  2572  		v.AddArg2(ptr, mem)
  2573  		return true
  2574  	}
  2575  	return false
  2576  }
  2577  func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
  2578  	v_1 := v.Args[1]
  2579  	v_0 := v.Args[0]
  2580  	b := v.Block
  2581  	typ := &b.Func.Config.Types
  2582  	// match: (LocalAddr <t> {sym} base mem)
  2583  	// cond: t.Elem().HasPointers()
  2584  	// result: (MOVDaddr {sym} (SPanchored base mem))
  2585  	for {
  2586  		t := v.Type
  2587  		sym := auxToSym(v.Aux)
  2588  		base := v_0
  2589  		mem := v_1
  2590  		if !(t.Elem().HasPointers()) {
  2591  			break
  2592  		}
  2593  		v.reset(OpPPC64MOVDaddr)
  2594  		v.Aux = symToAux(sym)
  2595  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  2596  		v0.AddArg2(base, mem)
  2597  		v.AddArg(v0)
  2598  		return true
  2599  	}
  2600  	// match: (LocalAddr <t> {sym} base _)
  2601  	// cond: !t.Elem().HasPointers()
  2602  	// result: (MOVDaddr {sym} base)
  2603  	for {
  2604  		t := v.Type
  2605  		sym := auxToSym(v.Aux)
  2606  		base := v_0
  2607  		if !(!t.Elem().HasPointers()) {
  2608  			break
  2609  		}
  2610  		v.reset(OpPPC64MOVDaddr)
  2611  		v.Aux = symToAux(sym)
  2612  		v.AddArg(base)
  2613  		return true
  2614  	}
  2615  	return false
  2616  }
  2617  func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
  2618  	v_1 := v.Args[1]
  2619  	v_0 := v.Args[0]
  2620  	b := v.Block
  2621  	typ := &b.Func.Config.Types
  2622  	// match: (Lsh16x16 x y)
  2623  	// cond: shiftIsBounded(v)
  2624  	// result: (SLD x y)
  2625  	for {
  2626  		x := v_0
  2627  		y := v_1
  2628  		if !(shiftIsBounded(v)) {
  2629  			break
  2630  		}
  2631  		v.reset(OpPPC64SLD)
  2632  		v.AddArg2(x, y)
  2633  		return true
  2634  	}
  2635  	// match: (Lsh16x16 <t> x y)
  2636  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF0] y)))
  2637  	for {
  2638  		t := v.Type
  2639  		x := v_0
  2640  		y := v_1
  2641  		v.reset(OpPPC64ISEL)
  2642  		v.AuxInt = int32ToAuxInt(2)
  2643  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2644  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2645  		v1.AddArg(x)
  2646  		v0.AddArg2(v1, y)
  2647  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2648  		v2.AuxInt = int64ToAuxInt(0)
  2649  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
  2650  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  2651  		v4.AuxInt = int64ToAuxInt(0xFFF0)
  2652  		v4.AddArg(y)
  2653  		v3.AddArg(v4)
  2654  		v.AddArg3(v0, v2, v3)
  2655  		return true
  2656  	}
  2657  }
  2658  func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
  2659  	v_1 := v.Args[1]
  2660  	v_0 := v.Args[0]
  2661  	b := v.Block
  2662  	typ := &b.Func.Config.Types
  2663  	// match: (Lsh16x32 x y)
  2664  	// cond: shiftIsBounded(v)
  2665  	// result: (SLD x y)
  2666  	for {
  2667  		x := v_0
  2668  		y := v_1
  2669  		if !(shiftIsBounded(v)) {
  2670  			break
  2671  		}
  2672  		v.reset(OpPPC64SLD)
  2673  		v.AddArg2(x, y)
  2674  		return true
  2675  	}
  2676  	// match: (Lsh16x32 <t> x y)
  2677  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
  2678  	for {
  2679  		t := v.Type
  2680  		x := v_0
  2681  		y := v_1
  2682  		v.reset(OpPPC64ISEL)
  2683  		v.AuxInt = int32ToAuxInt(0)
  2684  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2685  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2686  		v1.AddArg(x)
  2687  		v0.AddArg2(v1, y)
  2688  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2689  		v2.AuxInt = int64ToAuxInt(0)
  2690  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2691  		v3.AuxInt = int32ToAuxInt(16)
  2692  		v3.AddArg(y)
  2693  		v.AddArg3(v0, v2, v3)
  2694  		return true
  2695  	}
  2696  }
  2697  func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
  2698  	v_1 := v.Args[1]
  2699  	v_0 := v.Args[0]
  2700  	b := v.Block
  2701  	typ := &b.Func.Config.Types
  2702  	// match: (Lsh16x64 x (MOVDconst [c]))
  2703  	// cond: uint64(c) < 16
  2704  	// result: (SLWconst x [c])
  2705  	for {
  2706  		x := v_0
  2707  		if v_1.Op != OpPPC64MOVDconst {
  2708  			break
  2709  		}
  2710  		c := auxIntToInt64(v_1.AuxInt)
  2711  		if !(uint64(c) < 16) {
  2712  			break
  2713  		}
  2714  		v.reset(OpPPC64SLWconst)
  2715  		v.AuxInt = int64ToAuxInt(c)
  2716  		v.AddArg(x)
  2717  		return true
  2718  	}
  2719  	// match: (Lsh16x64 x y)
  2720  	// cond: shiftIsBounded(v)
  2721  	// result: (SLD x y)
  2722  	for {
  2723  		x := v_0
  2724  		y := v_1
  2725  		if !(shiftIsBounded(v)) {
  2726  			break
  2727  		}
  2728  		v.reset(OpPPC64SLD)
  2729  		v.AddArg2(x, y)
  2730  		return true
  2731  	}
  2732  	// match: (Lsh16x64 <t> x y)
  2733  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
  2734  	for {
  2735  		t := v.Type
  2736  		x := v_0
  2737  		y := v_1
  2738  		v.reset(OpPPC64ISEL)
  2739  		v.AuxInt = int32ToAuxInt(0)
  2740  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2741  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2742  		v1.AddArg(x)
  2743  		v0.AddArg2(v1, y)
  2744  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2745  		v2.AuxInt = int64ToAuxInt(0)
  2746  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  2747  		v3.AuxInt = int64ToAuxInt(16)
  2748  		v3.AddArg(y)
  2749  		v.AddArg3(v0, v2, v3)
  2750  		return true
  2751  	}
  2752  }
  2753  func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
  2754  	v_1 := v.Args[1]
  2755  	v_0 := v.Args[0]
  2756  	b := v.Block
  2757  	typ := &b.Func.Config.Types
  2758  	// match: (Lsh16x8 x y)
  2759  	// cond: shiftIsBounded(v)
  2760  	// result: (SLD x y)
  2761  	for {
  2762  		x := v_0
  2763  		y := v_1
  2764  		if !(shiftIsBounded(v)) {
  2765  			break
  2766  		}
  2767  		v.reset(OpPPC64SLD)
  2768  		v.AddArg2(x, y)
  2769  		return true
  2770  	}
  2771  	// match: (Lsh16x8 <t> x y)
  2772  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F0] y)))
  2773  	for {
  2774  		t := v.Type
  2775  		x := v_0
  2776  		y := v_1
  2777  		v.reset(OpPPC64ISEL)
  2778  		v.AuxInt = int32ToAuxInt(2)
  2779  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2780  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2781  		v1.AddArg(x)
  2782  		v0.AddArg2(v1, y)
  2783  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2784  		v2.AuxInt = int64ToAuxInt(0)
  2785  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
  2786  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  2787  		v4.AuxInt = int64ToAuxInt(0x00F0)
  2788  		v4.AddArg(y)
  2789  		v3.AddArg(v4)
  2790  		v.AddArg3(v0, v2, v3)
  2791  		return true
  2792  	}
  2793  }
  2794  func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
  2795  	v_1 := v.Args[1]
  2796  	v_0 := v.Args[0]
  2797  	b := v.Block
  2798  	typ := &b.Func.Config.Types
  2799  	// match: (Lsh32x16 x y)
  2800  	// cond: shiftIsBounded(v)
  2801  	// result: (SLW x y)
  2802  	for {
  2803  		x := v_0
  2804  		y := v_1
  2805  		if !(shiftIsBounded(v)) {
  2806  			break
  2807  		}
  2808  		v.reset(OpPPC64SLW)
  2809  		v.AddArg2(x, y)
  2810  		return true
  2811  	}
  2812  	// match: (Lsh32x16 <t> x y)
  2813  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFE0] y)))
  2814  	for {
  2815  		t := v.Type
  2816  		x := v_0
  2817  		y := v_1
  2818  		v.reset(OpPPC64ISEL)
  2819  		v.AuxInt = int32ToAuxInt(2)
  2820  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2821  		v0.AddArg2(x, y)
  2822  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2823  		v1.AuxInt = int64ToAuxInt(0)
  2824  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
  2825  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  2826  		v3.AuxInt = int64ToAuxInt(0xFFE0)
  2827  		v3.AddArg(y)
  2828  		v2.AddArg(v3)
  2829  		v.AddArg3(v0, v1, v2)
  2830  		return true
  2831  	}
  2832  }
  2833  func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
  2834  	v_1 := v.Args[1]
  2835  	v_0 := v.Args[0]
  2836  	b := v.Block
  2837  	typ := &b.Func.Config.Types
  2838  	// match: (Lsh32x32 x y)
  2839  	// cond: shiftIsBounded(v)
  2840  	// result: (SLW x y)
  2841  	for {
  2842  		x := v_0
  2843  		y := v_1
  2844  		if !(shiftIsBounded(v)) {
  2845  			break
  2846  		}
  2847  		v.reset(OpPPC64SLW)
  2848  		v.AddArg2(x, y)
  2849  		return true
  2850  	}
  2851  	// match: (Lsh32x32 <t> x y)
  2852  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
  2853  	for {
  2854  		t := v.Type
  2855  		x := v_0
  2856  		y := v_1
  2857  		v.reset(OpPPC64ISEL)
  2858  		v.AuxInt = int32ToAuxInt(0)
  2859  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2860  		v0.AddArg2(x, y)
  2861  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2862  		v1.AuxInt = int64ToAuxInt(0)
  2863  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2864  		v2.AuxInt = int32ToAuxInt(32)
  2865  		v2.AddArg(y)
  2866  		v.AddArg3(v0, v1, v2)
  2867  		return true
  2868  	}
  2869  }
  2870  func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
  2871  	v_1 := v.Args[1]
  2872  	v_0 := v.Args[0]
  2873  	b := v.Block
  2874  	typ := &b.Func.Config.Types
  2875  	// match: (Lsh32x64 x (MOVDconst [c]))
  2876  	// cond: uint64(c) < 32
  2877  	// result: (SLWconst x [c])
  2878  	for {
  2879  		x := v_0
  2880  		if v_1.Op != OpPPC64MOVDconst {
  2881  			break
  2882  		}
  2883  		c := auxIntToInt64(v_1.AuxInt)
  2884  		if !(uint64(c) < 32) {
  2885  			break
  2886  		}
  2887  		v.reset(OpPPC64SLWconst)
  2888  		v.AuxInt = int64ToAuxInt(c)
  2889  		v.AddArg(x)
  2890  		return true
  2891  	}
  2892  	// match: (Lsh32x64 x y)
  2893  	// cond: shiftIsBounded(v)
  2894  	// result: (SLW x y)
  2895  	for {
  2896  		x := v_0
  2897  		y := v_1
  2898  		if !(shiftIsBounded(v)) {
  2899  			break
  2900  		}
  2901  		v.reset(OpPPC64SLW)
  2902  		v.AddArg2(x, y)
  2903  		return true
  2904  	}
  2905  	// match: (Lsh32x64 <t> x y)
  2906  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
  2907  	for {
  2908  		t := v.Type
  2909  		x := v_0
  2910  		y := v_1
  2911  		v.reset(OpPPC64ISEL)
  2912  		v.AuxInt = int32ToAuxInt(0)
  2913  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2914  		v0.AddArg2(x, y)
  2915  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2916  		v1.AuxInt = int64ToAuxInt(0)
  2917  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  2918  		v2.AuxInt = int64ToAuxInt(32)
  2919  		v2.AddArg(y)
  2920  		v.AddArg3(v0, v1, v2)
  2921  		return true
  2922  	}
  2923  }
  2924  func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
  2925  	v_1 := v.Args[1]
  2926  	v_0 := v.Args[0]
  2927  	b := v.Block
  2928  	typ := &b.Func.Config.Types
  2929  	// match: (Lsh32x8 x y)
  2930  	// cond: shiftIsBounded(v)
  2931  	// result: (SLW x y)
  2932  	for {
  2933  		x := v_0
  2934  		y := v_1
  2935  		if !(shiftIsBounded(v)) {
  2936  			break
  2937  		}
  2938  		v.reset(OpPPC64SLW)
  2939  		v.AddArg2(x, y)
  2940  		return true
  2941  	}
  2942  	// match: (Lsh32x8 <t> x y)
  2943  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00E0] y)))
  2944  	for {
  2945  		t := v.Type
  2946  		x := v_0
  2947  		y := v_1
  2948  		v.reset(OpPPC64ISEL)
  2949  		v.AuxInt = int32ToAuxInt(2)
  2950  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2951  		v0.AddArg2(x, y)
  2952  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2953  		v1.AuxInt = int64ToAuxInt(0)
  2954  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
  2955  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  2956  		v3.AuxInt = int64ToAuxInt(0x00E0)
  2957  		v3.AddArg(y)
  2958  		v2.AddArg(v3)
  2959  		v.AddArg3(v0, v1, v2)
  2960  		return true
  2961  	}
  2962  }
  2963  func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
  2964  	v_1 := v.Args[1]
  2965  	v_0 := v.Args[0]
  2966  	b := v.Block
  2967  	typ := &b.Func.Config.Types
  2968  	// match: (Lsh64x16 x y)
  2969  	// cond: shiftIsBounded(v)
  2970  	// result: (SLD x y)
  2971  	for {
  2972  		x := v_0
  2973  		y := v_1
  2974  		if !(shiftIsBounded(v)) {
  2975  			break
  2976  		}
  2977  		v.reset(OpPPC64SLD)
  2978  		v.AddArg2(x, y)
  2979  		return true
  2980  	}
  2981  	// match: (Lsh64x16 <t> x y)
  2982  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFC0] y)))
  2983  	for {
  2984  		t := v.Type
  2985  		x := v_0
  2986  		y := v_1
  2987  		v.reset(OpPPC64ISEL)
  2988  		v.AuxInt = int32ToAuxInt(2)
  2989  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2990  		v0.AddArg2(x, y)
  2991  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2992  		v1.AuxInt = int64ToAuxInt(0)
  2993  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
  2994  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  2995  		v3.AuxInt = int64ToAuxInt(0xFFC0)
  2996  		v3.AddArg(y)
  2997  		v2.AddArg(v3)
  2998  		v.AddArg3(v0, v1, v2)
  2999  		return true
  3000  	}
  3001  }
  3002  func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
  3003  	v_1 := v.Args[1]
  3004  	v_0 := v.Args[0]
  3005  	b := v.Block
  3006  	typ := &b.Func.Config.Types
  3007  	// match: (Lsh64x32 x y)
  3008  	// cond: shiftIsBounded(v)
  3009  	// result: (SLD x y)
  3010  	for {
  3011  		x := v_0
  3012  		y := v_1
  3013  		if !(shiftIsBounded(v)) {
  3014  			break
  3015  		}
  3016  		v.reset(OpPPC64SLD)
  3017  		v.AddArg2(x, y)
  3018  		return true
  3019  	}
  3020  	// match: (Lsh64x32 <t> x y)
  3021  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
  3022  	for {
  3023  		t := v.Type
  3024  		x := v_0
  3025  		y := v_1
  3026  		v.reset(OpPPC64ISEL)
  3027  		v.AuxInt = int32ToAuxInt(0)
  3028  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3029  		v0.AddArg2(x, y)
  3030  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3031  		v1.AuxInt = int64ToAuxInt(0)
  3032  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3033  		v2.AuxInt = int32ToAuxInt(64)
  3034  		v2.AddArg(y)
  3035  		v.AddArg3(v0, v1, v2)
  3036  		return true
  3037  	}
  3038  }
  3039  func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
  3040  	v_1 := v.Args[1]
  3041  	v_0 := v.Args[0]
  3042  	b := v.Block
  3043  	typ := &b.Func.Config.Types
  3044  	// match: (Lsh64x64 x (MOVDconst [c]))
  3045  	// cond: uint64(c) < 64
  3046  	// result: (SLDconst x [c])
  3047  	for {
  3048  		x := v_0
  3049  		if v_1.Op != OpPPC64MOVDconst {
  3050  			break
  3051  		}
  3052  		c := auxIntToInt64(v_1.AuxInt)
  3053  		if !(uint64(c) < 64) {
  3054  			break
  3055  		}
  3056  		v.reset(OpPPC64SLDconst)
  3057  		v.AuxInt = int64ToAuxInt(c)
  3058  		v.AddArg(x)
  3059  		return true
  3060  	}
  3061  	// match: (Lsh64x64 x y)
  3062  	// cond: shiftIsBounded(v)
  3063  	// result: (SLD x y)
  3064  	for {
  3065  		x := v_0
  3066  		y := v_1
  3067  		if !(shiftIsBounded(v)) {
  3068  			break
  3069  		}
  3070  		v.reset(OpPPC64SLD)
  3071  		v.AddArg2(x, y)
  3072  		return true
  3073  	}
  3074  	// match: (Lsh64x64 <t> x y)
  3075  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
  3076  	for {
  3077  		t := v.Type
  3078  		x := v_0
  3079  		y := v_1
  3080  		v.reset(OpPPC64ISEL)
  3081  		v.AuxInt = int32ToAuxInt(0)
  3082  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3083  		v0.AddArg2(x, y)
  3084  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3085  		v1.AuxInt = int64ToAuxInt(0)
  3086  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3087  		v2.AuxInt = int64ToAuxInt(64)
  3088  		v2.AddArg(y)
  3089  		v.AddArg3(v0, v1, v2)
  3090  		return true
  3091  	}
  3092  }
  3093  func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
  3094  	v_1 := v.Args[1]
  3095  	v_0 := v.Args[0]
  3096  	b := v.Block
  3097  	typ := &b.Func.Config.Types
  3098  	// match: (Lsh64x8 x y)
  3099  	// cond: shiftIsBounded(v)
  3100  	// result: (SLD x y)
  3101  	for {
  3102  		x := v_0
  3103  		y := v_1
  3104  		if !(shiftIsBounded(v)) {
  3105  			break
  3106  		}
  3107  		v.reset(OpPPC64SLD)
  3108  		v.AddArg2(x, y)
  3109  		return true
  3110  	}
  3111  	// match: (Lsh64x8 <t> x y)
  3112  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00C0] y)))
  3113  	for {
  3114  		t := v.Type
  3115  		x := v_0
  3116  		y := v_1
  3117  		v.reset(OpPPC64ISEL)
  3118  		v.AuxInt = int32ToAuxInt(2)
  3119  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3120  		v0.AddArg2(x, y)
  3121  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3122  		v1.AuxInt = int64ToAuxInt(0)
  3123  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
  3124  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  3125  		v3.AuxInt = int64ToAuxInt(0x00C0)
  3126  		v3.AddArg(y)
  3127  		v2.AddArg(v3)
  3128  		v.AddArg3(v0, v1, v2)
  3129  		return true
  3130  	}
  3131  }
  3132  func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
  3133  	v_1 := v.Args[1]
  3134  	v_0 := v.Args[0]
  3135  	b := v.Block
  3136  	typ := &b.Func.Config.Types
  3137  	// match: (Lsh8x16 x y)
  3138  	// cond: shiftIsBounded(v)
  3139  	// result: (SLD x y)
  3140  	for {
  3141  		x := v_0
  3142  		y := v_1
  3143  		if !(shiftIsBounded(v)) {
  3144  			break
  3145  		}
  3146  		v.reset(OpPPC64SLD)
  3147  		v.AddArg2(x, y)
  3148  		return true
  3149  	}
  3150  	// match: (Lsh8x16 <t> x y)
  3151  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF8] y)))
  3152  	for {
  3153  		t := v.Type
  3154  		x := v_0
  3155  		y := v_1
  3156  		v.reset(OpPPC64ISEL)
  3157  		v.AuxInt = int32ToAuxInt(2)
  3158  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3159  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3160  		v1.AddArg(x)
  3161  		v0.AddArg2(v1, y)
  3162  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3163  		v2.AuxInt = int64ToAuxInt(0)
  3164  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
  3165  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  3166  		v4.AuxInt = int64ToAuxInt(0xFFF8)
  3167  		v4.AddArg(y)
  3168  		v3.AddArg(v4)
  3169  		v.AddArg3(v0, v2, v3)
  3170  		return true
  3171  	}
  3172  }
  3173  func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
  3174  	v_1 := v.Args[1]
  3175  	v_0 := v.Args[0]
  3176  	b := v.Block
  3177  	typ := &b.Func.Config.Types
  3178  	// match: (Lsh8x32 x y)
  3179  	// cond: shiftIsBounded(v)
  3180  	// result: (SLD x y)
  3181  	for {
  3182  		x := v_0
  3183  		y := v_1
  3184  		if !(shiftIsBounded(v)) {
  3185  			break
  3186  		}
  3187  		v.reset(OpPPC64SLD)
  3188  		v.AddArg2(x, y)
  3189  		return true
  3190  	}
  3191  	// match: (Lsh8x32 <t> x y)
  3192  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
  3193  	for {
  3194  		t := v.Type
  3195  		x := v_0
  3196  		y := v_1
  3197  		v.reset(OpPPC64ISEL)
  3198  		v.AuxInt = int32ToAuxInt(0)
  3199  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3200  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3201  		v1.AddArg(x)
  3202  		v0.AddArg2(v1, y)
  3203  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3204  		v2.AuxInt = int64ToAuxInt(0)
  3205  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3206  		v3.AuxInt = int32ToAuxInt(8)
  3207  		v3.AddArg(y)
  3208  		v.AddArg3(v0, v2, v3)
  3209  		return true
  3210  	}
  3211  }
  3212  func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
  3213  	v_1 := v.Args[1]
  3214  	v_0 := v.Args[0]
  3215  	b := v.Block
  3216  	typ := &b.Func.Config.Types
  3217  	// match: (Lsh8x64 x (MOVDconst [c]))
  3218  	// cond: uint64(c) < 8
  3219  	// result: (SLWconst x [c])
  3220  	for {
  3221  		x := v_0
  3222  		if v_1.Op != OpPPC64MOVDconst {
  3223  			break
  3224  		}
  3225  		c := auxIntToInt64(v_1.AuxInt)
  3226  		if !(uint64(c) < 8) {
  3227  			break
  3228  		}
  3229  		v.reset(OpPPC64SLWconst)
  3230  		v.AuxInt = int64ToAuxInt(c)
  3231  		v.AddArg(x)
  3232  		return true
  3233  	}
  3234  	// match: (Lsh8x64 x y)
  3235  	// cond: shiftIsBounded(v)
  3236  	// result: (SLD x y)
  3237  	for {
  3238  		x := v_0
  3239  		y := v_1
  3240  		if !(shiftIsBounded(v)) {
  3241  			break
  3242  		}
  3243  		v.reset(OpPPC64SLD)
  3244  		v.AddArg2(x, y)
  3245  		return true
  3246  	}
  3247  	// match: (Lsh8x64 <t> x y)
  3248  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
  3249  	for {
  3250  		t := v.Type
  3251  		x := v_0
  3252  		y := v_1
  3253  		v.reset(OpPPC64ISEL)
  3254  		v.AuxInt = int32ToAuxInt(0)
  3255  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3256  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3257  		v1.AddArg(x)
  3258  		v0.AddArg2(v1, y)
  3259  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3260  		v2.AuxInt = int64ToAuxInt(0)
  3261  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3262  		v3.AuxInt = int64ToAuxInt(8)
  3263  		v3.AddArg(y)
  3264  		v.AddArg3(v0, v2, v3)
  3265  		return true
  3266  	}
  3267  }
  3268  func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
  3269  	v_1 := v.Args[1]
  3270  	v_0 := v.Args[0]
  3271  	b := v.Block
  3272  	typ := &b.Func.Config.Types
  3273  	// match: (Lsh8x8 x y)
  3274  	// cond: shiftIsBounded(v)
  3275  	// result: (SLD x y)
  3276  	for {
  3277  		x := v_0
  3278  		y := v_1
  3279  		if !(shiftIsBounded(v)) {
  3280  			break
  3281  		}
  3282  		v.reset(OpPPC64SLD)
  3283  		v.AddArg2(x, y)
  3284  		return true
  3285  	}
  3286  	// match: (Lsh8x8 <t> x y)
  3287  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F8] y)))
  3288  	for {
  3289  		t := v.Type
  3290  		x := v_0
  3291  		y := v_1
  3292  		v.reset(OpPPC64ISEL)
  3293  		v.AuxInt = int32ToAuxInt(2)
  3294  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3295  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3296  		v1.AddArg(x)
  3297  		v0.AddArg2(v1, y)
  3298  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3299  		v2.AuxInt = int64ToAuxInt(0)
  3300  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
  3301  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  3302  		v4.AuxInt = int64ToAuxInt(0x00F8)
  3303  		v4.AddArg(y)
  3304  		v3.AddArg(v4)
  3305  		v.AddArg3(v0, v2, v3)
  3306  		return true
  3307  	}
  3308  }
  3309  func rewriteValuePPC64_OpMax32F(v *Value) bool {
  3310  	v_1 := v.Args[1]
  3311  	v_0 := v.Args[0]
  3312  	// match: (Max32F x y)
  3313  	// cond: buildcfg.GOPPC64 >= 9
  3314  	// result: (XSMAXJDP x y)
  3315  	for {
  3316  		x := v_0
  3317  		y := v_1
  3318  		if !(buildcfg.GOPPC64 >= 9) {
  3319  			break
  3320  		}
  3321  		v.reset(OpPPC64XSMAXJDP)
  3322  		v.AddArg2(x, y)
  3323  		return true
  3324  	}
  3325  	return false
  3326  }
  3327  func rewriteValuePPC64_OpMax64F(v *Value) bool {
  3328  	v_1 := v.Args[1]
  3329  	v_0 := v.Args[0]
  3330  	// match: (Max64F x y)
  3331  	// cond: buildcfg.GOPPC64 >= 9
  3332  	// result: (XSMAXJDP x y)
  3333  	for {
  3334  		x := v_0
  3335  		y := v_1
  3336  		if !(buildcfg.GOPPC64 >= 9) {
  3337  			break
  3338  		}
  3339  		v.reset(OpPPC64XSMAXJDP)
  3340  		v.AddArg2(x, y)
  3341  		return true
  3342  	}
  3343  	return false
  3344  }
  3345  func rewriteValuePPC64_OpMin32F(v *Value) bool {
  3346  	v_1 := v.Args[1]
  3347  	v_0 := v.Args[0]
  3348  	// match: (Min32F x y)
  3349  	// cond: buildcfg.GOPPC64 >= 9
  3350  	// result: (XSMINJDP x y)
  3351  	for {
  3352  		x := v_0
  3353  		y := v_1
  3354  		if !(buildcfg.GOPPC64 >= 9) {
  3355  			break
  3356  		}
  3357  		v.reset(OpPPC64XSMINJDP)
  3358  		v.AddArg2(x, y)
  3359  		return true
  3360  	}
  3361  	return false
  3362  }
  3363  func rewriteValuePPC64_OpMin64F(v *Value) bool {
  3364  	v_1 := v.Args[1]
  3365  	v_0 := v.Args[0]
  3366  	// match: (Min64F x y)
  3367  	// cond: buildcfg.GOPPC64 >= 9
  3368  	// result: (XSMINJDP x y)
  3369  	for {
  3370  		x := v_0
  3371  		y := v_1
  3372  		if !(buildcfg.GOPPC64 >= 9) {
  3373  			break
  3374  		}
  3375  		v.reset(OpPPC64XSMINJDP)
  3376  		v.AddArg2(x, y)
  3377  		return true
  3378  	}
  3379  	return false
  3380  }
  3381  func rewriteValuePPC64_OpMod16(v *Value) bool {
  3382  	v_1 := v.Args[1]
  3383  	v_0 := v.Args[0]
  3384  	b := v.Block
  3385  	typ := &b.Func.Config.Types
  3386  	// match: (Mod16 x y)
  3387  	// result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
  3388  	for {
  3389  		x := v_0
  3390  		y := v_1
  3391  		v.reset(OpMod32)
  3392  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3393  		v0.AddArg(x)
  3394  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3395  		v1.AddArg(y)
  3396  		v.AddArg2(v0, v1)
  3397  		return true
  3398  	}
  3399  }
  3400  func rewriteValuePPC64_OpMod16u(v *Value) bool {
  3401  	v_1 := v.Args[1]
  3402  	v_0 := v.Args[0]
  3403  	b := v.Block
  3404  	typ := &b.Func.Config.Types
  3405  	// match: (Mod16u x y)
  3406  	// result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
  3407  	for {
  3408  		x := v_0
  3409  		y := v_1
  3410  		v.reset(OpMod32u)
  3411  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3412  		v0.AddArg(x)
  3413  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3414  		v1.AddArg(y)
  3415  		v.AddArg2(v0, v1)
  3416  		return true
  3417  	}
  3418  }
  3419  func rewriteValuePPC64_OpMod32(v *Value) bool {
  3420  	v_1 := v.Args[1]
  3421  	v_0 := v.Args[0]
  3422  	b := v.Block
  3423  	typ := &b.Func.Config.Types
  3424  	// match: (Mod32 x y)
  3425  	// cond: buildcfg.GOPPC64 >= 9
  3426  	// result: (MODSW x y)
  3427  	for {
  3428  		x := v_0
  3429  		y := v_1
  3430  		if !(buildcfg.GOPPC64 >= 9) {
  3431  			break
  3432  		}
  3433  		v.reset(OpPPC64MODSW)
  3434  		v.AddArg2(x, y)
  3435  		return true
  3436  	}
  3437  	// match: (Mod32 x y)
  3438  	// cond: buildcfg.GOPPC64 <= 8
  3439  	// result: (SUB x (MULLW y (DIVW x y)))
  3440  	for {
  3441  		x := v_0
  3442  		y := v_1
  3443  		if !(buildcfg.GOPPC64 <= 8) {
  3444  			break
  3445  		}
  3446  		v.reset(OpPPC64SUB)
  3447  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3448  		v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
  3449  		v1.AddArg2(x, y)
  3450  		v0.AddArg2(y, v1)
  3451  		v.AddArg2(x, v0)
  3452  		return true
  3453  	}
  3454  	return false
  3455  }
  3456  func rewriteValuePPC64_OpMod32u(v *Value) bool {
  3457  	v_1 := v.Args[1]
  3458  	v_0 := v.Args[0]
  3459  	b := v.Block
  3460  	typ := &b.Func.Config.Types
  3461  	// match: (Mod32u x y)
  3462  	// cond: buildcfg.GOPPC64 >= 9
  3463  	// result: (MODUW x y)
  3464  	for {
  3465  		x := v_0
  3466  		y := v_1
  3467  		if !(buildcfg.GOPPC64 >= 9) {
  3468  			break
  3469  		}
  3470  		v.reset(OpPPC64MODUW)
  3471  		v.AddArg2(x, y)
  3472  		return true
  3473  	}
  3474  	// match: (Mod32u x y)
  3475  	// cond: buildcfg.GOPPC64 <= 8
  3476  	// result: (SUB x (MULLW y (DIVWU x y)))
  3477  	for {
  3478  		x := v_0
  3479  		y := v_1
  3480  		if !(buildcfg.GOPPC64 <= 8) {
  3481  			break
  3482  		}
  3483  		v.reset(OpPPC64SUB)
  3484  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3485  		v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
  3486  		v1.AddArg2(x, y)
  3487  		v0.AddArg2(y, v1)
  3488  		v.AddArg2(x, v0)
  3489  		return true
  3490  	}
  3491  	return false
  3492  }
  3493  func rewriteValuePPC64_OpMod64(v *Value) bool {
  3494  	v_1 := v.Args[1]
  3495  	v_0 := v.Args[0]
  3496  	b := v.Block
  3497  	typ := &b.Func.Config.Types
  3498  	// match: (Mod64 x y)
  3499  	// cond: buildcfg.GOPPC64 >=9
  3500  	// result: (MODSD x y)
  3501  	for {
  3502  		x := v_0
  3503  		y := v_1
  3504  		if !(buildcfg.GOPPC64 >= 9) {
  3505  			break
  3506  		}
  3507  		v.reset(OpPPC64MODSD)
  3508  		v.AddArg2(x, y)
  3509  		return true
  3510  	}
  3511  	// match: (Mod64 x y)
  3512  	// cond: buildcfg.GOPPC64 <=8
  3513  	// result: (SUB x (MULLD y (DIVD x y)))
  3514  	for {
  3515  		x := v_0
  3516  		y := v_1
  3517  		if !(buildcfg.GOPPC64 <= 8) {
  3518  			break
  3519  		}
  3520  		v.reset(OpPPC64SUB)
  3521  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3522  		v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
  3523  		v1.AddArg2(x, y)
  3524  		v0.AddArg2(y, v1)
  3525  		v.AddArg2(x, v0)
  3526  		return true
  3527  	}
  3528  	return false
  3529  }
  3530  func rewriteValuePPC64_OpMod64u(v *Value) bool {
  3531  	v_1 := v.Args[1]
  3532  	v_0 := v.Args[0]
  3533  	b := v.Block
  3534  	typ := &b.Func.Config.Types
  3535  	// match: (Mod64u x y)
  3536  	// cond: buildcfg.GOPPC64 >= 9
  3537  	// result: (MODUD x y)
  3538  	for {
  3539  		x := v_0
  3540  		y := v_1
  3541  		if !(buildcfg.GOPPC64 >= 9) {
  3542  			break
  3543  		}
  3544  		v.reset(OpPPC64MODUD)
  3545  		v.AddArg2(x, y)
  3546  		return true
  3547  	}
  3548  	// match: (Mod64u x y)
  3549  	// cond: buildcfg.GOPPC64 <= 8
  3550  	// result: (SUB x (MULLD y (DIVDU x y)))
  3551  	for {
  3552  		x := v_0
  3553  		y := v_1
  3554  		if !(buildcfg.GOPPC64 <= 8) {
  3555  			break
  3556  		}
  3557  		v.reset(OpPPC64SUB)
  3558  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3559  		v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
  3560  		v1.AddArg2(x, y)
  3561  		v0.AddArg2(y, v1)
  3562  		v.AddArg2(x, v0)
  3563  		return true
  3564  	}
  3565  	return false
  3566  }
  3567  func rewriteValuePPC64_OpMod8(v *Value) bool {
  3568  	v_1 := v.Args[1]
  3569  	v_0 := v.Args[0]
  3570  	b := v.Block
  3571  	typ := &b.Func.Config.Types
  3572  	// match: (Mod8 x y)
  3573  	// result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
  3574  	for {
  3575  		x := v_0
  3576  		y := v_1
  3577  		v.reset(OpMod32)
  3578  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3579  		v0.AddArg(x)
  3580  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3581  		v1.AddArg(y)
  3582  		v.AddArg2(v0, v1)
  3583  		return true
  3584  	}
  3585  }
  3586  func rewriteValuePPC64_OpMod8u(v *Value) bool {
  3587  	v_1 := v.Args[1]
  3588  	v_0 := v.Args[0]
  3589  	b := v.Block
  3590  	typ := &b.Func.Config.Types
  3591  	// match: (Mod8u x y)
  3592  	// result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
  3593  	for {
  3594  		x := v_0
  3595  		y := v_1
  3596  		v.reset(OpMod32u)
  3597  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3598  		v0.AddArg(x)
  3599  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3600  		v1.AddArg(y)
  3601  		v.AddArg2(v0, v1)
  3602  		return true
  3603  	}
  3604  }
  3605  func rewriteValuePPC64_OpMove(v *Value) bool {
  3606  	v_2 := v.Args[2]
  3607  	v_1 := v.Args[1]
  3608  	v_0 := v.Args[0]
  3609  	b := v.Block
  3610  	typ := &b.Func.Config.Types
  3611  	// match: (Move [0] _ _ mem)
  3612  	// result: mem
  3613  	for {
  3614  		if auxIntToInt64(v.AuxInt) != 0 {
  3615  			break
  3616  		}
  3617  		mem := v_2
  3618  		v.copyOf(mem)
  3619  		return true
  3620  	}
  3621  	// match: (Move [1] dst src mem)
  3622  	// result: (MOVBstore dst (MOVBZload src mem) mem)
  3623  	for {
  3624  		if auxIntToInt64(v.AuxInt) != 1 {
  3625  			break
  3626  		}
  3627  		dst := v_0
  3628  		src := v_1
  3629  		mem := v_2
  3630  		v.reset(OpPPC64MOVBstore)
  3631  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3632  		v0.AddArg2(src, mem)
  3633  		v.AddArg3(dst, v0, mem)
  3634  		return true
  3635  	}
  3636  	// match: (Move [2] dst src mem)
  3637  	// result: (MOVHstore dst (MOVHZload src mem) mem)
  3638  	for {
  3639  		if auxIntToInt64(v.AuxInt) != 2 {
  3640  			break
  3641  		}
  3642  		dst := v_0
  3643  		src := v_1
  3644  		mem := v_2
  3645  		v.reset(OpPPC64MOVHstore)
  3646  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3647  		v0.AddArg2(src, mem)
  3648  		v.AddArg3(dst, v0, mem)
  3649  		return true
  3650  	}
  3651  	// match: (Move [4] dst src mem)
  3652  	// result: (MOVWstore dst (MOVWZload src mem) mem)
  3653  	for {
  3654  		if auxIntToInt64(v.AuxInt) != 4 {
  3655  			break
  3656  		}
  3657  		dst := v_0
  3658  		src := v_1
  3659  		mem := v_2
  3660  		v.reset(OpPPC64MOVWstore)
  3661  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3662  		v0.AddArg2(src, mem)
  3663  		v.AddArg3(dst, v0, mem)
  3664  		return true
  3665  	}
  3666  	// match: (Move [8] {t} dst src mem)
  3667  	// result: (MOVDstore dst (MOVDload src mem) mem)
  3668  	for {
  3669  		if auxIntToInt64(v.AuxInt) != 8 {
  3670  			break
  3671  		}
  3672  		dst := v_0
  3673  		src := v_1
  3674  		mem := v_2
  3675  		v.reset(OpPPC64MOVDstore)
  3676  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
  3677  		v0.AddArg2(src, mem)
  3678  		v.AddArg3(dst, v0, mem)
  3679  		return true
  3680  	}
  3681  	// match: (Move [3] dst src mem)
  3682  	// result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
  3683  	for {
  3684  		if auxIntToInt64(v.AuxInt) != 3 {
  3685  			break
  3686  		}
  3687  		dst := v_0
  3688  		src := v_1
  3689  		mem := v_2
  3690  		v.reset(OpPPC64MOVBstore)
  3691  		v.AuxInt = int32ToAuxInt(2)
  3692  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3693  		v0.AuxInt = int32ToAuxInt(2)
  3694  		v0.AddArg2(src, mem)
  3695  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3696  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
  3697  		v2.AddArg2(src, mem)
  3698  		v1.AddArg3(dst, v2, mem)
  3699  		v.AddArg3(dst, v0, v1)
  3700  		return true
  3701  	}
  3702  	// match: (Move [5] dst src mem)
  3703  	// result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3704  	for {
  3705  		if auxIntToInt64(v.AuxInt) != 5 {
  3706  			break
  3707  		}
  3708  		dst := v_0
  3709  		src := v_1
  3710  		mem := v_2
  3711  		v.reset(OpPPC64MOVBstore)
  3712  		v.AuxInt = int32ToAuxInt(4)
  3713  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3714  		v0.AuxInt = int32ToAuxInt(4)
  3715  		v0.AddArg2(src, mem)
  3716  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3717  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3718  		v2.AddArg2(src, mem)
  3719  		v1.AddArg3(dst, v2, mem)
  3720  		v.AddArg3(dst, v0, v1)
  3721  		return true
  3722  	}
  3723  	// match: (Move [6] dst src mem)
  3724  	// result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3725  	for {
  3726  		if auxIntToInt64(v.AuxInt) != 6 {
  3727  			break
  3728  		}
  3729  		dst := v_0
  3730  		src := v_1
  3731  		mem := v_2
  3732  		v.reset(OpPPC64MOVHstore)
  3733  		v.AuxInt = int32ToAuxInt(4)
  3734  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3735  		v0.AuxInt = int32ToAuxInt(4)
  3736  		v0.AddArg2(src, mem)
  3737  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3738  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3739  		v2.AddArg2(src, mem)
  3740  		v1.AddArg3(dst, v2, mem)
  3741  		v.AddArg3(dst, v0, v1)
  3742  		return true
  3743  	}
  3744  	// match: (Move [7] dst src mem)
  3745  	// result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)))
  3746  	for {
  3747  		if auxIntToInt64(v.AuxInt) != 7 {
  3748  			break
  3749  		}
  3750  		dst := v_0
  3751  		src := v_1
  3752  		mem := v_2
  3753  		v.reset(OpPPC64MOVBstore)
  3754  		v.AuxInt = int32ToAuxInt(6)
  3755  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3756  		v0.AuxInt = int32ToAuxInt(6)
  3757  		v0.AddArg2(src, mem)
  3758  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3759  		v1.AuxInt = int32ToAuxInt(4)
  3760  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3761  		v2.AuxInt = int32ToAuxInt(4)
  3762  		v2.AddArg2(src, mem)
  3763  		v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3764  		v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3765  		v4.AddArg2(src, mem)
  3766  		v3.AddArg3(dst, v4, mem)
  3767  		v1.AddArg3(dst, v2, v3)
  3768  		v.AddArg3(dst, v0, v1)
  3769  		return true
  3770  	}
  3771  	// match: (Move [s] dst src mem)
  3772  	// cond: s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)
  3773  	// result: (LoweredMove [s] dst src mem)
  3774  	for {
  3775  		s := auxIntToInt64(v.AuxInt)
  3776  		dst := v_0
  3777  		src := v_1
  3778  		mem := v_2
  3779  		if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) {
  3780  			break
  3781  		}
  3782  		v.reset(OpPPC64LoweredMove)
  3783  		v.AuxInt = int64ToAuxInt(s)
  3784  		v.AddArg3(dst, src, mem)
  3785  		return true
  3786  	}
  3787  	// match: (Move [s] dst src mem)
  3788  	// cond: s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9
  3789  	// result: (LoweredQuadMoveShort [s] dst src mem)
  3790  	for {
  3791  		s := auxIntToInt64(v.AuxInt)
  3792  		dst := v_0
  3793  		src := v_1
  3794  		mem := v_2
  3795  		if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) {
  3796  			break
  3797  		}
  3798  		v.reset(OpPPC64LoweredQuadMoveShort)
  3799  		v.AuxInt = int64ToAuxInt(s)
  3800  		v.AddArg3(dst, src, mem)
  3801  		return true
  3802  	}
  3803  	// match: (Move [s] dst src mem)
  3804  	// cond: s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)
  3805  	// result: (LoweredQuadMove [s] dst src mem)
  3806  	for {
  3807  		s := auxIntToInt64(v.AuxInt)
  3808  		dst := v_0
  3809  		src := v_1
  3810  		mem := v_2
  3811  		if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) {
  3812  			break
  3813  		}
  3814  		v.reset(OpPPC64LoweredQuadMove)
  3815  		v.AuxInt = int64ToAuxInt(s)
  3816  		v.AddArg3(dst, src, mem)
  3817  		return true
  3818  	}
  3819  	return false
  3820  }
  3821  func rewriteValuePPC64_OpNeq16(v *Value) bool {
  3822  	v_1 := v.Args[1]
  3823  	v_0 := v.Args[0]
  3824  	b := v.Block
  3825  	typ := &b.Func.Config.Types
  3826  	// match: (Neq16 x y)
  3827  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  3828  	// result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  3829  	for {
  3830  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3831  			x := v_0
  3832  			y := v_1
  3833  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  3834  				continue
  3835  			}
  3836  			v.reset(OpPPC64NotEqual)
  3837  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3838  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3839  			v1.AddArg(x)
  3840  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3841  			v2.AddArg(y)
  3842  			v0.AddArg2(v1, v2)
  3843  			v.AddArg(v0)
  3844  			return true
  3845  		}
  3846  		break
  3847  	}
  3848  	// match: (Neq16 x y)
  3849  	// result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  3850  	for {
  3851  		x := v_0
  3852  		y := v_1
  3853  		v.reset(OpPPC64NotEqual)
  3854  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3855  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3856  		v1.AddArg(x)
  3857  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3858  		v2.AddArg(y)
  3859  		v0.AddArg2(v1, v2)
  3860  		v.AddArg(v0)
  3861  		return true
  3862  	}
  3863  }
  3864  func rewriteValuePPC64_OpNeq32(v *Value) bool {
  3865  	v_1 := v.Args[1]
  3866  	v_0 := v.Args[0]
  3867  	b := v.Block
  3868  	// match: (Neq32 x y)
  3869  	// result: (NotEqual (CMPW x y))
  3870  	for {
  3871  		x := v_0
  3872  		y := v_1
  3873  		v.reset(OpPPC64NotEqual)
  3874  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3875  		v0.AddArg2(x, y)
  3876  		v.AddArg(v0)
  3877  		return true
  3878  	}
  3879  }
  3880  func rewriteValuePPC64_OpNeq32F(v *Value) bool {
  3881  	v_1 := v.Args[1]
  3882  	v_0 := v.Args[0]
  3883  	b := v.Block
  3884  	// match: (Neq32F x y)
  3885  	// result: (NotEqual (FCMPU x y))
  3886  	for {
  3887  		x := v_0
  3888  		y := v_1
  3889  		v.reset(OpPPC64NotEqual)
  3890  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  3891  		v0.AddArg2(x, y)
  3892  		v.AddArg(v0)
  3893  		return true
  3894  	}
  3895  }
  3896  func rewriteValuePPC64_OpNeq64(v *Value) bool {
  3897  	v_1 := v.Args[1]
  3898  	v_0 := v.Args[0]
  3899  	b := v.Block
  3900  	// match: (Neq64 x y)
  3901  	// result: (NotEqual (CMP x y))
  3902  	for {
  3903  		x := v_0
  3904  		y := v_1
  3905  		v.reset(OpPPC64NotEqual)
  3906  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  3907  		v0.AddArg2(x, y)
  3908  		v.AddArg(v0)
  3909  		return true
  3910  	}
  3911  }
  3912  func rewriteValuePPC64_OpNeq64F(v *Value) bool {
  3913  	v_1 := v.Args[1]
  3914  	v_0 := v.Args[0]
  3915  	b := v.Block
  3916  	// match: (Neq64F x y)
  3917  	// result: (NotEqual (FCMPU x y))
  3918  	for {
  3919  		x := v_0
  3920  		y := v_1
  3921  		v.reset(OpPPC64NotEqual)
  3922  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  3923  		v0.AddArg2(x, y)
  3924  		v.AddArg(v0)
  3925  		return true
  3926  	}
  3927  }
  3928  func rewriteValuePPC64_OpNeq8(v *Value) bool {
  3929  	v_1 := v.Args[1]
  3930  	v_0 := v.Args[0]
  3931  	b := v.Block
  3932  	typ := &b.Func.Config.Types
  3933  	// match: (Neq8 x y)
  3934  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  3935  	// result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  3936  	for {
  3937  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3938  			x := v_0
  3939  			y := v_1
  3940  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  3941  				continue
  3942  			}
  3943  			v.reset(OpPPC64NotEqual)
  3944  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3945  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3946  			v1.AddArg(x)
  3947  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3948  			v2.AddArg(y)
  3949  			v0.AddArg2(v1, v2)
  3950  			v.AddArg(v0)
  3951  			return true
  3952  		}
  3953  		break
  3954  	}
  3955  	// match: (Neq8 x y)
  3956  	// result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  3957  	for {
  3958  		x := v_0
  3959  		y := v_1
  3960  		v.reset(OpPPC64NotEqual)
  3961  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3962  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3963  		v1.AddArg(x)
  3964  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3965  		v2.AddArg(y)
  3966  		v0.AddArg2(v1, v2)
  3967  		v.AddArg(v0)
  3968  		return true
  3969  	}
  3970  }
  3971  func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
  3972  	v_1 := v.Args[1]
  3973  	v_0 := v.Args[0]
  3974  	b := v.Block
  3975  	// match: (NeqPtr x y)
  3976  	// result: (NotEqual (CMP x y))
  3977  	for {
  3978  		x := v_0
  3979  		y := v_1
  3980  		v.reset(OpPPC64NotEqual)
  3981  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  3982  		v0.AddArg2(x, y)
  3983  		v.AddArg(v0)
  3984  		return true
  3985  	}
  3986  }
  3987  func rewriteValuePPC64_OpNot(v *Value) bool {
  3988  	v_0 := v.Args[0]
  3989  	// match: (Not x)
  3990  	// result: (XORconst [1] x)
  3991  	for {
  3992  		x := v_0
  3993  		v.reset(OpPPC64XORconst)
  3994  		v.AuxInt = int64ToAuxInt(1)
  3995  		v.AddArg(x)
  3996  		return true
  3997  	}
  3998  }
  3999  func rewriteValuePPC64_OpOffPtr(v *Value) bool {
  4000  	v_0 := v.Args[0]
  4001  	b := v.Block
  4002  	typ := &b.Func.Config.Types
  4003  	// match: (OffPtr [off] ptr)
  4004  	// result: (ADD (MOVDconst <typ.Int64> [off]) ptr)
  4005  	for {
  4006  		off := auxIntToInt64(v.AuxInt)
  4007  		ptr := v_0
  4008  		v.reset(OpPPC64ADD)
  4009  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  4010  		v0.AuxInt = int64ToAuxInt(off)
  4011  		v.AddArg2(v0, ptr)
  4012  		return true
  4013  	}
  4014  }
  4015  func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
  4016  	v_1 := v.Args[1]
  4017  	v_0 := v.Args[0]
  4018  	// match: (ADD l:(MULLD x y) z)
  4019  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4020  	// result: (MADDLD x y z)
  4021  	for {
  4022  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4023  			l := v_0
  4024  			if l.Op != OpPPC64MULLD {
  4025  				continue
  4026  			}
  4027  			y := l.Args[1]
  4028  			x := l.Args[0]
  4029  			z := v_1
  4030  			if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4031  				continue
  4032  			}
  4033  			v.reset(OpPPC64MADDLD)
  4034  			v.AddArg3(x, y, z)
  4035  			return true
  4036  		}
  4037  		break
  4038  	}
  4039  	// match: (ADD x (MOVDconst <t> [c]))
  4040  	// cond: is32Bit(c) && !t.IsPtr()
  4041  	// result: (ADDconst [c] x)
  4042  	for {
  4043  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4044  			x := v_0
  4045  			if v_1.Op != OpPPC64MOVDconst {
  4046  				continue
  4047  			}
  4048  			t := v_1.Type
  4049  			c := auxIntToInt64(v_1.AuxInt)
  4050  			if !(is32Bit(c) && !t.IsPtr()) {
  4051  				continue
  4052  			}
  4053  			v.reset(OpPPC64ADDconst)
  4054  			v.AuxInt = int64ToAuxInt(c)
  4055  			v.AddArg(x)
  4056  			return true
  4057  		}
  4058  		break
  4059  	}
  4060  	return false
  4061  }
  4062  func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool {
  4063  	v_2 := v.Args[2]
  4064  	v_1 := v.Args[1]
  4065  	v_0 := v.Args[0]
  4066  	b := v.Block
  4067  	typ := &b.Func.Config.Types
  4068  	// match: (ADDE x y (Select1 <typ.UInt64> (ADDCconst (MOVDconst [0]) [-1])))
  4069  	// result: (ADDC x y)
  4070  	for {
  4071  		x := v_0
  4072  		y := v_1
  4073  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
  4074  			break
  4075  		}
  4076  		v_2_0 := v_2.Args[0]
  4077  		if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 {
  4078  			break
  4079  		}
  4080  		v_2_0_0 := v_2_0.Args[0]
  4081  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
  4082  			break
  4083  		}
  4084  		v.reset(OpPPC64ADDC)
  4085  		v.AddArg2(x, y)
  4086  		return true
  4087  	}
  4088  	// match: (ADDE (MOVDconst [0]) y c)
  4089  	// result: (ADDZE y c)
  4090  	for {
  4091  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4092  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4093  				continue
  4094  			}
  4095  			y := v_1
  4096  			c := v_2
  4097  			v.reset(OpPPC64ADDZE)
  4098  			v.AddArg2(y, c)
  4099  			return true
  4100  		}
  4101  		break
  4102  	}
  4103  	return false
  4104  }
  4105  func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
  4106  	v_0 := v.Args[0]
  4107  	// match: (ADDconst [c] (ADDconst [d] x))
  4108  	// cond: is32Bit(c+d)
  4109  	// result: (ADDconst [c+d] x)
  4110  	for {
  4111  		c := auxIntToInt64(v.AuxInt)
  4112  		if v_0.Op != OpPPC64ADDconst {
  4113  			break
  4114  		}
  4115  		d := auxIntToInt64(v_0.AuxInt)
  4116  		x := v_0.Args[0]
  4117  		if !(is32Bit(c + d)) {
  4118  			break
  4119  		}
  4120  		v.reset(OpPPC64ADDconst)
  4121  		v.AuxInt = int64ToAuxInt(c + d)
  4122  		v.AddArg(x)
  4123  		return true
  4124  	}
  4125  	// match: (ADDconst [0] x)
  4126  	// result: x
  4127  	for {
  4128  		if auxIntToInt64(v.AuxInt) != 0 {
  4129  			break
  4130  		}
  4131  		x := v_0
  4132  		v.copyOf(x)
  4133  		return true
  4134  	}
  4135  	// match: (ADDconst [c] (MOVDaddr [d] {sym} x))
  4136  	// cond: is32Bit(c+int64(d))
  4137  	// result: (MOVDaddr [int32(c+int64(d))] {sym} x)
  4138  	for {
  4139  		c := auxIntToInt64(v.AuxInt)
  4140  		if v_0.Op != OpPPC64MOVDaddr {
  4141  			break
  4142  		}
  4143  		d := auxIntToInt32(v_0.AuxInt)
  4144  		sym := auxToSym(v_0.Aux)
  4145  		x := v_0.Args[0]
  4146  		if !(is32Bit(c + int64(d))) {
  4147  			break
  4148  		}
  4149  		v.reset(OpPPC64MOVDaddr)
  4150  		v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
  4151  		v.Aux = symToAux(sym)
  4152  		v.AddArg(x)
  4153  		return true
  4154  	}
  4155  	// match: (ADDconst [c] x:(SP))
  4156  	// cond: is32Bit(c)
  4157  	// result: (MOVDaddr [int32(c)] x)
  4158  	for {
  4159  		c := auxIntToInt64(v.AuxInt)
  4160  		x := v_0
  4161  		if x.Op != OpSP || !(is32Bit(c)) {
  4162  			break
  4163  		}
  4164  		v.reset(OpPPC64MOVDaddr)
  4165  		v.AuxInt = int32ToAuxInt(int32(c))
  4166  		v.AddArg(x)
  4167  		return true
  4168  	}
  4169  	// match: (ADDconst [c] (SUBFCconst [d] x))
  4170  	// cond: is32Bit(c+d)
  4171  	// result: (SUBFCconst [c+d] x)
  4172  	for {
  4173  		c := auxIntToInt64(v.AuxInt)
  4174  		if v_0.Op != OpPPC64SUBFCconst {
  4175  			break
  4176  		}
  4177  		d := auxIntToInt64(v_0.AuxInt)
  4178  		x := v_0.Args[0]
  4179  		if !(is32Bit(c + d)) {
  4180  			break
  4181  		}
  4182  		v.reset(OpPPC64SUBFCconst)
  4183  		v.AuxInt = int64ToAuxInt(c + d)
  4184  		v.AddArg(x)
  4185  		return true
  4186  	}
  4187  	return false
  4188  }
  4189  func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
  4190  	v_1 := v.Args[1]
  4191  	v_0 := v.Args[0]
  4192  	b := v.Block
  4193  	typ := &b.Func.Config.Types
  4194  	// match: (AND (MOVDconst [m]) (ROTLWconst [r] x))
  4195  	// cond: isPPC64WordRotateMask(m)
  4196  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4197  	for {
  4198  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4199  			if v_0.Op != OpPPC64MOVDconst {
  4200  				continue
  4201  			}
  4202  			m := auxIntToInt64(v_0.AuxInt)
  4203  			if v_1.Op != OpPPC64ROTLWconst {
  4204  				continue
  4205  			}
  4206  			r := auxIntToInt64(v_1.AuxInt)
  4207  			x := v_1.Args[0]
  4208  			if !(isPPC64WordRotateMask(m)) {
  4209  				continue
  4210  			}
  4211  			v.reset(OpPPC64RLWINM)
  4212  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4213  			v.AddArg(x)
  4214  			return true
  4215  		}
  4216  		break
  4217  	}
  4218  	// match: (AND (MOVDconst [m]) (ROTLW x r))
  4219  	// cond: isPPC64WordRotateMask(m)
  4220  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4221  	for {
  4222  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4223  			if v_0.Op != OpPPC64MOVDconst {
  4224  				continue
  4225  			}
  4226  			m := auxIntToInt64(v_0.AuxInt)
  4227  			if v_1.Op != OpPPC64ROTLW {
  4228  				continue
  4229  			}
  4230  			r := v_1.Args[1]
  4231  			x := v_1.Args[0]
  4232  			if !(isPPC64WordRotateMask(m)) {
  4233  				continue
  4234  			}
  4235  			v.reset(OpPPC64RLWNM)
  4236  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4237  			v.AddArg2(x, r)
  4238  			return true
  4239  		}
  4240  		break
  4241  	}
  4242  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4243  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4244  	// result: (MOVDconst [0])
  4245  	for {
  4246  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4247  			if v_0.Op != OpPPC64MOVDconst {
  4248  				continue
  4249  			}
  4250  			m := auxIntToInt64(v_0.AuxInt)
  4251  			if v_1.Op != OpPPC64SRWconst {
  4252  				continue
  4253  			}
  4254  			s := auxIntToInt64(v_1.AuxInt)
  4255  			if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4256  				continue
  4257  			}
  4258  			v.reset(OpPPC64MOVDconst)
  4259  			v.AuxInt = int64ToAuxInt(0)
  4260  			return true
  4261  		}
  4262  		break
  4263  	}
  4264  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4265  	// cond: mergePPC64AndSrwi(m,s) != 0
  4266  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4267  	for {
  4268  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4269  			if v_0.Op != OpPPC64MOVDconst {
  4270  				continue
  4271  			}
  4272  			m := auxIntToInt64(v_0.AuxInt)
  4273  			if v_1.Op != OpPPC64SRWconst {
  4274  				continue
  4275  			}
  4276  			s := auxIntToInt64(v_1.AuxInt)
  4277  			x := v_1.Args[0]
  4278  			if !(mergePPC64AndSrwi(m, s) != 0) {
  4279  				continue
  4280  			}
  4281  			v.reset(OpPPC64RLWINM)
  4282  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4283  			v.AddArg(x)
  4284  			return true
  4285  		}
  4286  		break
  4287  	}
  4288  	// match: (AND x (NOR y y))
  4289  	// result: (ANDN x y)
  4290  	for {
  4291  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4292  			x := v_0
  4293  			if v_1.Op != OpPPC64NOR {
  4294  				continue
  4295  			}
  4296  			y := v_1.Args[1]
  4297  			if y != v_1.Args[0] {
  4298  				continue
  4299  			}
  4300  			v.reset(OpPPC64ANDN)
  4301  			v.AddArg2(x, y)
  4302  			return true
  4303  		}
  4304  		break
  4305  	}
  4306  	// match: (AND (MOVDconst [c]) (MOVDconst [d]))
  4307  	// result: (MOVDconst [c&d])
  4308  	for {
  4309  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4310  			if v_0.Op != OpPPC64MOVDconst {
  4311  				continue
  4312  			}
  4313  			c := auxIntToInt64(v_0.AuxInt)
  4314  			if v_1.Op != OpPPC64MOVDconst {
  4315  				continue
  4316  			}
  4317  			d := auxIntToInt64(v_1.AuxInt)
  4318  			v.reset(OpPPC64MOVDconst)
  4319  			v.AuxInt = int64ToAuxInt(c & d)
  4320  			return true
  4321  		}
  4322  		break
  4323  	}
  4324  	// match: (AND x (MOVDconst [-1]))
  4325  	// result: x
  4326  	for {
  4327  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4328  			x := v_0
  4329  			if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  4330  				continue
  4331  			}
  4332  			v.copyOf(x)
  4333  			return true
  4334  		}
  4335  		break
  4336  	}
  4337  	// match: (AND x (MOVDconst [c]))
  4338  	// cond: isU16Bit(c)
  4339  	// result: (Select0 (ANDCCconst [c] x))
  4340  	for {
  4341  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4342  			x := v_0
  4343  			if v_1.Op != OpPPC64MOVDconst {
  4344  				continue
  4345  			}
  4346  			c := auxIntToInt64(v_1.AuxInt)
  4347  			if !(isU16Bit(c)) {
  4348  				continue
  4349  			}
  4350  			v.reset(OpSelect0)
  4351  			v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  4352  			v0.AuxInt = int64ToAuxInt(c)
  4353  			v0.AddArg(x)
  4354  			v.AddArg(v0)
  4355  			return true
  4356  		}
  4357  		break
  4358  	}
  4359  	// match: (AND (MOVDconst [c]) y:(MOVWZreg _))
  4360  	// cond: c&0xFFFFFFFF == 0xFFFFFFFF
  4361  	// result: y
  4362  	for {
  4363  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4364  			if v_0.Op != OpPPC64MOVDconst {
  4365  				continue
  4366  			}
  4367  			c := auxIntToInt64(v_0.AuxInt)
  4368  			y := v_1
  4369  			if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
  4370  				continue
  4371  			}
  4372  			v.copyOf(y)
  4373  			return true
  4374  		}
  4375  		break
  4376  	}
  4377  	// match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x))
  4378  	// result: (MOVWZreg x)
  4379  	for {
  4380  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4381  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
  4382  				continue
  4383  			}
  4384  			y := v_1
  4385  			if y.Op != OpPPC64MOVWreg {
  4386  				continue
  4387  			}
  4388  			x := y.Args[0]
  4389  			v.reset(OpPPC64MOVWZreg)
  4390  			v.AddArg(x)
  4391  			return true
  4392  		}
  4393  		break
  4394  	}
  4395  	// match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
  4396  	// result: (Select0 (ANDCCconst [c&0xFF] x))
  4397  	for {
  4398  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4399  			if v_0.Op != OpPPC64MOVDconst {
  4400  				continue
  4401  			}
  4402  			c := auxIntToInt64(v_0.AuxInt)
  4403  			x := v_1
  4404  			if x.Op != OpPPC64MOVBZload {
  4405  				continue
  4406  			}
  4407  			v.reset(OpSelect0)
  4408  			v0 := b.NewValue0(x.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
  4409  			v0.AuxInt = int64ToAuxInt(c & 0xFF)
  4410  			v0.AddArg(x)
  4411  			v.AddArg(v0)
  4412  			return true
  4413  		}
  4414  		break
  4415  	}
  4416  	return false
  4417  }
  4418  func rewriteValuePPC64_OpPPC64ANDCCconst(v *Value) bool {
  4419  	v_0 := v.Args[0]
  4420  	// match: (ANDCCconst [c] (Select0 (ANDCCconst [d] x)))
  4421  	// result: (ANDCCconst [c&d] x)
  4422  	for {
  4423  		c := auxIntToInt64(v.AuxInt)
  4424  		if v_0.Op != OpSelect0 {
  4425  			break
  4426  		}
  4427  		v_0_0 := v_0.Args[0]
  4428  		if v_0_0.Op != OpPPC64ANDCCconst {
  4429  			break
  4430  		}
  4431  		d := auxIntToInt64(v_0_0.AuxInt)
  4432  		x := v_0_0.Args[0]
  4433  		v.reset(OpPPC64ANDCCconst)
  4434  		v.AuxInt = int64ToAuxInt(c & d)
  4435  		v.AddArg(x)
  4436  		return true
  4437  	}
  4438  	return false
  4439  }
  4440  func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
  4441  	v_1 := v.Args[1]
  4442  	v_0 := v.Args[0]
  4443  	// match: (ANDN (MOVDconst [c]) (MOVDconst [d]))
  4444  	// result: (MOVDconst [c&^d])
  4445  	for {
  4446  		if v_0.Op != OpPPC64MOVDconst {
  4447  			break
  4448  		}
  4449  		c := auxIntToInt64(v_0.AuxInt)
  4450  		if v_1.Op != OpPPC64MOVDconst {
  4451  			break
  4452  		}
  4453  		d := auxIntToInt64(v_1.AuxInt)
  4454  		v.reset(OpPPC64MOVDconst)
  4455  		v.AuxInt = int64ToAuxInt(c &^ d)
  4456  		return true
  4457  	}
  4458  	return false
  4459  }
  4460  func rewriteValuePPC64_OpPPC64BRD(v *Value) bool {
  4461  	v_0 := v.Args[0]
  4462  	b := v.Block
  4463  	typ := &b.Func.Config.Types
  4464  	// match: (BRD x:(MOVDload [off] {sym} ptr mem))
  4465  	// cond: x.Uses == 1
  4466  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4467  	for {
  4468  		x := v_0
  4469  		if x.Op != OpPPC64MOVDload {
  4470  			break
  4471  		}
  4472  		off := auxIntToInt32(x.AuxInt)
  4473  		sym := auxToSym(x.Aux)
  4474  		mem := x.Args[1]
  4475  		ptr := x.Args[0]
  4476  		if !(x.Uses == 1) {
  4477  			break
  4478  		}
  4479  		b = x.Block
  4480  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  4481  		v.copyOf(v0)
  4482  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  4483  		v1.AuxInt = int32ToAuxInt(off)
  4484  		v1.Aux = symToAux(sym)
  4485  		v1.AddArg(ptr)
  4486  		v0.AddArg2(v1, mem)
  4487  		return true
  4488  	}
  4489  	// match: (BRD x:(MOVDloadidx ptr idx mem))
  4490  	// cond: x.Uses == 1
  4491  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  4492  	for {
  4493  		x := v_0
  4494  		if x.Op != OpPPC64MOVDloadidx {
  4495  			break
  4496  		}
  4497  		mem := x.Args[2]
  4498  		ptr := x.Args[0]
  4499  		idx := x.Args[1]
  4500  		if !(x.Uses == 1) {
  4501  			break
  4502  		}
  4503  		b = x.Block
  4504  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  4505  		v.copyOf(v0)
  4506  		v0.AddArg3(ptr, idx, mem)
  4507  		return true
  4508  	}
  4509  	return false
  4510  }
  4511  func rewriteValuePPC64_OpPPC64BRH(v *Value) bool {
  4512  	v_0 := v.Args[0]
  4513  	b := v.Block
  4514  	typ := &b.Func.Config.Types
  4515  	// match: (BRH x:(MOVHZload [off] {sym} ptr mem))
  4516  	// cond: x.Uses == 1
  4517  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4518  	for {
  4519  		x := v_0
  4520  		if x.Op != OpPPC64MOVHZload {
  4521  			break
  4522  		}
  4523  		off := auxIntToInt32(x.AuxInt)
  4524  		sym := auxToSym(x.Aux)
  4525  		mem := x.Args[1]
  4526  		ptr := x.Args[0]
  4527  		if !(x.Uses == 1) {
  4528  			break
  4529  		}
  4530  		b = x.Block
  4531  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  4532  		v.copyOf(v0)
  4533  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  4534  		v1.AuxInt = int32ToAuxInt(off)
  4535  		v1.Aux = symToAux(sym)
  4536  		v1.AddArg(ptr)
  4537  		v0.AddArg2(v1, mem)
  4538  		return true
  4539  	}
  4540  	// match: (BRH x:(MOVHZloadidx ptr idx mem))
  4541  	// cond: x.Uses == 1
  4542  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  4543  	for {
  4544  		x := v_0
  4545  		if x.Op != OpPPC64MOVHZloadidx {
  4546  			break
  4547  		}
  4548  		mem := x.Args[2]
  4549  		ptr := x.Args[0]
  4550  		idx := x.Args[1]
  4551  		if !(x.Uses == 1) {
  4552  			break
  4553  		}
  4554  		b = x.Block
  4555  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  4556  		v.copyOf(v0)
  4557  		v0.AddArg3(ptr, idx, mem)
  4558  		return true
  4559  	}
  4560  	return false
  4561  }
  4562  func rewriteValuePPC64_OpPPC64BRW(v *Value) bool {
  4563  	v_0 := v.Args[0]
  4564  	b := v.Block
  4565  	typ := &b.Func.Config.Types
  4566  	// match: (BRW x:(MOVWZload [off] {sym} ptr mem))
  4567  	// cond: x.Uses == 1
  4568  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4569  	for {
  4570  		x := v_0
  4571  		if x.Op != OpPPC64MOVWZload {
  4572  			break
  4573  		}
  4574  		off := auxIntToInt32(x.AuxInt)
  4575  		sym := auxToSym(x.Aux)
  4576  		mem := x.Args[1]
  4577  		ptr := x.Args[0]
  4578  		if !(x.Uses == 1) {
  4579  			break
  4580  		}
  4581  		b = x.Block
  4582  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  4583  		v.copyOf(v0)
  4584  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  4585  		v1.AuxInt = int32ToAuxInt(off)
  4586  		v1.Aux = symToAux(sym)
  4587  		v1.AddArg(ptr)
  4588  		v0.AddArg2(v1, mem)
  4589  		return true
  4590  	}
  4591  	// match: (BRW x:(MOVWZloadidx ptr idx mem))
  4592  	// cond: x.Uses == 1
  4593  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  4594  	for {
  4595  		x := v_0
  4596  		if x.Op != OpPPC64MOVWZloadidx {
  4597  			break
  4598  		}
  4599  		mem := x.Args[2]
  4600  		ptr := x.Args[0]
  4601  		idx := x.Args[1]
  4602  		if !(x.Uses == 1) {
  4603  			break
  4604  		}
  4605  		b = x.Block
  4606  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  4607  		v.copyOf(v0)
  4608  		v0.AddArg3(ptr, idx, mem)
  4609  		return true
  4610  	}
  4611  	return false
  4612  }
  4613  func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
  4614  	v_0 := v.Args[0]
  4615  	// match: (CLRLSLDI [c] (SRWconst [s] x))
  4616  	// cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0
  4617  	// result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x)
  4618  	for {
  4619  		c := auxIntToInt32(v.AuxInt)
  4620  		if v_0.Op != OpPPC64SRWconst {
  4621  			break
  4622  		}
  4623  		s := auxIntToInt64(v_0.AuxInt)
  4624  		x := v_0.Args[0]
  4625  		if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
  4626  			break
  4627  		}
  4628  		v.reset(OpPPC64RLWINM)
  4629  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
  4630  		v.AddArg(x)
  4631  		return true
  4632  	}
  4633  	// match: (CLRLSLDI [c] (SRDconst [s] x))
  4634  	// cond: mergePPC64ClrlsldiSrd(int64(c),s) != 0
  4635  	// result: (RLWINM [mergePPC64ClrlsldiSrd(int64(c),s)] x)
  4636  	for {
  4637  		c := auxIntToInt32(v.AuxInt)
  4638  		if v_0.Op != OpPPC64SRDconst {
  4639  			break
  4640  		}
  4641  		s := auxIntToInt64(v_0.AuxInt)
  4642  		x := v_0.Args[0]
  4643  		if !(mergePPC64ClrlsldiSrd(int64(c), s) != 0) {
  4644  			break
  4645  		}
  4646  		v.reset(OpPPC64RLWINM)
  4647  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrd(int64(c), s))
  4648  		v.AddArg(x)
  4649  		return true
  4650  	}
  4651  	// match: (CLRLSLDI [c] i:(RLWINM [s] x))
  4652  	// cond: mergePPC64ClrlsldiRlwinm(c,s) != 0
  4653  	// result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x)
  4654  	for {
  4655  		c := auxIntToInt32(v.AuxInt)
  4656  		i := v_0
  4657  		if i.Op != OpPPC64RLWINM {
  4658  			break
  4659  		}
  4660  		s := auxIntToInt64(i.AuxInt)
  4661  		x := i.Args[0]
  4662  		if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
  4663  			break
  4664  		}
  4665  		v.reset(OpPPC64RLWINM)
  4666  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
  4667  		v.AddArg(x)
  4668  		return true
  4669  	}
  4670  	return false
  4671  }
  4672  func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
  4673  	v_1 := v.Args[1]
  4674  	v_0 := v.Args[0]
  4675  	b := v.Block
  4676  	// match: (CMP x (MOVDconst [c]))
  4677  	// cond: is16Bit(c)
  4678  	// result: (CMPconst x [c])
  4679  	for {
  4680  		x := v_0
  4681  		if v_1.Op != OpPPC64MOVDconst {
  4682  			break
  4683  		}
  4684  		c := auxIntToInt64(v_1.AuxInt)
  4685  		if !(is16Bit(c)) {
  4686  			break
  4687  		}
  4688  		v.reset(OpPPC64CMPconst)
  4689  		v.AuxInt = int64ToAuxInt(c)
  4690  		v.AddArg(x)
  4691  		return true
  4692  	}
  4693  	// match: (CMP (MOVDconst [c]) y)
  4694  	// cond: is16Bit(c)
  4695  	// result: (InvertFlags (CMPconst y [c]))
  4696  	for {
  4697  		if v_0.Op != OpPPC64MOVDconst {
  4698  			break
  4699  		}
  4700  		c := auxIntToInt64(v_0.AuxInt)
  4701  		y := v_1
  4702  		if !(is16Bit(c)) {
  4703  			break
  4704  		}
  4705  		v.reset(OpPPC64InvertFlags)
  4706  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  4707  		v0.AuxInt = int64ToAuxInt(c)
  4708  		v0.AddArg(y)
  4709  		v.AddArg(v0)
  4710  		return true
  4711  	}
  4712  	// match: (CMP x y)
  4713  	// cond: canonLessThan(x,y)
  4714  	// result: (InvertFlags (CMP y x))
  4715  	for {
  4716  		x := v_0
  4717  		y := v_1
  4718  		if !(canonLessThan(x, y)) {
  4719  			break
  4720  		}
  4721  		v.reset(OpPPC64InvertFlags)
  4722  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  4723  		v0.AddArg2(y, x)
  4724  		v.AddArg(v0)
  4725  		return true
  4726  	}
  4727  	return false
  4728  }
  4729  func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
  4730  	v_1 := v.Args[1]
  4731  	v_0 := v.Args[0]
  4732  	b := v.Block
  4733  	// match: (CMPU x (MOVDconst [c]))
  4734  	// cond: isU16Bit(c)
  4735  	// result: (CMPUconst x [c])
  4736  	for {
  4737  		x := v_0
  4738  		if v_1.Op != OpPPC64MOVDconst {
  4739  			break
  4740  		}
  4741  		c := auxIntToInt64(v_1.AuxInt)
  4742  		if !(isU16Bit(c)) {
  4743  			break
  4744  		}
  4745  		v.reset(OpPPC64CMPUconst)
  4746  		v.AuxInt = int64ToAuxInt(c)
  4747  		v.AddArg(x)
  4748  		return true
  4749  	}
  4750  	// match: (CMPU (MOVDconst [c]) y)
  4751  	// cond: isU16Bit(c)
  4752  	// result: (InvertFlags (CMPUconst y [c]))
  4753  	for {
  4754  		if v_0.Op != OpPPC64MOVDconst {
  4755  			break
  4756  		}
  4757  		c := auxIntToInt64(v_0.AuxInt)
  4758  		y := v_1
  4759  		if !(isU16Bit(c)) {
  4760  			break
  4761  		}
  4762  		v.reset(OpPPC64InvertFlags)
  4763  		v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  4764  		v0.AuxInt = int64ToAuxInt(c)
  4765  		v0.AddArg(y)
  4766  		v.AddArg(v0)
  4767  		return true
  4768  	}
  4769  	// match: (CMPU x y)
  4770  	// cond: canonLessThan(x,y)
  4771  	// result: (InvertFlags (CMPU y x))
  4772  	for {
  4773  		x := v_0
  4774  		y := v_1
  4775  		if !(canonLessThan(x, y)) {
  4776  			break
  4777  		}
  4778  		v.reset(OpPPC64InvertFlags)
  4779  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  4780  		v0.AddArg2(y, x)
  4781  		v.AddArg(v0)
  4782  		return true
  4783  	}
  4784  	return false
  4785  }
  4786  func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
  4787  	v_0 := v.Args[0]
  4788  	// match: (CMPUconst [d] (Select0 (ANDCCconst z [c])))
  4789  	// cond: uint64(d) > uint64(c)
  4790  	// result: (FlagLT)
  4791  	for {
  4792  		d := auxIntToInt64(v.AuxInt)
  4793  		if v_0.Op != OpSelect0 {
  4794  			break
  4795  		}
  4796  		v_0_0 := v_0.Args[0]
  4797  		if v_0_0.Op != OpPPC64ANDCCconst {
  4798  			break
  4799  		}
  4800  		c := auxIntToInt64(v_0_0.AuxInt)
  4801  		if !(uint64(d) > uint64(c)) {
  4802  			break
  4803  		}
  4804  		v.reset(OpPPC64FlagLT)
  4805  		return true
  4806  	}
  4807  	// match: (CMPUconst (MOVDconst [x]) [y])
  4808  	// cond: x==y
  4809  	// result: (FlagEQ)
  4810  	for {
  4811  		y := auxIntToInt64(v.AuxInt)
  4812  		if v_0.Op != OpPPC64MOVDconst {
  4813  			break
  4814  		}
  4815  		x := auxIntToInt64(v_0.AuxInt)
  4816  		if !(x == y) {
  4817  			break
  4818  		}
  4819  		v.reset(OpPPC64FlagEQ)
  4820  		return true
  4821  	}
  4822  	// match: (CMPUconst (MOVDconst [x]) [y])
  4823  	// cond: uint64(x)<uint64(y)
  4824  	// result: (FlagLT)
  4825  	for {
  4826  		y := auxIntToInt64(v.AuxInt)
  4827  		if v_0.Op != OpPPC64MOVDconst {
  4828  			break
  4829  		}
  4830  		x := auxIntToInt64(v_0.AuxInt)
  4831  		if !(uint64(x) < uint64(y)) {
  4832  			break
  4833  		}
  4834  		v.reset(OpPPC64FlagLT)
  4835  		return true
  4836  	}
  4837  	// match: (CMPUconst (MOVDconst [x]) [y])
  4838  	// cond: uint64(x)>uint64(y)
  4839  	// result: (FlagGT)
  4840  	for {
  4841  		y := auxIntToInt64(v.AuxInt)
  4842  		if v_0.Op != OpPPC64MOVDconst {
  4843  			break
  4844  		}
  4845  		x := auxIntToInt64(v_0.AuxInt)
  4846  		if !(uint64(x) > uint64(y)) {
  4847  			break
  4848  		}
  4849  		v.reset(OpPPC64FlagGT)
  4850  		return true
  4851  	}
  4852  	// match: (CMPUconst [0] (Select0 a:(ANDCCconst [n] z)))
  4853  	// result: (Select1 <types.TypeFlags> a)
  4854  	for {
  4855  		if auxIntToInt64(v.AuxInt) != 0 || v_0.Op != OpSelect0 {
  4856  			break
  4857  		}
  4858  		a := v_0.Args[0]
  4859  		if a.Op != OpPPC64ANDCCconst {
  4860  			break
  4861  		}
  4862  		v.reset(OpSelect1)
  4863  		v.Type = types.TypeFlags
  4864  		v.AddArg(a)
  4865  		return true
  4866  	}
  4867  	return false
  4868  }
  4869  func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
  4870  	v_1 := v.Args[1]
  4871  	v_0 := v.Args[0]
  4872  	b := v.Block
  4873  	// match: (CMPW x (MOVWreg y))
  4874  	// result: (CMPW x y)
  4875  	for {
  4876  		x := v_0
  4877  		if v_1.Op != OpPPC64MOVWreg {
  4878  			break
  4879  		}
  4880  		y := v_1.Args[0]
  4881  		v.reset(OpPPC64CMPW)
  4882  		v.AddArg2(x, y)
  4883  		return true
  4884  	}
  4885  	// match: (CMPW (MOVWreg x) y)
  4886  	// result: (CMPW x y)
  4887  	for {
  4888  		if v_0.Op != OpPPC64MOVWreg {
  4889  			break
  4890  		}
  4891  		x := v_0.Args[0]
  4892  		y := v_1
  4893  		v.reset(OpPPC64CMPW)
  4894  		v.AddArg2(x, y)
  4895  		return true
  4896  	}
  4897  	// match: (CMPW x (MOVDconst [c]))
  4898  	// cond: is16Bit(c)
  4899  	// result: (CMPWconst x [int32(c)])
  4900  	for {
  4901  		x := v_0
  4902  		if v_1.Op != OpPPC64MOVDconst {
  4903  			break
  4904  		}
  4905  		c := auxIntToInt64(v_1.AuxInt)
  4906  		if !(is16Bit(c)) {
  4907  			break
  4908  		}
  4909  		v.reset(OpPPC64CMPWconst)
  4910  		v.AuxInt = int32ToAuxInt(int32(c))
  4911  		v.AddArg(x)
  4912  		return true
  4913  	}
  4914  	// match: (CMPW (MOVDconst [c]) y)
  4915  	// cond: is16Bit(c)
  4916  	// result: (InvertFlags (CMPWconst y [int32(c)]))
  4917  	for {
  4918  		if v_0.Op != OpPPC64MOVDconst {
  4919  			break
  4920  		}
  4921  		c := auxIntToInt64(v_0.AuxInt)
  4922  		y := v_1
  4923  		if !(is16Bit(c)) {
  4924  			break
  4925  		}
  4926  		v.reset(OpPPC64InvertFlags)
  4927  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
  4928  		v0.AuxInt = int32ToAuxInt(int32(c))
  4929  		v0.AddArg(y)
  4930  		v.AddArg(v0)
  4931  		return true
  4932  	}
  4933  	// match: (CMPW x y)
  4934  	// cond: canonLessThan(x,y)
  4935  	// result: (InvertFlags (CMPW y x))
  4936  	for {
  4937  		x := v_0
  4938  		y := v_1
  4939  		if !(canonLessThan(x, y)) {
  4940  			break
  4941  		}
  4942  		v.reset(OpPPC64InvertFlags)
  4943  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  4944  		v0.AddArg2(y, x)
  4945  		v.AddArg(v0)
  4946  		return true
  4947  	}
  4948  	return false
  4949  }
  4950  func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
  4951  	v_1 := v.Args[1]
  4952  	v_0 := v.Args[0]
  4953  	b := v.Block
  4954  	// match: (CMPWU x (MOVWZreg y))
  4955  	// result: (CMPWU x y)
  4956  	for {
  4957  		x := v_0
  4958  		if v_1.Op != OpPPC64MOVWZreg {
  4959  			break
  4960  		}
  4961  		y := v_1.Args[0]
  4962  		v.reset(OpPPC64CMPWU)
  4963  		v.AddArg2(x, y)
  4964  		return true
  4965  	}
  4966  	// match: (CMPWU (MOVWZreg x) y)
  4967  	// result: (CMPWU x y)
  4968  	for {
  4969  		if v_0.Op != OpPPC64MOVWZreg {
  4970  			break
  4971  		}
  4972  		x := v_0.Args[0]
  4973  		y := v_1
  4974  		v.reset(OpPPC64CMPWU)
  4975  		v.AddArg2(x, y)
  4976  		return true
  4977  	}
  4978  	// match: (CMPWU x (MOVDconst [c]))
  4979  	// cond: isU16Bit(c)
  4980  	// result: (CMPWUconst x [int32(c)])
  4981  	for {
  4982  		x := v_0
  4983  		if v_1.Op != OpPPC64MOVDconst {
  4984  			break
  4985  		}
  4986  		c := auxIntToInt64(v_1.AuxInt)
  4987  		if !(isU16Bit(c)) {
  4988  			break
  4989  		}
  4990  		v.reset(OpPPC64CMPWUconst)
  4991  		v.AuxInt = int32ToAuxInt(int32(c))
  4992  		v.AddArg(x)
  4993  		return true
  4994  	}
  4995  	// match: (CMPWU (MOVDconst [c]) y)
  4996  	// cond: isU16Bit(c)
  4997  	// result: (InvertFlags (CMPWUconst y [int32(c)]))
  4998  	for {
  4999  		if v_0.Op != OpPPC64MOVDconst {
  5000  			break
  5001  		}
  5002  		c := auxIntToInt64(v_0.AuxInt)
  5003  		y := v_1
  5004  		if !(isU16Bit(c)) {
  5005  			break
  5006  		}
  5007  		v.reset(OpPPC64InvertFlags)
  5008  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  5009  		v0.AuxInt = int32ToAuxInt(int32(c))
  5010  		v0.AddArg(y)
  5011  		v.AddArg(v0)
  5012  		return true
  5013  	}
  5014  	// match: (CMPWU x y)
  5015  	// cond: canonLessThan(x,y)
  5016  	// result: (InvertFlags (CMPWU y x))
  5017  	for {
  5018  		x := v_0
  5019  		y := v_1
  5020  		if !(canonLessThan(x, y)) {
  5021  			break
  5022  		}
  5023  		v.reset(OpPPC64InvertFlags)
  5024  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  5025  		v0.AddArg2(y, x)
  5026  		v.AddArg(v0)
  5027  		return true
  5028  	}
  5029  	return false
  5030  }
  5031  func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
  5032  	v_0 := v.Args[0]
  5033  	// match: (CMPWUconst [d] (Select0 (ANDCCconst z [c])))
  5034  	// cond: uint64(d) > uint64(c)
  5035  	// result: (FlagLT)
  5036  	for {
  5037  		d := auxIntToInt32(v.AuxInt)
  5038  		if v_0.Op != OpSelect0 {
  5039  			break
  5040  		}
  5041  		v_0_0 := v_0.Args[0]
  5042  		if v_0_0.Op != OpPPC64ANDCCconst {
  5043  			break
  5044  		}
  5045  		c := auxIntToInt64(v_0_0.AuxInt)
  5046  		if !(uint64(d) > uint64(c)) {
  5047  			break
  5048  		}
  5049  		v.reset(OpPPC64FlagLT)
  5050  		return true
  5051  	}
  5052  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5053  	// cond: int32(x)==int32(y)
  5054  	// result: (FlagEQ)
  5055  	for {
  5056  		y := auxIntToInt32(v.AuxInt)
  5057  		if v_0.Op != OpPPC64MOVDconst {
  5058  			break
  5059  		}
  5060  		x := auxIntToInt64(v_0.AuxInt)
  5061  		if !(int32(x) == int32(y)) {
  5062  			break
  5063  		}
  5064  		v.reset(OpPPC64FlagEQ)
  5065  		return true
  5066  	}
  5067  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5068  	// cond: uint32(x)<uint32(y)
  5069  	// result: (FlagLT)
  5070  	for {
  5071  		y := auxIntToInt32(v.AuxInt)
  5072  		if v_0.Op != OpPPC64MOVDconst {
  5073  			break
  5074  		}
  5075  		x := auxIntToInt64(v_0.AuxInt)
  5076  		if !(uint32(x) < uint32(y)) {
  5077  			break
  5078  		}
  5079  		v.reset(OpPPC64FlagLT)
  5080  		return true
  5081  	}
  5082  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5083  	// cond: uint32(x)>uint32(y)
  5084  	// result: (FlagGT)
  5085  	for {
  5086  		y := auxIntToInt32(v.AuxInt)
  5087  		if v_0.Op != OpPPC64MOVDconst {
  5088  			break
  5089  		}
  5090  		x := auxIntToInt64(v_0.AuxInt)
  5091  		if !(uint32(x) > uint32(y)) {
  5092  			break
  5093  		}
  5094  		v.reset(OpPPC64FlagGT)
  5095  		return true
  5096  	}
  5097  	// match: (CMPWUconst [0] (Select0 a:(ANDCCconst [n] z)))
  5098  	// result: (Select1 <types.TypeFlags> a)
  5099  	for {
  5100  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpSelect0 {
  5101  			break
  5102  		}
  5103  		a := v_0.Args[0]
  5104  		if a.Op != OpPPC64ANDCCconst {
  5105  			break
  5106  		}
  5107  		v.reset(OpSelect1)
  5108  		v.Type = types.TypeFlags
  5109  		v.AddArg(a)
  5110  		return true
  5111  	}
  5112  	return false
  5113  }
  5114  func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
  5115  	v_0 := v.Args[0]
  5116  	// match: (CMPWconst (MOVDconst [x]) [y])
  5117  	// cond: int32(x)==int32(y)
  5118  	// result: (FlagEQ)
  5119  	for {
  5120  		y := auxIntToInt32(v.AuxInt)
  5121  		if v_0.Op != OpPPC64MOVDconst {
  5122  			break
  5123  		}
  5124  		x := auxIntToInt64(v_0.AuxInt)
  5125  		if !(int32(x) == int32(y)) {
  5126  			break
  5127  		}
  5128  		v.reset(OpPPC64FlagEQ)
  5129  		return true
  5130  	}
  5131  	// match: (CMPWconst (MOVDconst [x]) [y])
  5132  	// cond: int32(x)<int32(y)
  5133  	// result: (FlagLT)
  5134  	for {
  5135  		y := auxIntToInt32(v.AuxInt)
  5136  		if v_0.Op != OpPPC64MOVDconst {
  5137  			break
  5138  		}
  5139  		x := auxIntToInt64(v_0.AuxInt)
  5140  		if !(int32(x) < int32(y)) {
  5141  			break
  5142  		}
  5143  		v.reset(OpPPC64FlagLT)
  5144  		return true
  5145  	}
  5146  	// match: (CMPWconst (MOVDconst [x]) [y])
  5147  	// cond: int32(x)>int32(y)
  5148  	// result: (FlagGT)
  5149  	for {
  5150  		y := auxIntToInt32(v.AuxInt)
  5151  		if v_0.Op != OpPPC64MOVDconst {
  5152  			break
  5153  		}
  5154  		x := auxIntToInt64(v_0.AuxInt)
  5155  		if !(int32(x) > int32(y)) {
  5156  			break
  5157  		}
  5158  		v.reset(OpPPC64FlagGT)
  5159  		return true
  5160  	}
  5161  	// match: (CMPWconst [0] (Select0 a:(ANDCCconst [n] z)))
  5162  	// result: (Select1 <types.TypeFlags> a)
  5163  	for {
  5164  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpSelect0 {
  5165  			break
  5166  		}
  5167  		a := v_0.Args[0]
  5168  		if a.Op != OpPPC64ANDCCconst {
  5169  			break
  5170  		}
  5171  		v.reset(OpSelect1)
  5172  		v.Type = types.TypeFlags
  5173  		v.AddArg(a)
  5174  		return true
  5175  	}
  5176  	return false
  5177  }
  5178  func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
  5179  	v_0 := v.Args[0]
  5180  	// match: (CMPconst (MOVDconst [x]) [y])
  5181  	// cond: x==y
  5182  	// result: (FlagEQ)
  5183  	for {
  5184  		y := auxIntToInt64(v.AuxInt)
  5185  		if v_0.Op != OpPPC64MOVDconst {
  5186  			break
  5187  		}
  5188  		x := auxIntToInt64(v_0.AuxInt)
  5189  		if !(x == y) {
  5190  			break
  5191  		}
  5192  		v.reset(OpPPC64FlagEQ)
  5193  		return true
  5194  	}
  5195  	// match: (CMPconst (MOVDconst [x]) [y])
  5196  	// cond: x<y
  5197  	// result: (FlagLT)
  5198  	for {
  5199  		y := auxIntToInt64(v.AuxInt)
  5200  		if v_0.Op != OpPPC64MOVDconst {
  5201  			break
  5202  		}
  5203  		x := auxIntToInt64(v_0.AuxInt)
  5204  		if !(x < y) {
  5205  			break
  5206  		}
  5207  		v.reset(OpPPC64FlagLT)
  5208  		return true
  5209  	}
  5210  	// match: (CMPconst (MOVDconst [x]) [y])
  5211  	// cond: x>y
  5212  	// result: (FlagGT)
  5213  	for {
  5214  		y := auxIntToInt64(v.AuxInt)
  5215  		if v_0.Op != OpPPC64MOVDconst {
  5216  			break
  5217  		}
  5218  		x := auxIntToInt64(v_0.AuxInt)
  5219  		if !(x > y) {
  5220  			break
  5221  		}
  5222  		v.reset(OpPPC64FlagGT)
  5223  		return true
  5224  	}
  5225  	// match: (CMPconst [0] (Select0 a:(ANDCCconst [n] z)))
  5226  	// result: (Select1 <types.TypeFlags> a)
  5227  	for {
  5228  		if auxIntToInt64(v.AuxInt) != 0 || v_0.Op != OpSelect0 {
  5229  			break
  5230  		}
  5231  		a := v_0.Args[0]
  5232  		if a.Op != OpPPC64ANDCCconst {
  5233  			break
  5234  		}
  5235  		v.reset(OpSelect1)
  5236  		v.Type = types.TypeFlags
  5237  		v.AddArg(a)
  5238  		return true
  5239  	}
  5240  	return false
  5241  }
  5242  func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
  5243  	v_0 := v.Args[0]
  5244  	// match: (Equal (FlagEQ))
  5245  	// result: (MOVDconst [1])
  5246  	for {
  5247  		if v_0.Op != OpPPC64FlagEQ {
  5248  			break
  5249  		}
  5250  		v.reset(OpPPC64MOVDconst)
  5251  		v.AuxInt = int64ToAuxInt(1)
  5252  		return true
  5253  	}
  5254  	// match: (Equal (FlagLT))
  5255  	// result: (MOVDconst [0])
  5256  	for {
  5257  		if v_0.Op != OpPPC64FlagLT {
  5258  			break
  5259  		}
  5260  		v.reset(OpPPC64MOVDconst)
  5261  		v.AuxInt = int64ToAuxInt(0)
  5262  		return true
  5263  	}
  5264  	// match: (Equal (FlagGT))
  5265  	// result: (MOVDconst [0])
  5266  	for {
  5267  		if v_0.Op != OpPPC64FlagGT {
  5268  			break
  5269  		}
  5270  		v.reset(OpPPC64MOVDconst)
  5271  		v.AuxInt = int64ToAuxInt(0)
  5272  		return true
  5273  	}
  5274  	// match: (Equal (InvertFlags x))
  5275  	// result: (Equal x)
  5276  	for {
  5277  		if v_0.Op != OpPPC64InvertFlags {
  5278  			break
  5279  		}
  5280  		x := v_0.Args[0]
  5281  		v.reset(OpPPC64Equal)
  5282  		v.AddArg(x)
  5283  		return true
  5284  	}
  5285  	// match: (Equal cmp)
  5286  	// result: (SETBC [2] cmp)
  5287  	for {
  5288  		cmp := v_0
  5289  		v.reset(OpPPC64SETBC)
  5290  		v.AuxInt = int32ToAuxInt(2)
  5291  		v.AddArg(cmp)
  5292  		return true
  5293  	}
  5294  }
  5295  func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
  5296  	v_0 := v.Args[0]
  5297  	// match: (FABS (FMOVDconst [x]))
  5298  	// result: (FMOVDconst [math.Abs(x)])
  5299  	for {
  5300  		if v_0.Op != OpPPC64FMOVDconst {
  5301  			break
  5302  		}
  5303  		x := auxIntToFloat64(v_0.AuxInt)
  5304  		v.reset(OpPPC64FMOVDconst)
  5305  		v.AuxInt = float64ToAuxInt(math.Abs(x))
  5306  		return true
  5307  	}
  5308  	return false
  5309  }
  5310  func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
  5311  	v_1 := v.Args[1]
  5312  	v_0 := v.Args[0]
  5313  	// match: (FADD (FMUL x y) z)
  5314  	// cond: x.Block.Func.useFMA(v)
  5315  	// result: (FMADD x y z)
  5316  	for {
  5317  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5318  			if v_0.Op != OpPPC64FMUL {
  5319  				continue
  5320  			}
  5321  			_ = v_0.Args[1]
  5322  			v_0_0 := v_0.Args[0]
  5323  			v_0_1 := v_0.Args[1]
  5324  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5325  				x := v_0_0
  5326  				y := v_0_1
  5327  				z := v_1
  5328  				if !(x.Block.Func.useFMA(v)) {
  5329  					continue
  5330  				}
  5331  				v.reset(OpPPC64FMADD)
  5332  				v.AddArg3(x, y, z)
  5333  				return true
  5334  			}
  5335  		}
  5336  		break
  5337  	}
  5338  	return false
  5339  }
  5340  func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
  5341  	v_1 := v.Args[1]
  5342  	v_0 := v.Args[0]
  5343  	// match: (FADDS (FMULS x y) z)
  5344  	// cond: x.Block.Func.useFMA(v)
  5345  	// result: (FMADDS x y z)
  5346  	for {
  5347  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5348  			if v_0.Op != OpPPC64FMULS {
  5349  				continue
  5350  			}
  5351  			_ = v_0.Args[1]
  5352  			v_0_0 := v_0.Args[0]
  5353  			v_0_1 := v_0.Args[1]
  5354  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5355  				x := v_0_0
  5356  				y := v_0_1
  5357  				z := v_1
  5358  				if !(x.Block.Func.useFMA(v)) {
  5359  					continue
  5360  				}
  5361  				v.reset(OpPPC64FMADDS)
  5362  				v.AddArg3(x, y, z)
  5363  				return true
  5364  			}
  5365  		}
  5366  		break
  5367  	}
  5368  	return false
  5369  }
  5370  func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
  5371  	v_0 := v.Args[0]
  5372  	// match: (FCEIL (FMOVDconst [x]))
  5373  	// result: (FMOVDconst [math.Ceil(x)])
  5374  	for {
  5375  		if v_0.Op != OpPPC64FMOVDconst {
  5376  			break
  5377  		}
  5378  		x := auxIntToFloat64(v_0.AuxInt)
  5379  		v.reset(OpPPC64FMOVDconst)
  5380  		v.AuxInt = float64ToAuxInt(math.Ceil(x))
  5381  		return true
  5382  	}
  5383  	return false
  5384  }
  5385  func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
  5386  	v_0 := v.Args[0]
  5387  	// match: (FFLOOR (FMOVDconst [x]))
  5388  	// result: (FMOVDconst [math.Floor(x)])
  5389  	for {
  5390  		if v_0.Op != OpPPC64FMOVDconst {
  5391  			break
  5392  		}
  5393  		x := auxIntToFloat64(v_0.AuxInt)
  5394  		v.reset(OpPPC64FMOVDconst)
  5395  		v.AuxInt = float64ToAuxInt(math.Floor(x))
  5396  		return true
  5397  	}
  5398  	return false
  5399  }
  5400  func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
  5401  	v_0 := v.Args[0]
  5402  	b := v.Block
  5403  	typ := &b.Func.Config.Types
  5404  	// match: (FGreaterEqual cmp)
  5405  	// result: (OR (SETBC [2] cmp) (SETBC [1] cmp))
  5406  	for {
  5407  		cmp := v_0
  5408  		v.reset(OpPPC64OR)
  5409  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5410  		v0.AuxInt = int32ToAuxInt(2)
  5411  		v0.AddArg(cmp)
  5412  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5413  		v1.AuxInt = int32ToAuxInt(1)
  5414  		v1.AddArg(cmp)
  5415  		v.AddArg2(v0, v1)
  5416  		return true
  5417  	}
  5418  }
  5419  func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
  5420  	v_0 := v.Args[0]
  5421  	// match: (FGreaterThan cmp)
  5422  	// result: (SETBC [1] cmp)
  5423  	for {
  5424  		cmp := v_0
  5425  		v.reset(OpPPC64SETBC)
  5426  		v.AuxInt = int32ToAuxInt(1)
  5427  		v.AddArg(cmp)
  5428  		return true
  5429  	}
  5430  }
  5431  func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
  5432  	v_0 := v.Args[0]
  5433  	b := v.Block
  5434  	typ := &b.Func.Config.Types
  5435  	// match: (FLessEqual cmp)
  5436  	// result: (OR (SETBC [2] cmp) (SETBC [0] cmp))
  5437  	for {
  5438  		cmp := v_0
  5439  		v.reset(OpPPC64OR)
  5440  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5441  		v0.AuxInt = int32ToAuxInt(2)
  5442  		v0.AddArg(cmp)
  5443  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5444  		v1.AuxInt = int32ToAuxInt(0)
  5445  		v1.AddArg(cmp)
  5446  		v.AddArg2(v0, v1)
  5447  		return true
  5448  	}
  5449  }
  5450  func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
  5451  	v_0 := v.Args[0]
  5452  	// match: (FLessThan cmp)
  5453  	// result: (SETBC [0] cmp)
  5454  	for {
  5455  		cmp := v_0
  5456  		v.reset(OpPPC64SETBC)
  5457  		v.AuxInt = int32ToAuxInt(0)
  5458  		v.AddArg(cmp)
  5459  		return true
  5460  	}
  5461  }
  5462  func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
  5463  	v_1 := v.Args[1]
  5464  	v_0 := v.Args[0]
  5465  	// match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _))
  5466  	// result: (MTVSRD x)
  5467  	for {
  5468  		off := auxIntToInt32(v.AuxInt)
  5469  		sym := auxToSym(v.Aux)
  5470  		ptr := v_0
  5471  		if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5472  			break
  5473  		}
  5474  		x := v_1.Args[1]
  5475  		if ptr != v_1.Args[0] {
  5476  			break
  5477  		}
  5478  		v.reset(OpPPC64MTVSRD)
  5479  		v.AddArg(x)
  5480  		return true
  5481  	}
  5482  	// match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5483  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5484  	// result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5485  	for {
  5486  		off1 := auxIntToInt32(v.AuxInt)
  5487  		sym1 := auxToSym(v.Aux)
  5488  		p := v_0
  5489  		if p.Op != OpPPC64MOVDaddr {
  5490  			break
  5491  		}
  5492  		off2 := auxIntToInt32(p.AuxInt)
  5493  		sym2 := auxToSym(p.Aux)
  5494  		ptr := p.Args[0]
  5495  		mem := v_1
  5496  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5497  			break
  5498  		}
  5499  		v.reset(OpPPC64FMOVDload)
  5500  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5501  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5502  		v.AddArg2(ptr, mem)
  5503  		return true
  5504  	}
  5505  	// match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  5506  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5507  	// result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
  5508  	for {
  5509  		off1 := auxIntToInt32(v.AuxInt)
  5510  		sym := auxToSym(v.Aux)
  5511  		if v_0.Op != OpPPC64ADDconst {
  5512  			break
  5513  		}
  5514  		off2 := auxIntToInt64(v_0.AuxInt)
  5515  		ptr := v_0.Args[0]
  5516  		mem := v_1
  5517  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5518  			break
  5519  		}
  5520  		v.reset(OpPPC64FMOVDload)
  5521  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5522  		v.Aux = symToAux(sym)
  5523  		v.AddArg2(ptr, mem)
  5524  		return true
  5525  	}
  5526  	return false
  5527  }
  5528  func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
  5529  	v_2 := v.Args[2]
  5530  	v_1 := v.Args[1]
  5531  	v_0 := v.Args[0]
  5532  	// match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem)
  5533  	// result: (MOVDstore [off] {sym} ptr x mem)
  5534  	for {
  5535  		off := auxIntToInt32(v.AuxInt)
  5536  		sym := auxToSym(v.Aux)
  5537  		ptr := v_0
  5538  		if v_1.Op != OpPPC64MTVSRD {
  5539  			break
  5540  		}
  5541  		x := v_1.Args[0]
  5542  		mem := v_2
  5543  		v.reset(OpPPC64MOVDstore)
  5544  		v.AuxInt = int32ToAuxInt(off)
  5545  		v.Aux = symToAux(sym)
  5546  		v.AddArg3(ptr, x, mem)
  5547  		return true
  5548  	}
  5549  	// match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5550  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5551  	// result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
  5552  	for {
  5553  		off1 := auxIntToInt32(v.AuxInt)
  5554  		sym := auxToSym(v.Aux)
  5555  		if v_0.Op != OpPPC64ADDconst {
  5556  			break
  5557  		}
  5558  		off2 := auxIntToInt64(v_0.AuxInt)
  5559  		ptr := v_0.Args[0]
  5560  		val := v_1
  5561  		mem := v_2
  5562  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5563  			break
  5564  		}
  5565  		v.reset(OpPPC64FMOVDstore)
  5566  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5567  		v.Aux = symToAux(sym)
  5568  		v.AddArg3(ptr, val, mem)
  5569  		return true
  5570  	}
  5571  	// match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  5572  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5573  	// result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5574  	for {
  5575  		off1 := auxIntToInt32(v.AuxInt)
  5576  		sym1 := auxToSym(v.Aux)
  5577  		p := v_0
  5578  		if p.Op != OpPPC64MOVDaddr {
  5579  			break
  5580  		}
  5581  		off2 := auxIntToInt32(p.AuxInt)
  5582  		sym2 := auxToSym(p.Aux)
  5583  		ptr := p.Args[0]
  5584  		val := v_1
  5585  		mem := v_2
  5586  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5587  			break
  5588  		}
  5589  		v.reset(OpPPC64FMOVDstore)
  5590  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5591  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5592  		v.AddArg3(ptr, val, mem)
  5593  		return true
  5594  	}
  5595  	return false
  5596  }
  5597  func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
  5598  	v_1 := v.Args[1]
  5599  	v_0 := v.Args[0]
  5600  	// match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5601  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5602  	// result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5603  	for {
  5604  		off1 := auxIntToInt32(v.AuxInt)
  5605  		sym1 := auxToSym(v.Aux)
  5606  		p := v_0
  5607  		if p.Op != OpPPC64MOVDaddr {
  5608  			break
  5609  		}
  5610  		off2 := auxIntToInt32(p.AuxInt)
  5611  		sym2 := auxToSym(p.Aux)
  5612  		ptr := p.Args[0]
  5613  		mem := v_1
  5614  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5615  			break
  5616  		}
  5617  		v.reset(OpPPC64FMOVSload)
  5618  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5619  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5620  		v.AddArg2(ptr, mem)
  5621  		return true
  5622  	}
  5623  	// match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
  5624  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5625  	// result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
  5626  	for {
  5627  		off1 := auxIntToInt32(v.AuxInt)
  5628  		sym := auxToSym(v.Aux)
  5629  		if v_0.Op != OpPPC64ADDconst {
  5630  			break
  5631  		}
  5632  		off2 := auxIntToInt64(v_0.AuxInt)
  5633  		ptr := v_0.Args[0]
  5634  		mem := v_1
  5635  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5636  			break
  5637  		}
  5638  		v.reset(OpPPC64FMOVSload)
  5639  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5640  		v.Aux = symToAux(sym)
  5641  		v.AddArg2(ptr, mem)
  5642  		return true
  5643  	}
  5644  	return false
  5645  }
  5646  func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
  5647  	v_2 := v.Args[2]
  5648  	v_1 := v.Args[1]
  5649  	v_0 := v.Args[0]
  5650  	// match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5651  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5652  	// result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
  5653  	for {
  5654  		off1 := auxIntToInt32(v.AuxInt)
  5655  		sym := auxToSym(v.Aux)
  5656  		if v_0.Op != OpPPC64ADDconst {
  5657  			break
  5658  		}
  5659  		off2 := auxIntToInt64(v_0.AuxInt)
  5660  		ptr := v_0.Args[0]
  5661  		val := v_1
  5662  		mem := v_2
  5663  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5664  			break
  5665  		}
  5666  		v.reset(OpPPC64FMOVSstore)
  5667  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5668  		v.Aux = symToAux(sym)
  5669  		v.AddArg3(ptr, val, mem)
  5670  		return true
  5671  	}
  5672  	// match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  5673  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5674  	// result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5675  	for {
  5676  		off1 := auxIntToInt32(v.AuxInt)
  5677  		sym1 := auxToSym(v.Aux)
  5678  		p := v_0
  5679  		if p.Op != OpPPC64MOVDaddr {
  5680  			break
  5681  		}
  5682  		off2 := auxIntToInt32(p.AuxInt)
  5683  		sym2 := auxToSym(p.Aux)
  5684  		ptr := p.Args[0]
  5685  		val := v_1
  5686  		mem := v_2
  5687  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5688  			break
  5689  		}
  5690  		v.reset(OpPPC64FMOVSstore)
  5691  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5692  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5693  		v.AddArg3(ptr, val, mem)
  5694  		return true
  5695  	}
  5696  	return false
  5697  }
  5698  func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
  5699  	v_0 := v.Args[0]
  5700  	// match: (FNEG (FABS x))
  5701  	// result: (FNABS x)
  5702  	for {
  5703  		if v_0.Op != OpPPC64FABS {
  5704  			break
  5705  		}
  5706  		x := v_0.Args[0]
  5707  		v.reset(OpPPC64FNABS)
  5708  		v.AddArg(x)
  5709  		return true
  5710  	}
  5711  	// match: (FNEG (FNABS x))
  5712  	// result: (FABS x)
  5713  	for {
  5714  		if v_0.Op != OpPPC64FNABS {
  5715  			break
  5716  		}
  5717  		x := v_0.Args[0]
  5718  		v.reset(OpPPC64FABS)
  5719  		v.AddArg(x)
  5720  		return true
  5721  	}
  5722  	return false
  5723  }
  5724  func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
  5725  	v_0 := v.Args[0]
  5726  	// match: (FSQRT (FMOVDconst [x]))
  5727  	// cond: x >= 0
  5728  	// result: (FMOVDconst [math.Sqrt(x)])
  5729  	for {
  5730  		if v_0.Op != OpPPC64FMOVDconst {
  5731  			break
  5732  		}
  5733  		x := auxIntToFloat64(v_0.AuxInt)
  5734  		if !(x >= 0) {
  5735  			break
  5736  		}
  5737  		v.reset(OpPPC64FMOVDconst)
  5738  		v.AuxInt = float64ToAuxInt(math.Sqrt(x))
  5739  		return true
  5740  	}
  5741  	return false
  5742  }
  5743  func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
  5744  	v_1 := v.Args[1]
  5745  	v_0 := v.Args[0]
  5746  	// match: (FSUB (FMUL x y) z)
  5747  	// cond: x.Block.Func.useFMA(v)
  5748  	// result: (FMSUB x y z)
  5749  	for {
  5750  		if v_0.Op != OpPPC64FMUL {
  5751  			break
  5752  		}
  5753  		_ = v_0.Args[1]
  5754  		v_0_0 := v_0.Args[0]
  5755  		v_0_1 := v_0.Args[1]
  5756  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  5757  			x := v_0_0
  5758  			y := v_0_1
  5759  			z := v_1
  5760  			if !(x.Block.Func.useFMA(v)) {
  5761  				continue
  5762  			}
  5763  			v.reset(OpPPC64FMSUB)
  5764  			v.AddArg3(x, y, z)
  5765  			return true
  5766  		}
  5767  		break
  5768  	}
  5769  	return false
  5770  }
  5771  func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
  5772  	v_1 := v.Args[1]
  5773  	v_0 := v.Args[0]
  5774  	// match: (FSUBS (FMULS x y) z)
  5775  	// cond: x.Block.Func.useFMA(v)
  5776  	// result: (FMSUBS x y z)
  5777  	for {
  5778  		if v_0.Op != OpPPC64FMULS {
  5779  			break
  5780  		}
  5781  		_ = v_0.Args[1]
  5782  		v_0_0 := v_0.Args[0]
  5783  		v_0_1 := v_0.Args[1]
  5784  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  5785  			x := v_0_0
  5786  			y := v_0_1
  5787  			z := v_1
  5788  			if !(x.Block.Func.useFMA(v)) {
  5789  				continue
  5790  			}
  5791  			v.reset(OpPPC64FMSUBS)
  5792  			v.AddArg3(x, y, z)
  5793  			return true
  5794  		}
  5795  		break
  5796  	}
  5797  	return false
  5798  }
  5799  func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
  5800  	v_0 := v.Args[0]
  5801  	// match: (FTRUNC (FMOVDconst [x]))
  5802  	// result: (FMOVDconst [math.Trunc(x)])
  5803  	for {
  5804  		if v_0.Op != OpPPC64FMOVDconst {
  5805  			break
  5806  		}
  5807  		x := auxIntToFloat64(v_0.AuxInt)
  5808  		v.reset(OpPPC64FMOVDconst)
  5809  		v.AuxInt = float64ToAuxInt(math.Trunc(x))
  5810  		return true
  5811  	}
  5812  	return false
  5813  }
  5814  func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
  5815  	v_0 := v.Args[0]
  5816  	// match: (GreaterEqual (FlagEQ))
  5817  	// result: (MOVDconst [1])
  5818  	for {
  5819  		if v_0.Op != OpPPC64FlagEQ {
  5820  			break
  5821  		}
  5822  		v.reset(OpPPC64MOVDconst)
  5823  		v.AuxInt = int64ToAuxInt(1)
  5824  		return true
  5825  	}
  5826  	// match: (GreaterEqual (FlagLT))
  5827  	// result: (MOVDconst [0])
  5828  	for {
  5829  		if v_0.Op != OpPPC64FlagLT {
  5830  			break
  5831  		}
  5832  		v.reset(OpPPC64MOVDconst)
  5833  		v.AuxInt = int64ToAuxInt(0)
  5834  		return true
  5835  	}
  5836  	// match: (GreaterEqual (FlagGT))
  5837  	// result: (MOVDconst [1])
  5838  	for {
  5839  		if v_0.Op != OpPPC64FlagGT {
  5840  			break
  5841  		}
  5842  		v.reset(OpPPC64MOVDconst)
  5843  		v.AuxInt = int64ToAuxInt(1)
  5844  		return true
  5845  	}
  5846  	// match: (GreaterEqual (InvertFlags x))
  5847  	// result: (LessEqual x)
  5848  	for {
  5849  		if v_0.Op != OpPPC64InvertFlags {
  5850  			break
  5851  		}
  5852  		x := v_0.Args[0]
  5853  		v.reset(OpPPC64LessEqual)
  5854  		v.AddArg(x)
  5855  		return true
  5856  	}
  5857  	// match: (GreaterEqual cmp)
  5858  	// result: (SETBCR [0] cmp)
  5859  	for {
  5860  		cmp := v_0
  5861  		v.reset(OpPPC64SETBCR)
  5862  		v.AuxInt = int32ToAuxInt(0)
  5863  		v.AddArg(cmp)
  5864  		return true
  5865  	}
  5866  }
  5867  func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
  5868  	v_0 := v.Args[0]
  5869  	// match: (GreaterThan (FlagEQ))
  5870  	// result: (MOVDconst [0])
  5871  	for {
  5872  		if v_0.Op != OpPPC64FlagEQ {
  5873  			break
  5874  		}
  5875  		v.reset(OpPPC64MOVDconst)
  5876  		v.AuxInt = int64ToAuxInt(0)
  5877  		return true
  5878  	}
  5879  	// match: (GreaterThan (FlagLT))
  5880  	// result: (MOVDconst [0])
  5881  	for {
  5882  		if v_0.Op != OpPPC64FlagLT {
  5883  			break
  5884  		}
  5885  		v.reset(OpPPC64MOVDconst)
  5886  		v.AuxInt = int64ToAuxInt(0)
  5887  		return true
  5888  	}
  5889  	// match: (GreaterThan (FlagGT))
  5890  	// result: (MOVDconst [1])
  5891  	for {
  5892  		if v_0.Op != OpPPC64FlagGT {
  5893  			break
  5894  		}
  5895  		v.reset(OpPPC64MOVDconst)
  5896  		v.AuxInt = int64ToAuxInt(1)
  5897  		return true
  5898  	}
  5899  	// match: (GreaterThan (InvertFlags x))
  5900  	// result: (LessThan x)
  5901  	for {
  5902  		if v_0.Op != OpPPC64InvertFlags {
  5903  			break
  5904  		}
  5905  		x := v_0.Args[0]
  5906  		v.reset(OpPPC64LessThan)
  5907  		v.AddArg(x)
  5908  		return true
  5909  	}
  5910  	// match: (GreaterThan cmp)
  5911  	// result: (SETBC [1] cmp)
  5912  	for {
  5913  		cmp := v_0
  5914  		v.reset(OpPPC64SETBC)
  5915  		v.AuxInt = int32ToAuxInt(1)
  5916  		v.AddArg(cmp)
  5917  		return true
  5918  	}
  5919  }
  5920  func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
  5921  	v_2 := v.Args[2]
  5922  	v_1 := v.Args[1]
  5923  	v_0 := v.Args[0]
  5924  	// match: (ISEL [6] x y (Select1 (ANDCCconst [1] (SETBC [c] cmp))))
  5925  	// result: (ISEL [c] x y cmp)
  5926  	for {
  5927  		if auxIntToInt32(v.AuxInt) != 6 {
  5928  			break
  5929  		}
  5930  		x := v_0
  5931  		y := v_1
  5932  		if v_2.Op != OpSelect1 {
  5933  			break
  5934  		}
  5935  		v_2_0 := v_2.Args[0]
  5936  		if v_2_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_2_0.AuxInt) != 1 {
  5937  			break
  5938  		}
  5939  		v_2_0_0 := v_2_0.Args[0]
  5940  		if v_2_0_0.Op != OpPPC64SETBC {
  5941  			break
  5942  		}
  5943  		c := auxIntToInt32(v_2_0_0.AuxInt)
  5944  		cmp := v_2_0_0.Args[0]
  5945  		v.reset(OpPPC64ISEL)
  5946  		v.AuxInt = int32ToAuxInt(c)
  5947  		v.AddArg3(x, y, cmp)
  5948  		return true
  5949  	}
  5950  	// match: (ISEL [6] x y (CMPconst [0] (SETBC [c] cmp)))
  5951  	// result: (ISEL [c] x y cmp)
  5952  	for {
  5953  		if auxIntToInt32(v.AuxInt) != 6 {
  5954  			break
  5955  		}
  5956  		x := v_0
  5957  		y := v_1
  5958  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  5959  			break
  5960  		}
  5961  		v_2_0 := v_2.Args[0]
  5962  		if v_2_0.Op != OpPPC64SETBC {
  5963  			break
  5964  		}
  5965  		c := auxIntToInt32(v_2_0.AuxInt)
  5966  		cmp := v_2_0.Args[0]
  5967  		v.reset(OpPPC64ISEL)
  5968  		v.AuxInt = int32ToAuxInt(c)
  5969  		v.AddArg3(x, y, cmp)
  5970  		return true
  5971  	}
  5972  	// match: (ISEL [6] x y (CMPWconst [0] (SETBC [c] cmp)))
  5973  	// result: (ISEL [c] x y cmp)
  5974  	for {
  5975  		if auxIntToInt32(v.AuxInt) != 6 {
  5976  			break
  5977  		}
  5978  		x := v_0
  5979  		y := v_1
  5980  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  5981  			break
  5982  		}
  5983  		v_2_0 := v_2.Args[0]
  5984  		if v_2_0.Op != OpPPC64SETBC {
  5985  			break
  5986  		}
  5987  		c := auxIntToInt32(v_2_0.AuxInt)
  5988  		cmp := v_2_0.Args[0]
  5989  		v.reset(OpPPC64ISEL)
  5990  		v.AuxInt = int32ToAuxInt(c)
  5991  		v.AddArg3(x, y, cmp)
  5992  		return true
  5993  	}
  5994  	// match: (ISEL [6] x y (CMPconst [0] (SETBCR [c] cmp)))
  5995  	// result: (ISEL [c+4] x y cmp)
  5996  	for {
  5997  		if auxIntToInt32(v.AuxInt) != 6 {
  5998  			break
  5999  		}
  6000  		x := v_0
  6001  		y := v_1
  6002  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6003  			break
  6004  		}
  6005  		v_2_0 := v_2.Args[0]
  6006  		if v_2_0.Op != OpPPC64SETBCR {
  6007  			break
  6008  		}
  6009  		c := auxIntToInt32(v_2_0.AuxInt)
  6010  		cmp := v_2_0.Args[0]
  6011  		v.reset(OpPPC64ISEL)
  6012  		v.AuxInt = int32ToAuxInt(c + 4)
  6013  		v.AddArg3(x, y, cmp)
  6014  		return true
  6015  	}
  6016  	// match: (ISEL [6] x y (CMPWconst [0] (SETBCR [c] cmp)))
  6017  	// result: (ISEL [c+4] x y cmp)
  6018  	for {
  6019  		if auxIntToInt32(v.AuxInt) != 6 {
  6020  			break
  6021  		}
  6022  		x := v_0
  6023  		y := v_1
  6024  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6025  			break
  6026  		}
  6027  		v_2_0 := v_2.Args[0]
  6028  		if v_2_0.Op != OpPPC64SETBCR {
  6029  			break
  6030  		}
  6031  		c := auxIntToInt32(v_2_0.AuxInt)
  6032  		cmp := v_2_0.Args[0]
  6033  		v.reset(OpPPC64ISEL)
  6034  		v.AuxInt = int32ToAuxInt(c + 4)
  6035  		v.AddArg3(x, y, cmp)
  6036  		return true
  6037  	}
  6038  	// match: (ISEL [2] x _ (FlagEQ))
  6039  	// result: x
  6040  	for {
  6041  		if auxIntToInt32(v.AuxInt) != 2 {
  6042  			break
  6043  		}
  6044  		x := v_0
  6045  		if v_2.Op != OpPPC64FlagEQ {
  6046  			break
  6047  		}
  6048  		v.copyOf(x)
  6049  		return true
  6050  	}
  6051  	// match: (ISEL [2] _ y (FlagLT))
  6052  	// result: y
  6053  	for {
  6054  		if auxIntToInt32(v.AuxInt) != 2 {
  6055  			break
  6056  		}
  6057  		y := v_1
  6058  		if v_2.Op != OpPPC64FlagLT {
  6059  			break
  6060  		}
  6061  		v.copyOf(y)
  6062  		return true
  6063  	}
  6064  	// match: (ISEL [2] _ y (FlagGT))
  6065  	// result: y
  6066  	for {
  6067  		if auxIntToInt32(v.AuxInt) != 2 {
  6068  			break
  6069  		}
  6070  		y := v_1
  6071  		if v_2.Op != OpPPC64FlagGT {
  6072  			break
  6073  		}
  6074  		v.copyOf(y)
  6075  		return true
  6076  	}
  6077  	// match: (ISEL [6] _ y (FlagEQ))
  6078  	// result: y
  6079  	for {
  6080  		if auxIntToInt32(v.AuxInt) != 6 {
  6081  			break
  6082  		}
  6083  		y := v_1
  6084  		if v_2.Op != OpPPC64FlagEQ {
  6085  			break
  6086  		}
  6087  		v.copyOf(y)
  6088  		return true
  6089  	}
  6090  	// match: (ISEL [6] x _ (FlagLT))
  6091  	// result: x
  6092  	for {
  6093  		if auxIntToInt32(v.AuxInt) != 6 {
  6094  			break
  6095  		}
  6096  		x := v_0
  6097  		if v_2.Op != OpPPC64FlagLT {
  6098  			break
  6099  		}
  6100  		v.copyOf(x)
  6101  		return true
  6102  	}
  6103  	// match: (ISEL [6] x _ (FlagGT))
  6104  	// result: x
  6105  	for {
  6106  		if auxIntToInt32(v.AuxInt) != 6 {
  6107  			break
  6108  		}
  6109  		x := v_0
  6110  		if v_2.Op != OpPPC64FlagGT {
  6111  			break
  6112  		}
  6113  		v.copyOf(x)
  6114  		return true
  6115  	}
  6116  	// match: (ISEL [0] _ y (FlagEQ))
  6117  	// result: y
  6118  	for {
  6119  		if auxIntToInt32(v.AuxInt) != 0 {
  6120  			break
  6121  		}
  6122  		y := v_1
  6123  		if v_2.Op != OpPPC64FlagEQ {
  6124  			break
  6125  		}
  6126  		v.copyOf(y)
  6127  		return true
  6128  	}
  6129  	// match: (ISEL [0] _ y (FlagGT))
  6130  	// result: y
  6131  	for {
  6132  		if auxIntToInt32(v.AuxInt) != 0 {
  6133  			break
  6134  		}
  6135  		y := v_1
  6136  		if v_2.Op != OpPPC64FlagGT {
  6137  			break
  6138  		}
  6139  		v.copyOf(y)
  6140  		return true
  6141  	}
  6142  	// match: (ISEL [0] x _ (FlagLT))
  6143  	// result: x
  6144  	for {
  6145  		if auxIntToInt32(v.AuxInt) != 0 {
  6146  			break
  6147  		}
  6148  		x := v_0
  6149  		if v_2.Op != OpPPC64FlagLT {
  6150  			break
  6151  		}
  6152  		v.copyOf(x)
  6153  		return true
  6154  	}
  6155  	// match: (ISEL [5] _ x (FlagEQ))
  6156  	// result: x
  6157  	for {
  6158  		if auxIntToInt32(v.AuxInt) != 5 {
  6159  			break
  6160  		}
  6161  		x := v_1
  6162  		if v_2.Op != OpPPC64FlagEQ {
  6163  			break
  6164  		}
  6165  		v.copyOf(x)
  6166  		return true
  6167  	}
  6168  	// match: (ISEL [5] _ x (FlagLT))
  6169  	// result: x
  6170  	for {
  6171  		if auxIntToInt32(v.AuxInt) != 5 {
  6172  			break
  6173  		}
  6174  		x := v_1
  6175  		if v_2.Op != OpPPC64FlagLT {
  6176  			break
  6177  		}
  6178  		v.copyOf(x)
  6179  		return true
  6180  	}
  6181  	// match: (ISEL [5] y _ (FlagGT))
  6182  	// result: y
  6183  	for {
  6184  		if auxIntToInt32(v.AuxInt) != 5 {
  6185  			break
  6186  		}
  6187  		y := v_0
  6188  		if v_2.Op != OpPPC64FlagGT {
  6189  			break
  6190  		}
  6191  		v.copyOf(y)
  6192  		return true
  6193  	}
  6194  	// match: (ISEL [1] _ y (FlagEQ))
  6195  	// result: y
  6196  	for {
  6197  		if auxIntToInt32(v.AuxInt) != 1 {
  6198  			break
  6199  		}
  6200  		y := v_1
  6201  		if v_2.Op != OpPPC64FlagEQ {
  6202  			break
  6203  		}
  6204  		v.copyOf(y)
  6205  		return true
  6206  	}
  6207  	// match: (ISEL [1] _ y (FlagLT))
  6208  	// result: y
  6209  	for {
  6210  		if auxIntToInt32(v.AuxInt) != 1 {
  6211  			break
  6212  		}
  6213  		y := v_1
  6214  		if v_2.Op != OpPPC64FlagLT {
  6215  			break
  6216  		}
  6217  		v.copyOf(y)
  6218  		return true
  6219  	}
  6220  	// match: (ISEL [1] x _ (FlagGT))
  6221  	// result: x
  6222  	for {
  6223  		if auxIntToInt32(v.AuxInt) != 1 {
  6224  			break
  6225  		}
  6226  		x := v_0
  6227  		if v_2.Op != OpPPC64FlagGT {
  6228  			break
  6229  		}
  6230  		v.copyOf(x)
  6231  		return true
  6232  	}
  6233  	// match: (ISEL [4] x _ (FlagEQ))
  6234  	// result: x
  6235  	for {
  6236  		if auxIntToInt32(v.AuxInt) != 4 {
  6237  			break
  6238  		}
  6239  		x := v_0
  6240  		if v_2.Op != OpPPC64FlagEQ {
  6241  			break
  6242  		}
  6243  		v.copyOf(x)
  6244  		return true
  6245  	}
  6246  	// match: (ISEL [4] x _ (FlagGT))
  6247  	// result: x
  6248  	for {
  6249  		if auxIntToInt32(v.AuxInt) != 4 {
  6250  			break
  6251  		}
  6252  		x := v_0
  6253  		if v_2.Op != OpPPC64FlagGT {
  6254  			break
  6255  		}
  6256  		v.copyOf(x)
  6257  		return true
  6258  	}
  6259  	// match: (ISEL [4] _ y (FlagLT))
  6260  	// result: y
  6261  	for {
  6262  		if auxIntToInt32(v.AuxInt) != 4 {
  6263  			break
  6264  		}
  6265  		y := v_1
  6266  		if v_2.Op != OpPPC64FlagLT {
  6267  			break
  6268  		}
  6269  		v.copyOf(y)
  6270  		return true
  6271  	}
  6272  	// match: (ISEL [n] x y (InvertFlags bool))
  6273  	// cond: n%4 == 0
  6274  	// result: (ISEL [n+1] x y bool)
  6275  	for {
  6276  		n := auxIntToInt32(v.AuxInt)
  6277  		x := v_0
  6278  		y := v_1
  6279  		if v_2.Op != OpPPC64InvertFlags {
  6280  			break
  6281  		}
  6282  		bool := v_2.Args[0]
  6283  		if !(n%4 == 0) {
  6284  			break
  6285  		}
  6286  		v.reset(OpPPC64ISEL)
  6287  		v.AuxInt = int32ToAuxInt(n + 1)
  6288  		v.AddArg3(x, y, bool)
  6289  		return true
  6290  	}
  6291  	// match: (ISEL [n] x y (InvertFlags bool))
  6292  	// cond: n%4 == 1
  6293  	// result: (ISEL [n-1] x y bool)
  6294  	for {
  6295  		n := auxIntToInt32(v.AuxInt)
  6296  		x := v_0
  6297  		y := v_1
  6298  		if v_2.Op != OpPPC64InvertFlags {
  6299  			break
  6300  		}
  6301  		bool := v_2.Args[0]
  6302  		if !(n%4 == 1) {
  6303  			break
  6304  		}
  6305  		v.reset(OpPPC64ISEL)
  6306  		v.AuxInt = int32ToAuxInt(n - 1)
  6307  		v.AddArg3(x, y, bool)
  6308  		return true
  6309  	}
  6310  	// match: (ISEL [n] x y (InvertFlags bool))
  6311  	// cond: n%4 == 2
  6312  	// result: (ISEL [n] x y bool)
  6313  	for {
  6314  		n := auxIntToInt32(v.AuxInt)
  6315  		x := v_0
  6316  		y := v_1
  6317  		if v_2.Op != OpPPC64InvertFlags {
  6318  			break
  6319  		}
  6320  		bool := v_2.Args[0]
  6321  		if !(n%4 == 2) {
  6322  			break
  6323  		}
  6324  		v.reset(OpPPC64ISEL)
  6325  		v.AuxInt = int32ToAuxInt(n)
  6326  		v.AddArg3(x, y, bool)
  6327  		return true
  6328  	}
  6329  	return false
  6330  }
  6331  func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
  6332  	v_0 := v.Args[0]
  6333  	// match: (LessEqual (FlagEQ))
  6334  	// result: (MOVDconst [1])
  6335  	for {
  6336  		if v_0.Op != OpPPC64FlagEQ {
  6337  			break
  6338  		}
  6339  		v.reset(OpPPC64MOVDconst)
  6340  		v.AuxInt = int64ToAuxInt(1)
  6341  		return true
  6342  	}
  6343  	// match: (LessEqual (FlagLT))
  6344  	// result: (MOVDconst [1])
  6345  	for {
  6346  		if v_0.Op != OpPPC64FlagLT {
  6347  			break
  6348  		}
  6349  		v.reset(OpPPC64MOVDconst)
  6350  		v.AuxInt = int64ToAuxInt(1)
  6351  		return true
  6352  	}
  6353  	// match: (LessEqual (FlagGT))
  6354  	// result: (MOVDconst [0])
  6355  	for {
  6356  		if v_0.Op != OpPPC64FlagGT {
  6357  			break
  6358  		}
  6359  		v.reset(OpPPC64MOVDconst)
  6360  		v.AuxInt = int64ToAuxInt(0)
  6361  		return true
  6362  	}
  6363  	// match: (LessEqual (InvertFlags x))
  6364  	// result: (GreaterEqual x)
  6365  	for {
  6366  		if v_0.Op != OpPPC64InvertFlags {
  6367  			break
  6368  		}
  6369  		x := v_0.Args[0]
  6370  		v.reset(OpPPC64GreaterEqual)
  6371  		v.AddArg(x)
  6372  		return true
  6373  	}
  6374  	// match: (LessEqual cmp)
  6375  	// result: (SETBCR [1] cmp)
  6376  	for {
  6377  		cmp := v_0
  6378  		v.reset(OpPPC64SETBCR)
  6379  		v.AuxInt = int32ToAuxInt(1)
  6380  		v.AddArg(cmp)
  6381  		return true
  6382  	}
  6383  }
  6384  func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
  6385  	v_0 := v.Args[0]
  6386  	// match: (LessThan (FlagEQ))
  6387  	// result: (MOVDconst [0])
  6388  	for {
  6389  		if v_0.Op != OpPPC64FlagEQ {
  6390  			break
  6391  		}
  6392  		v.reset(OpPPC64MOVDconst)
  6393  		v.AuxInt = int64ToAuxInt(0)
  6394  		return true
  6395  	}
  6396  	// match: (LessThan (FlagLT))
  6397  	// result: (MOVDconst [1])
  6398  	for {
  6399  		if v_0.Op != OpPPC64FlagLT {
  6400  			break
  6401  		}
  6402  		v.reset(OpPPC64MOVDconst)
  6403  		v.AuxInt = int64ToAuxInt(1)
  6404  		return true
  6405  	}
  6406  	// match: (LessThan (FlagGT))
  6407  	// result: (MOVDconst [0])
  6408  	for {
  6409  		if v_0.Op != OpPPC64FlagGT {
  6410  			break
  6411  		}
  6412  		v.reset(OpPPC64MOVDconst)
  6413  		v.AuxInt = int64ToAuxInt(0)
  6414  		return true
  6415  	}
  6416  	// match: (LessThan (InvertFlags x))
  6417  	// result: (GreaterThan x)
  6418  	for {
  6419  		if v_0.Op != OpPPC64InvertFlags {
  6420  			break
  6421  		}
  6422  		x := v_0.Args[0]
  6423  		v.reset(OpPPC64GreaterThan)
  6424  		v.AddArg(x)
  6425  		return true
  6426  	}
  6427  	// match: (LessThan cmp)
  6428  	// result: (SETBC [0] cmp)
  6429  	for {
  6430  		cmp := v_0
  6431  		v.reset(OpPPC64SETBC)
  6432  		v.AuxInt = int32ToAuxInt(0)
  6433  		v.AddArg(cmp)
  6434  		return true
  6435  	}
  6436  }
  6437  func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
  6438  	v_0 := v.Args[0]
  6439  	b := v.Block
  6440  	typ := &b.Func.Config.Types
  6441  	// match: (MFVSRD (FMOVDconst [c]))
  6442  	// result: (MOVDconst [int64(math.Float64bits(c))])
  6443  	for {
  6444  		if v_0.Op != OpPPC64FMOVDconst {
  6445  			break
  6446  		}
  6447  		c := auxIntToFloat64(v_0.AuxInt)
  6448  		v.reset(OpPPC64MOVDconst)
  6449  		v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
  6450  		return true
  6451  	}
  6452  	// match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem))
  6453  	// cond: x.Uses == 1 && clobber(x)
  6454  	// result: @x.Block (MOVDload [off] {sym} ptr mem)
  6455  	for {
  6456  		x := v_0
  6457  		if x.Op != OpPPC64FMOVDload {
  6458  			break
  6459  		}
  6460  		off := auxIntToInt32(x.AuxInt)
  6461  		sym := auxToSym(x.Aux)
  6462  		mem := x.Args[1]
  6463  		ptr := x.Args[0]
  6464  		if !(x.Uses == 1 && clobber(x)) {
  6465  			break
  6466  		}
  6467  		b = x.Block
  6468  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
  6469  		v.copyOf(v0)
  6470  		v0.AuxInt = int32ToAuxInt(off)
  6471  		v0.Aux = symToAux(sym)
  6472  		v0.AddArg2(ptr, mem)
  6473  		return true
  6474  	}
  6475  	return false
  6476  }
  6477  func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
  6478  	v_1 := v.Args[1]
  6479  	v_0 := v.Args[0]
  6480  	// match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  6481  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6482  	// result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6483  	for {
  6484  		off1 := auxIntToInt32(v.AuxInt)
  6485  		sym1 := auxToSym(v.Aux)
  6486  		p := v_0
  6487  		if p.Op != OpPPC64MOVDaddr {
  6488  			break
  6489  		}
  6490  		off2 := auxIntToInt32(p.AuxInt)
  6491  		sym2 := auxToSym(p.Aux)
  6492  		ptr := p.Args[0]
  6493  		mem := v_1
  6494  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6495  			break
  6496  		}
  6497  		v.reset(OpPPC64MOVBZload)
  6498  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6499  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6500  		v.AddArg2(ptr, mem)
  6501  		return true
  6502  	}
  6503  	// match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
  6504  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6505  	// result: (MOVBZload [off1+int32(off2)] {sym} x mem)
  6506  	for {
  6507  		off1 := auxIntToInt32(v.AuxInt)
  6508  		sym := auxToSym(v.Aux)
  6509  		if v_0.Op != OpPPC64ADDconst {
  6510  			break
  6511  		}
  6512  		off2 := auxIntToInt64(v_0.AuxInt)
  6513  		x := v_0.Args[0]
  6514  		mem := v_1
  6515  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6516  			break
  6517  		}
  6518  		v.reset(OpPPC64MOVBZload)
  6519  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6520  		v.Aux = symToAux(sym)
  6521  		v.AddArg2(x, mem)
  6522  		return true
  6523  	}
  6524  	// match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem)
  6525  	// cond: sym == nil && p.Uses == 1
  6526  	// result: (MOVBZloadidx ptr idx mem)
  6527  	for {
  6528  		if auxIntToInt32(v.AuxInt) != 0 {
  6529  			break
  6530  		}
  6531  		sym := auxToSym(v.Aux)
  6532  		p := v_0
  6533  		if p.Op != OpPPC64ADD {
  6534  			break
  6535  		}
  6536  		idx := p.Args[1]
  6537  		ptr := p.Args[0]
  6538  		mem := v_1
  6539  		if !(sym == nil && p.Uses == 1) {
  6540  			break
  6541  		}
  6542  		v.reset(OpPPC64MOVBZloadidx)
  6543  		v.AddArg3(ptr, idx, mem)
  6544  		return true
  6545  	}
  6546  	return false
  6547  }
  6548  func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
  6549  	v_2 := v.Args[2]
  6550  	v_1 := v.Args[1]
  6551  	v_0 := v.Args[0]
  6552  	// match: (MOVBZloadidx ptr (MOVDconst [c]) mem)
  6553  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  6554  	// result: (MOVBZload [int32(c)] ptr mem)
  6555  	for {
  6556  		ptr := v_0
  6557  		if v_1.Op != OpPPC64MOVDconst {
  6558  			break
  6559  		}
  6560  		c := auxIntToInt64(v_1.AuxInt)
  6561  		mem := v_2
  6562  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  6563  			break
  6564  		}
  6565  		v.reset(OpPPC64MOVBZload)
  6566  		v.AuxInt = int32ToAuxInt(int32(c))
  6567  		v.AddArg2(ptr, mem)
  6568  		return true
  6569  	}
  6570  	// match: (MOVBZloadidx (MOVDconst [c]) ptr mem)
  6571  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  6572  	// result: (MOVBZload [int32(c)] ptr mem)
  6573  	for {
  6574  		if v_0.Op != OpPPC64MOVDconst {
  6575  			break
  6576  		}
  6577  		c := auxIntToInt64(v_0.AuxInt)
  6578  		ptr := v_1
  6579  		mem := v_2
  6580  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  6581  			break
  6582  		}
  6583  		v.reset(OpPPC64MOVBZload)
  6584  		v.AuxInt = int32ToAuxInt(int32(c))
  6585  		v.AddArg2(ptr, mem)
  6586  		return true
  6587  	}
  6588  	return false
  6589  }
  6590  func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
  6591  	v_0 := v.Args[0]
  6592  	b := v.Block
  6593  	typ := &b.Func.Config.Types
  6594  	// match: (MOVBZreg y:(Select0 (ANDCCconst [c] _)))
  6595  	// cond: uint64(c) <= 0xFF
  6596  	// result: y
  6597  	for {
  6598  		y := v_0
  6599  		if y.Op != OpSelect0 {
  6600  			break
  6601  		}
  6602  		y_0 := y.Args[0]
  6603  		if y_0.Op != OpPPC64ANDCCconst {
  6604  			break
  6605  		}
  6606  		c := auxIntToInt64(y_0.AuxInt)
  6607  		if !(uint64(c) <= 0xFF) {
  6608  			break
  6609  		}
  6610  		v.copyOf(y)
  6611  		return true
  6612  	}
  6613  	// match: (MOVBZreg (SRWconst [c] (MOVBZreg x)))
  6614  	// result: (SRWconst [c] (MOVBZreg x))
  6615  	for {
  6616  		if v_0.Op != OpPPC64SRWconst {
  6617  			break
  6618  		}
  6619  		c := auxIntToInt64(v_0.AuxInt)
  6620  		v_0_0 := v_0.Args[0]
  6621  		if v_0_0.Op != OpPPC64MOVBZreg {
  6622  			break
  6623  		}
  6624  		x := v_0_0.Args[0]
  6625  		v.reset(OpPPC64SRWconst)
  6626  		v.AuxInt = int64ToAuxInt(c)
  6627  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  6628  		v0.AddArg(x)
  6629  		v.AddArg(v0)
  6630  		return true
  6631  	}
  6632  	// match: (MOVBZreg (SRWconst [c] x))
  6633  	// cond: sizeof(x.Type) == 8
  6634  	// result: (SRWconst [c] x)
  6635  	for {
  6636  		if v_0.Op != OpPPC64SRWconst {
  6637  			break
  6638  		}
  6639  		c := auxIntToInt64(v_0.AuxInt)
  6640  		x := v_0.Args[0]
  6641  		if !(sizeof(x.Type) == 8) {
  6642  			break
  6643  		}
  6644  		v.reset(OpPPC64SRWconst)
  6645  		v.AuxInt = int64ToAuxInt(c)
  6646  		v.AddArg(x)
  6647  		return true
  6648  	}
  6649  	// match: (MOVBZreg (SRDconst [c] x))
  6650  	// cond: c>=56
  6651  	// result: (SRDconst [c] x)
  6652  	for {
  6653  		if v_0.Op != OpPPC64SRDconst {
  6654  			break
  6655  		}
  6656  		c := auxIntToInt64(v_0.AuxInt)
  6657  		x := v_0.Args[0]
  6658  		if !(c >= 56) {
  6659  			break
  6660  		}
  6661  		v.reset(OpPPC64SRDconst)
  6662  		v.AuxInt = int64ToAuxInt(c)
  6663  		v.AddArg(x)
  6664  		return true
  6665  	}
  6666  	// match: (MOVBZreg (SRWconst [c] x))
  6667  	// cond: c>=24
  6668  	// result: (SRWconst [c] x)
  6669  	for {
  6670  		if v_0.Op != OpPPC64SRWconst {
  6671  			break
  6672  		}
  6673  		c := auxIntToInt64(v_0.AuxInt)
  6674  		x := v_0.Args[0]
  6675  		if !(c >= 24) {
  6676  			break
  6677  		}
  6678  		v.reset(OpPPC64SRWconst)
  6679  		v.AuxInt = int64ToAuxInt(c)
  6680  		v.AddArg(x)
  6681  		return true
  6682  	}
  6683  	// match: (MOVBZreg y:(MOVBZreg _))
  6684  	// result: y
  6685  	for {
  6686  		y := v_0
  6687  		if y.Op != OpPPC64MOVBZreg {
  6688  			break
  6689  		}
  6690  		v.copyOf(y)
  6691  		return true
  6692  	}
  6693  	// match: (MOVBZreg (MOVBreg x))
  6694  	// result: (MOVBZreg x)
  6695  	for {
  6696  		if v_0.Op != OpPPC64MOVBreg {
  6697  			break
  6698  		}
  6699  		x := v_0.Args[0]
  6700  		v.reset(OpPPC64MOVBZreg)
  6701  		v.AddArg(x)
  6702  		return true
  6703  	}
  6704  	// match: (MOVBZreg (SRWconst x [s]))
  6705  	// cond: mergePPC64AndSrwi(0xFF,s) != 0
  6706  	// result: (RLWINM [mergePPC64AndSrwi(0xFF,s)] x)
  6707  	for {
  6708  		if v_0.Op != OpPPC64SRWconst {
  6709  			break
  6710  		}
  6711  		s := auxIntToInt64(v_0.AuxInt)
  6712  		x := v_0.Args[0]
  6713  		if !(mergePPC64AndSrwi(0xFF, s) != 0) {
  6714  			break
  6715  		}
  6716  		v.reset(OpPPC64RLWINM)
  6717  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(0xFF, s))
  6718  		v.AddArg(x)
  6719  		return true
  6720  	}
  6721  	// match: (MOVBZreg (RLWINM [r] y))
  6722  	// cond: mergePPC64AndRlwinm(0xFF,r) != 0
  6723  	// result: (RLWINM [mergePPC64AndRlwinm(0xFF,r)] y)
  6724  	for {
  6725  		if v_0.Op != OpPPC64RLWINM {
  6726  			break
  6727  		}
  6728  		r := auxIntToInt64(v_0.AuxInt)
  6729  		y := v_0.Args[0]
  6730  		if !(mergePPC64AndRlwinm(0xFF, r) != 0) {
  6731  			break
  6732  		}
  6733  		v.reset(OpPPC64RLWINM)
  6734  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFF, r))
  6735  		v.AddArg(y)
  6736  		return true
  6737  	}
  6738  	// match: (MOVBZreg (OR <t> x (MOVWZreg y)))
  6739  	// result: (MOVBZreg (OR <t> x y))
  6740  	for {
  6741  		if v_0.Op != OpPPC64OR {
  6742  			break
  6743  		}
  6744  		t := v_0.Type
  6745  		_ = v_0.Args[1]
  6746  		v_0_0 := v_0.Args[0]
  6747  		v_0_1 := v_0.Args[1]
  6748  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6749  			x := v_0_0
  6750  			if v_0_1.Op != OpPPC64MOVWZreg {
  6751  				continue
  6752  			}
  6753  			y := v_0_1.Args[0]
  6754  			v.reset(OpPPC64MOVBZreg)
  6755  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  6756  			v0.AddArg2(x, y)
  6757  			v.AddArg(v0)
  6758  			return true
  6759  		}
  6760  		break
  6761  	}
  6762  	// match: (MOVBZreg (XOR <t> x (MOVWZreg y)))
  6763  	// result: (MOVBZreg (XOR <t> x y))
  6764  	for {
  6765  		if v_0.Op != OpPPC64XOR {
  6766  			break
  6767  		}
  6768  		t := v_0.Type
  6769  		_ = v_0.Args[1]
  6770  		v_0_0 := v_0.Args[0]
  6771  		v_0_1 := v_0.Args[1]
  6772  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6773  			x := v_0_0
  6774  			if v_0_1.Op != OpPPC64MOVWZreg {
  6775  				continue
  6776  			}
  6777  			y := v_0_1.Args[0]
  6778  			v.reset(OpPPC64MOVBZreg)
  6779  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  6780  			v0.AddArg2(x, y)
  6781  			v.AddArg(v0)
  6782  			return true
  6783  		}
  6784  		break
  6785  	}
  6786  	// match: (MOVBZreg (AND <t> x (MOVWZreg y)))
  6787  	// result: (MOVBZreg (AND <t> x y))
  6788  	for {
  6789  		if v_0.Op != OpPPC64AND {
  6790  			break
  6791  		}
  6792  		t := v_0.Type
  6793  		_ = v_0.Args[1]
  6794  		v_0_0 := v_0.Args[0]
  6795  		v_0_1 := v_0.Args[1]
  6796  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6797  			x := v_0_0
  6798  			if v_0_1.Op != OpPPC64MOVWZreg {
  6799  				continue
  6800  			}
  6801  			y := v_0_1.Args[0]
  6802  			v.reset(OpPPC64MOVBZreg)
  6803  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  6804  			v0.AddArg2(x, y)
  6805  			v.AddArg(v0)
  6806  			return true
  6807  		}
  6808  		break
  6809  	}
  6810  	// match: (MOVBZreg (OR <t> x (MOVHZreg y)))
  6811  	// result: (MOVBZreg (OR <t> x y))
  6812  	for {
  6813  		if v_0.Op != OpPPC64OR {
  6814  			break
  6815  		}
  6816  		t := v_0.Type
  6817  		_ = v_0.Args[1]
  6818  		v_0_0 := v_0.Args[0]
  6819  		v_0_1 := v_0.Args[1]
  6820  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6821  			x := v_0_0
  6822  			if v_0_1.Op != OpPPC64MOVHZreg {
  6823  				continue
  6824  			}
  6825  			y := v_0_1.Args[0]
  6826  			v.reset(OpPPC64MOVBZreg)
  6827  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  6828  			v0.AddArg2(x, y)
  6829  			v.AddArg(v0)
  6830  			return true
  6831  		}
  6832  		break
  6833  	}
  6834  	// match: (MOVBZreg (XOR <t> x (MOVHZreg y)))
  6835  	// result: (MOVBZreg (XOR <t> x y))
  6836  	for {
  6837  		if v_0.Op != OpPPC64XOR {
  6838  			break
  6839  		}
  6840  		t := v_0.Type
  6841  		_ = v_0.Args[1]
  6842  		v_0_0 := v_0.Args[0]
  6843  		v_0_1 := v_0.Args[1]
  6844  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6845  			x := v_0_0
  6846  			if v_0_1.Op != OpPPC64MOVHZreg {
  6847  				continue
  6848  			}
  6849  			y := v_0_1.Args[0]
  6850  			v.reset(OpPPC64MOVBZreg)
  6851  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  6852  			v0.AddArg2(x, y)
  6853  			v.AddArg(v0)
  6854  			return true
  6855  		}
  6856  		break
  6857  	}
  6858  	// match: (MOVBZreg (AND <t> x (MOVHZreg y)))
  6859  	// result: (MOVBZreg (AND <t> x y))
  6860  	for {
  6861  		if v_0.Op != OpPPC64AND {
  6862  			break
  6863  		}
  6864  		t := v_0.Type
  6865  		_ = v_0.Args[1]
  6866  		v_0_0 := v_0.Args[0]
  6867  		v_0_1 := v_0.Args[1]
  6868  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6869  			x := v_0_0
  6870  			if v_0_1.Op != OpPPC64MOVHZreg {
  6871  				continue
  6872  			}
  6873  			y := v_0_1.Args[0]
  6874  			v.reset(OpPPC64MOVBZreg)
  6875  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  6876  			v0.AddArg2(x, y)
  6877  			v.AddArg(v0)
  6878  			return true
  6879  		}
  6880  		break
  6881  	}
  6882  	// match: (MOVBZreg (OR <t> x (MOVBZreg y)))
  6883  	// result: (MOVBZreg (OR <t> x y))
  6884  	for {
  6885  		if v_0.Op != OpPPC64OR {
  6886  			break
  6887  		}
  6888  		t := v_0.Type
  6889  		_ = v_0.Args[1]
  6890  		v_0_0 := v_0.Args[0]
  6891  		v_0_1 := v_0.Args[1]
  6892  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6893  			x := v_0_0
  6894  			if v_0_1.Op != OpPPC64MOVBZreg {
  6895  				continue
  6896  			}
  6897  			y := v_0_1.Args[0]
  6898  			v.reset(OpPPC64MOVBZreg)
  6899  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  6900  			v0.AddArg2(x, y)
  6901  			v.AddArg(v0)
  6902  			return true
  6903  		}
  6904  		break
  6905  	}
  6906  	// match: (MOVBZreg (XOR <t> x (MOVBZreg y)))
  6907  	// result: (MOVBZreg (XOR <t> x y))
  6908  	for {
  6909  		if v_0.Op != OpPPC64XOR {
  6910  			break
  6911  		}
  6912  		t := v_0.Type
  6913  		_ = v_0.Args[1]
  6914  		v_0_0 := v_0.Args[0]
  6915  		v_0_1 := v_0.Args[1]
  6916  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6917  			x := v_0_0
  6918  			if v_0_1.Op != OpPPC64MOVBZreg {
  6919  				continue
  6920  			}
  6921  			y := v_0_1.Args[0]
  6922  			v.reset(OpPPC64MOVBZreg)
  6923  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  6924  			v0.AddArg2(x, y)
  6925  			v.AddArg(v0)
  6926  			return true
  6927  		}
  6928  		break
  6929  	}
  6930  	// match: (MOVBZreg (AND <t> x (MOVBZreg y)))
  6931  	// result: (MOVBZreg (AND <t> x y))
  6932  	for {
  6933  		if v_0.Op != OpPPC64AND {
  6934  			break
  6935  		}
  6936  		t := v_0.Type
  6937  		_ = v_0.Args[1]
  6938  		v_0_0 := v_0.Args[0]
  6939  		v_0_1 := v_0.Args[1]
  6940  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6941  			x := v_0_0
  6942  			if v_0_1.Op != OpPPC64MOVBZreg {
  6943  				continue
  6944  			}
  6945  			y := v_0_1.Args[0]
  6946  			v.reset(OpPPC64MOVBZreg)
  6947  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  6948  			v0.AddArg2(x, y)
  6949  			v.AddArg(v0)
  6950  			return true
  6951  		}
  6952  		break
  6953  	}
  6954  	// match: (MOVBZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x))))
  6955  	// result: z
  6956  	for {
  6957  		z := v_0
  6958  		if z.Op != OpSelect0 {
  6959  			break
  6960  		}
  6961  		z_0 := z.Args[0]
  6962  		if z_0.Op != OpPPC64ANDCCconst {
  6963  			break
  6964  		}
  6965  		z_0_0 := z_0.Args[0]
  6966  		if z_0_0.Op != OpPPC64MOVBZload {
  6967  			break
  6968  		}
  6969  		v.copyOf(z)
  6970  		return true
  6971  	}
  6972  	// match: (MOVBZreg z:(AND y (MOVBZload ptr x)))
  6973  	// result: z
  6974  	for {
  6975  		z := v_0
  6976  		if z.Op != OpPPC64AND {
  6977  			break
  6978  		}
  6979  		_ = z.Args[1]
  6980  		z_0 := z.Args[0]
  6981  		z_1 := z.Args[1]
  6982  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  6983  			if z_1.Op != OpPPC64MOVBZload {
  6984  				continue
  6985  			}
  6986  			v.copyOf(z)
  6987  			return true
  6988  		}
  6989  		break
  6990  	}
  6991  	// match: (MOVBZreg x:(MOVBZload _ _))
  6992  	// result: x
  6993  	for {
  6994  		x := v_0
  6995  		if x.Op != OpPPC64MOVBZload {
  6996  			break
  6997  		}
  6998  		v.copyOf(x)
  6999  		return true
  7000  	}
  7001  	// match: (MOVBZreg x:(MOVBZloadidx _ _ _))
  7002  	// result: x
  7003  	for {
  7004  		x := v_0
  7005  		if x.Op != OpPPC64MOVBZloadidx {
  7006  			break
  7007  		}
  7008  		v.copyOf(x)
  7009  		return true
  7010  	}
  7011  	// match: (MOVBZreg x:(Select0 (LoweredAtomicLoad8 _ _)))
  7012  	// result: x
  7013  	for {
  7014  		x := v_0
  7015  		if x.Op != OpSelect0 {
  7016  			break
  7017  		}
  7018  		x_0 := x.Args[0]
  7019  		if x_0.Op != OpPPC64LoweredAtomicLoad8 {
  7020  			break
  7021  		}
  7022  		v.copyOf(x)
  7023  		return true
  7024  	}
  7025  	// match: (MOVBZreg x:(Arg <t>))
  7026  	// cond: is8BitInt(t) && !t.IsSigned()
  7027  	// result: x
  7028  	for {
  7029  		x := v_0
  7030  		if x.Op != OpArg {
  7031  			break
  7032  		}
  7033  		t := x.Type
  7034  		if !(is8BitInt(t) && !t.IsSigned()) {
  7035  			break
  7036  		}
  7037  		v.copyOf(x)
  7038  		return true
  7039  	}
  7040  	// match: (MOVBZreg (MOVDconst [c]))
  7041  	// result: (MOVDconst [int64(uint8(c))])
  7042  	for {
  7043  		if v_0.Op != OpPPC64MOVDconst {
  7044  			break
  7045  		}
  7046  		c := auxIntToInt64(v_0.AuxInt)
  7047  		v.reset(OpPPC64MOVDconst)
  7048  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  7049  		return true
  7050  	}
  7051  	return false
  7052  }
  7053  func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
  7054  	v_0 := v.Args[0]
  7055  	b := v.Block
  7056  	typ := &b.Func.Config.Types
  7057  	// match: (MOVBreg y:(Select0 (ANDCCconst [c] _)))
  7058  	// cond: uint64(c) <= 0x7F
  7059  	// result: y
  7060  	for {
  7061  		y := v_0
  7062  		if y.Op != OpSelect0 {
  7063  			break
  7064  		}
  7065  		y_0 := y.Args[0]
  7066  		if y_0.Op != OpPPC64ANDCCconst {
  7067  			break
  7068  		}
  7069  		c := auxIntToInt64(y_0.AuxInt)
  7070  		if !(uint64(c) <= 0x7F) {
  7071  			break
  7072  		}
  7073  		v.copyOf(y)
  7074  		return true
  7075  	}
  7076  	// match: (MOVBreg (SRAWconst [c] (MOVBreg x)))
  7077  	// result: (SRAWconst [c] (MOVBreg x))
  7078  	for {
  7079  		if v_0.Op != OpPPC64SRAWconst {
  7080  			break
  7081  		}
  7082  		c := auxIntToInt64(v_0.AuxInt)
  7083  		v_0_0 := v_0.Args[0]
  7084  		if v_0_0.Op != OpPPC64MOVBreg {
  7085  			break
  7086  		}
  7087  		x := v_0_0.Args[0]
  7088  		v.reset(OpPPC64SRAWconst)
  7089  		v.AuxInt = int64ToAuxInt(c)
  7090  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  7091  		v0.AddArg(x)
  7092  		v.AddArg(v0)
  7093  		return true
  7094  	}
  7095  	// match: (MOVBreg (SRAWconst [c] x))
  7096  	// cond: sizeof(x.Type) == 8
  7097  	// result: (SRAWconst [c] x)
  7098  	for {
  7099  		if v_0.Op != OpPPC64SRAWconst {
  7100  			break
  7101  		}
  7102  		c := auxIntToInt64(v_0.AuxInt)
  7103  		x := v_0.Args[0]
  7104  		if !(sizeof(x.Type) == 8) {
  7105  			break
  7106  		}
  7107  		v.reset(OpPPC64SRAWconst)
  7108  		v.AuxInt = int64ToAuxInt(c)
  7109  		v.AddArg(x)
  7110  		return true
  7111  	}
  7112  	// match: (MOVBreg (SRDconst [c] x))
  7113  	// cond: c>56
  7114  	// result: (SRDconst [c] x)
  7115  	for {
  7116  		if v_0.Op != OpPPC64SRDconst {
  7117  			break
  7118  		}
  7119  		c := auxIntToInt64(v_0.AuxInt)
  7120  		x := v_0.Args[0]
  7121  		if !(c > 56) {
  7122  			break
  7123  		}
  7124  		v.reset(OpPPC64SRDconst)
  7125  		v.AuxInt = int64ToAuxInt(c)
  7126  		v.AddArg(x)
  7127  		return true
  7128  	}
  7129  	// match: (MOVBreg (SRDconst [c] x))
  7130  	// cond: c==56
  7131  	// result: (SRADconst [c] x)
  7132  	for {
  7133  		if v_0.Op != OpPPC64SRDconst {
  7134  			break
  7135  		}
  7136  		c := auxIntToInt64(v_0.AuxInt)
  7137  		x := v_0.Args[0]
  7138  		if !(c == 56) {
  7139  			break
  7140  		}
  7141  		v.reset(OpPPC64SRADconst)
  7142  		v.AuxInt = int64ToAuxInt(c)
  7143  		v.AddArg(x)
  7144  		return true
  7145  	}
  7146  	// match: (MOVBreg (SRADconst [c] x))
  7147  	// cond: c>=56
  7148  	// result: (SRADconst [c] x)
  7149  	for {
  7150  		if v_0.Op != OpPPC64SRADconst {
  7151  			break
  7152  		}
  7153  		c := auxIntToInt64(v_0.AuxInt)
  7154  		x := v_0.Args[0]
  7155  		if !(c >= 56) {
  7156  			break
  7157  		}
  7158  		v.reset(OpPPC64SRADconst)
  7159  		v.AuxInt = int64ToAuxInt(c)
  7160  		v.AddArg(x)
  7161  		return true
  7162  	}
  7163  	// match: (MOVBreg (SRWconst [c] x))
  7164  	// cond: c>24
  7165  	// result: (SRWconst [c] x)
  7166  	for {
  7167  		if v_0.Op != OpPPC64SRWconst {
  7168  			break
  7169  		}
  7170  		c := auxIntToInt64(v_0.AuxInt)
  7171  		x := v_0.Args[0]
  7172  		if !(c > 24) {
  7173  			break
  7174  		}
  7175  		v.reset(OpPPC64SRWconst)
  7176  		v.AuxInt = int64ToAuxInt(c)
  7177  		v.AddArg(x)
  7178  		return true
  7179  	}
  7180  	// match: (MOVBreg (SRWconst [c] x))
  7181  	// cond: c==24
  7182  	// result: (SRAWconst [c] x)
  7183  	for {
  7184  		if v_0.Op != OpPPC64SRWconst {
  7185  			break
  7186  		}
  7187  		c := auxIntToInt64(v_0.AuxInt)
  7188  		x := v_0.Args[0]
  7189  		if !(c == 24) {
  7190  			break
  7191  		}
  7192  		v.reset(OpPPC64SRAWconst)
  7193  		v.AuxInt = int64ToAuxInt(c)
  7194  		v.AddArg(x)
  7195  		return true
  7196  	}
  7197  	// match: (MOVBreg (SRAWconst [c] x))
  7198  	// cond: c>=24
  7199  	// result: (SRAWconst [c] x)
  7200  	for {
  7201  		if v_0.Op != OpPPC64SRAWconst {
  7202  			break
  7203  		}
  7204  		c := auxIntToInt64(v_0.AuxInt)
  7205  		x := v_0.Args[0]
  7206  		if !(c >= 24) {
  7207  			break
  7208  		}
  7209  		v.reset(OpPPC64SRAWconst)
  7210  		v.AuxInt = int64ToAuxInt(c)
  7211  		v.AddArg(x)
  7212  		return true
  7213  	}
  7214  	// match: (MOVBreg y:(MOVBreg _))
  7215  	// result: y
  7216  	for {
  7217  		y := v_0
  7218  		if y.Op != OpPPC64MOVBreg {
  7219  			break
  7220  		}
  7221  		v.copyOf(y)
  7222  		return true
  7223  	}
  7224  	// match: (MOVBreg (MOVBZreg x))
  7225  	// result: (MOVBreg x)
  7226  	for {
  7227  		if v_0.Op != OpPPC64MOVBZreg {
  7228  			break
  7229  		}
  7230  		x := v_0.Args[0]
  7231  		v.reset(OpPPC64MOVBreg)
  7232  		v.AddArg(x)
  7233  		return true
  7234  	}
  7235  	// match: (MOVBreg x:(Arg <t>))
  7236  	// cond: is8BitInt(t) && t.IsSigned()
  7237  	// result: x
  7238  	for {
  7239  		x := v_0
  7240  		if x.Op != OpArg {
  7241  			break
  7242  		}
  7243  		t := x.Type
  7244  		if !(is8BitInt(t) && t.IsSigned()) {
  7245  			break
  7246  		}
  7247  		v.copyOf(x)
  7248  		return true
  7249  	}
  7250  	// match: (MOVBreg (MOVDconst [c]))
  7251  	// result: (MOVDconst [int64(int8(c))])
  7252  	for {
  7253  		if v_0.Op != OpPPC64MOVDconst {
  7254  			break
  7255  		}
  7256  		c := auxIntToInt64(v_0.AuxInt)
  7257  		v.reset(OpPPC64MOVDconst)
  7258  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  7259  		return true
  7260  	}
  7261  	return false
  7262  }
  7263  func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
  7264  	v_2 := v.Args[2]
  7265  	v_1 := v.Args[1]
  7266  	v_0 := v.Args[0]
  7267  	b := v.Block
  7268  	typ := &b.Func.Config.Types
  7269  	// match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
  7270  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  7271  	// result: (MOVBstore [off1+int32(off2)] {sym} x val mem)
  7272  	for {
  7273  		off1 := auxIntToInt32(v.AuxInt)
  7274  		sym := auxToSym(v.Aux)
  7275  		if v_0.Op != OpPPC64ADDconst {
  7276  			break
  7277  		}
  7278  		off2 := auxIntToInt64(v_0.AuxInt)
  7279  		x := v_0.Args[0]
  7280  		val := v_1
  7281  		mem := v_2
  7282  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  7283  			break
  7284  		}
  7285  		v.reset(OpPPC64MOVBstore)
  7286  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7287  		v.Aux = symToAux(sym)
  7288  		v.AddArg3(x, val, mem)
  7289  		return true
  7290  	}
  7291  	// match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  7292  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  7293  	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  7294  	for {
  7295  		off1 := auxIntToInt32(v.AuxInt)
  7296  		sym1 := auxToSym(v.Aux)
  7297  		p := v_0
  7298  		if p.Op != OpPPC64MOVDaddr {
  7299  			break
  7300  		}
  7301  		off2 := auxIntToInt32(p.AuxInt)
  7302  		sym2 := auxToSym(p.Aux)
  7303  		ptr := p.Args[0]
  7304  		val := v_1
  7305  		mem := v_2
  7306  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  7307  			break
  7308  		}
  7309  		v.reset(OpPPC64MOVBstore)
  7310  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7311  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7312  		v.AddArg3(ptr, val, mem)
  7313  		return true
  7314  	}
  7315  	// match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
  7316  	// result: (MOVBstorezero [off] {sym} ptr mem)
  7317  	for {
  7318  		off := auxIntToInt32(v.AuxInt)
  7319  		sym := auxToSym(v.Aux)
  7320  		ptr := v_0
  7321  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7322  			break
  7323  		}
  7324  		mem := v_2
  7325  		v.reset(OpPPC64MOVBstorezero)
  7326  		v.AuxInt = int32ToAuxInt(off)
  7327  		v.Aux = symToAux(sym)
  7328  		v.AddArg2(ptr, mem)
  7329  		return true
  7330  	}
  7331  	// match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem)
  7332  	// cond: sym == nil && p.Uses == 1
  7333  	// result: (MOVBstoreidx ptr idx val mem)
  7334  	for {
  7335  		if auxIntToInt32(v.AuxInt) != 0 {
  7336  			break
  7337  		}
  7338  		sym := auxToSym(v.Aux)
  7339  		p := v_0
  7340  		if p.Op != OpPPC64ADD {
  7341  			break
  7342  		}
  7343  		idx := p.Args[1]
  7344  		ptr := p.Args[0]
  7345  		val := v_1
  7346  		mem := v_2
  7347  		if !(sym == nil && p.Uses == 1) {
  7348  			break
  7349  		}
  7350  		v.reset(OpPPC64MOVBstoreidx)
  7351  		v.AddArg4(ptr, idx, val, mem)
  7352  		return true
  7353  	}
  7354  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  7355  	// result: (MOVBstore [off] {sym} ptr x mem)
  7356  	for {
  7357  		off := auxIntToInt32(v.AuxInt)
  7358  		sym := auxToSym(v.Aux)
  7359  		ptr := v_0
  7360  		if v_1.Op != OpPPC64MOVBreg {
  7361  			break
  7362  		}
  7363  		x := v_1.Args[0]
  7364  		mem := v_2
  7365  		v.reset(OpPPC64MOVBstore)
  7366  		v.AuxInt = int32ToAuxInt(off)
  7367  		v.Aux = symToAux(sym)
  7368  		v.AddArg3(ptr, x, mem)
  7369  		return true
  7370  	}
  7371  	// match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
  7372  	// result: (MOVBstore [off] {sym} ptr x mem)
  7373  	for {
  7374  		off := auxIntToInt32(v.AuxInt)
  7375  		sym := auxToSym(v.Aux)
  7376  		ptr := v_0
  7377  		if v_1.Op != OpPPC64MOVBZreg {
  7378  			break
  7379  		}
  7380  		x := v_1.Args[0]
  7381  		mem := v_2
  7382  		v.reset(OpPPC64MOVBstore)
  7383  		v.AuxInt = int32ToAuxInt(off)
  7384  		v.Aux = symToAux(sym)
  7385  		v.AddArg3(ptr, x, mem)
  7386  		return true
  7387  	}
  7388  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  7389  	// result: (MOVBstore [off] {sym} ptr x mem)
  7390  	for {
  7391  		off := auxIntToInt32(v.AuxInt)
  7392  		sym := auxToSym(v.Aux)
  7393  		ptr := v_0
  7394  		if v_1.Op != OpPPC64MOVHreg {
  7395  			break
  7396  		}
  7397  		x := v_1.Args[0]
  7398  		mem := v_2
  7399  		v.reset(OpPPC64MOVBstore)
  7400  		v.AuxInt = int32ToAuxInt(off)
  7401  		v.Aux = symToAux(sym)
  7402  		v.AddArg3(ptr, x, mem)
  7403  		return true
  7404  	}
  7405  	// match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem)
  7406  	// result: (MOVBstore [off] {sym} ptr x mem)
  7407  	for {
  7408  		off := auxIntToInt32(v.AuxInt)
  7409  		sym := auxToSym(v.Aux)
  7410  		ptr := v_0
  7411  		if v_1.Op != OpPPC64MOVHZreg {
  7412  			break
  7413  		}
  7414  		x := v_1.Args[0]
  7415  		mem := v_2
  7416  		v.reset(OpPPC64MOVBstore)
  7417  		v.AuxInt = int32ToAuxInt(off)
  7418  		v.Aux = symToAux(sym)
  7419  		v.AddArg3(ptr, x, mem)
  7420  		return true
  7421  	}
  7422  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  7423  	// result: (MOVBstore [off] {sym} ptr x mem)
  7424  	for {
  7425  		off := auxIntToInt32(v.AuxInt)
  7426  		sym := auxToSym(v.Aux)
  7427  		ptr := v_0
  7428  		if v_1.Op != OpPPC64MOVWreg {
  7429  			break
  7430  		}
  7431  		x := v_1.Args[0]
  7432  		mem := v_2
  7433  		v.reset(OpPPC64MOVBstore)
  7434  		v.AuxInt = int32ToAuxInt(off)
  7435  		v.Aux = symToAux(sym)
  7436  		v.AddArg3(ptr, x, mem)
  7437  		return true
  7438  	}
  7439  	// match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem)
  7440  	// result: (MOVBstore [off] {sym} ptr x mem)
  7441  	for {
  7442  		off := auxIntToInt32(v.AuxInt)
  7443  		sym := auxToSym(v.Aux)
  7444  		ptr := v_0
  7445  		if v_1.Op != OpPPC64MOVWZreg {
  7446  			break
  7447  		}
  7448  		x := v_1.Args[0]
  7449  		mem := v_2
  7450  		v.reset(OpPPC64MOVBstore)
  7451  		v.AuxInt = int32ToAuxInt(off)
  7452  		v.Aux = symToAux(sym)
  7453  		v.AddArg3(ptr, x, mem)
  7454  		return true
  7455  	}
  7456  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem)
  7457  	// cond: c <= 8
  7458  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7459  	for {
  7460  		off := auxIntToInt32(v.AuxInt)
  7461  		sym := auxToSym(v.Aux)
  7462  		ptr := v_0
  7463  		if v_1.Op != OpPPC64SRWconst {
  7464  			break
  7465  		}
  7466  		c := auxIntToInt64(v_1.AuxInt)
  7467  		v_1_0 := v_1.Args[0]
  7468  		if v_1_0.Op != OpPPC64MOVHreg {
  7469  			break
  7470  		}
  7471  		x := v_1_0.Args[0]
  7472  		mem := v_2
  7473  		if !(c <= 8) {
  7474  			break
  7475  		}
  7476  		v.reset(OpPPC64MOVBstore)
  7477  		v.AuxInt = int32ToAuxInt(off)
  7478  		v.Aux = symToAux(sym)
  7479  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7480  		v0.AuxInt = int64ToAuxInt(c)
  7481  		v0.AddArg(x)
  7482  		v.AddArg3(ptr, v0, mem)
  7483  		return true
  7484  	}
  7485  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem)
  7486  	// cond: c <= 8
  7487  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7488  	for {
  7489  		off := auxIntToInt32(v.AuxInt)
  7490  		sym := auxToSym(v.Aux)
  7491  		ptr := v_0
  7492  		if v_1.Op != OpPPC64SRWconst {
  7493  			break
  7494  		}
  7495  		c := auxIntToInt64(v_1.AuxInt)
  7496  		v_1_0 := v_1.Args[0]
  7497  		if v_1_0.Op != OpPPC64MOVHZreg {
  7498  			break
  7499  		}
  7500  		x := v_1_0.Args[0]
  7501  		mem := v_2
  7502  		if !(c <= 8) {
  7503  			break
  7504  		}
  7505  		v.reset(OpPPC64MOVBstore)
  7506  		v.AuxInt = int32ToAuxInt(off)
  7507  		v.Aux = symToAux(sym)
  7508  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7509  		v0.AuxInt = int64ToAuxInt(c)
  7510  		v0.AddArg(x)
  7511  		v.AddArg3(ptr, v0, mem)
  7512  		return true
  7513  	}
  7514  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem)
  7515  	// cond: c <= 24
  7516  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7517  	for {
  7518  		off := auxIntToInt32(v.AuxInt)
  7519  		sym := auxToSym(v.Aux)
  7520  		ptr := v_0
  7521  		if v_1.Op != OpPPC64SRWconst {
  7522  			break
  7523  		}
  7524  		c := auxIntToInt64(v_1.AuxInt)
  7525  		v_1_0 := v_1.Args[0]
  7526  		if v_1_0.Op != OpPPC64MOVWreg {
  7527  			break
  7528  		}
  7529  		x := v_1_0.Args[0]
  7530  		mem := v_2
  7531  		if !(c <= 24) {
  7532  			break
  7533  		}
  7534  		v.reset(OpPPC64MOVBstore)
  7535  		v.AuxInt = int32ToAuxInt(off)
  7536  		v.Aux = symToAux(sym)
  7537  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7538  		v0.AuxInt = int64ToAuxInt(c)
  7539  		v0.AddArg(x)
  7540  		v.AddArg3(ptr, v0, mem)
  7541  		return true
  7542  	}
  7543  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem)
  7544  	// cond: c <= 24
  7545  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7546  	for {
  7547  		off := auxIntToInt32(v.AuxInt)
  7548  		sym := auxToSym(v.Aux)
  7549  		ptr := v_0
  7550  		if v_1.Op != OpPPC64SRWconst {
  7551  			break
  7552  		}
  7553  		c := auxIntToInt64(v_1.AuxInt)
  7554  		v_1_0 := v_1.Args[0]
  7555  		if v_1_0.Op != OpPPC64MOVWZreg {
  7556  			break
  7557  		}
  7558  		x := v_1_0.Args[0]
  7559  		mem := v_2
  7560  		if !(c <= 24) {
  7561  			break
  7562  		}
  7563  		v.reset(OpPPC64MOVBstore)
  7564  		v.AuxInt = int32ToAuxInt(off)
  7565  		v.Aux = symToAux(sym)
  7566  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7567  		v0.AuxInt = int64ToAuxInt(c)
  7568  		v0.AddArg(x)
  7569  		v.AddArg3(ptr, v0, mem)
  7570  		return true
  7571  	}
  7572  	return false
  7573  }
  7574  func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
  7575  	v_3 := v.Args[3]
  7576  	v_2 := v.Args[2]
  7577  	v_1 := v.Args[1]
  7578  	v_0 := v.Args[0]
  7579  	b := v.Block
  7580  	typ := &b.Func.Config.Types
  7581  	// match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
  7582  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7583  	// result: (MOVBstore [int32(c)] ptr val mem)
  7584  	for {
  7585  		ptr := v_0
  7586  		if v_1.Op != OpPPC64MOVDconst {
  7587  			break
  7588  		}
  7589  		c := auxIntToInt64(v_1.AuxInt)
  7590  		val := v_2
  7591  		mem := v_3
  7592  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7593  			break
  7594  		}
  7595  		v.reset(OpPPC64MOVBstore)
  7596  		v.AuxInt = int32ToAuxInt(int32(c))
  7597  		v.AddArg3(ptr, val, mem)
  7598  		return true
  7599  	}
  7600  	// match: (MOVBstoreidx (MOVDconst [c]) ptr val mem)
  7601  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7602  	// result: (MOVBstore [int32(c)] ptr val mem)
  7603  	for {
  7604  		if v_0.Op != OpPPC64MOVDconst {
  7605  			break
  7606  		}
  7607  		c := auxIntToInt64(v_0.AuxInt)
  7608  		ptr := v_1
  7609  		val := v_2
  7610  		mem := v_3
  7611  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7612  			break
  7613  		}
  7614  		v.reset(OpPPC64MOVBstore)
  7615  		v.AuxInt = int32ToAuxInt(int32(c))
  7616  		v.AddArg3(ptr, val, mem)
  7617  		return true
  7618  	}
  7619  	// match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
  7620  	// result: (MOVBstoreidx ptr idx x mem)
  7621  	for {
  7622  		ptr := v_0
  7623  		idx := v_1
  7624  		if v_2.Op != OpPPC64MOVBreg {
  7625  			break
  7626  		}
  7627  		x := v_2.Args[0]
  7628  		mem := v_3
  7629  		v.reset(OpPPC64MOVBstoreidx)
  7630  		v.AddArg4(ptr, idx, x, mem)
  7631  		return true
  7632  	}
  7633  	// match: (MOVBstoreidx ptr idx (MOVBZreg x) mem)
  7634  	// result: (MOVBstoreidx ptr idx x mem)
  7635  	for {
  7636  		ptr := v_0
  7637  		idx := v_1
  7638  		if v_2.Op != OpPPC64MOVBZreg {
  7639  			break
  7640  		}
  7641  		x := v_2.Args[0]
  7642  		mem := v_3
  7643  		v.reset(OpPPC64MOVBstoreidx)
  7644  		v.AddArg4(ptr, idx, x, mem)
  7645  		return true
  7646  	}
  7647  	// match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
  7648  	// result: (MOVBstoreidx ptr idx x mem)
  7649  	for {
  7650  		ptr := v_0
  7651  		idx := v_1
  7652  		if v_2.Op != OpPPC64MOVHreg {
  7653  			break
  7654  		}
  7655  		x := v_2.Args[0]
  7656  		mem := v_3
  7657  		v.reset(OpPPC64MOVBstoreidx)
  7658  		v.AddArg4(ptr, idx, x, mem)
  7659  		return true
  7660  	}
  7661  	// match: (MOVBstoreidx ptr idx (MOVHZreg x) mem)
  7662  	// result: (MOVBstoreidx ptr idx x mem)
  7663  	for {
  7664  		ptr := v_0
  7665  		idx := v_1
  7666  		if v_2.Op != OpPPC64MOVHZreg {
  7667  			break
  7668  		}
  7669  		x := v_2.Args[0]
  7670  		mem := v_3
  7671  		v.reset(OpPPC64MOVBstoreidx)
  7672  		v.AddArg4(ptr, idx, x, mem)
  7673  		return true
  7674  	}
  7675  	// match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
  7676  	// result: (MOVBstoreidx ptr idx x mem)
  7677  	for {
  7678  		ptr := v_0
  7679  		idx := v_1
  7680  		if v_2.Op != OpPPC64MOVWreg {
  7681  			break
  7682  		}
  7683  		x := v_2.Args[0]
  7684  		mem := v_3
  7685  		v.reset(OpPPC64MOVBstoreidx)
  7686  		v.AddArg4(ptr, idx, x, mem)
  7687  		return true
  7688  	}
  7689  	// match: (MOVBstoreidx ptr idx (MOVWZreg x) mem)
  7690  	// result: (MOVBstoreidx ptr idx x mem)
  7691  	for {
  7692  		ptr := v_0
  7693  		idx := v_1
  7694  		if v_2.Op != OpPPC64MOVWZreg {
  7695  			break
  7696  		}
  7697  		x := v_2.Args[0]
  7698  		mem := v_3
  7699  		v.reset(OpPPC64MOVBstoreidx)
  7700  		v.AddArg4(ptr, idx, x, mem)
  7701  		return true
  7702  	}
  7703  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem)
  7704  	// cond: c <= 8
  7705  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  7706  	for {
  7707  		ptr := v_0
  7708  		idx := v_1
  7709  		if v_2.Op != OpPPC64SRWconst {
  7710  			break
  7711  		}
  7712  		c := auxIntToInt64(v_2.AuxInt)
  7713  		v_2_0 := v_2.Args[0]
  7714  		if v_2_0.Op != OpPPC64MOVHreg {
  7715  			break
  7716  		}
  7717  		x := v_2_0.Args[0]
  7718  		mem := v_3
  7719  		if !(c <= 8) {
  7720  			break
  7721  		}
  7722  		v.reset(OpPPC64MOVBstoreidx)
  7723  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7724  		v0.AuxInt = int64ToAuxInt(c)
  7725  		v0.AddArg(x)
  7726  		v.AddArg4(ptr, idx, v0, mem)
  7727  		return true
  7728  	}
  7729  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem)
  7730  	// cond: c <= 8
  7731  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  7732  	for {
  7733  		ptr := v_0
  7734  		idx := v_1
  7735  		if v_2.Op != OpPPC64SRWconst {
  7736  			break
  7737  		}
  7738  		c := auxIntToInt64(v_2.AuxInt)
  7739  		v_2_0 := v_2.Args[0]
  7740  		if v_2_0.Op != OpPPC64MOVHZreg {
  7741  			break
  7742  		}
  7743  		x := v_2_0.Args[0]
  7744  		mem := v_3
  7745  		if !(c <= 8) {
  7746  			break
  7747  		}
  7748  		v.reset(OpPPC64MOVBstoreidx)
  7749  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7750  		v0.AuxInt = int64ToAuxInt(c)
  7751  		v0.AddArg(x)
  7752  		v.AddArg4(ptr, idx, v0, mem)
  7753  		return true
  7754  	}
  7755  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem)
  7756  	// cond: c <= 24
  7757  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  7758  	for {
  7759  		ptr := v_0
  7760  		idx := v_1
  7761  		if v_2.Op != OpPPC64SRWconst {
  7762  			break
  7763  		}
  7764  		c := auxIntToInt64(v_2.AuxInt)
  7765  		v_2_0 := v_2.Args[0]
  7766  		if v_2_0.Op != OpPPC64MOVWreg {
  7767  			break
  7768  		}
  7769  		x := v_2_0.Args[0]
  7770  		mem := v_3
  7771  		if !(c <= 24) {
  7772  			break
  7773  		}
  7774  		v.reset(OpPPC64MOVBstoreidx)
  7775  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7776  		v0.AuxInt = int64ToAuxInt(c)
  7777  		v0.AddArg(x)
  7778  		v.AddArg4(ptr, idx, v0, mem)
  7779  		return true
  7780  	}
  7781  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem)
  7782  	// cond: c <= 24
  7783  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  7784  	for {
  7785  		ptr := v_0
  7786  		idx := v_1
  7787  		if v_2.Op != OpPPC64SRWconst {
  7788  			break
  7789  		}
  7790  		c := auxIntToInt64(v_2.AuxInt)
  7791  		v_2_0 := v_2.Args[0]
  7792  		if v_2_0.Op != OpPPC64MOVWZreg {
  7793  			break
  7794  		}
  7795  		x := v_2_0.Args[0]
  7796  		mem := v_3
  7797  		if !(c <= 24) {
  7798  			break
  7799  		}
  7800  		v.reset(OpPPC64MOVBstoreidx)
  7801  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7802  		v0.AuxInt = int64ToAuxInt(c)
  7803  		v0.AddArg(x)
  7804  		v.AddArg4(ptr, idx, v0, mem)
  7805  		return true
  7806  	}
  7807  	return false
  7808  }
  7809  func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
  7810  	v_1 := v.Args[1]
  7811  	v_0 := v.Args[0]
  7812  	// match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
  7813  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  7814  	// result: (MOVBstorezero [off1+int32(off2)] {sym} x mem)
  7815  	for {
  7816  		off1 := auxIntToInt32(v.AuxInt)
  7817  		sym := auxToSym(v.Aux)
  7818  		if v_0.Op != OpPPC64ADDconst {
  7819  			break
  7820  		}
  7821  		off2 := auxIntToInt64(v_0.AuxInt)
  7822  		x := v_0.Args[0]
  7823  		mem := v_1
  7824  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  7825  			break
  7826  		}
  7827  		v.reset(OpPPC64MOVBstorezero)
  7828  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7829  		v.Aux = symToAux(sym)
  7830  		v.AddArg2(x, mem)
  7831  		return true
  7832  	}
  7833  	// match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  7834  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  7835  	// result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  7836  	for {
  7837  		off1 := auxIntToInt32(v.AuxInt)
  7838  		sym1 := auxToSym(v.Aux)
  7839  		p := v_0
  7840  		if p.Op != OpPPC64MOVDaddr {
  7841  			break
  7842  		}
  7843  		off2 := auxIntToInt32(p.AuxInt)
  7844  		sym2 := auxToSym(p.Aux)
  7845  		x := p.Args[0]
  7846  		mem := v_1
  7847  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  7848  			break
  7849  		}
  7850  		v.reset(OpPPC64MOVBstorezero)
  7851  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7852  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7853  		v.AddArg2(x, mem)
  7854  		return true
  7855  	}
  7856  	return false
  7857  }
  7858  func rewriteValuePPC64_OpPPC64MOVDaddr(v *Value) bool {
  7859  	v_0 := v.Args[0]
  7860  	// match: (MOVDaddr {sym} [n] p:(ADD x y))
  7861  	// cond: sym == nil && n == 0
  7862  	// result: p
  7863  	for {
  7864  		n := auxIntToInt32(v.AuxInt)
  7865  		sym := auxToSym(v.Aux)
  7866  		p := v_0
  7867  		if p.Op != OpPPC64ADD {
  7868  			break
  7869  		}
  7870  		if !(sym == nil && n == 0) {
  7871  			break
  7872  		}
  7873  		v.copyOf(p)
  7874  		return true
  7875  	}
  7876  	// match: (MOVDaddr {sym} [n] ptr)
  7877  	// cond: sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)
  7878  	// result: ptr
  7879  	for {
  7880  		n := auxIntToInt32(v.AuxInt)
  7881  		sym := auxToSym(v.Aux)
  7882  		ptr := v_0
  7883  		if !(sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)) {
  7884  			break
  7885  		}
  7886  		v.copyOf(ptr)
  7887  		return true
  7888  	}
  7889  	return false
  7890  }
  7891  func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
  7892  	v_1 := v.Args[1]
  7893  	v_0 := v.Args[0]
  7894  	// match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _))
  7895  	// result: (MFVSRD x)
  7896  	for {
  7897  		off := auxIntToInt32(v.AuxInt)
  7898  		sym := auxToSym(v.Aux)
  7899  		ptr := v_0
  7900  		if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  7901  			break
  7902  		}
  7903  		x := v_1.Args[1]
  7904  		if ptr != v_1.Args[0] {
  7905  			break
  7906  		}
  7907  		v.reset(OpPPC64MFVSRD)
  7908  		v.AddArg(x)
  7909  		return true
  7910  	}
  7911  	// match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  7912  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  7913  	// result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  7914  	for {
  7915  		off1 := auxIntToInt32(v.AuxInt)
  7916  		sym1 := auxToSym(v.Aux)
  7917  		p := v_0
  7918  		if p.Op != OpPPC64MOVDaddr {
  7919  			break
  7920  		}
  7921  		off2 := auxIntToInt32(p.AuxInt)
  7922  		sym2 := auxToSym(p.Aux)
  7923  		ptr := p.Args[0]
  7924  		mem := v_1
  7925  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  7926  			break
  7927  		}
  7928  		v.reset(OpPPC64MOVDload)
  7929  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7930  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7931  		v.AddArg2(ptr, mem)
  7932  		return true
  7933  	}
  7934  	// match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
  7935  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  7936  	// result: (MOVDload [off1+int32(off2)] {sym} x mem)
  7937  	for {
  7938  		off1 := auxIntToInt32(v.AuxInt)
  7939  		sym := auxToSym(v.Aux)
  7940  		if v_0.Op != OpPPC64ADDconst {
  7941  			break
  7942  		}
  7943  		off2 := auxIntToInt64(v_0.AuxInt)
  7944  		x := v_0.Args[0]
  7945  		mem := v_1
  7946  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  7947  			break
  7948  		}
  7949  		v.reset(OpPPC64MOVDload)
  7950  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7951  		v.Aux = symToAux(sym)
  7952  		v.AddArg2(x, mem)
  7953  		return true
  7954  	}
  7955  	// match: (MOVDload [0] {sym} p:(ADD ptr idx) mem)
  7956  	// cond: sym == nil && p.Uses == 1
  7957  	// result: (MOVDloadidx ptr idx mem)
  7958  	for {
  7959  		if auxIntToInt32(v.AuxInt) != 0 {
  7960  			break
  7961  		}
  7962  		sym := auxToSym(v.Aux)
  7963  		p := v_0
  7964  		if p.Op != OpPPC64ADD {
  7965  			break
  7966  		}
  7967  		idx := p.Args[1]
  7968  		ptr := p.Args[0]
  7969  		mem := v_1
  7970  		if !(sym == nil && p.Uses == 1) {
  7971  			break
  7972  		}
  7973  		v.reset(OpPPC64MOVDloadidx)
  7974  		v.AddArg3(ptr, idx, mem)
  7975  		return true
  7976  	}
  7977  	return false
  7978  }
  7979  func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
  7980  	v_2 := v.Args[2]
  7981  	v_1 := v.Args[1]
  7982  	v_0 := v.Args[0]
  7983  	// match: (MOVDloadidx ptr (MOVDconst [c]) mem)
  7984  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7985  	// result: (MOVDload [int32(c)] ptr mem)
  7986  	for {
  7987  		ptr := v_0
  7988  		if v_1.Op != OpPPC64MOVDconst {
  7989  			break
  7990  		}
  7991  		c := auxIntToInt64(v_1.AuxInt)
  7992  		mem := v_2
  7993  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7994  			break
  7995  		}
  7996  		v.reset(OpPPC64MOVDload)
  7997  		v.AuxInt = int32ToAuxInt(int32(c))
  7998  		v.AddArg2(ptr, mem)
  7999  		return true
  8000  	}
  8001  	// match: (MOVDloadidx (MOVDconst [c]) ptr mem)
  8002  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8003  	// result: (MOVDload [int32(c)] ptr mem)
  8004  	for {
  8005  		if v_0.Op != OpPPC64MOVDconst {
  8006  			break
  8007  		}
  8008  		c := auxIntToInt64(v_0.AuxInt)
  8009  		ptr := v_1
  8010  		mem := v_2
  8011  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8012  			break
  8013  		}
  8014  		v.reset(OpPPC64MOVDload)
  8015  		v.AuxInt = int32ToAuxInt(int32(c))
  8016  		v.AddArg2(ptr, mem)
  8017  		return true
  8018  	}
  8019  	return false
  8020  }
  8021  func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
  8022  	v_2 := v.Args[2]
  8023  	v_1 := v.Args[1]
  8024  	v_0 := v.Args[0]
  8025  	b := v.Block
  8026  	// match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem)
  8027  	// result: (FMOVDstore [off] {sym} ptr x mem)
  8028  	for {
  8029  		off := auxIntToInt32(v.AuxInt)
  8030  		sym := auxToSym(v.Aux)
  8031  		ptr := v_0
  8032  		if v_1.Op != OpPPC64MFVSRD {
  8033  			break
  8034  		}
  8035  		x := v_1.Args[0]
  8036  		mem := v_2
  8037  		v.reset(OpPPC64FMOVDstore)
  8038  		v.AuxInt = int32ToAuxInt(off)
  8039  		v.Aux = symToAux(sym)
  8040  		v.AddArg3(ptr, x, mem)
  8041  		return true
  8042  	}
  8043  	// match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
  8044  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8045  	// result: (MOVDstore [off1+int32(off2)] {sym} x val mem)
  8046  	for {
  8047  		off1 := auxIntToInt32(v.AuxInt)
  8048  		sym := auxToSym(v.Aux)
  8049  		if v_0.Op != OpPPC64ADDconst {
  8050  			break
  8051  		}
  8052  		off2 := auxIntToInt64(v_0.AuxInt)
  8053  		x := v_0.Args[0]
  8054  		val := v_1
  8055  		mem := v_2
  8056  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8057  			break
  8058  		}
  8059  		v.reset(OpPPC64MOVDstore)
  8060  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8061  		v.Aux = symToAux(sym)
  8062  		v.AddArg3(x, val, mem)
  8063  		return true
  8064  	}
  8065  	// match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  8066  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8067  	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  8068  	for {
  8069  		off1 := auxIntToInt32(v.AuxInt)
  8070  		sym1 := auxToSym(v.Aux)
  8071  		p := v_0
  8072  		if p.Op != OpPPC64MOVDaddr {
  8073  			break
  8074  		}
  8075  		off2 := auxIntToInt32(p.AuxInt)
  8076  		sym2 := auxToSym(p.Aux)
  8077  		ptr := p.Args[0]
  8078  		val := v_1
  8079  		mem := v_2
  8080  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8081  			break
  8082  		}
  8083  		v.reset(OpPPC64MOVDstore)
  8084  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8085  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8086  		v.AddArg3(ptr, val, mem)
  8087  		return true
  8088  	}
  8089  	// match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
  8090  	// result: (MOVDstorezero [off] {sym} ptr mem)
  8091  	for {
  8092  		off := auxIntToInt32(v.AuxInt)
  8093  		sym := auxToSym(v.Aux)
  8094  		ptr := v_0
  8095  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  8096  			break
  8097  		}
  8098  		mem := v_2
  8099  		v.reset(OpPPC64MOVDstorezero)
  8100  		v.AuxInt = int32ToAuxInt(off)
  8101  		v.Aux = symToAux(sym)
  8102  		v.AddArg2(ptr, mem)
  8103  		return true
  8104  	}
  8105  	// match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem)
  8106  	// cond: sym == nil && p.Uses == 1
  8107  	// result: (MOVDstoreidx ptr idx val mem)
  8108  	for {
  8109  		if auxIntToInt32(v.AuxInt) != 0 {
  8110  			break
  8111  		}
  8112  		sym := auxToSym(v.Aux)
  8113  		p := v_0
  8114  		if p.Op != OpPPC64ADD {
  8115  			break
  8116  		}
  8117  		idx := p.Args[1]
  8118  		ptr := p.Args[0]
  8119  		val := v_1
  8120  		mem := v_2
  8121  		if !(sym == nil && p.Uses == 1) {
  8122  			break
  8123  		}
  8124  		v.reset(OpPPC64MOVDstoreidx)
  8125  		v.AddArg4(ptr, idx, val, mem)
  8126  		return true
  8127  	}
  8128  	// match: (MOVDstore [off] {sym} ptr r:(BRD val) mem)
  8129  	// cond: r.Uses == 1
  8130  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8131  	for {
  8132  		off := auxIntToInt32(v.AuxInt)
  8133  		sym := auxToSym(v.Aux)
  8134  		ptr := v_0
  8135  		r := v_1
  8136  		if r.Op != OpPPC64BRD {
  8137  			break
  8138  		}
  8139  		val := r.Args[0]
  8140  		mem := v_2
  8141  		if !(r.Uses == 1) {
  8142  			break
  8143  		}
  8144  		v.reset(OpPPC64MOVDBRstore)
  8145  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8146  		v0.AuxInt = int32ToAuxInt(off)
  8147  		v0.Aux = symToAux(sym)
  8148  		v0.AddArg(ptr)
  8149  		v.AddArg3(v0, val, mem)
  8150  		return true
  8151  	}
  8152  	// match: (MOVDstore [off] {sym} ptr (Bswap64 val) mem)
  8153  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8154  	for {
  8155  		off := auxIntToInt32(v.AuxInt)
  8156  		sym := auxToSym(v.Aux)
  8157  		ptr := v_0
  8158  		if v_1.Op != OpBswap64 {
  8159  			break
  8160  		}
  8161  		val := v_1.Args[0]
  8162  		mem := v_2
  8163  		v.reset(OpPPC64MOVDBRstore)
  8164  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8165  		v0.AuxInt = int32ToAuxInt(off)
  8166  		v0.Aux = symToAux(sym)
  8167  		v0.AddArg(ptr)
  8168  		v.AddArg3(v0, val, mem)
  8169  		return true
  8170  	}
  8171  	return false
  8172  }
  8173  func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
  8174  	v_3 := v.Args[3]
  8175  	v_2 := v.Args[2]
  8176  	v_1 := v.Args[1]
  8177  	v_0 := v.Args[0]
  8178  	// match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
  8179  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8180  	// result: (MOVDstore [int32(c)] ptr val mem)
  8181  	for {
  8182  		ptr := v_0
  8183  		if v_1.Op != OpPPC64MOVDconst {
  8184  			break
  8185  		}
  8186  		c := auxIntToInt64(v_1.AuxInt)
  8187  		val := v_2
  8188  		mem := v_3
  8189  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8190  			break
  8191  		}
  8192  		v.reset(OpPPC64MOVDstore)
  8193  		v.AuxInt = int32ToAuxInt(int32(c))
  8194  		v.AddArg3(ptr, val, mem)
  8195  		return true
  8196  	}
  8197  	// match: (MOVDstoreidx (MOVDconst [c]) ptr val mem)
  8198  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8199  	// result: (MOVDstore [int32(c)] ptr val mem)
  8200  	for {
  8201  		if v_0.Op != OpPPC64MOVDconst {
  8202  			break
  8203  		}
  8204  		c := auxIntToInt64(v_0.AuxInt)
  8205  		ptr := v_1
  8206  		val := v_2
  8207  		mem := v_3
  8208  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8209  			break
  8210  		}
  8211  		v.reset(OpPPC64MOVDstore)
  8212  		v.AuxInt = int32ToAuxInt(int32(c))
  8213  		v.AddArg3(ptr, val, mem)
  8214  		return true
  8215  	}
  8216  	// match: (MOVDstoreidx ptr idx r:(BRD val) mem)
  8217  	// cond: r.Uses == 1
  8218  	// result: (MOVDBRstoreidx ptr idx val mem)
  8219  	for {
  8220  		ptr := v_0
  8221  		idx := v_1
  8222  		r := v_2
  8223  		if r.Op != OpPPC64BRD {
  8224  			break
  8225  		}
  8226  		val := r.Args[0]
  8227  		mem := v_3
  8228  		if !(r.Uses == 1) {
  8229  			break
  8230  		}
  8231  		v.reset(OpPPC64MOVDBRstoreidx)
  8232  		v.AddArg4(ptr, idx, val, mem)
  8233  		return true
  8234  	}
  8235  	// match: (MOVDstoreidx ptr idx (Bswap64 val) mem)
  8236  	// result: (MOVDBRstoreidx ptr idx val mem)
  8237  	for {
  8238  		ptr := v_0
  8239  		idx := v_1
  8240  		if v_2.Op != OpBswap64 {
  8241  			break
  8242  		}
  8243  		val := v_2.Args[0]
  8244  		mem := v_3
  8245  		v.reset(OpPPC64MOVDBRstoreidx)
  8246  		v.AddArg4(ptr, idx, val, mem)
  8247  		return true
  8248  	}
  8249  	return false
  8250  }
  8251  func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
  8252  	v_1 := v.Args[1]
  8253  	v_0 := v.Args[0]
  8254  	// match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8255  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8256  	// result: (MOVDstorezero [off1+int32(off2)] {sym} x mem)
  8257  	for {
  8258  		off1 := auxIntToInt32(v.AuxInt)
  8259  		sym := auxToSym(v.Aux)
  8260  		if v_0.Op != OpPPC64ADDconst {
  8261  			break
  8262  		}
  8263  		off2 := auxIntToInt64(v_0.AuxInt)
  8264  		x := v_0.Args[0]
  8265  		mem := v_1
  8266  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8267  			break
  8268  		}
  8269  		v.reset(OpPPC64MOVDstorezero)
  8270  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8271  		v.Aux = symToAux(sym)
  8272  		v.AddArg2(x, mem)
  8273  		return true
  8274  	}
  8275  	// match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8276  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8277  	// result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8278  	for {
  8279  		off1 := auxIntToInt32(v.AuxInt)
  8280  		sym1 := auxToSym(v.Aux)
  8281  		p := v_0
  8282  		if p.Op != OpPPC64MOVDaddr {
  8283  			break
  8284  		}
  8285  		off2 := auxIntToInt32(p.AuxInt)
  8286  		sym2 := auxToSym(p.Aux)
  8287  		x := p.Args[0]
  8288  		mem := v_1
  8289  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8290  			break
  8291  		}
  8292  		v.reset(OpPPC64MOVDstorezero)
  8293  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8294  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8295  		v.AddArg2(x, mem)
  8296  		return true
  8297  	}
  8298  	return false
  8299  }
  8300  func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
  8301  	v_2 := v.Args[2]
  8302  	v_1 := v.Args[1]
  8303  	v_0 := v.Args[0]
  8304  	// match: (MOVHBRstore ptr (MOVHreg x) mem)
  8305  	// result: (MOVHBRstore ptr x mem)
  8306  	for {
  8307  		ptr := v_0
  8308  		if v_1.Op != OpPPC64MOVHreg {
  8309  			break
  8310  		}
  8311  		x := v_1.Args[0]
  8312  		mem := v_2
  8313  		v.reset(OpPPC64MOVHBRstore)
  8314  		v.AddArg3(ptr, x, mem)
  8315  		return true
  8316  	}
  8317  	// match: (MOVHBRstore ptr (MOVHZreg x) mem)
  8318  	// result: (MOVHBRstore ptr x mem)
  8319  	for {
  8320  		ptr := v_0
  8321  		if v_1.Op != OpPPC64MOVHZreg {
  8322  			break
  8323  		}
  8324  		x := v_1.Args[0]
  8325  		mem := v_2
  8326  		v.reset(OpPPC64MOVHBRstore)
  8327  		v.AddArg3(ptr, x, mem)
  8328  		return true
  8329  	}
  8330  	// match: (MOVHBRstore ptr (MOVWreg x) mem)
  8331  	// result: (MOVHBRstore ptr x mem)
  8332  	for {
  8333  		ptr := v_0
  8334  		if v_1.Op != OpPPC64MOVWreg {
  8335  			break
  8336  		}
  8337  		x := v_1.Args[0]
  8338  		mem := v_2
  8339  		v.reset(OpPPC64MOVHBRstore)
  8340  		v.AddArg3(ptr, x, mem)
  8341  		return true
  8342  	}
  8343  	// match: (MOVHBRstore ptr (MOVWZreg x) mem)
  8344  	// result: (MOVHBRstore ptr x mem)
  8345  	for {
  8346  		ptr := v_0
  8347  		if v_1.Op != OpPPC64MOVWZreg {
  8348  			break
  8349  		}
  8350  		x := v_1.Args[0]
  8351  		mem := v_2
  8352  		v.reset(OpPPC64MOVHBRstore)
  8353  		v.AddArg3(ptr, x, mem)
  8354  		return true
  8355  	}
  8356  	return false
  8357  }
  8358  func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
  8359  	v_1 := v.Args[1]
  8360  	v_0 := v.Args[0]
  8361  	// match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8362  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8363  	// result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8364  	for {
  8365  		off1 := auxIntToInt32(v.AuxInt)
  8366  		sym1 := auxToSym(v.Aux)
  8367  		p := v_0
  8368  		if p.Op != OpPPC64MOVDaddr {
  8369  			break
  8370  		}
  8371  		off2 := auxIntToInt32(p.AuxInt)
  8372  		sym2 := auxToSym(p.Aux)
  8373  		ptr := p.Args[0]
  8374  		mem := v_1
  8375  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8376  			break
  8377  		}
  8378  		v.reset(OpPPC64MOVHZload)
  8379  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8380  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8381  		v.AddArg2(ptr, mem)
  8382  		return true
  8383  	}
  8384  	// match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
  8385  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8386  	// result: (MOVHZload [off1+int32(off2)] {sym} x mem)
  8387  	for {
  8388  		off1 := auxIntToInt32(v.AuxInt)
  8389  		sym := auxToSym(v.Aux)
  8390  		if v_0.Op != OpPPC64ADDconst {
  8391  			break
  8392  		}
  8393  		off2 := auxIntToInt64(v_0.AuxInt)
  8394  		x := v_0.Args[0]
  8395  		mem := v_1
  8396  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8397  			break
  8398  		}
  8399  		v.reset(OpPPC64MOVHZload)
  8400  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8401  		v.Aux = symToAux(sym)
  8402  		v.AddArg2(x, mem)
  8403  		return true
  8404  	}
  8405  	// match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem)
  8406  	// cond: sym == nil && p.Uses == 1
  8407  	// result: (MOVHZloadidx ptr idx mem)
  8408  	for {
  8409  		if auxIntToInt32(v.AuxInt) != 0 {
  8410  			break
  8411  		}
  8412  		sym := auxToSym(v.Aux)
  8413  		p := v_0
  8414  		if p.Op != OpPPC64ADD {
  8415  			break
  8416  		}
  8417  		idx := p.Args[1]
  8418  		ptr := p.Args[0]
  8419  		mem := v_1
  8420  		if !(sym == nil && p.Uses == 1) {
  8421  			break
  8422  		}
  8423  		v.reset(OpPPC64MOVHZloadidx)
  8424  		v.AddArg3(ptr, idx, mem)
  8425  		return true
  8426  	}
  8427  	return false
  8428  }
  8429  func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
  8430  	v_2 := v.Args[2]
  8431  	v_1 := v.Args[1]
  8432  	v_0 := v.Args[0]
  8433  	// match: (MOVHZloadidx ptr (MOVDconst [c]) mem)
  8434  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8435  	// result: (MOVHZload [int32(c)] ptr mem)
  8436  	for {
  8437  		ptr := v_0
  8438  		if v_1.Op != OpPPC64MOVDconst {
  8439  			break
  8440  		}
  8441  		c := auxIntToInt64(v_1.AuxInt)
  8442  		mem := v_2
  8443  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8444  			break
  8445  		}
  8446  		v.reset(OpPPC64MOVHZload)
  8447  		v.AuxInt = int32ToAuxInt(int32(c))
  8448  		v.AddArg2(ptr, mem)
  8449  		return true
  8450  	}
  8451  	// match: (MOVHZloadidx (MOVDconst [c]) ptr mem)
  8452  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8453  	// result: (MOVHZload [int32(c)] ptr mem)
  8454  	for {
  8455  		if v_0.Op != OpPPC64MOVDconst {
  8456  			break
  8457  		}
  8458  		c := auxIntToInt64(v_0.AuxInt)
  8459  		ptr := v_1
  8460  		mem := v_2
  8461  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8462  			break
  8463  		}
  8464  		v.reset(OpPPC64MOVHZload)
  8465  		v.AuxInt = int32ToAuxInt(int32(c))
  8466  		v.AddArg2(ptr, mem)
  8467  		return true
  8468  	}
  8469  	return false
  8470  }
  8471  func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
  8472  	v_0 := v.Args[0]
  8473  	b := v.Block
  8474  	typ := &b.Func.Config.Types
  8475  	// match: (MOVHZreg y:(Select0 (ANDCCconst [c] _)))
  8476  	// cond: uint64(c) <= 0xFFFF
  8477  	// result: y
  8478  	for {
  8479  		y := v_0
  8480  		if y.Op != OpSelect0 {
  8481  			break
  8482  		}
  8483  		y_0 := y.Args[0]
  8484  		if y_0.Op != OpPPC64ANDCCconst {
  8485  			break
  8486  		}
  8487  		c := auxIntToInt64(y_0.AuxInt)
  8488  		if !(uint64(c) <= 0xFFFF) {
  8489  			break
  8490  		}
  8491  		v.copyOf(y)
  8492  		return true
  8493  	}
  8494  	// match: (MOVHZreg (SRWconst [c] (MOVBZreg x)))
  8495  	// result: (SRWconst [c] (MOVBZreg x))
  8496  	for {
  8497  		if v_0.Op != OpPPC64SRWconst {
  8498  			break
  8499  		}
  8500  		c := auxIntToInt64(v_0.AuxInt)
  8501  		v_0_0 := v_0.Args[0]
  8502  		if v_0_0.Op != OpPPC64MOVBZreg {
  8503  			break
  8504  		}
  8505  		x := v_0_0.Args[0]
  8506  		v.reset(OpPPC64SRWconst)
  8507  		v.AuxInt = int64ToAuxInt(c)
  8508  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  8509  		v0.AddArg(x)
  8510  		v.AddArg(v0)
  8511  		return true
  8512  	}
  8513  	// match: (MOVHZreg (SRWconst [c] (MOVHZreg x)))
  8514  	// result: (SRWconst [c] (MOVHZreg x))
  8515  	for {
  8516  		if v_0.Op != OpPPC64SRWconst {
  8517  			break
  8518  		}
  8519  		c := auxIntToInt64(v_0.AuxInt)
  8520  		v_0_0 := v_0.Args[0]
  8521  		if v_0_0.Op != OpPPC64MOVHZreg {
  8522  			break
  8523  		}
  8524  		x := v_0_0.Args[0]
  8525  		v.reset(OpPPC64SRWconst)
  8526  		v.AuxInt = int64ToAuxInt(c)
  8527  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  8528  		v0.AddArg(x)
  8529  		v.AddArg(v0)
  8530  		return true
  8531  	}
  8532  	// match: (MOVHZreg (SRWconst [c] x))
  8533  	// cond: sizeof(x.Type) <= 16
  8534  	// result: (SRWconst [c] x)
  8535  	for {
  8536  		if v_0.Op != OpPPC64SRWconst {
  8537  			break
  8538  		}
  8539  		c := auxIntToInt64(v_0.AuxInt)
  8540  		x := v_0.Args[0]
  8541  		if !(sizeof(x.Type) <= 16) {
  8542  			break
  8543  		}
  8544  		v.reset(OpPPC64SRWconst)
  8545  		v.AuxInt = int64ToAuxInt(c)
  8546  		v.AddArg(x)
  8547  		return true
  8548  	}
  8549  	// match: (MOVHZreg (SRDconst [c] x))
  8550  	// cond: c>=48
  8551  	// result: (SRDconst [c] x)
  8552  	for {
  8553  		if v_0.Op != OpPPC64SRDconst {
  8554  			break
  8555  		}
  8556  		c := auxIntToInt64(v_0.AuxInt)
  8557  		x := v_0.Args[0]
  8558  		if !(c >= 48) {
  8559  			break
  8560  		}
  8561  		v.reset(OpPPC64SRDconst)
  8562  		v.AuxInt = int64ToAuxInt(c)
  8563  		v.AddArg(x)
  8564  		return true
  8565  	}
  8566  	// match: (MOVHZreg (SRWconst [c] x))
  8567  	// cond: c>=16
  8568  	// result: (SRWconst [c] x)
  8569  	for {
  8570  		if v_0.Op != OpPPC64SRWconst {
  8571  			break
  8572  		}
  8573  		c := auxIntToInt64(v_0.AuxInt)
  8574  		x := v_0.Args[0]
  8575  		if !(c >= 16) {
  8576  			break
  8577  		}
  8578  		v.reset(OpPPC64SRWconst)
  8579  		v.AuxInt = int64ToAuxInt(c)
  8580  		v.AddArg(x)
  8581  		return true
  8582  	}
  8583  	// match: (MOVHZreg (RLWINM [r] y))
  8584  	// cond: mergePPC64AndRlwinm(0xFFFF,r) != 0
  8585  	// result: (RLWINM [mergePPC64AndRlwinm(0xFFFF,r)] y)
  8586  	for {
  8587  		if v_0.Op != OpPPC64RLWINM {
  8588  			break
  8589  		}
  8590  		r := auxIntToInt64(v_0.AuxInt)
  8591  		y := v_0.Args[0]
  8592  		if !(mergePPC64AndRlwinm(0xFFFF, r) != 0) {
  8593  			break
  8594  		}
  8595  		v.reset(OpPPC64RLWINM)
  8596  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFFFF, r))
  8597  		v.AddArg(y)
  8598  		return true
  8599  	}
  8600  	// match: (MOVHZreg y:(MOVHZreg _))
  8601  	// result: y
  8602  	for {
  8603  		y := v_0
  8604  		if y.Op != OpPPC64MOVHZreg {
  8605  			break
  8606  		}
  8607  		v.copyOf(y)
  8608  		return true
  8609  	}
  8610  	// match: (MOVHZreg y:(MOVBZreg _))
  8611  	// result: y
  8612  	for {
  8613  		y := v_0
  8614  		if y.Op != OpPPC64MOVBZreg {
  8615  			break
  8616  		}
  8617  		v.copyOf(y)
  8618  		return true
  8619  	}
  8620  	// match: (MOVHZreg y:(MOVHBRload _ _))
  8621  	// result: y
  8622  	for {
  8623  		y := v_0
  8624  		if y.Op != OpPPC64MOVHBRload {
  8625  			break
  8626  		}
  8627  		v.copyOf(y)
  8628  		return true
  8629  	}
  8630  	// match: (MOVHZreg y:(MOVHreg x))
  8631  	// result: (MOVHZreg x)
  8632  	for {
  8633  		y := v_0
  8634  		if y.Op != OpPPC64MOVHreg {
  8635  			break
  8636  		}
  8637  		x := y.Args[0]
  8638  		v.reset(OpPPC64MOVHZreg)
  8639  		v.AddArg(x)
  8640  		return true
  8641  	}
  8642  	// match: (MOVHZreg (OR <t> x (MOVWZreg y)))
  8643  	// result: (MOVHZreg (OR <t> x y))
  8644  	for {
  8645  		if v_0.Op != OpPPC64OR {
  8646  			break
  8647  		}
  8648  		t := v_0.Type
  8649  		_ = v_0.Args[1]
  8650  		v_0_0 := v_0.Args[0]
  8651  		v_0_1 := v_0.Args[1]
  8652  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  8653  			x := v_0_0
  8654  			if v_0_1.Op != OpPPC64MOVWZreg {
  8655  				continue
  8656  			}
  8657  			y := v_0_1.Args[0]
  8658  			v.reset(OpPPC64MOVHZreg)
  8659  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  8660  			v0.AddArg2(x, y)
  8661  			v.AddArg(v0)
  8662  			return true
  8663  		}
  8664  		break
  8665  	}
  8666  	// match: (MOVHZreg (XOR <t> x (MOVWZreg y)))
  8667  	// result: (MOVHZreg (XOR <t> x y))
  8668  	for {
  8669  		if v_0.Op != OpPPC64XOR {
  8670  			break
  8671  		}
  8672  		t := v_0.Type
  8673  		_ = v_0.Args[1]
  8674  		v_0_0 := v_0.Args[0]
  8675  		v_0_1 := v_0.Args[1]
  8676  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  8677  			x := v_0_0
  8678  			if v_0_1.Op != OpPPC64MOVWZreg {
  8679  				continue
  8680  			}
  8681  			y := v_0_1.Args[0]
  8682  			v.reset(OpPPC64MOVHZreg)
  8683  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  8684  			v0.AddArg2(x, y)
  8685  			v.AddArg(v0)
  8686  			return true
  8687  		}
  8688  		break
  8689  	}
  8690  	// match: (MOVHZreg (AND <t> x (MOVWZreg y)))
  8691  	// result: (MOVHZreg (AND <t> x y))
  8692  	for {
  8693  		if v_0.Op != OpPPC64AND {
  8694  			break
  8695  		}
  8696  		t := v_0.Type
  8697  		_ = v_0.Args[1]
  8698  		v_0_0 := v_0.Args[0]
  8699  		v_0_1 := v_0.Args[1]
  8700  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  8701  			x := v_0_0
  8702  			if v_0_1.Op != OpPPC64MOVWZreg {
  8703  				continue
  8704  			}
  8705  			y := v_0_1.Args[0]
  8706  			v.reset(OpPPC64MOVHZreg)
  8707  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  8708  			v0.AddArg2(x, y)
  8709  			v.AddArg(v0)
  8710  			return true
  8711  		}
  8712  		break
  8713  	}
  8714  	// match: (MOVHZreg (OR <t> x (MOVHZreg y)))
  8715  	// result: (MOVHZreg (OR <t> x y))
  8716  	for {
  8717  		if v_0.Op != OpPPC64OR {
  8718  			break
  8719  		}
  8720  		t := v_0.Type
  8721  		_ = v_0.Args[1]
  8722  		v_0_0 := v_0.Args[0]
  8723  		v_0_1 := v_0.Args[1]
  8724  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  8725  			x := v_0_0
  8726  			if v_0_1.Op != OpPPC64MOVHZreg {
  8727  				continue
  8728  			}
  8729  			y := v_0_1.Args[0]
  8730  			v.reset(OpPPC64MOVHZreg)
  8731  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  8732  			v0.AddArg2(x, y)
  8733  			v.AddArg(v0)
  8734  			return true
  8735  		}
  8736  		break
  8737  	}
  8738  	// match: (MOVHZreg (XOR <t> x (MOVHZreg y)))
  8739  	// result: (MOVHZreg (XOR <t> x y))
  8740  	for {
  8741  		if v_0.Op != OpPPC64XOR {
  8742  			break
  8743  		}
  8744  		t := v_0.Type
  8745  		_ = v_0.Args[1]
  8746  		v_0_0 := v_0.Args[0]
  8747  		v_0_1 := v_0.Args[1]
  8748  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  8749  			x := v_0_0
  8750  			if v_0_1.Op != OpPPC64MOVHZreg {
  8751  				continue
  8752  			}
  8753  			y := v_0_1.Args[0]
  8754  			v.reset(OpPPC64MOVHZreg)
  8755  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  8756  			v0.AddArg2(x, y)
  8757  			v.AddArg(v0)
  8758  			return true
  8759  		}
  8760  		break
  8761  	}
  8762  	// match: (MOVHZreg (AND <t> x (MOVHZreg y)))
  8763  	// result: (MOVHZreg (AND <t> x y))
  8764  	for {
  8765  		if v_0.Op != OpPPC64AND {
  8766  			break
  8767  		}
  8768  		t := v_0.Type
  8769  		_ = v_0.Args[1]
  8770  		v_0_0 := v_0.Args[0]
  8771  		v_0_1 := v_0.Args[1]
  8772  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  8773  			x := v_0_0
  8774  			if v_0_1.Op != OpPPC64MOVHZreg {
  8775  				continue
  8776  			}
  8777  			y := v_0_1.Args[0]
  8778  			v.reset(OpPPC64MOVHZreg)
  8779  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  8780  			v0.AddArg2(x, y)
  8781  			v.AddArg(v0)
  8782  			return true
  8783  		}
  8784  		break
  8785  	}
  8786  	// match: (MOVHZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x))))
  8787  	// result: z
  8788  	for {
  8789  		z := v_0
  8790  		if z.Op != OpSelect0 {
  8791  			break
  8792  		}
  8793  		z_0 := z.Args[0]
  8794  		if z_0.Op != OpPPC64ANDCCconst {
  8795  			break
  8796  		}
  8797  		z_0_0 := z_0.Args[0]
  8798  		if z_0_0.Op != OpPPC64MOVBZload {
  8799  			break
  8800  		}
  8801  		v.copyOf(z)
  8802  		return true
  8803  	}
  8804  	// match: (MOVHZreg z:(AND y (MOVHZload ptr x)))
  8805  	// result: z
  8806  	for {
  8807  		z := v_0
  8808  		if z.Op != OpPPC64AND {
  8809  			break
  8810  		}
  8811  		_ = z.Args[1]
  8812  		z_0 := z.Args[0]
  8813  		z_1 := z.Args[1]
  8814  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  8815  			if z_1.Op != OpPPC64MOVHZload {
  8816  				continue
  8817  			}
  8818  			v.copyOf(z)
  8819  			return true
  8820  		}
  8821  		break
  8822  	}
  8823  	// match: (MOVHZreg z:(Select0 (ANDCCconst [c] (MOVHZload ptr x))))
  8824  	// result: z
  8825  	for {
  8826  		z := v_0
  8827  		if z.Op != OpSelect0 {
  8828  			break
  8829  		}
  8830  		z_0 := z.Args[0]
  8831  		if z_0.Op != OpPPC64ANDCCconst {
  8832  			break
  8833  		}
  8834  		z_0_0 := z_0.Args[0]
  8835  		if z_0_0.Op != OpPPC64MOVHZload {
  8836  			break
  8837  		}
  8838  		v.copyOf(z)
  8839  		return true
  8840  	}
  8841  	// match: (MOVHZreg x:(MOVBZload _ _))
  8842  	// result: x
  8843  	for {
  8844  		x := v_0
  8845  		if x.Op != OpPPC64MOVBZload {
  8846  			break
  8847  		}
  8848  		v.copyOf(x)
  8849  		return true
  8850  	}
  8851  	// match: (MOVHZreg x:(MOVBZloadidx _ _ _))
  8852  	// result: x
  8853  	for {
  8854  		x := v_0
  8855  		if x.Op != OpPPC64MOVBZloadidx {
  8856  			break
  8857  		}
  8858  		v.copyOf(x)
  8859  		return true
  8860  	}
  8861  	// match: (MOVHZreg x:(MOVHZload _ _))
  8862  	// result: x
  8863  	for {
  8864  		x := v_0
  8865  		if x.Op != OpPPC64MOVHZload {
  8866  			break
  8867  		}
  8868  		v.copyOf(x)
  8869  		return true
  8870  	}
  8871  	// match: (MOVHZreg x:(MOVHZloadidx _ _ _))
  8872  	// result: x
  8873  	for {
  8874  		x := v_0
  8875  		if x.Op != OpPPC64MOVHZloadidx {
  8876  			break
  8877  		}
  8878  		v.copyOf(x)
  8879  		return true
  8880  	}
  8881  	// match: (MOVHZreg x:(Arg <t>))
  8882  	// cond: (is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()
  8883  	// result: x
  8884  	for {
  8885  		x := v_0
  8886  		if x.Op != OpArg {
  8887  			break
  8888  		}
  8889  		t := x.Type
  8890  		if !((is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()) {
  8891  			break
  8892  		}
  8893  		v.copyOf(x)
  8894  		return true
  8895  	}
  8896  	// match: (MOVHZreg (MOVDconst [c]))
  8897  	// result: (MOVDconst [int64(uint16(c))])
  8898  	for {
  8899  		if v_0.Op != OpPPC64MOVDconst {
  8900  			break
  8901  		}
  8902  		c := auxIntToInt64(v_0.AuxInt)
  8903  		v.reset(OpPPC64MOVDconst)
  8904  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  8905  		return true
  8906  	}
  8907  	return false
  8908  }
  8909  func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
  8910  	v_1 := v.Args[1]
  8911  	v_0 := v.Args[0]
  8912  	// match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8913  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8914  	// result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8915  	for {
  8916  		off1 := auxIntToInt32(v.AuxInt)
  8917  		sym1 := auxToSym(v.Aux)
  8918  		p := v_0
  8919  		if p.Op != OpPPC64MOVDaddr {
  8920  			break
  8921  		}
  8922  		off2 := auxIntToInt32(p.AuxInt)
  8923  		sym2 := auxToSym(p.Aux)
  8924  		ptr := p.Args[0]
  8925  		mem := v_1
  8926  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8927  			break
  8928  		}
  8929  		v.reset(OpPPC64MOVHload)
  8930  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8931  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8932  		v.AddArg2(ptr, mem)
  8933  		return true
  8934  	}
  8935  	// match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
  8936  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8937  	// result: (MOVHload [off1+int32(off2)] {sym} x mem)
  8938  	for {
  8939  		off1 := auxIntToInt32(v.AuxInt)
  8940  		sym := auxToSym(v.Aux)
  8941  		if v_0.Op != OpPPC64ADDconst {
  8942  			break
  8943  		}
  8944  		off2 := auxIntToInt64(v_0.AuxInt)
  8945  		x := v_0.Args[0]
  8946  		mem := v_1
  8947  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8948  			break
  8949  		}
  8950  		v.reset(OpPPC64MOVHload)
  8951  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8952  		v.Aux = symToAux(sym)
  8953  		v.AddArg2(x, mem)
  8954  		return true
  8955  	}
  8956  	// match: (MOVHload [0] {sym} p:(ADD ptr idx) mem)
  8957  	// cond: sym == nil && p.Uses == 1
  8958  	// result: (MOVHloadidx ptr idx mem)
  8959  	for {
  8960  		if auxIntToInt32(v.AuxInt) != 0 {
  8961  			break
  8962  		}
  8963  		sym := auxToSym(v.Aux)
  8964  		p := v_0
  8965  		if p.Op != OpPPC64ADD {
  8966  			break
  8967  		}
  8968  		idx := p.Args[1]
  8969  		ptr := p.Args[0]
  8970  		mem := v_1
  8971  		if !(sym == nil && p.Uses == 1) {
  8972  			break
  8973  		}
  8974  		v.reset(OpPPC64MOVHloadidx)
  8975  		v.AddArg3(ptr, idx, mem)
  8976  		return true
  8977  	}
  8978  	return false
  8979  }
  8980  func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
  8981  	v_2 := v.Args[2]
  8982  	v_1 := v.Args[1]
  8983  	v_0 := v.Args[0]
  8984  	// match: (MOVHloadidx ptr (MOVDconst [c]) mem)
  8985  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8986  	// result: (MOVHload [int32(c)] ptr mem)
  8987  	for {
  8988  		ptr := v_0
  8989  		if v_1.Op != OpPPC64MOVDconst {
  8990  			break
  8991  		}
  8992  		c := auxIntToInt64(v_1.AuxInt)
  8993  		mem := v_2
  8994  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8995  			break
  8996  		}
  8997  		v.reset(OpPPC64MOVHload)
  8998  		v.AuxInt = int32ToAuxInt(int32(c))
  8999  		v.AddArg2(ptr, mem)
  9000  		return true
  9001  	}
  9002  	// match: (MOVHloadidx (MOVDconst [c]) ptr mem)
  9003  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9004  	// result: (MOVHload [int32(c)] ptr mem)
  9005  	for {
  9006  		if v_0.Op != OpPPC64MOVDconst {
  9007  			break
  9008  		}
  9009  		c := auxIntToInt64(v_0.AuxInt)
  9010  		ptr := v_1
  9011  		mem := v_2
  9012  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9013  			break
  9014  		}
  9015  		v.reset(OpPPC64MOVHload)
  9016  		v.AuxInt = int32ToAuxInt(int32(c))
  9017  		v.AddArg2(ptr, mem)
  9018  		return true
  9019  	}
  9020  	return false
  9021  }
  9022  func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
  9023  	v_0 := v.Args[0]
  9024  	b := v.Block
  9025  	typ := &b.Func.Config.Types
  9026  	// match: (MOVHreg y:(Select0 (ANDCCconst [c] _)))
  9027  	// cond: uint64(c) <= 0x7FFF
  9028  	// result: y
  9029  	for {
  9030  		y := v_0
  9031  		if y.Op != OpSelect0 {
  9032  			break
  9033  		}
  9034  		y_0 := y.Args[0]
  9035  		if y_0.Op != OpPPC64ANDCCconst {
  9036  			break
  9037  		}
  9038  		c := auxIntToInt64(y_0.AuxInt)
  9039  		if !(uint64(c) <= 0x7FFF) {
  9040  			break
  9041  		}
  9042  		v.copyOf(y)
  9043  		return true
  9044  	}
  9045  	// match: (MOVHreg (SRAWconst [c] (MOVBreg x)))
  9046  	// result: (SRAWconst [c] (MOVBreg x))
  9047  	for {
  9048  		if v_0.Op != OpPPC64SRAWconst {
  9049  			break
  9050  		}
  9051  		c := auxIntToInt64(v_0.AuxInt)
  9052  		v_0_0 := v_0.Args[0]
  9053  		if v_0_0.Op != OpPPC64MOVBreg {
  9054  			break
  9055  		}
  9056  		x := v_0_0.Args[0]
  9057  		v.reset(OpPPC64SRAWconst)
  9058  		v.AuxInt = int64ToAuxInt(c)
  9059  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  9060  		v0.AddArg(x)
  9061  		v.AddArg(v0)
  9062  		return true
  9063  	}
  9064  	// match: (MOVHreg (SRAWconst [c] (MOVHreg x)))
  9065  	// result: (SRAWconst [c] (MOVHreg x))
  9066  	for {
  9067  		if v_0.Op != OpPPC64SRAWconst {
  9068  			break
  9069  		}
  9070  		c := auxIntToInt64(v_0.AuxInt)
  9071  		v_0_0 := v_0.Args[0]
  9072  		if v_0_0.Op != OpPPC64MOVHreg {
  9073  			break
  9074  		}
  9075  		x := v_0_0.Args[0]
  9076  		v.reset(OpPPC64SRAWconst)
  9077  		v.AuxInt = int64ToAuxInt(c)
  9078  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
  9079  		v0.AddArg(x)
  9080  		v.AddArg(v0)
  9081  		return true
  9082  	}
  9083  	// match: (MOVHreg (SRAWconst [c] x))
  9084  	// cond: sizeof(x.Type) <= 16
  9085  	// result: (SRAWconst [c] x)
  9086  	for {
  9087  		if v_0.Op != OpPPC64SRAWconst {
  9088  			break
  9089  		}
  9090  		c := auxIntToInt64(v_0.AuxInt)
  9091  		x := v_0.Args[0]
  9092  		if !(sizeof(x.Type) <= 16) {
  9093  			break
  9094  		}
  9095  		v.reset(OpPPC64SRAWconst)
  9096  		v.AuxInt = int64ToAuxInt(c)
  9097  		v.AddArg(x)
  9098  		return true
  9099  	}
  9100  	// match: (MOVHreg (SRDconst [c] x))
  9101  	// cond: c>48
  9102  	// result: (SRDconst [c] x)
  9103  	for {
  9104  		if v_0.Op != OpPPC64SRDconst {
  9105  			break
  9106  		}
  9107  		c := auxIntToInt64(v_0.AuxInt)
  9108  		x := v_0.Args[0]
  9109  		if !(c > 48) {
  9110  			break
  9111  		}
  9112  		v.reset(OpPPC64SRDconst)
  9113  		v.AuxInt = int64ToAuxInt(c)
  9114  		v.AddArg(x)
  9115  		return true
  9116  	}
  9117  	// match: (MOVHreg (SRDconst [c] x))
  9118  	// cond: c==48
  9119  	// result: (SRADconst [c] x)
  9120  	for {
  9121  		if v_0.Op != OpPPC64SRDconst {
  9122  			break
  9123  		}
  9124  		c := auxIntToInt64(v_0.AuxInt)
  9125  		x := v_0.Args[0]
  9126  		if !(c == 48) {
  9127  			break
  9128  		}
  9129  		v.reset(OpPPC64SRADconst)
  9130  		v.AuxInt = int64ToAuxInt(c)
  9131  		v.AddArg(x)
  9132  		return true
  9133  	}
  9134  	// match: (MOVHreg (SRADconst [c] x))
  9135  	// cond: c>=48
  9136  	// result: (SRADconst [c] x)
  9137  	for {
  9138  		if v_0.Op != OpPPC64SRADconst {
  9139  			break
  9140  		}
  9141  		c := auxIntToInt64(v_0.AuxInt)
  9142  		x := v_0.Args[0]
  9143  		if !(c >= 48) {
  9144  			break
  9145  		}
  9146  		v.reset(OpPPC64SRADconst)
  9147  		v.AuxInt = int64ToAuxInt(c)
  9148  		v.AddArg(x)
  9149  		return true
  9150  	}
  9151  	// match: (MOVHreg (SRWconst [c] x))
  9152  	// cond: c>16
  9153  	// result: (SRWconst [c] x)
  9154  	for {
  9155  		if v_0.Op != OpPPC64SRWconst {
  9156  			break
  9157  		}
  9158  		c := auxIntToInt64(v_0.AuxInt)
  9159  		x := v_0.Args[0]
  9160  		if !(c > 16) {
  9161  			break
  9162  		}
  9163  		v.reset(OpPPC64SRWconst)
  9164  		v.AuxInt = int64ToAuxInt(c)
  9165  		v.AddArg(x)
  9166  		return true
  9167  	}
  9168  	// match: (MOVHreg (SRAWconst [c] x))
  9169  	// cond: c>=16
  9170  	// result: (SRAWconst [c] x)
  9171  	for {
  9172  		if v_0.Op != OpPPC64SRAWconst {
  9173  			break
  9174  		}
  9175  		c := auxIntToInt64(v_0.AuxInt)
  9176  		x := v_0.Args[0]
  9177  		if !(c >= 16) {
  9178  			break
  9179  		}
  9180  		v.reset(OpPPC64SRAWconst)
  9181  		v.AuxInt = int64ToAuxInt(c)
  9182  		v.AddArg(x)
  9183  		return true
  9184  	}
  9185  	// match: (MOVHreg (SRWconst [c] x))
  9186  	// cond: c==16
  9187  	// result: (SRAWconst [c] x)
  9188  	for {
  9189  		if v_0.Op != OpPPC64SRWconst {
  9190  			break
  9191  		}
  9192  		c := auxIntToInt64(v_0.AuxInt)
  9193  		x := v_0.Args[0]
  9194  		if !(c == 16) {
  9195  			break
  9196  		}
  9197  		v.reset(OpPPC64SRAWconst)
  9198  		v.AuxInt = int64ToAuxInt(c)
  9199  		v.AddArg(x)
  9200  		return true
  9201  	}
  9202  	// match: (MOVHreg y:(MOVHreg _))
  9203  	// result: y
  9204  	for {
  9205  		y := v_0
  9206  		if y.Op != OpPPC64MOVHreg {
  9207  			break
  9208  		}
  9209  		v.copyOf(y)
  9210  		return true
  9211  	}
  9212  	// match: (MOVHreg y:(MOVBreg _))
  9213  	// result: y
  9214  	for {
  9215  		y := v_0
  9216  		if y.Op != OpPPC64MOVBreg {
  9217  			break
  9218  		}
  9219  		v.copyOf(y)
  9220  		return true
  9221  	}
  9222  	// match: (MOVHreg y:(MOVHZreg x))
  9223  	// result: (MOVHreg x)
  9224  	for {
  9225  		y := v_0
  9226  		if y.Op != OpPPC64MOVHZreg {
  9227  			break
  9228  		}
  9229  		x := y.Args[0]
  9230  		v.reset(OpPPC64MOVHreg)
  9231  		v.AddArg(x)
  9232  		return true
  9233  	}
  9234  	// match: (MOVHreg x:(MOVHload _ _))
  9235  	// result: x
  9236  	for {
  9237  		x := v_0
  9238  		if x.Op != OpPPC64MOVHload {
  9239  			break
  9240  		}
  9241  		v.copyOf(x)
  9242  		return true
  9243  	}
  9244  	// match: (MOVHreg x:(MOVHloadidx _ _ _))
  9245  	// result: x
  9246  	for {
  9247  		x := v_0
  9248  		if x.Op != OpPPC64MOVHloadidx {
  9249  			break
  9250  		}
  9251  		v.copyOf(x)
  9252  		return true
  9253  	}
  9254  	// match: (MOVHreg x:(Arg <t>))
  9255  	// cond: (is8BitInt(t) || is16BitInt(t)) && t.IsSigned()
  9256  	// result: x
  9257  	for {
  9258  		x := v_0
  9259  		if x.Op != OpArg {
  9260  			break
  9261  		}
  9262  		t := x.Type
  9263  		if !((is8BitInt(t) || is16BitInt(t)) && t.IsSigned()) {
  9264  			break
  9265  		}
  9266  		v.copyOf(x)
  9267  		return true
  9268  	}
  9269  	// match: (MOVHreg (MOVDconst [c]))
  9270  	// result: (MOVDconst [int64(int16(c))])
  9271  	for {
  9272  		if v_0.Op != OpPPC64MOVDconst {
  9273  			break
  9274  		}
  9275  		c := auxIntToInt64(v_0.AuxInt)
  9276  		v.reset(OpPPC64MOVDconst)
  9277  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  9278  		return true
  9279  	}
  9280  	return false
  9281  }
  9282  func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
  9283  	v_2 := v.Args[2]
  9284  	v_1 := v.Args[1]
  9285  	v_0 := v.Args[0]
  9286  	b := v.Block
  9287  	// match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
  9288  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9289  	// result: (MOVHstore [off1+int32(off2)] {sym} x val mem)
  9290  	for {
  9291  		off1 := auxIntToInt32(v.AuxInt)
  9292  		sym := auxToSym(v.Aux)
  9293  		if v_0.Op != OpPPC64ADDconst {
  9294  			break
  9295  		}
  9296  		off2 := auxIntToInt64(v_0.AuxInt)
  9297  		x := v_0.Args[0]
  9298  		val := v_1
  9299  		mem := v_2
  9300  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9301  			break
  9302  		}
  9303  		v.reset(OpPPC64MOVHstore)
  9304  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9305  		v.Aux = symToAux(sym)
  9306  		v.AddArg3(x, val, mem)
  9307  		return true
  9308  	}
  9309  	// match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  9310  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9311  	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9312  	for {
  9313  		off1 := auxIntToInt32(v.AuxInt)
  9314  		sym1 := auxToSym(v.Aux)
  9315  		p := v_0
  9316  		if p.Op != OpPPC64MOVDaddr {
  9317  			break
  9318  		}
  9319  		off2 := auxIntToInt32(p.AuxInt)
  9320  		sym2 := auxToSym(p.Aux)
  9321  		ptr := p.Args[0]
  9322  		val := v_1
  9323  		mem := v_2
  9324  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9325  			break
  9326  		}
  9327  		v.reset(OpPPC64MOVHstore)
  9328  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9329  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9330  		v.AddArg3(ptr, val, mem)
  9331  		return true
  9332  	}
  9333  	// match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
  9334  	// result: (MOVHstorezero [off] {sym} ptr mem)
  9335  	for {
  9336  		off := auxIntToInt32(v.AuxInt)
  9337  		sym := auxToSym(v.Aux)
  9338  		ptr := v_0
  9339  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  9340  			break
  9341  		}
  9342  		mem := v_2
  9343  		v.reset(OpPPC64MOVHstorezero)
  9344  		v.AuxInt = int32ToAuxInt(off)
  9345  		v.Aux = symToAux(sym)
  9346  		v.AddArg2(ptr, mem)
  9347  		return true
  9348  	}
  9349  	// match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem)
  9350  	// cond: sym == nil && p.Uses == 1
  9351  	// result: (MOVHstoreidx ptr idx val mem)
  9352  	for {
  9353  		if auxIntToInt32(v.AuxInt) != 0 {
  9354  			break
  9355  		}
  9356  		sym := auxToSym(v.Aux)
  9357  		p := v_0
  9358  		if p.Op != OpPPC64ADD {
  9359  			break
  9360  		}
  9361  		idx := p.Args[1]
  9362  		ptr := p.Args[0]
  9363  		val := v_1
  9364  		mem := v_2
  9365  		if !(sym == nil && p.Uses == 1) {
  9366  			break
  9367  		}
  9368  		v.reset(OpPPC64MOVHstoreidx)
  9369  		v.AddArg4(ptr, idx, val, mem)
  9370  		return true
  9371  	}
  9372  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  9373  	// result: (MOVHstore [off] {sym} ptr x mem)
  9374  	for {
  9375  		off := auxIntToInt32(v.AuxInt)
  9376  		sym := auxToSym(v.Aux)
  9377  		ptr := v_0
  9378  		if v_1.Op != OpPPC64MOVHreg {
  9379  			break
  9380  		}
  9381  		x := v_1.Args[0]
  9382  		mem := v_2
  9383  		v.reset(OpPPC64MOVHstore)
  9384  		v.AuxInt = int32ToAuxInt(off)
  9385  		v.Aux = symToAux(sym)
  9386  		v.AddArg3(ptr, x, mem)
  9387  		return true
  9388  	}
  9389  	// match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
  9390  	// result: (MOVHstore [off] {sym} ptr x mem)
  9391  	for {
  9392  		off := auxIntToInt32(v.AuxInt)
  9393  		sym := auxToSym(v.Aux)
  9394  		ptr := v_0
  9395  		if v_1.Op != OpPPC64MOVHZreg {
  9396  			break
  9397  		}
  9398  		x := v_1.Args[0]
  9399  		mem := v_2
  9400  		v.reset(OpPPC64MOVHstore)
  9401  		v.AuxInt = int32ToAuxInt(off)
  9402  		v.Aux = symToAux(sym)
  9403  		v.AddArg3(ptr, x, mem)
  9404  		return true
  9405  	}
  9406  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  9407  	// result: (MOVHstore [off] {sym} ptr x mem)
  9408  	for {
  9409  		off := auxIntToInt32(v.AuxInt)
  9410  		sym := auxToSym(v.Aux)
  9411  		ptr := v_0
  9412  		if v_1.Op != OpPPC64MOVWreg {
  9413  			break
  9414  		}
  9415  		x := v_1.Args[0]
  9416  		mem := v_2
  9417  		v.reset(OpPPC64MOVHstore)
  9418  		v.AuxInt = int32ToAuxInt(off)
  9419  		v.Aux = symToAux(sym)
  9420  		v.AddArg3(ptr, x, mem)
  9421  		return true
  9422  	}
  9423  	// match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem)
  9424  	// result: (MOVHstore [off] {sym} ptr x mem)
  9425  	for {
  9426  		off := auxIntToInt32(v.AuxInt)
  9427  		sym := auxToSym(v.Aux)
  9428  		ptr := v_0
  9429  		if v_1.Op != OpPPC64MOVWZreg {
  9430  			break
  9431  		}
  9432  		x := v_1.Args[0]
  9433  		mem := v_2
  9434  		v.reset(OpPPC64MOVHstore)
  9435  		v.AuxInt = int32ToAuxInt(off)
  9436  		v.Aux = symToAux(sym)
  9437  		v.AddArg3(ptr, x, mem)
  9438  		return true
  9439  	}
  9440  	// match: (MOVHstore [off] {sym} ptr r:(BRH val) mem)
  9441  	// cond: r.Uses == 1
  9442  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  9443  	for {
  9444  		off := auxIntToInt32(v.AuxInt)
  9445  		sym := auxToSym(v.Aux)
  9446  		ptr := v_0
  9447  		r := v_1
  9448  		if r.Op != OpPPC64BRH {
  9449  			break
  9450  		}
  9451  		val := r.Args[0]
  9452  		mem := v_2
  9453  		if !(r.Uses == 1) {
  9454  			break
  9455  		}
  9456  		v.reset(OpPPC64MOVHBRstore)
  9457  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  9458  		v0.AuxInt = int32ToAuxInt(off)
  9459  		v0.Aux = symToAux(sym)
  9460  		v0.AddArg(ptr)
  9461  		v.AddArg3(v0, val, mem)
  9462  		return true
  9463  	}
  9464  	// match: (MOVHstore [off] {sym} ptr (Bswap16 val) mem)
  9465  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  9466  	for {
  9467  		off := auxIntToInt32(v.AuxInt)
  9468  		sym := auxToSym(v.Aux)
  9469  		ptr := v_0
  9470  		if v_1.Op != OpBswap16 {
  9471  			break
  9472  		}
  9473  		val := v_1.Args[0]
  9474  		mem := v_2
  9475  		v.reset(OpPPC64MOVHBRstore)
  9476  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  9477  		v0.AuxInt = int32ToAuxInt(off)
  9478  		v0.Aux = symToAux(sym)
  9479  		v0.AddArg(ptr)
  9480  		v.AddArg3(v0, val, mem)
  9481  		return true
  9482  	}
  9483  	return false
  9484  }
  9485  func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
  9486  	v_3 := v.Args[3]
  9487  	v_2 := v.Args[2]
  9488  	v_1 := v.Args[1]
  9489  	v_0 := v.Args[0]
  9490  	// match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
  9491  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9492  	// result: (MOVHstore [int32(c)] ptr val mem)
  9493  	for {
  9494  		ptr := v_0
  9495  		if v_1.Op != OpPPC64MOVDconst {
  9496  			break
  9497  		}
  9498  		c := auxIntToInt64(v_1.AuxInt)
  9499  		val := v_2
  9500  		mem := v_3
  9501  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9502  			break
  9503  		}
  9504  		v.reset(OpPPC64MOVHstore)
  9505  		v.AuxInt = int32ToAuxInt(int32(c))
  9506  		v.AddArg3(ptr, val, mem)
  9507  		return true
  9508  	}
  9509  	// match: (MOVHstoreidx (MOVDconst [c]) ptr val mem)
  9510  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9511  	// result: (MOVHstore [int32(c)] ptr val mem)
  9512  	for {
  9513  		if v_0.Op != OpPPC64MOVDconst {
  9514  			break
  9515  		}
  9516  		c := auxIntToInt64(v_0.AuxInt)
  9517  		ptr := v_1
  9518  		val := v_2
  9519  		mem := v_3
  9520  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9521  			break
  9522  		}
  9523  		v.reset(OpPPC64MOVHstore)
  9524  		v.AuxInt = int32ToAuxInt(int32(c))
  9525  		v.AddArg3(ptr, val, mem)
  9526  		return true
  9527  	}
  9528  	// match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
  9529  	// result: (MOVHstoreidx ptr idx x mem)
  9530  	for {
  9531  		ptr := v_0
  9532  		idx := v_1
  9533  		if v_2.Op != OpPPC64MOVHreg {
  9534  			break
  9535  		}
  9536  		x := v_2.Args[0]
  9537  		mem := v_3
  9538  		v.reset(OpPPC64MOVHstoreidx)
  9539  		v.AddArg4(ptr, idx, x, mem)
  9540  		return true
  9541  	}
  9542  	// match: (MOVHstoreidx ptr idx (MOVHZreg x) mem)
  9543  	// result: (MOVHstoreidx ptr idx x mem)
  9544  	for {
  9545  		ptr := v_0
  9546  		idx := v_1
  9547  		if v_2.Op != OpPPC64MOVHZreg {
  9548  			break
  9549  		}
  9550  		x := v_2.Args[0]
  9551  		mem := v_3
  9552  		v.reset(OpPPC64MOVHstoreidx)
  9553  		v.AddArg4(ptr, idx, x, mem)
  9554  		return true
  9555  	}
  9556  	// match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
  9557  	// result: (MOVHstoreidx ptr idx x mem)
  9558  	for {
  9559  		ptr := v_0
  9560  		idx := v_1
  9561  		if v_2.Op != OpPPC64MOVWreg {
  9562  			break
  9563  		}
  9564  		x := v_2.Args[0]
  9565  		mem := v_3
  9566  		v.reset(OpPPC64MOVHstoreidx)
  9567  		v.AddArg4(ptr, idx, x, mem)
  9568  		return true
  9569  	}
  9570  	// match: (MOVHstoreidx ptr idx (MOVWZreg x) mem)
  9571  	// result: (MOVHstoreidx ptr idx x mem)
  9572  	for {
  9573  		ptr := v_0
  9574  		idx := v_1
  9575  		if v_2.Op != OpPPC64MOVWZreg {
  9576  			break
  9577  		}
  9578  		x := v_2.Args[0]
  9579  		mem := v_3
  9580  		v.reset(OpPPC64MOVHstoreidx)
  9581  		v.AddArg4(ptr, idx, x, mem)
  9582  		return true
  9583  	}
  9584  	// match: (MOVHstoreidx ptr idx r:(BRH val) mem)
  9585  	// cond: r.Uses == 1
  9586  	// result: (MOVHBRstoreidx ptr idx val mem)
  9587  	for {
  9588  		ptr := v_0
  9589  		idx := v_1
  9590  		r := v_2
  9591  		if r.Op != OpPPC64BRH {
  9592  			break
  9593  		}
  9594  		val := r.Args[0]
  9595  		mem := v_3
  9596  		if !(r.Uses == 1) {
  9597  			break
  9598  		}
  9599  		v.reset(OpPPC64MOVHBRstoreidx)
  9600  		v.AddArg4(ptr, idx, val, mem)
  9601  		return true
  9602  	}
  9603  	// match: (MOVHstoreidx ptr idx (Bswap16 val) mem)
  9604  	// result: (MOVHBRstoreidx ptr idx val mem)
  9605  	for {
  9606  		ptr := v_0
  9607  		idx := v_1
  9608  		if v_2.Op != OpBswap16 {
  9609  			break
  9610  		}
  9611  		val := v_2.Args[0]
  9612  		mem := v_3
  9613  		v.reset(OpPPC64MOVHBRstoreidx)
  9614  		v.AddArg4(ptr, idx, val, mem)
  9615  		return true
  9616  	}
  9617  	return false
  9618  }
  9619  func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
  9620  	v_1 := v.Args[1]
  9621  	v_0 := v.Args[0]
  9622  	// match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
  9623  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  9624  	// result: (MOVHstorezero [off1+int32(off2)] {sym} x mem)
  9625  	for {
  9626  		off1 := auxIntToInt32(v.AuxInt)
  9627  		sym := auxToSym(v.Aux)
  9628  		if v_0.Op != OpPPC64ADDconst {
  9629  			break
  9630  		}
  9631  		off2 := auxIntToInt64(v_0.AuxInt)
  9632  		x := v_0.Args[0]
  9633  		mem := v_1
  9634  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  9635  			break
  9636  		}
  9637  		v.reset(OpPPC64MOVHstorezero)
  9638  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9639  		v.Aux = symToAux(sym)
  9640  		v.AddArg2(x, mem)
  9641  		return true
  9642  	}
  9643  	// match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  9644  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9645  	// result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  9646  	for {
  9647  		off1 := auxIntToInt32(v.AuxInt)
  9648  		sym1 := auxToSym(v.Aux)
  9649  		p := v_0
  9650  		if p.Op != OpPPC64MOVDaddr {
  9651  			break
  9652  		}
  9653  		off2 := auxIntToInt32(p.AuxInt)
  9654  		sym2 := auxToSym(p.Aux)
  9655  		x := p.Args[0]
  9656  		mem := v_1
  9657  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9658  			break
  9659  		}
  9660  		v.reset(OpPPC64MOVHstorezero)
  9661  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9662  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9663  		v.AddArg2(x, mem)
  9664  		return true
  9665  	}
  9666  	return false
  9667  }
  9668  func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
  9669  	v_2 := v.Args[2]
  9670  	v_1 := v.Args[1]
  9671  	v_0 := v.Args[0]
  9672  	// match: (MOVWBRstore ptr (MOVWreg x) mem)
  9673  	// result: (MOVWBRstore ptr x mem)
  9674  	for {
  9675  		ptr := v_0
  9676  		if v_1.Op != OpPPC64MOVWreg {
  9677  			break
  9678  		}
  9679  		x := v_1.Args[0]
  9680  		mem := v_2
  9681  		v.reset(OpPPC64MOVWBRstore)
  9682  		v.AddArg3(ptr, x, mem)
  9683  		return true
  9684  	}
  9685  	// match: (MOVWBRstore ptr (MOVWZreg x) mem)
  9686  	// result: (MOVWBRstore ptr x mem)
  9687  	for {
  9688  		ptr := v_0
  9689  		if v_1.Op != OpPPC64MOVWZreg {
  9690  			break
  9691  		}
  9692  		x := v_1.Args[0]
  9693  		mem := v_2
  9694  		v.reset(OpPPC64MOVWBRstore)
  9695  		v.AddArg3(ptr, x, mem)
  9696  		return true
  9697  	}
  9698  	return false
  9699  }
  9700  func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
  9701  	v_1 := v.Args[1]
  9702  	v_0 := v.Args[0]
  9703  	// match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  9704  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9705  	// result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9706  	for {
  9707  		off1 := auxIntToInt32(v.AuxInt)
  9708  		sym1 := auxToSym(v.Aux)
  9709  		p := v_0
  9710  		if p.Op != OpPPC64MOVDaddr {
  9711  			break
  9712  		}
  9713  		off2 := auxIntToInt32(p.AuxInt)
  9714  		sym2 := auxToSym(p.Aux)
  9715  		ptr := p.Args[0]
  9716  		mem := v_1
  9717  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9718  			break
  9719  		}
  9720  		v.reset(OpPPC64MOVWZload)
  9721  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9722  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9723  		v.AddArg2(ptr, mem)
  9724  		return true
  9725  	}
  9726  	// match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
  9727  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9728  	// result: (MOVWZload [off1+int32(off2)] {sym} x mem)
  9729  	for {
  9730  		off1 := auxIntToInt32(v.AuxInt)
  9731  		sym := auxToSym(v.Aux)
  9732  		if v_0.Op != OpPPC64ADDconst {
  9733  			break
  9734  		}
  9735  		off2 := auxIntToInt64(v_0.AuxInt)
  9736  		x := v_0.Args[0]
  9737  		mem := v_1
  9738  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9739  			break
  9740  		}
  9741  		v.reset(OpPPC64MOVWZload)
  9742  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9743  		v.Aux = symToAux(sym)
  9744  		v.AddArg2(x, mem)
  9745  		return true
  9746  	}
  9747  	// match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem)
  9748  	// cond: sym == nil && p.Uses == 1
  9749  	// result: (MOVWZloadidx ptr idx mem)
  9750  	for {
  9751  		if auxIntToInt32(v.AuxInt) != 0 {
  9752  			break
  9753  		}
  9754  		sym := auxToSym(v.Aux)
  9755  		p := v_0
  9756  		if p.Op != OpPPC64ADD {
  9757  			break
  9758  		}
  9759  		idx := p.Args[1]
  9760  		ptr := p.Args[0]
  9761  		mem := v_1
  9762  		if !(sym == nil && p.Uses == 1) {
  9763  			break
  9764  		}
  9765  		v.reset(OpPPC64MOVWZloadidx)
  9766  		v.AddArg3(ptr, idx, mem)
  9767  		return true
  9768  	}
  9769  	return false
  9770  }
  9771  func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
  9772  	v_2 := v.Args[2]
  9773  	v_1 := v.Args[1]
  9774  	v_0 := v.Args[0]
  9775  	// match: (MOVWZloadidx ptr (MOVDconst [c]) mem)
  9776  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9777  	// result: (MOVWZload [int32(c)] ptr mem)
  9778  	for {
  9779  		ptr := v_0
  9780  		if v_1.Op != OpPPC64MOVDconst {
  9781  			break
  9782  		}
  9783  		c := auxIntToInt64(v_1.AuxInt)
  9784  		mem := v_2
  9785  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9786  			break
  9787  		}
  9788  		v.reset(OpPPC64MOVWZload)
  9789  		v.AuxInt = int32ToAuxInt(int32(c))
  9790  		v.AddArg2(ptr, mem)
  9791  		return true
  9792  	}
  9793  	// match: (MOVWZloadidx (MOVDconst [c]) ptr mem)
  9794  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9795  	// result: (MOVWZload [int32(c)] ptr mem)
  9796  	for {
  9797  		if v_0.Op != OpPPC64MOVDconst {
  9798  			break
  9799  		}
  9800  		c := auxIntToInt64(v_0.AuxInt)
  9801  		ptr := v_1
  9802  		mem := v_2
  9803  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9804  			break
  9805  		}
  9806  		v.reset(OpPPC64MOVWZload)
  9807  		v.AuxInt = int32ToAuxInt(int32(c))
  9808  		v.AddArg2(ptr, mem)
  9809  		return true
  9810  	}
  9811  	return false
  9812  }
  9813  func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
  9814  	v_0 := v.Args[0]
  9815  	b := v.Block
  9816  	typ := &b.Func.Config.Types
  9817  	// match: (MOVWZreg y:(Select0 (ANDCCconst [c] _)))
  9818  	// cond: uint64(c) <= 0xFFFFFFFF
  9819  	// result: y
  9820  	for {
  9821  		y := v_0
  9822  		if y.Op != OpSelect0 {
  9823  			break
  9824  		}
  9825  		y_0 := y.Args[0]
  9826  		if y_0.Op != OpPPC64ANDCCconst {
  9827  			break
  9828  		}
  9829  		c := auxIntToInt64(y_0.AuxInt)
  9830  		if !(uint64(c) <= 0xFFFFFFFF) {
  9831  			break
  9832  		}
  9833  		v.copyOf(y)
  9834  		return true
  9835  	}
  9836  	// match: (MOVWZreg y:(AND (MOVDconst [c]) _))
  9837  	// cond: uint64(c) <= 0xFFFFFFFF
  9838  	// result: y
  9839  	for {
  9840  		y := v_0
  9841  		if y.Op != OpPPC64AND {
  9842  			break
  9843  		}
  9844  		y_0 := y.Args[0]
  9845  		y_1 := y.Args[1]
  9846  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
  9847  			if y_0.Op != OpPPC64MOVDconst {
  9848  				continue
  9849  			}
  9850  			c := auxIntToInt64(y_0.AuxInt)
  9851  			if !(uint64(c) <= 0xFFFFFFFF) {
  9852  				continue
  9853  			}
  9854  			v.copyOf(y)
  9855  			return true
  9856  		}
  9857  		break
  9858  	}
  9859  	// match: (MOVWZreg (SRWconst [c] (MOVBZreg x)))
  9860  	// result: (SRWconst [c] (MOVBZreg x))
  9861  	for {
  9862  		if v_0.Op != OpPPC64SRWconst {
  9863  			break
  9864  		}
  9865  		c := auxIntToInt64(v_0.AuxInt)
  9866  		v_0_0 := v_0.Args[0]
  9867  		if v_0_0.Op != OpPPC64MOVBZreg {
  9868  			break
  9869  		}
  9870  		x := v_0_0.Args[0]
  9871  		v.reset(OpPPC64SRWconst)
  9872  		v.AuxInt = int64ToAuxInt(c)
  9873  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  9874  		v0.AddArg(x)
  9875  		v.AddArg(v0)
  9876  		return true
  9877  	}
  9878  	// match: (MOVWZreg (SRWconst [c] (MOVHZreg x)))
  9879  	// result: (SRWconst [c] (MOVHZreg x))
  9880  	for {
  9881  		if v_0.Op != OpPPC64SRWconst {
  9882  			break
  9883  		}
  9884  		c := auxIntToInt64(v_0.AuxInt)
  9885  		v_0_0 := v_0.Args[0]
  9886  		if v_0_0.Op != OpPPC64MOVHZreg {
  9887  			break
  9888  		}
  9889  		x := v_0_0.Args[0]
  9890  		v.reset(OpPPC64SRWconst)
  9891  		v.AuxInt = int64ToAuxInt(c)
  9892  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  9893  		v0.AddArg(x)
  9894  		v.AddArg(v0)
  9895  		return true
  9896  	}
  9897  	// match: (MOVWZreg (SRWconst [c] (MOVWZreg x)))
  9898  	// result: (SRWconst [c] (MOVWZreg x))
  9899  	for {
  9900  		if v_0.Op != OpPPC64SRWconst {
  9901  			break
  9902  		}
  9903  		c := auxIntToInt64(v_0.AuxInt)
  9904  		v_0_0 := v_0.Args[0]
  9905  		if v_0_0.Op != OpPPC64MOVWZreg {
  9906  			break
  9907  		}
  9908  		x := v_0_0.Args[0]
  9909  		v.reset(OpPPC64SRWconst)
  9910  		v.AuxInt = int64ToAuxInt(c)
  9911  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  9912  		v0.AddArg(x)
  9913  		v.AddArg(v0)
  9914  		return true
  9915  	}
  9916  	// match: (MOVWZreg (SRWconst [c] x))
  9917  	// cond: sizeof(x.Type) <= 32
  9918  	// result: (SRWconst [c] x)
  9919  	for {
  9920  		if v_0.Op != OpPPC64SRWconst {
  9921  			break
  9922  		}
  9923  		c := auxIntToInt64(v_0.AuxInt)
  9924  		x := v_0.Args[0]
  9925  		if !(sizeof(x.Type) <= 32) {
  9926  			break
  9927  		}
  9928  		v.reset(OpPPC64SRWconst)
  9929  		v.AuxInt = int64ToAuxInt(c)
  9930  		v.AddArg(x)
  9931  		return true
  9932  	}
  9933  	// match: (MOVWZreg (SRDconst [c] x))
  9934  	// cond: c>=32
  9935  	// result: (SRDconst [c] x)
  9936  	for {
  9937  		if v_0.Op != OpPPC64SRDconst {
  9938  			break
  9939  		}
  9940  		c := auxIntToInt64(v_0.AuxInt)
  9941  		x := v_0.Args[0]
  9942  		if !(c >= 32) {
  9943  			break
  9944  		}
  9945  		v.reset(OpPPC64SRDconst)
  9946  		v.AuxInt = int64ToAuxInt(c)
  9947  		v.AddArg(x)
  9948  		return true
  9949  	}
  9950  	// match: (MOVWZreg (RLWINM [r] y))
  9951  	// cond: mergePPC64AndRlwinm(0xFFFFFFFF,r) != 0
  9952  	// result: (RLWINM [mergePPC64AndRlwinm(0xFFFFFFFF,r)] y)
  9953  	for {
  9954  		if v_0.Op != OpPPC64RLWINM {
  9955  			break
  9956  		}
  9957  		r := auxIntToInt64(v_0.AuxInt)
  9958  		y := v_0.Args[0]
  9959  		if !(mergePPC64AndRlwinm(0xFFFFFFFF, r) != 0) {
  9960  			break
  9961  		}
  9962  		v.reset(OpPPC64RLWINM)
  9963  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFFFFFFFF, r))
  9964  		v.AddArg(y)
  9965  		return true
  9966  	}
  9967  	// match: (MOVWZreg w:(SLWconst u))
  9968  	// result: w
  9969  	for {
  9970  		w := v_0
  9971  		if w.Op != OpPPC64SLWconst {
  9972  			break
  9973  		}
  9974  		v.copyOf(w)
  9975  		return true
  9976  	}
  9977  	// match: (MOVWZreg y:(MOVWZreg _))
  9978  	// result: y
  9979  	for {
  9980  		y := v_0
  9981  		if y.Op != OpPPC64MOVWZreg {
  9982  			break
  9983  		}
  9984  		v.copyOf(y)
  9985  		return true
  9986  	}
  9987  	// match: (MOVWZreg y:(MOVHZreg _))
  9988  	// result: y
  9989  	for {
  9990  		y := v_0
  9991  		if y.Op != OpPPC64MOVHZreg {
  9992  			break
  9993  		}
  9994  		v.copyOf(y)
  9995  		return true
  9996  	}
  9997  	// match: (MOVWZreg y:(MOVBZreg _))
  9998  	// result: y
  9999  	for {
 10000  		y := v_0
 10001  		if y.Op != OpPPC64MOVBZreg {
 10002  			break
 10003  		}
 10004  		v.copyOf(y)
 10005  		return true
 10006  	}
 10007  	// match: (MOVWZreg y:(MOVHBRload _ _))
 10008  	// result: y
 10009  	for {
 10010  		y := v_0
 10011  		if y.Op != OpPPC64MOVHBRload {
 10012  			break
 10013  		}
 10014  		v.copyOf(y)
 10015  		return true
 10016  	}
 10017  	// match: (MOVWZreg y:(MOVWBRload _ _))
 10018  	// result: y
 10019  	for {
 10020  		y := v_0
 10021  		if y.Op != OpPPC64MOVWBRload {
 10022  			break
 10023  		}
 10024  		v.copyOf(y)
 10025  		return true
 10026  	}
 10027  	// match: (MOVWZreg y:(MOVWreg x))
 10028  	// result: (MOVWZreg x)
 10029  	for {
 10030  		y := v_0
 10031  		if y.Op != OpPPC64MOVWreg {
 10032  			break
 10033  		}
 10034  		x := y.Args[0]
 10035  		v.reset(OpPPC64MOVWZreg)
 10036  		v.AddArg(x)
 10037  		return true
 10038  	}
 10039  	// match: (MOVWZreg (OR <t> x (MOVWZreg y)))
 10040  	// result: (MOVWZreg (OR <t> x y))
 10041  	for {
 10042  		if v_0.Op != OpPPC64OR {
 10043  			break
 10044  		}
 10045  		t := v_0.Type
 10046  		_ = v_0.Args[1]
 10047  		v_0_0 := v_0.Args[0]
 10048  		v_0_1 := v_0.Args[1]
 10049  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10050  			x := v_0_0
 10051  			if v_0_1.Op != OpPPC64MOVWZreg {
 10052  				continue
 10053  			}
 10054  			y := v_0_1.Args[0]
 10055  			v.reset(OpPPC64MOVWZreg)
 10056  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
 10057  			v0.AddArg2(x, y)
 10058  			v.AddArg(v0)
 10059  			return true
 10060  		}
 10061  		break
 10062  	}
 10063  	// match: (MOVWZreg (XOR <t> x (MOVWZreg y)))
 10064  	// result: (MOVWZreg (XOR <t> x y))
 10065  	for {
 10066  		if v_0.Op != OpPPC64XOR {
 10067  			break
 10068  		}
 10069  		t := v_0.Type
 10070  		_ = v_0.Args[1]
 10071  		v_0_0 := v_0.Args[0]
 10072  		v_0_1 := v_0.Args[1]
 10073  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10074  			x := v_0_0
 10075  			if v_0_1.Op != OpPPC64MOVWZreg {
 10076  				continue
 10077  			}
 10078  			y := v_0_1.Args[0]
 10079  			v.reset(OpPPC64MOVWZreg)
 10080  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
 10081  			v0.AddArg2(x, y)
 10082  			v.AddArg(v0)
 10083  			return true
 10084  		}
 10085  		break
 10086  	}
 10087  	// match: (MOVWZreg (AND <t> x (MOVWZreg y)))
 10088  	// result: (MOVWZreg (AND <t> x y))
 10089  	for {
 10090  		if v_0.Op != OpPPC64AND {
 10091  			break
 10092  		}
 10093  		t := v_0.Type
 10094  		_ = v_0.Args[1]
 10095  		v_0_0 := v_0.Args[0]
 10096  		v_0_1 := v_0.Args[1]
 10097  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10098  			x := v_0_0
 10099  			if v_0_1.Op != OpPPC64MOVWZreg {
 10100  				continue
 10101  			}
 10102  			y := v_0_1.Args[0]
 10103  			v.reset(OpPPC64MOVWZreg)
 10104  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
 10105  			v0.AddArg2(x, y)
 10106  			v.AddArg(v0)
 10107  			return true
 10108  		}
 10109  		break
 10110  	}
 10111  	// match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVBZload ptr x))))
 10112  	// result: z
 10113  	for {
 10114  		z := v_0
 10115  		if z.Op != OpSelect0 {
 10116  			break
 10117  		}
 10118  		z_0 := z.Args[0]
 10119  		if z_0.Op != OpPPC64ANDCCconst {
 10120  			break
 10121  		}
 10122  		z_0_0 := z_0.Args[0]
 10123  		if z_0_0.Op != OpPPC64MOVBZload {
 10124  			break
 10125  		}
 10126  		v.copyOf(z)
 10127  		return true
 10128  	}
 10129  	// match: (MOVWZreg z:(AND y (MOVWZload ptr x)))
 10130  	// result: z
 10131  	for {
 10132  		z := v_0
 10133  		if z.Op != OpPPC64AND {
 10134  			break
 10135  		}
 10136  		_ = z.Args[1]
 10137  		z_0 := z.Args[0]
 10138  		z_1 := z.Args[1]
 10139  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 10140  			if z_1.Op != OpPPC64MOVWZload {
 10141  				continue
 10142  			}
 10143  			v.copyOf(z)
 10144  			return true
 10145  		}
 10146  		break
 10147  	}
 10148  	// match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVHZload ptr x))))
 10149  	// result: z
 10150  	for {
 10151  		z := v_0
 10152  		if z.Op != OpSelect0 {
 10153  			break
 10154  		}
 10155  		z_0 := z.Args[0]
 10156  		if z_0.Op != OpPPC64ANDCCconst {
 10157  			break
 10158  		}
 10159  		z_0_0 := z_0.Args[0]
 10160  		if z_0_0.Op != OpPPC64MOVHZload {
 10161  			break
 10162  		}
 10163  		v.copyOf(z)
 10164  		return true
 10165  	}
 10166  	// match: (MOVWZreg z:(Select0 (ANDCCconst [c] (MOVWZload ptr x))))
 10167  	// result: z
 10168  	for {
 10169  		z := v_0
 10170  		if z.Op != OpSelect0 {
 10171  			break
 10172  		}
 10173  		z_0 := z.Args[0]
 10174  		if z_0.Op != OpPPC64ANDCCconst {
 10175  			break
 10176  		}
 10177  		z_0_0 := z_0.Args[0]
 10178  		if z_0_0.Op != OpPPC64MOVWZload {
 10179  			break
 10180  		}
 10181  		v.copyOf(z)
 10182  		return true
 10183  	}
 10184  	// match: (MOVWZreg x:(MOVBZload _ _))
 10185  	// result: x
 10186  	for {
 10187  		x := v_0
 10188  		if x.Op != OpPPC64MOVBZload {
 10189  			break
 10190  		}
 10191  		v.copyOf(x)
 10192  		return true
 10193  	}
 10194  	// match: (MOVWZreg x:(MOVBZloadidx _ _ _))
 10195  	// result: x
 10196  	for {
 10197  		x := v_0
 10198  		if x.Op != OpPPC64MOVBZloadidx {
 10199  			break
 10200  		}
 10201  		v.copyOf(x)
 10202  		return true
 10203  	}
 10204  	// match: (MOVWZreg x:(MOVHZload _ _))
 10205  	// result: x
 10206  	for {
 10207  		x := v_0
 10208  		if x.Op != OpPPC64MOVHZload {
 10209  			break
 10210  		}
 10211  		v.copyOf(x)
 10212  		return true
 10213  	}
 10214  	// match: (MOVWZreg x:(MOVHZloadidx _ _ _))
 10215  	// result: x
 10216  	for {
 10217  		x := v_0
 10218  		if x.Op != OpPPC64MOVHZloadidx {
 10219  			break
 10220  		}
 10221  		v.copyOf(x)
 10222  		return true
 10223  	}
 10224  	// match: (MOVWZreg x:(MOVWZload _ _))
 10225  	// result: x
 10226  	for {
 10227  		x := v_0
 10228  		if x.Op != OpPPC64MOVWZload {
 10229  			break
 10230  		}
 10231  		v.copyOf(x)
 10232  		return true
 10233  	}
 10234  	// match: (MOVWZreg x:(MOVWZloadidx _ _ _))
 10235  	// result: x
 10236  	for {
 10237  		x := v_0
 10238  		if x.Op != OpPPC64MOVWZloadidx {
 10239  			break
 10240  		}
 10241  		v.copyOf(x)
 10242  		return true
 10243  	}
 10244  	// match: (MOVWZreg x:(Select0 (LoweredAtomicLoad32 _ _)))
 10245  	// result: x
 10246  	for {
 10247  		x := v_0
 10248  		if x.Op != OpSelect0 {
 10249  			break
 10250  		}
 10251  		x_0 := x.Args[0]
 10252  		if x_0.Op != OpPPC64LoweredAtomicLoad32 {
 10253  			break
 10254  		}
 10255  		v.copyOf(x)
 10256  		return true
 10257  	}
 10258  	// match: (MOVWZreg x:(Arg <t>))
 10259  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()
 10260  	// result: x
 10261  	for {
 10262  		x := v_0
 10263  		if x.Op != OpArg {
 10264  			break
 10265  		}
 10266  		t := x.Type
 10267  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()) {
 10268  			break
 10269  		}
 10270  		v.copyOf(x)
 10271  		return true
 10272  	}
 10273  	// match: (MOVWZreg (MOVDconst [c]))
 10274  	// result: (MOVDconst [int64(uint32(c))])
 10275  	for {
 10276  		if v_0.Op != OpPPC64MOVDconst {
 10277  			break
 10278  		}
 10279  		c := auxIntToInt64(v_0.AuxInt)
 10280  		v.reset(OpPPC64MOVDconst)
 10281  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
 10282  		return true
 10283  	}
 10284  	return false
 10285  }
 10286  func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
 10287  	v_1 := v.Args[1]
 10288  	v_0 := v.Args[0]
 10289  	// match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10290  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10291  	// result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10292  	for {
 10293  		off1 := auxIntToInt32(v.AuxInt)
 10294  		sym1 := auxToSym(v.Aux)
 10295  		p := v_0
 10296  		if p.Op != OpPPC64MOVDaddr {
 10297  			break
 10298  		}
 10299  		off2 := auxIntToInt32(p.AuxInt)
 10300  		sym2 := auxToSym(p.Aux)
 10301  		ptr := p.Args[0]
 10302  		mem := v_1
 10303  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10304  			break
 10305  		}
 10306  		v.reset(OpPPC64MOVWload)
 10307  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10308  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10309  		v.AddArg2(ptr, mem)
 10310  		return true
 10311  	}
 10312  	// match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
 10313  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10314  	// result: (MOVWload [off1+int32(off2)] {sym} x mem)
 10315  	for {
 10316  		off1 := auxIntToInt32(v.AuxInt)
 10317  		sym := auxToSym(v.Aux)
 10318  		if v_0.Op != OpPPC64ADDconst {
 10319  			break
 10320  		}
 10321  		off2 := auxIntToInt64(v_0.AuxInt)
 10322  		x := v_0.Args[0]
 10323  		mem := v_1
 10324  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10325  			break
 10326  		}
 10327  		v.reset(OpPPC64MOVWload)
 10328  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10329  		v.Aux = symToAux(sym)
 10330  		v.AddArg2(x, mem)
 10331  		return true
 10332  	}
 10333  	// match: (MOVWload [0] {sym} p:(ADD ptr idx) mem)
 10334  	// cond: sym == nil && p.Uses == 1
 10335  	// result: (MOVWloadidx ptr idx mem)
 10336  	for {
 10337  		if auxIntToInt32(v.AuxInt) != 0 {
 10338  			break
 10339  		}
 10340  		sym := auxToSym(v.Aux)
 10341  		p := v_0
 10342  		if p.Op != OpPPC64ADD {
 10343  			break
 10344  		}
 10345  		idx := p.Args[1]
 10346  		ptr := p.Args[0]
 10347  		mem := v_1
 10348  		if !(sym == nil && p.Uses == 1) {
 10349  			break
 10350  		}
 10351  		v.reset(OpPPC64MOVWloadidx)
 10352  		v.AddArg3(ptr, idx, mem)
 10353  		return true
 10354  	}
 10355  	return false
 10356  }
 10357  func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
 10358  	v_2 := v.Args[2]
 10359  	v_1 := v.Args[1]
 10360  	v_0 := v.Args[0]
 10361  	// match: (MOVWloadidx ptr (MOVDconst [c]) mem)
 10362  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10363  	// result: (MOVWload [int32(c)] ptr mem)
 10364  	for {
 10365  		ptr := v_0
 10366  		if v_1.Op != OpPPC64MOVDconst {
 10367  			break
 10368  		}
 10369  		c := auxIntToInt64(v_1.AuxInt)
 10370  		mem := v_2
 10371  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10372  			break
 10373  		}
 10374  		v.reset(OpPPC64MOVWload)
 10375  		v.AuxInt = int32ToAuxInt(int32(c))
 10376  		v.AddArg2(ptr, mem)
 10377  		return true
 10378  	}
 10379  	// match: (MOVWloadidx (MOVDconst [c]) ptr mem)
 10380  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10381  	// result: (MOVWload [int32(c)] ptr mem)
 10382  	for {
 10383  		if v_0.Op != OpPPC64MOVDconst {
 10384  			break
 10385  		}
 10386  		c := auxIntToInt64(v_0.AuxInt)
 10387  		ptr := v_1
 10388  		mem := v_2
 10389  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10390  			break
 10391  		}
 10392  		v.reset(OpPPC64MOVWload)
 10393  		v.AuxInt = int32ToAuxInt(int32(c))
 10394  		v.AddArg2(ptr, mem)
 10395  		return true
 10396  	}
 10397  	return false
 10398  }
 10399  func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
 10400  	v_0 := v.Args[0]
 10401  	b := v.Block
 10402  	typ := &b.Func.Config.Types
 10403  	// match: (MOVWreg y:(Select0 (ANDCCconst [c] _)))
 10404  	// cond: uint64(c) <= 0xFFFF
 10405  	// result: y
 10406  	for {
 10407  		y := v_0
 10408  		if y.Op != OpSelect0 {
 10409  			break
 10410  		}
 10411  		y_0 := y.Args[0]
 10412  		if y_0.Op != OpPPC64ANDCCconst {
 10413  			break
 10414  		}
 10415  		c := auxIntToInt64(y_0.AuxInt)
 10416  		if !(uint64(c) <= 0xFFFF) {
 10417  			break
 10418  		}
 10419  		v.copyOf(y)
 10420  		return true
 10421  	}
 10422  	// match: (MOVWreg y:(AND (MOVDconst [c]) _))
 10423  	// cond: uint64(c) <= 0x7FFFFFFF
 10424  	// result: y
 10425  	for {
 10426  		y := v_0
 10427  		if y.Op != OpPPC64AND {
 10428  			break
 10429  		}
 10430  		y_0 := y.Args[0]
 10431  		y_1 := y.Args[1]
 10432  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10433  			if y_0.Op != OpPPC64MOVDconst {
 10434  				continue
 10435  			}
 10436  			c := auxIntToInt64(y_0.AuxInt)
 10437  			if !(uint64(c) <= 0x7FFFFFFF) {
 10438  				continue
 10439  			}
 10440  			v.copyOf(y)
 10441  			return true
 10442  		}
 10443  		break
 10444  	}
 10445  	// match: (MOVWreg (SRAWconst [c] (MOVBreg x)))
 10446  	// result: (SRAWconst [c] (MOVBreg x))
 10447  	for {
 10448  		if v_0.Op != OpPPC64SRAWconst {
 10449  			break
 10450  		}
 10451  		c := auxIntToInt64(v_0.AuxInt)
 10452  		v_0_0 := v_0.Args[0]
 10453  		if v_0_0.Op != OpPPC64MOVBreg {
 10454  			break
 10455  		}
 10456  		x := v_0_0.Args[0]
 10457  		v.reset(OpPPC64SRAWconst)
 10458  		v.AuxInt = int64ToAuxInt(c)
 10459  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 10460  		v0.AddArg(x)
 10461  		v.AddArg(v0)
 10462  		return true
 10463  	}
 10464  	// match: (MOVWreg (SRAWconst [c] (MOVHreg x)))
 10465  	// result: (SRAWconst [c] (MOVHreg x))
 10466  	for {
 10467  		if v_0.Op != OpPPC64SRAWconst {
 10468  			break
 10469  		}
 10470  		c := auxIntToInt64(v_0.AuxInt)
 10471  		v_0_0 := v_0.Args[0]
 10472  		if v_0_0.Op != OpPPC64MOVHreg {
 10473  			break
 10474  		}
 10475  		x := v_0_0.Args[0]
 10476  		v.reset(OpPPC64SRAWconst)
 10477  		v.AuxInt = int64ToAuxInt(c)
 10478  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 10479  		v0.AddArg(x)
 10480  		v.AddArg(v0)
 10481  		return true
 10482  	}
 10483  	// match: (MOVWreg (SRAWconst [c] (MOVWreg x)))
 10484  	// result: (SRAWconst [c] (MOVWreg x))
 10485  	for {
 10486  		if v_0.Op != OpPPC64SRAWconst {
 10487  			break
 10488  		}
 10489  		c := auxIntToInt64(v_0.AuxInt)
 10490  		v_0_0 := v_0.Args[0]
 10491  		if v_0_0.Op != OpPPC64MOVWreg {
 10492  			break
 10493  		}
 10494  		x := v_0_0.Args[0]
 10495  		v.reset(OpPPC64SRAWconst)
 10496  		v.AuxInt = int64ToAuxInt(c)
 10497  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
 10498  		v0.AddArg(x)
 10499  		v.AddArg(v0)
 10500  		return true
 10501  	}
 10502  	// match: (MOVWreg (SRAWconst [c] x))
 10503  	// cond: sizeof(x.Type) <= 32
 10504  	// result: (SRAWconst [c] x)
 10505  	for {
 10506  		if v_0.Op != OpPPC64SRAWconst {
 10507  			break
 10508  		}
 10509  		c := auxIntToInt64(v_0.AuxInt)
 10510  		x := v_0.Args[0]
 10511  		if !(sizeof(x.Type) <= 32) {
 10512  			break
 10513  		}
 10514  		v.reset(OpPPC64SRAWconst)
 10515  		v.AuxInt = int64ToAuxInt(c)
 10516  		v.AddArg(x)
 10517  		return true
 10518  	}
 10519  	// match: (MOVWreg (SRDconst [c] x))
 10520  	// cond: c>32
 10521  	// result: (SRDconst [c] x)
 10522  	for {
 10523  		if v_0.Op != OpPPC64SRDconst {
 10524  			break
 10525  		}
 10526  		c := auxIntToInt64(v_0.AuxInt)
 10527  		x := v_0.Args[0]
 10528  		if !(c > 32) {
 10529  			break
 10530  		}
 10531  		v.reset(OpPPC64SRDconst)
 10532  		v.AuxInt = int64ToAuxInt(c)
 10533  		v.AddArg(x)
 10534  		return true
 10535  	}
 10536  	// match: (MOVWreg (SRADconst [c] x))
 10537  	// cond: c>=32
 10538  	// result: (SRADconst [c] x)
 10539  	for {
 10540  		if v_0.Op != OpPPC64SRADconst {
 10541  			break
 10542  		}
 10543  		c := auxIntToInt64(v_0.AuxInt)
 10544  		x := v_0.Args[0]
 10545  		if !(c >= 32) {
 10546  			break
 10547  		}
 10548  		v.reset(OpPPC64SRADconst)
 10549  		v.AuxInt = int64ToAuxInt(c)
 10550  		v.AddArg(x)
 10551  		return true
 10552  	}
 10553  	// match: (MOVWreg (SRDconst [c] x))
 10554  	// cond: c==32
 10555  	// result: (SRADconst [c] x)
 10556  	for {
 10557  		if v_0.Op != OpPPC64SRDconst {
 10558  			break
 10559  		}
 10560  		c := auxIntToInt64(v_0.AuxInt)
 10561  		x := v_0.Args[0]
 10562  		if !(c == 32) {
 10563  			break
 10564  		}
 10565  		v.reset(OpPPC64SRADconst)
 10566  		v.AuxInt = int64ToAuxInt(c)
 10567  		v.AddArg(x)
 10568  		return true
 10569  	}
 10570  	// match: (MOVWreg y:(MOVWreg _))
 10571  	// result: y
 10572  	for {
 10573  		y := v_0
 10574  		if y.Op != OpPPC64MOVWreg {
 10575  			break
 10576  		}
 10577  		v.copyOf(y)
 10578  		return true
 10579  	}
 10580  	// match: (MOVWreg y:(MOVHreg _))
 10581  	// result: y
 10582  	for {
 10583  		y := v_0
 10584  		if y.Op != OpPPC64MOVHreg {
 10585  			break
 10586  		}
 10587  		v.copyOf(y)
 10588  		return true
 10589  	}
 10590  	// match: (MOVWreg y:(MOVBreg _))
 10591  	// result: y
 10592  	for {
 10593  		y := v_0
 10594  		if y.Op != OpPPC64MOVBreg {
 10595  			break
 10596  		}
 10597  		v.copyOf(y)
 10598  		return true
 10599  	}
 10600  	// match: (MOVWreg y:(MOVWZreg x))
 10601  	// result: (MOVWreg x)
 10602  	for {
 10603  		y := v_0
 10604  		if y.Op != OpPPC64MOVWZreg {
 10605  			break
 10606  		}
 10607  		x := y.Args[0]
 10608  		v.reset(OpPPC64MOVWreg)
 10609  		v.AddArg(x)
 10610  		return true
 10611  	}
 10612  	// match: (MOVWreg x:(MOVHload _ _))
 10613  	// result: x
 10614  	for {
 10615  		x := v_0
 10616  		if x.Op != OpPPC64MOVHload {
 10617  			break
 10618  		}
 10619  		v.copyOf(x)
 10620  		return true
 10621  	}
 10622  	// match: (MOVWreg x:(MOVHloadidx _ _ _))
 10623  	// result: x
 10624  	for {
 10625  		x := v_0
 10626  		if x.Op != OpPPC64MOVHloadidx {
 10627  			break
 10628  		}
 10629  		v.copyOf(x)
 10630  		return true
 10631  	}
 10632  	// match: (MOVWreg x:(MOVWload _ _))
 10633  	// result: x
 10634  	for {
 10635  		x := v_0
 10636  		if x.Op != OpPPC64MOVWload {
 10637  			break
 10638  		}
 10639  		v.copyOf(x)
 10640  		return true
 10641  	}
 10642  	// match: (MOVWreg x:(MOVWloadidx _ _ _))
 10643  	// result: x
 10644  	for {
 10645  		x := v_0
 10646  		if x.Op != OpPPC64MOVWloadidx {
 10647  			break
 10648  		}
 10649  		v.copyOf(x)
 10650  		return true
 10651  	}
 10652  	// match: (MOVWreg x:(Arg <t>))
 10653  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()
 10654  	// result: x
 10655  	for {
 10656  		x := v_0
 10657  		if x.Op != OpArg {
 10658  			break
 10659  		}
 10660  		t := x.Type
 10661  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()) {
 10662  			break
 10663  		}
 10664  		v.copyOf(x)
 10665  		return true
 10666  	}
 10667  	// match: (MOVWreg (MOVDconst [c]))
 10668  	// result: (MOVDconst [int64(int32(c))])
 10669  	for {
 10670  		if v_0.Op != OpPPC64MOVDconst {
 10671  			break
 10672  		}
 10673  		c := auxIntToInt64(v_0.AuxInt)
 10674  		v.reset(OpPPC64MOVDconst)
 10675  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
 10676  		return true
 10677  	}
 10678  	return false
 10679  }
 10680  func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
 10681  	v_2 := v.Args[2]
 10682  	v_1 := v.Args[1]
 10683  	v_0 := v.Args[0]
 10684  	b := v.Block
 10685  	// match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
 10686  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10687  	// result: (MOVWstore [off1+int32(off2)] {sym} x val mem)
 10688  	for {
 10689  		off1 := auxIntToInt32(v.AuxInt)
 10690  		sym := auxToSym(v.Aux)
 10691  		if v_0.Op != OpPPC64ADDconst {
 10692  			break
 10693  		}
 10694  		off2 := auxIntToInt64(v_0.AuxInt)
 10695  		x := v_0.Args[0]
 10696  		val := v_1
 10697  		mem := v_2
 10698  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10699  			break
 10700  		}
 10701  		v.reset(OpPPC64MOVWstore)
 10702  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10703  		v.Aux = symToAux(sym)
 10704  		v.AddArg3(x, val, mem)
 10705  		return true
 10706  	}
 10707  	// match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
 10708  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10709  	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 10710  	for {
 10711  		off1 := auxIntToInt32(v.AuxInt)
 10712  		sym1 := auxToSym(v.Aux)
 10713  		p := v_0
 10714  		if p.Op != OpPPC64MOVDaddr {
 10715  			break
 10716  		}
 10717  		off2 := auxIntToInt32(p.AuxInt)
 10718  		sym2 := auxToSym(p.Aux)
 10719  		ptr := p.Args[0]
 10720  		val := v_1
 10721  		mem := v_2
 10722  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10723  			break
 10724  		}
 10725  		v.reset(OpPPC64MOVWstore)
 10726  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10727  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10728  		v.AddArg3(ptr, val, mem)
 10729  		return true
 10730  	}
 10731  	// match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
 10732  	// result: (MOVWstorezero [off] {sym} ptr mem)
 10733  	for {
 10734  		off := auxIntToInt32(v.AuxInt)
 10735  		sym := auxToSym(v.Aux)
 10736  		ptr := v_0
 10737  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 10738  			break
 10739  		}
 10740  		mem := v_2
 10741  		v.reset(OpPPC64MOVWstorezero)
 10742  		v.AuxInt = int32ToAuxInt(off)
 10743  		v.Aux = symToAux(sym)
 10744  		v.AddArg2(ptr, mem)
 10745  		return true
 10746  	}
 10747  	// match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem)
 10748  	// cond: sym == nil && p.Uses == 1
 10749  	// result: (MOVWstoreidx ptr idx val mem)
 10750  	for {
 10751  		if auxIntToInt32(v.AuxInt) != 0 {
 10752  			break
 10753  		}
 10754  		sym := auxToSym(v.Aux)
 10755  		p := v_0
 10756  		if p.Op != OpPPC64ADD {
 10757  			break
 10758  		}
 10759  		idx := p.Args[1]
 10760  		ptr := p.Args[0]
 10761  		val := v_1
 10762  		mem := v_2
 10763  		if !(sym == nil && p.Uses == 1) {
 10764  			break
 10765  		}
 10766  		v.reset(OpPPC64MOVWstoreidx)
 10767  		v.AddArg4(ptr, idx, val, mem)
 10768  		return true
 10769  	}
 10770  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
 10771  	// result: (MOVWstore [off] {sym} ptr x mem)
 10772  	for {
 10773  		off := auxIntToInt32(v.AuxInt)
 10774  		sym := auxToSym(v.Aux)
 10775  		ptr := v_0
 10776  		if v_1.Op != OpPPC64MOVWreg {
 10777  			break
 10778  		}
 10779  		x := v_1.Args[0]
 10780  		mem := v_2
 10781  		v.reset(OpPPC64MOVWstore)
 10782  		v.AuxInt = int32ToAuxInt(off)
 10783  		v.Aux = symToAux(sym)
 10784  		v.AddArg3(ptr, x, mem)
 10785  		return true
 10786  	}
 10787  	// match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
 10788  	// result: (MOVWstore [off] {sym} ptr x mem)
 10789  	for {
 10790  		off := auxIntToInt32(v.AuxInt)
 10791  		sym := auxToSym(v.Aux)
 10792  		ptr := v_0
 10793  		if v_1.Op != OpPPC64MOVWZreg {
 10794  			break
 10795  		}
 10796  		x := v_1.Args[0]
 10797  		mem := v_2
 10798  		v.reset(OpPPC64MOVWstore)
 10799  		v.AuxInt = int32ToAuxInt(off)
 10800  		v.Aux = symToAux(sym)
 10801  		v.AddArg3(ptr, x, mem)
 10802  		return true
 10803  	}
 10804  	// match: (MOVWstore [off] {sym} ptr r:(BRW val) mem)
 10805  	// cond: r.Uses == 1
 10806  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 10807  	for {
 10808  		off := auxIntToInt32(v.AuxInt)
 10809  		sym := auxToSym(v.Aux)
 10810  		ptr := v_0
 10811  		r := v_1
 10812  		if r.Op != OpPPC64BRW {
 10813  			break
 10814  		}
 10815  		val := r.Args[0]
 10816  		mem := v_2
 10817  		if !(r.Uses == 1) {
 10818  			break
 10819  		}
 10820  		v.reset(OpPPC64MOVWBRstore)
 10821  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 10822  		v0.AuxInt = int32ToAuxInt(off)
 10823  		v0.Aux = symToAux(sym)
 10824  		v0.AddArg(ptr)
 10825  		v.AddArg3(v0, val, mem)
 10826  		return true
 10827  	}
 10828  	// match: (MOVWstore [off] {sym} ptr (Bswap32 val) mem)
 10829  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 10830  	for {
 10831  		off := auxIntToInt32(v.AuxInt)
 10832  		sym := auxToSym(v.Aux)
 10833  		ptr := v_0
 10834  		if v_1.Op != OpBswap32 {
 10835  			break
 10836  		}
 10837  		val := v_1.Args[0]
 10838  		mem := v_2
 10839  		v.reset(OpPPC64MOVWBRstore)
 10840  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 10841  		v0.AuxInt = int32ToAuxInt(off)
 10842  		v0.Aux = symToAux(sym)
 10843  		v0.AddArg(ptr)
 10844  		v.AddArg3(v0, val, mem)
 10845  		return true
 10846  	}
 10847  	return false
 10848  }
 10849  func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
 10850  	v_3 := v.Args[3]
 10851  	v_2 := v.Args[2]
 10852  	v_1 := v.Args[1]
 10853  	v_0 := v.Args[0]
 10854  	// match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
 10855  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10856  	// result: (MOVWstore [int32(c)] ptr val mem)
 10857  	for {
 10858  		ptr := v_0
 10859  		if v_1.Op != OpPPC64MOVDconst {
 10860  			break
 10861  		}
 10862  		c := auxIntToInt64(v_1.AuxInt)
 10863  		val := v_2
 10864  		mem := v_3
 10865  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10866  			break
 10867  		}
 10868  		v.reset(OpPPC64MOVWstore)
 10869  		v.AuxInt = int32ToAuxInt(int32(c))
 10870  		v.AddArg3(ptr, val, mem)
 10871  		return true
 10872  	}
 10873  	// match: (MOVWstoreidx (MOVDconst [c]) ptr val mem)
 10874  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10875  	// result: (MOVWstore [int32(c)] ptr val mem)
 10876  	for {
 10877  		if v_0.Op != OpPPC64MOVDconst {
 10878  			break
 10879  		}
 10880  		c := auxIntToInt64(v_0.AuxInt)
 10881  		ptr := v_1
 10882  		val := v_2
 10883  		mem := v_3
 10884  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10885  			break
 10886  		}
 10887  		v.reset(OpPPC64MOVWstore)
 10888  		v.AuxInt = int32ToAuxInt(int32(c))
 10889  		v.AddArg3(ptr, val, mem)
 10890  		return true
 10891  	}
 10892  	// match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
 10893  	// result: (MOVWstoreidx ptr idx x mem)
 10894  	for {
 10895  		ptr := v_0
 10896  		idx := v_1
 10897  		if v_2.Op != OpPPC64MOVWreg {
 10898  			break
 10899  		}
 10900  		x := v_2.Args[0]
 10901  		mem := v_3
 10902  		v.reset(OpPPC64MOVWstoreidx)
 10903  		v.AddArg4(ptr, idx, x, mem)
 10904  		return true
 10905  	}
 10906  	// match: (MOVWstoreidx ptr idx (MOVWZreg x) mem)
 10907  	// result: (MOVWstoreidx ptr idx x mem)
 10908  	for {
 10909  		ptr := v_0
 10910  		idx := v_1
 10911  		if v_2.Op != OpPPC64MOVWZreg {
 10912  			break
 10913  		}
 10914  		x := v_2.Args[0]
 10915  		mem := v_3
 10916  		v.reset(OpPPC64MOVWstoreidx)
 10917  		v.AddArg4(ptr, idx, x, mem)
 10918  		return true
 10919  	}
 10920  	// match: (MOVWstoreidx ptr idx r:(BRW val) mem)
 10921  	// cond: r.Uses == 1
 10922  	// result: (MOVWBRstoreidx ptr idx val mem)
 10923  	for {
 10924  		ptr := v_0
 10925  		idx := v_1
 10926  		r := v_2
 10927  		if r.Op != OpPPC64BRW {
 10928  			break
 10929  		}
 10930  		val := r.Args[0]
 10931  		mem := v_3
 10932  		if !(r.Uses == 1) {
 10933  			break
 10934  		}
 10935  		v.reset(OpPPC64MOVWBRstoreidx)
 10936  		v.AddArg4(ptr, idx, val, mem)
 10937  		return true
 10938  	}
 10939  	// match: (MOVWstoreidx ptr idx (Bswap32 val) mem)
 10940  	// result: (MOVWBRstoreidx ptr idx val mem)
 10941  	for {
 10942  		ptr := v_0
 10943  		idx := v_1
 10944  		if v_2.Op != OpBswap32 {
 10945  			break
 10946  		}
 10947  		val := v_2.Args[0]
 10948  		mem := v_3
 10949  		v.reset(OpPPC64MOVWBRstoreidx)
 10950  		v.AddArg4(ptr, idx, val, mem)
 10951  		return true
 10952  	}
 10953  	return false
 10954  }
 10955  func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
 10956  	v_1 := v.Args[1]
 10957  	v_0 := v.Args[0]
 10958  	// match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
 10959  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
 10960  	// result: (MOVWstorezero [off1+int32(off2)] {sym} x mem)
 10961  	for {
 10962  		off1 := auxIntToInt32(v.AuxInt)
 10963  		sym := auxToSym(v.Aux)
 10964  		if v_0.Op != OpPPC64ADDconst {
 10965  			break
 10966  		}
 10967  		off2 := auxIntToInt64(v_0.AuxInt)
 10968  		x := v_0.Args[0]
 10969  		mem := v_1
 10970  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
 10971  			break
 10972  		}
 10973  		v.reset(OpPPC64MOVWstorezero)
 10974  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10975  		v.Aux = symToAux(sym)
 10976  		v.AddArg2(x, mem)
 10977  		return true
 10978  	}
 10979  	// match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 10980  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10981  	// result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 10982  	for {
 10983  		off1 := auxIntToInt32(v.AuxInt)
 10984  		sym1 := auxToSym(v.Aux)
 10985  		p := v_0
 10986  		if p.Op != OpPPC64MOVDaddr {
 10987  			break
 10988  		}
 10989  		off2 := auxIntToInt32(p.AuxInt)
 10990  		sym2 := auxToSym(p.Aux)
 10991  		x := p.Args[0]
 10992  		mem := v_1
 10993  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10994  			break
 10995  		}
 10996  		v.reset(OpPPC64MOVWstorezero)
 10997  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10998  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10999  		v.AddArg2(x, mem)
 11000  		return true
 11001  	}
 11002  	return false
 11003  }
 11004  func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
 11005  	v_0 := v.Args[0]
 11006  	b := v.Block
 11007  	typ := &b.Func.Config.Types
 11008  	// match: (MTVSRD (MOVDconst [c]))
 11009  	// cond: !math.IsNaN(math.Float64frombits(uint64(c)))
 11010  	// result: (FMOVDconst [math.Float64frombits(uint64(c))])
 11011  	for {
 11012  		if v_0.Op != OpPPC64MOVDconst {
 11013  			break
 11014  		}
 11015  		c := auxIntToInt64(v_0.AuxInt)
 11016  		if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
 11017  			break
 11018  		}
 11019  		v.reset(OpPPC64FMOVDconst)
 11020  		v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
 11021  		return true
 11022  	}
 11023  	// match: (MTVSRD x:(MOVDload [off] {sym} ptr mem))
 11024  	// cond: x.Uses == 1 && clobber(x)
 11025  	// result: @x.Block (FMOVDload [off] {sym} ptr mem)
 11026  	for {
 11027  		x := v_0
 11028  		if x.Op != OpPPC64MOVDload {
 11029  			break
 11030  		}
 11031  		off := auxIntToInt32(x.AuxInt)
 11032  		sym := auxToSym(x.Aux)
 11033  		mem := x.Args[1]
 11034  		ptr := x.Args[0]
 11035  		if !(x.Uses == 1 && clobber(x)) {
 11036  			break
 11037  		}
 11038  		b = x.Block
 11039  		v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
 11040  		v.copyOf(v0)
 11041  		v0.AuxInt = int32ToAuxInt(off)
 11042  		v0.Aux = symToAux(sym)
 11043  		v0.AddArg2(ptr, mem)
 11044  		return true
 11045  	}
 11046  	return false
 11047  }
 11048  func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
 11049  	v_1 := v.Args[1]
 11050  	v_0 := v.Args[0]
 11051  	// match: (MULLD x (MOVDconst [c]))
 11052  	// cond: is16Bit(c)
 11053  	// result: (MULLDconst [int32(c)] x)
 11054  	for {
 11055  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11056  			x := v_0
 11057  			if v_1.Op != OpPPC64MOVDconst {
 11058  				continue
 11059  			}
 11060  			c := auxIntToInt64(v_1.AuxInt)
 11061  			if !(is16Bit(c)) {
 11062  				continue
 11063  			}
 11064  			v.reset(OpPPC64MULLDconst)
 11065  			v.AuxInt = int32ToAuxInt(int32(c))
 11066  			v.AddArg(x)
 11067  			return true
 11068  		}
 11069  		break
 11070  	}
 11071  	return false
 11072  }
 11073  func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
 11074  	v_1 := v.Args[1]
 11075  	v_0 := v.Args[0]
 11076  	// match: (MULLW x (MOVDconst [c]))
 11077  	// cond: is16Bit(c)
 11078  	// result: (MULLWconst [int32(c)] x)
 11079  	for {
 11080  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11081  			x := v_0
 11082  			if v_1.Op != OpPPC64MOVDconst {
 11083  				continue
 11084  			}
 11085  			c := auxIntToInt64(v_1.AuxInt)
 11086  			if !(is16Bit(c)) {
 11087  				continue
 11088  			}
 11089  			v.reset(OpPPC64MULLWconst)
 11090  			v.AuxInt = int32ToAuxInt(int32(c))
 11091  			v.AddArg(x)
 11092  			return true
 11093  		}
 11094  		break
 11095  	}
 11096  	return false
 11097  }
 11098  func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
 11099  	v_0 := v.Args[0]
 11100  	// match: (NEG (ADDconst [c] x))
 11101  	// cond: is32Bit(-c)
 11102  	// result: (SUBFCconst [-c] x)
 11103  	for {
 11104  		if v_0.Op != OpPPC64ADDconst {
 11105  			break
 11106  		}
 11107  		c := auxIntToInt64(v_0.AuxInt)
 11108  		x := v_0.Args[0]
 11109  		if !(is32Bit(-c)) {
 11110  			break
 11111  		}
 11112  		v.reset(OpPPC64SUBFCconst)
 11113  		v.AuxInt = int64ToAuxInt(-c)
 11114  		v.AddArg(x)
 11115  		return true
 11116  	}
 11117  	// match: (NEG (SUBFCconst [c] x))
 11118  	// cond: is32Bit(-c)
 11119  	// result: (ADDconst [-c] x)
 11120  	for {
 11121  		if v_0.Op != OpPPC64SUBFCconst {
 11122  			break
 11123  		}
 11124  		c := auxIntToInt64(v_0.AuxInt)
 11125  		x := v_0.Args[0]
 11126  		if !(is32Bit(-c)) {
 11127  			break
 11128  		}
 11129  		v.reset(OpPPC64ADDconst)
 11130  		v.AuxInt = int64ToAuxInt(-c)
 11131  		v.AddArg(x)
 11132  		return true
 11133  	}
 11134  	// match: (NEG (SUB x y))
 11135  	// result: (SUB y x)
 11136  	for {
 11137  		if v_0.Op != OpPPC64SUB {
 11138  			break
 11139  		}
 11140  		y := v_0.Args[1]
 11141  		x := v_0.Args[0]
 11142  		v.reset(OpPPC64SUB)
 11143  		v.AddArg2(y, x)
 11144  		return true
 11145  	}
 11146  	// match: (NEG (NEG x))
 11147  	// result: x
 11148  	for {
 11149  		if v_0.Op != OpPPC64NEG {
 11150  			break
 11151  		}
 11152  		x := v_0.Args[0]
 11153  		v.copyOf(x)
 11154  		return true
 11155  	}
 11156  	return false
 11157  }
 11158  func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
 11159  	v_1 := v.Args[1]
 11160  	v_0 := v.Args[0]
 11161  	// match: (NOR (MOVDconst [c]) (MOVDconst [d]))
 11162  	// result: (MOVDconst [^(c|d)])
 11163  	for {
 11164  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11165  			if v_0.Op != OpPPC64MOVDconst {
 11166  				continue
 11167  			}
 11168  			c := auxIntToInt64(v_0.AuxInt)
 11169  			if v_1.Op != OpPPC64MOVDconst {
 11170  				continue
 11171  			}
 11172  			d := auxIntToInt64(v_1.AuxInt)
 11173  			v.reset(OpPPC64MOVDconst)
 11174  			v.AuxInt = int64ToAuxInt(^(c | d))
 11175  			return true
 11176  		}
 11177  		break
 11178  	}
 11179  	return false
 11180  }
 11181  func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
 11182  	v_0 := v.Args[0]
 11183  	// match: (NotEqual (FlagEQ))
 11184  	// result: (MOVDconst [0])
 11185  	for {
 11186  		if v_0.Op != OpPPC64FlagEQ {
 11187  			break
 11188  		}
 11189  		v.reset(OpPPC64MOVDconst)
 11190  		v.AuxInt = int64ToAuxInt(0)
 11191  		return true
 11192  	}
 11193  	// match: (NotEqual (FlagLT))
 11194  	// result: (MOVDconst [1])
 11195  	for {
 11196  		if v_0.Op != OpPPC64FlagLT {
 11197  			break
 11198  		}
 11199  		v.reset(OpPPC64MOVDconst)
 11200  		v.AuxInt = int64ToAuxInt(1)
 11201  		return true
 11202  	}
 11203  	// match: (NotEqual (FlagGT))
 11204  	// result: (MOVDconst [1])
 11205  	for {
 11206  		if v_0.Op != OpPPC64FlagGT {
 11207  			break
 11208  		}
 11209  		v.reset(OpPPC64MOVDconst)
 11210  		v.AuxInt = int64ToAuxInt(1)
 11211  		return true
 11212  	}
 11213  	// match: (NotEqual (InvertFlags x))
 11214  	// result: (NotEqual x)
 11215  	for {
 11216  		if v_0.Op != OpPPC64InvertFlags {
 11217  			break
 11218  		}
 11219  		x := v_0.Args[0]
 11220  		v.reset(OpPPC64NotEqual)
 11221  		v.AddArg(x)
 11222  		return true
 11223  	}
 11224  	// match: (NotEqual cmp)
 11225  	// result: (SETBCR [2] cmp)
 11226  	for {
 11227  		cmp := v_0
 11228  		v.reset(OpPPC64SETBCR)
 11229  		v.AuxInt = int32ToAuxInt(2)
 11230  		v.AddArg(cmp)
 11231  		return true
 11232  	}
 11233  }
 11234  func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
 11235  	v_1 := v.Args[1]
 11236  	v_0 := v.Args[0]
 11237  	// match: (OR x (NOR y y))
 11238  	// result: (ORN x y)
 11239  	for {
 11240  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11241  			x := v_0
 11242  			if v_1.Op != OpPPC64NOR {
 11243  				continue
 11244  			}
 11245  			y := v_1.Args[1]
 11246  			if y != v_1.Args[0] {
 11247  				continue
 11248  			}
 11249  			v.reset(OpPPC64ORN)
 11250  			v.AddArg2(x, y)
 11251  			return true
 11252  		}
 11253  		break
 11254  	}
 11255  	// match: (OR (MOVDconst [c]) (MOVDconst [d]))
 11256  	// result: (MOVDconst [c|d])
 11257  	for {
 11258  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11259  			if v_0.Op != OpPPC64MOVDconst {
 11260  				continue
 11261  			}
 11262  			c := auxIntToInt64(v_0.AuxInt)
 11263  			if v_1.Op != OpPPC64MOVDconst {
 11264  				continue
 11265  			}
 11266  			d := auxIntToInt64(v_1.AuxInt)
 11267  			v.reset(OpPPC64MOVDconst)
 11268  			v.AuxInt = int64ToAuxInt(c | d)
 11269  			return true
 11270  		}
 11271  		break
 11272  	}
 11273  	// match: (OR x (MOVDconst [c]))
 11274  	// cond: isU32Bit(c)
 11275  	// result: (ORconst [c] x)
 11276  	for {
 11277  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11278  			x := v_0
 11279  			if v_1.Op != OpPPC64MOVDconst {
 11280  				continue
 11281  			}
 11282  			c := auxIntToInt64(v_1.AuxInt)
 11283  			if !(isU32Bit(c)) {
 11284  				continue
 11285  			}
 11286  			v.reset(OpPPC64ORconst)
 11287  			v.AuxInt = int64ToAuxInt(c)
 11288  			v.AddArg(x)
 11289  			return true
 11290  		}
 11291  		break
 11292  	}
 11293  	return false
 11294  }
 11295  func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
 11296  	v_1 := v.Args[1]
 11297  	v_0 := v.Args[0]
 11298  	// match: (ORN x (MOVDconst [-1]))
 11299  	// result: x
 11300  	for {
 11301  		x := v_0
 11302  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
 11303  			break
 11304  		}
 11305  		v.copyOf(x)
 11306  		return true
 11307  	}
 11308  	// match: (ORN (MOVDconst [c]) (MOVDconst [d]))
 11309  	// result: (MOVDconst [c|^d])
 11310  	for {
 11311  		if v_0.Op != OpPPC64MOVDconst {
 11312  			break
 11313  		}
 11314  		c := auxIntToInt64(v_0.AuxInt)
 11315  		if v_1.Op != OpPPC64MOVDconst {
 11316  			break
 11317  		}
 11318  		d := auxIntToInt64(v_1.AuxInt)
 11319  		v.reset(OpPPC64MOVDconst)
 11320  		v.AuxInt = int64ToAuxInt(c | ^d)
 11321  		return true
 11322  	}
 11323  	return false
 11324  }
 11325  func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
 11326  	v_0 := v.Args[0]
 11327  	// match: (ORconst [c] (ORconst [d] x))
 11328  	// result: (ORconst [c|d] x)
 11329  	for {
 11330  		c := auxIntToInt64(v.AuxInt)
 11331  		if v_0.Op != OpPPC64ORconst {
 11332  			break
 11333  		}
 11334  		d := auxIntToInt64(v_0.AuxInt)
 11335  		x := v_0.Args[0]
 11336  		v.reset(OpPPC64ORconst)
 11337  		v.AuxInt = int64ToAuxInt(c | d)
 11338  		v.AddArg(x)
 11339  		return true
 11340  	}
 11341  	// match: (ORconst [-1] _)
 11342  	// result: (MOVDconst [-1])
 11343  	for {
 11344  		if auxIntToInt64(v.AuxInt) != -1 {
 11345  			break
 11346  		}
 11347  		v.reset(OpPPC64MOVDconst)
 11348  		v.AuxInt = int64ToAuxInt(-1)
 11349  		return true
 11350  	}
 11351  	// match: (ORconst [0] x)
 11352  	// result: x
 11353  	for {
 11354  		if auxIntToInt64(v.AuxInt) != 0 {
 11355  			break
 11356  		}
 11357  		x := v_0
 11358  		v.copyOf(x)
 11359  		return true
 11360  	}
 11361  	return false
 11362  }
 11363  func rewriteValuePPC64_OpPPC64RLWINM(v *Value) bool {
 11364  	v_0 := v.Args[0]
 11365  	// match: (RLWINM [r] (MOVHZreg u))
 11366  	// cond: mergePPC64RlwinmAnd(r,0xFFFF) != 0
 11367  	// result: (RLWINM [mergePPC64RlwinmAnd(r,0xFFFF)] u)
 11368  	for {
 11369  		r := auxIntToInt64(v.AuxInt)
 11370  		if v_0.Op != OpPPC64MOVHZreg {
 11371  			break
 11372  		}
 11373  		u := v_0.Args[0]
 11374  		if !(mergePPC64RlwinmAnd(r, 0xFFFF) != 0) {
 11375  			break
 11376  		}
 11377  		v.reset(OpPPC64RLWINM)
 11378  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, 0xFFFF))
 11379  		v.AddArg(u)
 11380  		return true
 11381  	}
 11382  	// match: (RLWINM [r] (Select0 (ANDCCconst [a] u)))
 11383  	// cond: mergePPC64RlwinmAnd(r,uint32(a)) != 0
 11384  	// result: (RLWINM [mergePPC64RlwinmAnd(r,uint32(a))] u)
 11385  	for {
 11386  		r := auxIntToInt64(v.AuxInt)
 11387  		if v_0.Op != OpSelect0 {
 11388  			break
 11389  		}
 11390  		v_0_0 := v_0.Args[0]
 11391  		if v_0_0.Op != OpPPC64ANDCCconst {
 11392  			break
 11393  		}
 11394  		a := auxIntToInt64(v_0_0.AuxInt)
 11395  		u := v_0_0.Args[0]
 11396  		if !(mergePPC64RlwinmAnd(r, uint32(a)) != 0) {
 11397  			break
 11398  		}
 11399  		v.reset(OpPPC64RLWINM)
 11400  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, uint32(a)))
 11401  		v.AddArg(u)
 11402  		return true
 11403  	}
 11404  	return false
 11405  }
 11406  func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
 11407  	v_1 := v.Args[1]
 11408  	v_0 := v.Args[0]
 11409  	// match: (ROTL x (MOVDconst [c]))
 11410  	// result: (ROTLconst x [c&63])
 11411  	for {
 11412  		x := v_0
 11413  		if v_1.Op != OpPPC64MOVDconst {
 11414  			break
 11415  		}
 11416  		c := auxIntToInt64(v_1.AuxInt)
 11417  		v.reset(OpPPC64ROTLconst)
 11418  		v.AuxInt = int64ToAuxInt(c & 63)
 11419  		v.AddArg(x)
 11420  		return true
 11421  	}
 11422  	return false
 11423  }
 11424  func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
 11425  	v_1 := v.Args[1]
 11426  	v_0 := v.Args[0]
 11427  	// match: (ROTLW x (MOVDconst [c]))
 11428  	// result: (ROTLWconst x [c&31])
 11429  	for {
 11430  		x := v_0
 11431  		if v_1.Op != OpPPC64MOVDconst {
 11432  			break
 11433  		}
 11434  		c := auxIntToInt64(v_1.AuxInt)
 11435  		v.reset(OpPPC64ROTLWconst)
 11436  		v.AuxInt = int64ToAuxInt(c & 31)
 11437  		v.AddArg(x)
 11438  		return true
 11439  	}
 11440  	return false
 11441  }
 11442  func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
 11443  	v_0 := v.Args[0]
 11444  	// match: (ROTLWconst [r] (AND (MOVDconst [m]) x))
 11445  	// cond: isPPC64WordRotateMask(m)
 11446  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 11447  	for {
 11448  		r := auxIntToInt64(v.AuxInt)
 11449  		if v_0.Op != OpPPC64AND {
 11450  			break
 11451  		}
 11452  		_ = v_0.Args[1]
 11453  		v_0_0 := v_0.Args[0]
 11454  		v_0_1 := v_0.Args[1]
 11455  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 11456  			if v_0_0.Op != OpPPC64MOVDconst {
 11457  				continue
 11458  			}
 11459  			m := auxIntToInt64(v_0_0.AuxInt)
 11460  			x := v_0_1
 11461  			if !(isPPC64WordRotateMask(m)) {
 11462  				continue
 11463  			}
 11464  			v.reset(OpPPC64RLWINM)
 11465  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 11466  			v.AddArg(x)
 11467  			return true
 11468  		}
 11469  		break
 11470  	}
 11471  	// match: (ROTLWconst [r] (Select0 (ANDCCconst [m] x)))
 11472  	// cond: isPPC64WordRotateMask(m)
 11473  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 11474  	for {
 11475  		r := auxIntToInt64(v.AuxInt)
 11476  		if v_0.Op != OpSelect0 {
 11477  			break
 11478  		}
 11479  		v_0_0 := v_0.Args[0]
 11480  		if v_0_0.Op != OpPPC64ANDCCconst {
 11481  			break
 11482  		}
 11483  		m := auxIntToInt64(v_0_0.AuxInt)
 11484  		x := v_0_0.Args[0]
 11485  		if !(isPPC64WordRotateMask(m)) {
 11486  			break
 11487  		}
 11488  		v.reset(OpPPC64RLWINM)
 11489  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 11490  		v.AddArg(x)
 11491  		return true
 11492  	}
 11493  	return false
 11494  }
 11495  func rewriteValuePPC64_OpPPC64SETBC(v *Value) bool {
 11496  	v_0 := v.Args[0]
 11497  	b := v.Block
 11498  	typ := &b.Func.Config.Types
 11499  	// match: (SETBC [0] (FlagLT))
 11500  	// result: (MOVDconst [1])
 11501  	for {
 11502  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 11503  			break
 11504  		}
 11505  		v.reset(OpPPC64MOVDconst)
 11506  		v.AuxInt = int64ToAuxInt(1)
 11507  		return true
 11508  	}
 11509  	// match: (SETBC [0] (FlagGT))
 11510  	// result: (MOVDconst [0])
 11511  	for {
 11512  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 11513  			break
 11514  		}
 11515  		v.reset(OpPPC64MOVDconst)
 11516  		v.AuxInt = int64ToAuxInt(0)
 11517  		return true
 11518  	}
 11519  	// match: (SETBC [0] (FlagEQ))
 11520  	// result: (MOVDconst [0])
 11521  	for {
 11522  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 11523  			break
 11524  		}
 11525  		v.reset(OpPPC64MOVDconst)
 11526  		v.AuxInt = int64ToAuxInt(0)
 11527  		return true
 11528  	}
 11529  	// match: (SETBC [1] (FlagGT))
 11530  	// result: (MOVDconst [1])
 11531  	for {
 11532  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 11533  			break
 11534  		}
 11535  		v.reset(OpPPC64MOVDconst)
 11536  		v.AuxInt = int64ToAuxInt(1)
 11537  		return true
 11538  	}
 11539  	// match: (SETBC [1] (FlagLT))
 11540  	// result: (MOVDconst [0])
 11541  	for {
 11542  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 11543  			break
 11544  		}
 11545  		v.reset(OpPPC64MOVDconst)
 11546  		v.AuxInt = int64ToAuxInt(0)
 11547  		return true
 11548  	}
 11549  	// match: (SETBC [1] (FlagEQ))
 11550  	// result: (MOVDconst [0])
 11551  	for {
 11552  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 11553  			break
 11554  		}
 11555  		v.reset(OpPPC64MOVDconst)
 11556  		v.AuxInt = int64ToAuxInt(0)
 11557  		return true
 11558  	}
 11559  	// match: (SETBC [2] (FlagEQ))
 11560  	// result: (MOVDconst [1])
 11561  	for {
 11562  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 11563  			break
 11564  		}
 11565  		v.reset(OpPPC64MOVDconst)
 11566  		v.AuxInt = int64ToAuxInt(1)
 11567  		return true
 11568  	}
 11569  	// match: (SETBC [2] (FlagLT))
 11570  	// result: (MOVDconst [0])
 11571  	for {
 11572  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 11573  			break
 11574  		}
 11575  		v.reset(OpPPC64MOVDconst)
 11576  		v.AuxInt = int64ToAuxInt(0)
 11577  		return true
 11578  	}
 11579  	// match: (SETBC [2] (FlagGT))
 11580  	// result: (MOVDconst [0])
 11581  	for {
 11582  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 11583  			break
 11584  		}
 11585  		v.reset(OpPPC64MOVDconst)
 11586  		v.AuxInt = int64ToAuxInt(0)
 11587  		return true
 11588  	}
 11589  	// match: (SETBC [0] (InvertFlags bool))
 11590  	// result: (SETBC [1] bool)
 11591  	for {
 11592  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 11593  			break
 11594  		}
 11595  		bool := v_0.Args[0]
 11596  		v.reset(OpPPC64SETBC)
 11597  		v.AuxInt = int32ToAuxInt(1)
 11598  		v.AddArg(bool)
 11599  		return true
 11600  	}
 11601  	// match: (SETBC [1] (InvertFlags bool))
 11602  	// result: (SETBC [0] bool)
 11603  	for {
 11604  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 11605  			break
 11606  		}
 11607  		bool := v_0.Args[0]
 11608  		v.reset(OpPPC64SETBC)
 11609  		v.AuxInt = int32ToAuxInt(0)
 11610  		v.AddArg(bool)
 11611  		return true
 11612  	}
 11613  	// match: (SETBC [2] (InvertFlags bool))
 11614  	// result: (SETBC [2] bool)
 11615  	for {
 11616  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 11617  			break
 11618  		}
 11619  		bool := v_0.Args[0]
 11620  		v.reset(OpPPC64SETBC)
 11621  		v.AuxInt = int32ToAuxInt(2)
 11622  		v.AddArg(bool)
 11623  		return true
 11624  	}
 11625  	// match: (SETBC [n] (InvertFlags bool))
 11626  	// result: (SETBCR [n] bool)
 11627  	for {
 11628  		n := auxIntToInt32(v.AuxInt)
 11629  		if v_0.Op != OpPPC64InvertFlags {
 11630  			break
 11631  		}
 11632  		bool := v_0.Args[0]
 11633  		v.reset(OpPPC64SETBCR)
 11634  		v.AuxInt = int32ToAuxInt(n)
 11635  		v.AddArg(bool)
 11636  		return true
 11637  	}
 11638  	// match: (SETBC [2] (Select1 a:(ANDCCconst <t> [1] _)))
 11639  	// result: (XORconst [1] (Select0 <t.FieldType(0)> a))
 11640  	for {
 11641  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpSelect1 {
 11642  			break
 11643  		}
 11644  		a := v_0.Args[0]
 11645  		if a.Op != OpPPC64ANDCCconst {
 11646  			break
 11647  		}
 11648  		t := a.Type
 11649  		if auxIntToInt64(a.AuxInt) != 1 {
 11650  			break
 11651  		}
 11652  		v.reset(OpPPC64XORconst)
 11653  		v.AuxInt = int64ToAuxInt(1)
 11654  		v0 := b.NewValue0(v.Pos, OpSelect0, t.FieldType(0))
 11655  		v0.AddArg(a)
 11656  		v.AddArg(v0)
 11657  		return true
 11658  	}
 11659  	// match: (SETBC [2] (CMPconst [0] a:(AND y z)))
 11660  	// cond: a.Uses == 1
 11661  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 11662  	for {
 11663  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11664  			break
 11665  		}
 11666  		a := v_0.Args[0]
 11667  		if a.Op != OpPPC64AND {
 11668  			break
 11669  		}
 11670  		z := a.Args[1]
 11671  		y := a.Args[0]
 11672  		if !(a.Uses == 1) {
 11673  			break
 11674  		}
 11675  		v.reset(OpPPC64SETBC)
 11676  		v.AuxInt = int32ToAuxInt(2)
 11677  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 11678  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 11679  		v1.AddArg2(y, z)
 11680  		v0.AddArg(v1)
 11681  		v.AddArg(v0)
 11682  		return true
 11683  	}
 11684  	// match: (SETBC [2] (CMPconst [0] o:(OR y z)))
 11685  	// cond: o.Uses == 1
 11686  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ORCC y z )))
 11687  	for {
 11688  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11689  			break
 11690  		}
 11691  		o := v_0.Args[0]
 11692  		if o.Op != OpPPC64OR {
 11693  			break
 11694  		}
 11695  		z := o.Args[1]
 11696  		y := o.Args[0]
 11697  		if !(o.Uses == 1) {
 11698  			break
 11699  		}
 11700  		v.reset(OpPPC64SETBC)
 11701  		v.AuxInt = int32ToAuxInt(2)
 11702  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 11703  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 11704  		v1.AddArg2(y, z)
 11705  		v0.AddArg(v1)
 11706  		v.AddArg(v0)
 11707  		return true
 11708  	}
 11709  	// match: (SETBC [2] (CMPconst [0] a:(XOR y z)))
 11710  	// cond: a.Uses == 1
 11711  	// result: (SETBC [2] (Select1 <types.TypeFlags> (XORCC y z )))
 11712  	for {
 11713  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11714  			break
 11715  		}
 11716  		a := v_0.Args[0]
 11717  		if a.Op != OpPPC64XOR {
 11718  			break
 11719  		}
 11720  		z := a.Args[1]
 11721  		y := a.Args[0]
 11722  		if !(a.Uses == 1) {
 11723  			break
 11724  		}
 11725  		v.reset(OpPPC64SETBC)
 11726  		v.AuxInt = int32ToAuxInt(2)
 11727  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 11728  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 11729  		v1.AddArg2(y, z)
 11730  		v0.AddArg(v1)
 11731  		v.AddArg(v0)
 11732  		return true
 11733  	}
 11734  	return false
 11735  }
 11736  func rewriteValuePPC64_OpPPC64SETBCR(v *Value) bool {
 11737  	v_0 := v.Args[0]
 11738  	b := v.Block
 11739  	typ := &b.Func.Config.Types
 11740  	// match: (SETBCR [0] (FlagLT))
 11741  	// result: (MOVDconst [0])
 11742  	for {
 11743  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 11744  			break
 11745  		}
 11746  		v.reset(OpPPC64MOVDconst)
 11747  		v.AuxInt = int64ToAuxInt(0)
 11748  		return true
 11749  	}
 11750  	// match: (SETBCR [0] (FlagGT))
 11751  	// result: (MOVDconst [1])
 11752  	for {
 11753  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 11754  			break
 11755  		}
 11756  		v.reset(OpPPC64MOVDconst)
 11757  		v.AuxInt = int64ToAuxInt(1)
 11758  		return true
 11759  	}
 11760  	// match: (SETBCR [0] (FlagEQ))
 11761  	// result: (MOVDconst [1])
 11762  	for {
 11763  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 11764  			break
 11765  		}
 11766  		v.reset(OpPPC64MOVDconst)
 11767  		v.AuxInt = int64ToAuxInt(1)
 11768  		return true
 11769  	}
 11770  	// match: (SETBCR [1] (FlagGT))
 11771  	// result: (MOVDconst [0])
 11772  	for {
 11773  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 11774  			break
 11775  		}
 11776  		v.reset(OpPPC64MOVDconst)
 11777  		v.AuxInt = int64ToAuxInt(0)
 11778  		return true
 11779  	}
 11780  	// match: (SETBCR [1] (FlagLT))
 11781  	// result: (MOVDconst [1])
 11782  	for {
 11783  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 11784  			break
 11785  		}
 11786  		v.reset(OpPPC64MOVDconst)
 11787  		v.AuxInt = int64ToAuxInt(1)
 11788  		return true
 11789  	}
 11790  	// match: (SETBCR [1] (FlagEQ))
 11791  	// result: (MOVDconst [1])
 11792  	for {
 11793  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 11794  			break
 11795  		}
 11796  		v.reset(OpPPC64MOVDconst)
 11797  		v.AuxInt = int64ToAuxInt(1)
 11798  		return true
 11799  	}
 11800  	// match: (SETBCR [2] (FlagEQ))
 11801  	// result: (MOVDconst [0])
 11802  	for {
 11803  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 11804  			break
 11805  		}
 11806  		v.reset(OpPPC64MOVDconst)
 11807  		v.AuxInt = int64ToAuxInt(0)
 11808  		return true
 11809  	}
 11810  	// match: (SETBCR [2] (FlagLT))
 11811  	// result: (MOVDconst [1])
 11812  	for {
 11813  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 11814  			break
 11815  		}
 11816  		v.reset(OpPPC64MOVDconst)
 11817  		v.AuxInt = int64ToAuxInt(1)
 11818  		return true
 11819  	}
 11820  	// match: (SETBCR [2] (FlagGT))
 11821  	// result: (MOVDconst [1])
 11822  	for {
 11823  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 11824  			break
 11825  		}
 11826  		v.reset(OpPPC64MOVDconst)
 11827  		v.AuxInt = int64ToAuxInt(1)
 11828  		return true
 11829  	}
 11830  	// match: (SETBCR [0] (InvertFlags bool))
 11831  	// result: (SETBCR [1] bool)
 11832  	for {
 11833  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 11834  			break
 11835  		}
 11836  		bool := v_0.Args[0]
 11837  		v.reset(OpPPC64SETBCR)
 11838  		v.AuxInt = int32ToAuxInt(1)
 11839  		v.AddArg(bool)
 11840  		return true
 11841  	}
 11842  	// match: (SETBCR [1] (InvertFlags bool))
 11843  	// result: (SETBCR [0] bool)
 11844  	for {
 11845  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 11846  			break
 11847  		}
 11848  		bool := v_0.Args[0]
 11849  		v.reset(OpPPC64SETBCR)
 11850  		v.AuxInt = int32ToAuxInt(0)
 11851  		v.AddArg(bool)
 11852  		return true
 11853  	}
 11854  	// match: (SETBCR [2] (InvertFlags bool))
 11855  	// result: (SETBCR [2] bool)
 11856  	for {
 11857  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 11858  			break
 11859  		}
 11860  		bool := v_0.Args[0]
 11861  		v.reset(OpPPC64SETBCR)
 11862  		v.AuxInt = int32ToAuxInt(2)
 11863  		v.AddArg(bool)
 11864  		return true
 11865  	}
 11866  	// match: (SETBCR [n] (InvertFlags bool))
 11867  	// result: (SETBC [n] bool)
 11868  	for {
 11869  		n := auxIntToInt32(v.AuxInt)
 11870  		if v_0.Op != OpPPC64InvertFlags {
 11871  			break
 11872  		}
 11873  		bool := v_0.Args[0]
 11874  		v.reset(OpPPC64SETBC)
 11875  		v.AuxInt = int32ToAuxInt(n)
 11876  		v.AddArg(bool)
 11877  		return true
 11878  	}
 11879  	// match: (SETBCR [2] (Select1 a:(ANDCCconst [1] _)))
 11880  	// result: (Select0 a)
 11881  	for {
 11882  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpSelect1 {
 11883  			break
 11884  		}
 11885  		a := v_0.Args[0]
 11886  		if a.Op != OpPPC64ANDCCconst || auxIntToInt64(a.AuxInt) != 1 {
 11887  			break
 11888  		}
 11889  		v.reset(OpSelect0)
 11890  		v.AddArg(a)
 11891  		return true
 11892  	}
 11893  	// match: (SETBCR [2] (CMPconst [0] a:(AND y z)))
 11894  	// cond: a.Uses == 1
 11895  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 11896  	for {
 11897  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11898  			break
 11899  		}
 11900  		a := v_0.Args[0]
 11901  		if a.Op != OpPPC64AND {
 11902  			break
 11903  		}
 11904  		z := a.Args[1]
 11905  		y := a.Args[0]
 11906  		if !(a.Uses == 1) {
 11907  			break
 11908  		}
 11909  		v.reset(OpPPC64SETBCR)
 11910  		v.AuxInt = int32ToAuxInt(2)
 11911  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 11912  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 11913  		v1.AddArg2(y, z)
 11914  		v0.AddArg(v1)
 11915  		v.AddArg(v0)
 11916  		return true
 11917  	}
 11918  	// match: (SETBCR [2] (CMPconst [0] o:(OR y z)))
 11919  	// cond: o.Uses == 1
 11920  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ORCC y z )))
 11921  	for {
 11922  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11923  			break
 11924  		}
 11925  		o := v_0.Args[0]
 11926  		if o.Op != OpPPC64OR {
 11927  			break
 11928  		}
 11929  		z := o.Args[1]
 11930  		y := o.Args[0]
 11931  		if !(o.Uses == 1) {
 11932  			break
 11933  		}
 11934  		v.reset(OpPPC64SETBCR)
 11935  		v.AuxInt = int32ToAuxInt(2)
 11936  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 11937  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 11938  		v1.AddArg2(y, z)
 11939  		v0.AddArg(v1)
 11940  		v.AddArg(v0)
 11941  		return true
 11942  	}
 11943  	// match: (SETBCR [2] (CMPconst [0] a:(XOR y z)))
 11944  	// cond: a.Uses == 1
 11945  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (XORCC y z )))
 11946  	for {
 11947  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11948  			break
 11949  		}
 11950  		a := v_0.Args[0]
 11951  		if a.Op != OpPPC64XOR {
 11952  			break
 11953  		}
 11954  		z := a.Args[1]
 11955  		y := a.Args[0]
 11956  		if !(a.Uses == 1) {
 11957  			break
 11958  		}
 11959  		v.reset(OpPPC64SETBCR)
 11960  		v.AuxInt = int32ToAuxInt(2)
 11961  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 11962  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 11963  		v1.AddArg2(y, z)
 11964  		v0.AddArg(v1)
 11965  		v.AddArg(v0)
 11966  		return true
 11967  	}
 11968  	return false
 11969  }
 11970  func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
 11971  	v_1 := v.Args[1]
 11972  	v_0 := v.Args[0]
 11973  	// match: (SLD x (MOVDconst [c]))
 11974  	// result: (SLDconst [c&63 | (c>>6&1*63)] x)
 11975  	for {
 11976  		x := v_0
 11977  		if v_1.Op != OpPPC64MOVDconst {
 11978  			break
 11979  		}
 11980  		c := auxIntToInt64(v_1.AuxInt)
 11981  		v.reset(OpPPC64SLDconst)
 11982  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 11983  		v.AddArg(x)
 11984  		return true
 11985  	}
 11986  	return false
 11987  }
 11988  func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
 11989  	v_0 := v.Args[0]
 11990  	// match: (SLDconst [l] (SRWconst [r] x))
 11991  	// cond: mergePPC64SldiSrw(l,r) != 0
 11992  	// result: (RLWINM [mergePPC64SldiSrw(l,r)] x)
 11993  	for {
 11994  		l := auxIntToInt64(v.AuxInt)
 11995  		if v_0.Op != OpPPC64SRWconst {
 11996  			break
 11997  		}
 11998  		r := auxIntToInt64(v_0.AuxInt)
 11999  		x := v_0.Args[0]
 12000  		if !(mergePPC64SldiSrw(l, r) != 0) {
 12001  			break
 12002  		}
 12003  		v.reset(OpPPC64RLWINM)
 12004  		v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
 12005  		v.AddArg(x)
 12006  		return true
 12007  	}
 12008  	// match: (SLDconst [s] (RLWINM [r] y))
 12009  	// cond: mergePPC64SldiRlwinm(s,r) != 0
 12010  	// result: (RLWINM [mergePPC64SldiRlwinm(s,r)] y)
 12011  	for {
 12012  		s := auxIntToInt64(v.AuxInt)
 12013  		if v_0.Op != OpPPC64RLWINM {
 12014  			break
 12015  		}
 12016  		r := auxIntToInt64(v_0.AuxInt)
 12017  		y := v_0.Args[0]
 12018  		if !(mergePPC64SldiRlwinm(s, r) != 0) {
 12019  			break
 12020  		}
 12021  		v.reset(OpPPC64RLWINM)
 12022  		v.AuxInt = int64ToAuxInt(mergePPC64SldiRlwinm(s, r))
 12023  		v.AddArg(y)
 12024  		return true
 12025  	}
 12026  	// match: (SLDconst [c] z:(MOVBZreg x))
 12027  	// cond: c < 8 && z.Uses == 1
 12028  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,56,63,64)] x)
 12029  	for {
 12030  		c := auxIntToInt64(v.AuxInt)
 12031  		z := v_0
 12032  		if z.Op != OpPPC64MOVBZreg {
 12033  			break
 12034  		}
 12035  		x := z.Args[0]
 12036  		if !(c < 8 && z.Uses == 1) {
 12037  			break
 12038  		}
 12039  		v.reset(OpPPC64CLRLSLDI)
 12040  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
 12041  		v.AddArg(x)
 12042  		return true
 12043  	}
 12044  	// match: (SLDconst [c] z:(MOVHZreg x))
 12045  	// cond: c < 16 && z.Uses == 1
 12046  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,48,63,64)] x)
 12047  	for {
 12048  		c := auxIntToInt64(v.AuxInt)
 12049  		z := v_0
 12050  		if z.Op != OpPPC64MOVHZreg {
 12051  			break
 12052  		}
 12053  		x := z.Args[0]
 12054  		if !(c < 16 && z.Uses == 1) {
 12055  			break
 12056  		}
 12057  		v.reset(OpPPC64CLRLSLDI)
 12058  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
 12059  		v.AddArg(x)
 12060  		return true
 12061  	}
 12062  	// match: (SLDconst [c] z:(MOVWZreg x))
 12063  	// cond: c < 32 && z.Uses == 1
 12064  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,32,63,64)] x)
 12065  	for {
 12066  		c := auxIntToInt64(v.AuxInt)
 12067  		z := v_0
 12068  		if z.Op != OpPPC64MOVWZreg {
 12069  			break
 12070  		}
 12071  		x := z.Args[0]
 12072  		if !(c < 32 && z.Uses == 1) {
 12073  			break
 12074  		}
 12075  		v.reset(OpPPC64CLRLSLDI)
 12076  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
 12077  		v.AddArg(x)
 12078  		return true
 12079  	}
 12080  	// match: (SLDconst [c] z:(Select0 (ANDCCconst [d] x)))
 12081  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))
 12082  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12083  	for {
 12084  		c := auxIntToInt64(v.AuxInt)
 12085  		z := v_0
 12086  		if z.Op != OpSelect0 {
 12087  			break
 12088  		}
 12089  		z_0 := z.Args[0]
 12090  		if z_0.Op != OpPPC64ANDCCconst {
 12091  			break
 12092  		}
 12093  		d := auxIntToInt64(z_0.AuxInt)
 12094  		x := z_0.Args[0]
 12095  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12096  			break
 12097  		}
 12098  		v.reset(OpPPC64CLRLSLDI)
 12099  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12100  		v.AddArg(x)
 12101  		return true
 12102  	}
 12103  	// match: (SLDconst [c] z:(AND (MOVDconst [d]) x))
 12104  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(64-getPPC64ShiftMaskLength(d))
 12105  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12106  	for {
 12107  		c := auxIntToInt64(v.AuxInt)
 12108  		z := v_0
 12109  		if z.Op != OpPPC64AND {
 12110  			break
 12111  		}
 12112  		_ = z.Args[1]
 12113  		z_0 := z.Args[0]
 12114  		z_1 := z.Args[1]
 12115  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12116  			if z_0.Op != OpPPC64MOVDconst {
 12117  				continue
 12118  			}
 12119  			d := auxIntToInt64(z_0.AuxInt)
 12120  			x := z_1
 12121  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12122  				continue
 12123  			}
 12124  			v.reset(OpPPC64CLRLSLDI)
 12125  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12126  			v.AddArg(x)
 12127  			return true
 12128  		}
 12129  		break
 12130  	}
 12131  	// match: (SLDconst [c] z:(MOVWreg x))
 12132  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12133  	// result: (EXTSWSLconst [c] x)
 12134  	for {
 12135  		c := auxIntToInt64(v.AuxInt)
 12136  		z := v_0
 12137  		if z.Op != OpPPC64MOVWreg {
 12138  			break
 12139  		}
 12140  		x := z.Args[0]
 12141  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12142  			break
 12143  		}
 12144  		v.reset(OpPPC64EXTSWSLconst)
 12145  		v.AuxInt = int64ToAuxInt(c)
 12146  		v.AddArg(x)
 12147  		return true
 12148  	}
 12149  	return false
 12150  }
 12151  func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
 12152  	v_1 := v.Args[1]
 12153  	v_0 := v.Args[0]
 12154  	// match: (SLW x (MOVDconst [c]))
 12155  	// result: (SLWconst [c&31 | (c>>5&1*31)] x)
 12156  	for {
 12157  		x := v_0
 12158  		if v_1.Op != OpPPC64MOVDconst {
 12159  			break
 12160  		}
 12161  		c := auxIntToInt64(v_1.AuxInt)
 12162  		v.reset(OpPPC64SLWconst)
 12163  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12164  		v.AddArg(x)
 12165  		return true
 12166  	}
 12167  	return false
 12168  }
 12169  func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
 12170  	v_0 := v.Args[0]
 12171  	// match: (SLWconst [s] (MOVWZreg w))
 12172  	// result: (SLWconst [s] w)
 12173  	for {
 12174  		s := auxIntToInt64(v.AuxInt)
 12175  		if v_0.Op != OpPPC64MOVWZreg {
 12176  			break
 12177  		}
 12178  		w := v_0.Args[0]
 12179  		v.reset(OpPPC64SLWconst)
 12180  		v.AuxInt = int64ToAuxInt(s)
 12181  		v.AddArg(w)
 12182  		return true
 12183  	}
 12184  	// match: (SLWconst [c] z:(MOVBZreg x))
 12185  	// cond: z.Uses == 1 && c < 8
 12186  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,24,31,32)] x)
 12187  	for {
 12188  		c := auxIntToInt64(v.AuxInt)
 12189  		z := v_0
 12190  		if z.Op != OpPPC64MOVBZreg {
 12191  			break
 12192  		}
 12193  		x := z.Args[0]
 12194  		if !(z.Uses == 1 && c < 8) {
 12195  			break
 12196  		}
 12197  		v.reset(OpPPC64CLRLSLWI)
 12198  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
 12199  		v.AddArg(x)
 12200  		return true
 12201  	}
 12202  	// match: (SLWconst [c] z:(MOVHZreg x))
 12203  	// cond: z.Uses == 1 && c < 16
 12204  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,16,31,32)] x)
 12205  	for {
 12206  		c := auxIntToInt64(v.AuxInt)
 12207  		z := v_0
 12208  		if z.Op != OpPPC64MOVHZreg {
 12209  			break
 12210  		}
 12211  		x := z.Args[0]
 12212  		if !(z.Uses == 1 && c < 16) {
 12213  			break
 12214  		}
 12215  		v.reset(OpPPC64CLRLSLWI)
 12216  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
 12217  		v.AddArg(x)
 12218  		return true
 12219  	}
 12220  	// match: (SLWconst [c] z:(Select0 (ANDCCconst [d] x)))
 12221  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12222  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12223  	for {
 12224  		c := auxIntToInt64(v.AuxInt)
 12225  		z := v_0
 12226  		if z.Op != OpSelect0 {
 12227  			break
 12228  		}
 12229  		z_0 := z.Args[0]
 12230  		if z_0.Op != OpPPC64ANDCCconst {
 12231  			break
 12232  		}
 12233  		d := auxIntToInt64(z_0.AuxInt)
 12234  		x := z_0.Args[0]
 12235  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12236  			break
 12237  		}
 12238  		v.reset(OpPPC64CLRLSLWI)
 12239  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12240  		v.AddArg(x)
 12241  		return true
 12242  	}
 12243  	// match: (SLWconst [c] z:(AND (MOVDconst [d]) x))
 12244  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12245  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12246  	for {
 12247  		c := auxIntToInt64(v.AuxInt)
 12248  		z := v_0
 12249  		if z.Op != OpPPC64AND {
 12250  			break
 12251  		}
 12252  		_ = z.Args[1]
 12253  		z_0 := z.Args[0]
 12254  		z_1 := z.Args[1]
 12255  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12256  			if z_0.Op != OpPPC64MOVDconst {
 12257  				continue
 12258  			}
 12259  			d := auxIntToInt64(z_0.AuxInt)
 12260  			x := z_1
 12261  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12262  				continue
 12263  			}
 12264  			v.reset(OpPPC64CLRLSLWI)
 12265  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12266  			v.AddArg(x)
 12267  			return true
 12268  		}
 12269  		break
 12270  	}
 12271  	// match: (SLWconst [c] z:(MOVWreg x))
 12272  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12273  	// result: (EXTSWSLconst [c] x)
 12274  	for {
 12275  		c := auxIntToInt64(v.AuxInt)
 12276  		z := v_0
 12277  		if z.Op != OpPPC64MOVWreg {
 12278  			break
 12279  		}
 12280  		x := z.Args[0]
 12281  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12282  			break
 12283  		}
 12284  		v.reset(OpPPC64EXTSWSLconst)
 12285  		v.AuxInt = int64ToAuxInt(c)
 12286  		v.AddArg(x)
 12287  		return true
 12288  	}
 12289  	return false
 12290  }
 12291  func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
 12292  	v_1 := v.Args[1]
 12293  	v_0 := v.Args[0]
 12294  	// match: (SRAD x (MOVDconst [c]))
 12295  	// result: (SRADconst [c&63 | (c>>6&1*63)] x)
 12296  	for {
 12297  		x := v_0
 12298  		if v_1.Op != OpPPC64MOVDconst {
 12299  			break
 12300  		}
 12301  		c := auxIntToInt64(v_1.AuxInt)
 12302  		v.reset(OpPPC64SRADconst)
 12303  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12304  		v.AddArg(x)
 12305  		return true
 12306  	}
 12307  	return false
 12308  }
 12309  func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
 12310  	v_1 := v.Args[1]
 12311  	v_0 := v.Args[0]
 12312  	// match: (SRAW x (MOVDconst [c]))
 12313  	// result: (SRAWconst [c&31 | (c>>5&1*31)] x)
 12314  	for {
 12315  		x := v_0
 12316  		if v_1.Op != OpPPC64MOVDconst {
 12317  			break
 12318  		}
 12319  		c := auxIntToInt64(v_1.AuxInt)
 12320  		v.reset(OpPPC64SRAWconst)
 12321  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12322  		v.AddArg(x)
 12323  		return true
 12324  	}
 12325  	return false
 12326  }
 12327  func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
 12328  	v_1 := v.Args[1]
 12329  	v_0 := v.Args[0]
 12330  	// match: (SRD x (MOVDconst [c]))
 12331  	// result: (SRDconst [c&63 | (c>>6&1*63)] x)
 12332  	for {
 12333  		x := v_0
 12334  		if v_1.Op != OpPPC64MOVDconst {
 12335  			break
 12336  		}
 12337  		c := auxIntToInt64(v_1.AuxInt)
 12338  		v.reset(OpPPC64SRDconst)
 12339  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12340  		v.AddArg(x)
 12341  		return true
 12342  	}
 12343  	return false
 12344  }
 12345  func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
 12346  	v_1 := v.Args[1]
 12347  	v_0 := v.Args[0]
 12348  	// match: (SRW x (MOVDconst [c]))
 12349  	// result: (SRWconst [c&31 | (c>>5&1*31)] x)
 12350  	for {
 12351  		x := v_0
 12352  		if v_1.Op != OpPPC64MOVDconst {
 12353  			break
 12354  		}
 12355  		c := auxIntToInt64(v_1.AuxInt)
 12356  		v.reset(OpPPC64SRWconst)
 12357  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12358  		v.AddArg(x)
 12359  		return true
 12360  	}
 12361  	return false
 12362  }
 12363  func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
 12364  	v_0 := v.Args[0]
 12365  	// match: (SRWconst (Select0 (ANDCCconst [m] x)) [s])
 12366  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 12367  	// result: (MOVDconst [0])
 12368  	for {
 12369  		s := auxIntToInt64(v.AuxInt)
 12370  		if v_0.Op != OpSelect0 {
 12371  			break
 12372  		}
 12373  		v_0_0 := v_0.Args[0]
 12374  		if v_0_0.Op != OpPPC64ANDCCconst {
 12375  			break
 12376  		}
 12377  		m := auxIntToInt64(v_0_0.AuxInt)
 12378  		if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 12379  			break
 12380  		}
 12381  		v.reset(OpPPC64MOVDconst)
 12382  		v.AuxInt = int64ToAuxInt(0)
 12383  		return true
 12384  	}
 12385  	// match: (SRWconst (Select0 (ANDCCconst [m] x)) [s])
 12386  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 12387  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 12388  	for {
 12389  		s := auxIntToInt64(v.AuxInt)
 12390  		if v_0.Op != OpSelect0 {
 12391  			break
 12392  		}
 12393  		v_0_0 := v_0.Args[0]
 12394  		if v_0_0.Op != OpPPC64ANDCCconst {
 12395  			break
 12396  		}
 12397  		m := auxIntToInt64(v_0_0.AuxInt)
 12398  		x := v_0_0.Args[0]
 12399  		if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 12400  			break
 12401  		}
 12402  		v.reset(OpPPC64RLWINM)
 12403  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 12404  		v.AddArg(x)
 12405  		return true
 12406  	}
 12407  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 12408  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 12409  	// result: (MOVDconst [0])
 12410  	for {
 12411  		s := auxIntToInt64(v.AuxInt)
 12412  		if v_0.Op != OpPPC64AND {
 12413  			break
 12414  		}
 12415  		_ = v_0.Args[1]
 12416  		v_0_0 := v_0.Args[0]
 12417  		v_0_1 := v_0.Args[1]
 12418  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 12419  			if v_0_0.Op != OpPPC64MOVDconst {
 12420  				continue
 12421  			}
 12422  			m := auxIntToInt64(v_0_0.AuxInt)
 12423  			if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 12424  				continue
 12425  			}
 12426  			v.reset(OpPPC64MOVDconst)
 12427  			v.AuxInt = int64ToAuxInt(0)
 12428  			return true
 12429  		}
 12430  		break
 12431  	}
 12432  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 12433  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 12434  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 12435  	for {
 12436  		s := auxIntToInt64(v.AuxInt)
 12437  		if v_0.Op != OpPPC64AND {
 12438  			break
 12439  		}
 12440  		_ = v_0.Args[1]
 12441  		v_0_0 := v_0.Args[0]
 12442  		v_0_1 := v_0.Args[1]
 12443  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 12444  			if v_0_0.Op != OpPPC64MOVDconst {
 12445  				continue
 12446  			}
 12447  			m := auxIntToInt64(v_0_0.AuxInt)
 12448  			x := v_0_1
 12449  			if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 12450  				continue
 12451  			}
 12452  			v.reset(OpPPC64RLWINM)
 12453  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 12454  			v.AddArg(x)
 12455  			return true
 12456  		}
 12457  		break
 12458  	}
 12459  	return false
 12460  }
 12461  func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
 12462  	v_1 := v.Args[1]
 12463  	v_0 := v.Args[0]
 12464  	// match: (SUB x (MOVDconst [c]))
 12465  	// cond: is32Bit(-c)
 12466  	// result: (ADDconst [-c] x)
 12467  	for {
 12468  		x := v_0
 12469  		if v_1.Op != OpPPC64MOVDconst {
 12470  			break
 12471  		}
 12472  		c := auxIntToInt64(v_1.AuxInt)
 12473  		if !(is32Bit(-c)) {
 12474  			break
 12475  		}
 12476  		v.reset(OpPPC64ADDconst)
 12477  		v.AuxInt = int64ToAuxInt(-c)
 12478  		v.AddArg(x)
 12479  		return true
 12480  	}
 12481  	// match: (SUB (MOVDconst [c]) x)
 12482  	// cond: is32Bit(c)
 12483  	// result: (SUBFCconst [c] x)
 12484  	for {
 12485  		if v_0.Op != OpPPC64MOVDconst {
 12486  			break
 12487  		}
 12488  		c := auxIntToInt64(v_0.AuxInt)
 12489  		x := v_1
 12490  		if !(is32Bit(c)) {
 12491  			break
 12492  		}
 12493  		v.reset(OpPPC64SUBFCconst)
 12494  		v.AuxInt = int64ToAuxInt(c)
 12495  		v.AddArg(x)
 12496  		return true
 12497  	}
 12498  	return false
 12499  }
 12500  func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
 12501  	v_2 := v.Args[2]
 12502  	v_1 := v.Args[1]
 12503  	v_0 := v.Args[0]
 12504  	b := v.Block
 12505  	typ := &b.Func.Config.Types
 12506  	// match: (SUBE x y (Select1 <typ.UInt64> (SUBCconst (MOVDconst [0]) [0])))
 12507  	// result: (SUBC x y)
 12508  	for {
 12509  		x := v_0
 12510  		y := v_1
 12511  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
 12512  			break
 12513  		}
 12514  		v_2_0 := v_2.Args[0]
 12515  		if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
 12516  			break
 12517  		}
 12518  		v_2_0_0 := v_2_0.Args[0]
 12519  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
 12520  			break
 12521  		}
 12522  		v.reset(OpPPC64SUBC)
 12523  		v.AddArg2(x, y)
 12524  		return true
 12525  	}
 12526  	return false
 12527  }
 12528  func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
 12529  	v_0 := v.Args[0]
 12530  	// match: (SUBFCconst [c] (NEG x))
 12531  	// result: (ADDconst [c] x)
 12532  	for {
 12533  		c := auxIntToInt64(v.AuxInt)
 12534  		if v_0.Op != OpPPC64NEG {
 12535  			break
 12536  		}
 12537  		x := v_0.Args[0]
 12538  		v.reset(OpPPC64ADDconst)
 12539  		v.AuxInt = int64ToAuxInt(c)
 12540  		v.AddArg(x)
 12541  		return true
 12542  	}
 12543  	// match: (SUBFCconst [c] (SUBFCconst [d] x))
 12544  	// cond: is32Bit(c-d)
 12545  	// result: (ADDconst [c-d] x)
 12546  	for {
 12547  		c := auxIntToInt64(v.AuxInt)
 12548  		if v_0.Op != OpPPC64SUBFCconst {
 12549  			break
 12550  		}
 12551  		d := auxIntToInt64(v_0.AuxInt)
 12552  		x := v_0.Args[0]
 12553  		if !(is32Bit(c - d)) {
 12554  			break
 12555  		}
 12556  		v.reset(OpPPC64ADDconst)
 12557  		v.AuxInt = int64ToAuxInt(c - d)
 12558  		v.AddArg(x)
 12559  		return true
 12560  	}
 12561  	// match: (SUBFCconst [0] x)
 12562  	// result: (NEG x)
 12563  	for {
 12564  		if auxIntToInt64(v.AuxInt) != 0 {
 12565  			break
 12566  		}
 12567  		x := v_0
 12568  		v.reset(OpPPC64NEG)
 12569  		v.AddArg(x)
 12570  		return true
 12571  	}
 12572  	return false
 12573  }
 12574  func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
 12575  	v_1 := v.Args[1]
 12576  	v_0 := v.Args[0]
 12577  	// match: (XOR (MOVDconst [c]) (MOVDconst [d]))
 12578  	// result: (MOVDconst [c^d])
 12579  	for {
 12580  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12581  			if v_0.Op != OpPPC64MOVDconst {
 12582  				continue
 12583  			}
 12584  			c := auxIntToInt64(v_0.AuxInt)
 12585  			if v_1.Op != OpPPC64MOVDconst {
 12586  				continue
 12587  			}
 12588  			d := auxIntToInt64(v_1.AuxInt)
 12589  			v.reset(OpPPC64MOVDconst)
 12590  			v.AuxInt = int64ToAuxInt(c ^ d)
 12591  			return true
 12592  		}
 12593  		break
 12594  	}
 12595  	// match: (XOR x (MOVDconst [c]))
 12596  	// cond: isU32Bit(c)
 12597  	// result: (XORconst [c] x)
 12598  	for {
 12599  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12600  			x := v_0
 12601  			if v_1.Op != OpPPC64MOVDconst {
 12602  				continue
 12603  			}
 12604  			c := auxIntToInt64(v_1.AuxInt)
 12605  			if !(isU32Bit(c)) {
 12606  				continue
 12607  			}
 12608  			v.reset(OpPPC64XORconst)
 12609  			v.AuxInt = int64ToAuxInt(c)
 12610  			v.AddArg(x)
 12611  			return true
 12612  		}
 12613  		break
 12614  	}
 12615  	return false
 12616  }
 12617  func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
 12618  	v_0 := v.Args[0]
 12619  	// match: (XORconst [c] (XORconst [d] x))
 12620  	// result: (XORconst [c^d] x)
 12621  	for {
 12622  		c := auxIntToInt64(v.AuxInt)
 12623  		if v_0.Op != OpPPC64XORconst {
 12624  			break
 12625  		}
 12626  		d := auxIntToInt64(v_0.AuxInt)
 12627  		x := v_0.Args[0]
 12628  		v.reset(OpPPC64XORconst)
 12629  		v.AuxInt = int64ToAuxInt(c ^ d)
 12630  		v.AddArg(x)
 12631  		return true
 12632  	}
 12633  	// match: (XORconst [0] x)
 12634  	// result: x
 12635  	for {
 12636  		if auxIntToInt64(v.AuxInt) != 0 {
 12637  			break
 12638  		}
 12639  		x := v_0
 12640  		v.copyOf(x)
 12641  		return true
 12642  	}
 12643  	// match: (XORconst [1] (SETBCR [n] cmp))
 12644  	// result: (SETBC [n] cmp)
 12645  	for {
 12646  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
 12647  			break
 12648  		}
 12649  		n := auxIntToInt32(v_0.AuxInt)
 12650  		cmp := v_0.Args[0]
 12651  		v.reset(OpPPC64SETBC)
 12652  		v.AuxInt = int32ToAuxInt(n)
 12653  		v.AddArg(cmp)
 12654  		return true
 12655  	}
 12656  	// match: (XORconst [1] (SETBC [n] cmp))
 12657  	// result: (SETBCR [n] cmp)
 12658  	for {
 12659  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
 12660  			break
 12661  		}
 12662  		n := auxIntToInt32(v_0.AuxInt)
 12663  		cmp := v_0.Args[0]
 12664  		v.reset(OpPPC64SETBCR)
 12665  		v.AuxInt = int32ToAuxInt(n)
 12666  		v.AddArg(cmp)
 12667  		return true
 12668  	}
 12669  	return false
 12670  }
 12671  func rewriteValuePPC64_OpPanicBounds(v *Value) bool {
 12672  	v_2 := v.Args[2]
 12673  	v_1 := v.Args[1]
 12674  	v_0 := v.Args[0]
 12675  	// match: (PanicBounds [kind] x y mem)
 12676  	// cond: boundsABI(kind) == 0
 12677  	// result: (LoweredPanicBoundsA [kind] x y mem)
 12678  	for {
 12679  		kind := auxIntToInt64(v.AuxInt)
 12680  		x := v_0
 12681  		y := v_1
 12682  		mem := v_2
 12683  		if !(boundsABI(kind) == 0) {
 12684  			break
 12685  		}
 12686  		v.reset(OpPPC64LoweredPanicBoundsA)
 12687  		v.AuxInt = int64ToAuxInt(kind)
 12688  		v.AddArg3(x, y, mem)
 12689  		return true
 12690  	}
 12691  	// match: (PanicBounds [kind] x y mem)
 12692  	// cond: boundsABI(kind) == 1
 12693  	// result: (LoweredPanicBoundsB [kind] x y mem)
 12694  	for {
 12695  		kind := auxIntToInt64(v.AuxInt)
 12696  		x := v_0
 12697  		y := v_1
 12698  		mem := v_2
 12699  		if !(boundsABI(kind) == 1) {
 12700  			break
 12701  		}
 12702  		v.reset(OpPPC64LoweredPanicBoundsB)
 12703  		v.AuxInt = int64ToAuxInt(kind)
 12704  		v.AddArg3(x, y, mem)
 12705  		return true
 12706  	}
 12707  	// match: (PanicBounds [kind] x y mem)
 12708  	// cond: boundsABI(kind) == 2
 12709  	// result: (LoweredPanicBoundsC [kind] x y mem)
 12710  	for {
 12711  		kind := auxIntToInt64(v.AuxInt)
 12712  		x := v_0
 12713  		y := v_1
 12714  		mem := v_2
 12715  		if !(boundsABI(kind) == 2) {
 12716  			break
 12717  		}
 12718  		v.reset(OpPPC64LoweredPanicBoundsC)
 12719  		v.AuxInt = int64ToAuxInt(kind)
 12720  		v.AddArg3(x, y, mem)
 12721  		return true
 12722  	}
 12723  	return false
 12724  }
 12725  func rewriteValuePPC64_OpPopCount16(v *Value) bool {
 12726  	v_0 := v.Args[0]
 12727  	b := v.Block
 12728  	typ := &b.Func.Config.Types
 12729  	// match: (PopCount16 x)
 12730  	// result: (POPCNTW (MOVHZreg x))
 12731  	for {
 12732  		x := v_0
 12733  		v.reset(OpPPC64POPCNTW)
 12734  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 12735  		v0.AddArg(x)
 12736  		v.AddArg(v0)
 12737  		return true
 12738  	}
 12739  }
 12740  func rewriteValuePPC64_OpPopCount32(v *Value) bool {
 12741  	v_0 := v.Args[0]
 12742  	b := v.Block
 12743  	typ := &b.Func.Config.Types
 12744  	// match: (PopCount32 x)
 12745  	// result: (POPCNTW (MOVWZreg x))
 12746  	for {
 12747  		x := v_0
 12748  		v.reset(OpPPC64POPCNTW)
 12749  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 12750  		v0.AddArg(x)
 12751  		v.AddArg(v0)
 12752  		return true
 12753  	}
 12754  }
 12755  func rewriteValuePPC64_OpPopCount8(v *Value) bool {
 12756  	v_0 := v.Args[0]
 12757  	b := v.Block
 12758  	typ := &b.Func.Config.Types
 12759  	// match: (PopCount8 x)
 12760  	// result: (POPCNTB (MOVBZreg x))
 12761  	for {
 12762  		x := v_0
 12763  		v.reset(OpPPC64POPCNTB)
 12764  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 12765  		v0.AddArg(x)
 12766  		v.AddArg(v0)
 12767  		return true
 12768  	}
 12769  }
 12770  func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
 12771  	v_1 := v.Args[1]
 12772  	v_0 := v.Args[0]
 12773  	// match: (PrefetchCache ptr mem)
 12774  	// result: (DCBT ptr mem [0])
 12775  	for {
 12776  		ptr := v_0
 12777  		mem := v_1
 12778  		v.reset(OpPPC64DCBT)
 12779  		v.AuxInt = int64ToAuxInt(0)
 12780  		v.AddArg2(ptr, mem)
 12781  		return true
 12782  	}
 12783  }
 12784  func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
 12785  	v_1 := v.Args[1]
 12786  	v_0 := v.Args[0]
 12787  	// match: (PrefetchCacheStreamed ptr mem)
 12788  	// result: (DCBT ptr mem [16])
 12789  	for {
 12790  		ptr := v_0
 12791  		mem := v_1
 12792  		v.reset(OpPPC64DCBT)
 12793  		v.AuxInt = int64ToAuxInt(16)
 12794  		v.AddArg2(ptr, mem)
 12795  		return true
 12796  	}
 12797  }
 12798  func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
 12799  	v_1 := v.Args[1]
 12800  	v_0 := v.Args[0]
 12801  	b := v.Block
 12802  	typ := &b.Func.Config.Types
 12803  	// match: (RotateLeft16 <t> x (MOVDconst [c]))
 12804  	// result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
 12805  	for {
 12806  		t := v.Type
 12807  		x := v_0
 12808  		if v_1.Op != OpPPC64MOVDconst {
 12809  			break
 12810  		}
 12811  		c := auxIntToInt64(v_1.AuxInt)
 12812  		v.reset(OpOr16)
 12813  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 12814  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 12815  		v1.AuxInt = int64ToAuxInt(c & 15)
 12816  		v0.AddArg2(x, v1)
 12817  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 12818  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 12819  		v3.AuxInt = int64ToAuxInt(-c & 15)
 12820  		v2.AddArg2(x, v3)
 12821  		v.AddArg2(v0, v2)
 12822  		return true
 12823  	}
 12824  	return false
 12825  }
 12826  func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
 12827  	v_1 := v.Args[1]
 12828  	v_0 := v.Args[0]
 12829  	b := v.Block
 12830  	typ := &b.Func.Config.Types
 12831  	// match: (RotateLeft8 <t> x (MOVDconst [c]))
 12832  	// result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
 12833  	for {
 12834  		t := v.Type
 12835  		x := v_0
 12836  		if v_1.Op != OpPPC64MOVDconst {
 12837  			break
 12838  		}
 12839  		c := auxIntToInt64(v_1.AuxInt)
 12840  		v.reset(OpOr8)
 12841  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 12842  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 12843  		v1.AuxInt = int64ToAuxInt(c & 7)
 12844  		v0.AddArg2(x, v1)
 12845  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 12846  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 12847  		v3.AuxInt = int64ToAuxInt(-c & 7)
 12848  		v2.AddArg2(x, v3)
 12849  		v.AddArg2(v0, v2)
 12850  		return true
 12851  	}
 12852  	return false
 12853  }
 12854  func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
 12855  	v_1 := v.Args[1]
 12856  	v_0 := v.Args[0]
 12857  	b := v.Block
 12858  	typ := &b.Func.Config.Types
 12859  	// match: (Rsh16Ux16 x y)
 12860  	// cond: shiftIsBounded(v)
 12861  	// result: (SRD (MOVHZreg x) y)
 12862  	for {
 12863  		x := v_0
 12864  		y := v_1
 12865  		if !(shiftIsBounded(v)) {
 12866  			break
 12867  		}
 12868  		v.reset(OpPPC64SRD)
 12869  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 12870  		v0.AddArg(x)
 12871  		v.AddArg2(v0, y)
 12872  		return true
 12873  	}
 12874  	// match: (Rsh16Ux16 <t> x y)
 12875  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF0] y)))
 12876  	for {
 12877  		t := v.Type
 12878  		x := v_0
 12879  		y := v_1
 12880  		v.reset(OpPPC64ISEL)
 12881  		v.AuxInt = int32ToAuxInt(2)
 12882  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 12883  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 12884  		v1.AddArg(x)
 12885  		v0.AddArg2(v1, y)
 12886  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 12887  		v2.AuxInt = int64ToAuxInt(0)
 12888  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12889  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 12890  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 12891  		v4.AddArg(y)
 12892  		v3.AddArg(v4)
 12893  		v.AddArg3(v0, v2, v3)
 12894  		return true
 12895  	}
 12896  }
 12897  func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
 12898  	v_1 := v.Args[1]
 12899  	v_0 := v.Args[0]
 12900  	b := v.Block
 12901  	typ := &b.Func.Config.Types
 12902  	// match: (Rsh16Ux32 x y)
 12903  	// cond: shiftIsBounded(v)
 12904  	// result: (SRD (MOVHZreg x) y)
 12905  	for {
 12906  		x := v_0
 12907  		y := v_1
 12908  		if !(shiftIsBounded(v)) {
 12909  			break
 12910  		}
 12911  		v.reset(OpPPC64SRD)
 12912  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 12913  		v0.AddArg(x)
 12914  		v.AddArg2(v0, y)
 12915  		return true
 12916  	}
 12917  	// match: (Rsh16Ux32 <t> x y)
 12918  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
 12919  	for {
 12920  		t := v.Type
 12921  		x := v_0
 12922  		y := v_1
 12923  		v.reset(OpPPC64ISEL)
 12924  		v.AuxInt = int32ToAuxInt(0)
 12925  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 12926  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 12927  		v1.AddArg(x)
 12928  		v0.AddArg2(v1, y)
 12929  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 12930  		v2.AuxInt = int64ToAuxInt(0)
 12931  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 12932  		v3.AuxInt = int32ToAuxInt(16)
 12933  		v3.AddArg(y)
 12934  		v.AddArg3(v0, v2, v3)
 12935  		return true
 12936  	}
 12937  }
 12938  func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
 12939  	v_1 := v.Args[1]
 12940  	v_0 := v.Args[0]
 12941  	b := v.Block
 12942  	typ := &b.Func.Config.Types
 12943  	// match: (Rsh16Ux64 x (MOVDconst [c]))
 12944  	// cond: uint64(c) < 16
 12945  	// result: (SRWconst (ZeroExt16to32 x) [c])
 12946  	for {
 12947  		x := v_0
 12948  		if v_1.Op != OpPPC64MOVDconst {
 12949  			break
 12950  		}
 12951  		c := auxIntToInt64(v_1.AuxInt)
 12952  		if !(uint64(c) < 16) {
 12953  			break
 12954  		}
 12955  		v.reset(OpPPC64SRWconst)
 12956  		v.AuxInt = int64ToAuxInt(c)
 12957  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 12958  		v0.AddArg(x)
 12959  		v.AddArg(v0)
 12960  		return true
 12961  	}
 12962  	// match: (Rsh16Ux64 x y)
 12963  	// cond: shiftIsBounded(v)
 12964  	// result: (SRD (MOVHZreg x) y)
 12965  	for {
 12966  		x := v_0
 12967  		y := v_1
 12968  		if !(shiftIsBounded(v)) {
 12969  			break
 12970  		}
 12971  		v.reset(OpPPC64SRD)
 12972  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 12973  		v0.AddArg(x)
 12974  		v.AddArg2(v0, y)
 12975  		return true
 12976  	}
 12977  	// match: (Rsh16Ux64 <t> x y)
 12978  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
 12979  	for {
 12980  		t := v.Type
 12981  		x := v_0
 12982  		y := v_1
 12983  		v.reset(OpPPC64ISEL)
 12984  		v.AuxInt = int32ToAuxInt(0)
 12985  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 12986  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 12987  		v1.AddArg(x)
 12988  		v0.AddArg2(v1, y)
 12989  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 12990  		v2.AuxInt = int64ToAuxInt(0)
 12991  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 12992  		v3.AuxInt = int64ToAuxInt(16)
 12993  		v3.AddArg(y)
 12994  		v.AddArg3(v0, v2, v3)
 12995  		return true
 12996  	}
 12997  }
 12998  func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
 12999  	v_1 := v.Args[1]
 13000  	v_0 := v.Args[0]
 13001  	b := v.Block
 13002  	typ := &b.Func.Config.Types
 13003  	// match: (Rsh16Ux8 x y)
 13004  	// cond: shiftIsBounded(v)
 13005  	// result: (SRD (MOVHZreg x) y)
 13006  	for {
 13007  		x := v_0
 13008  		y := v_1
 13009  		if !(shiftIsBounded(v)) {
 13010  			break
 13011  		}
 13012  		v.reset(OpPPC64SRD)
 13013  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13014  		v0.AddArg(x)
 13015  		v.AddArg2(v0, y)
 13016  		return true
 13017  	}
 13018  	// match: (Rsh16Ux8 <t> x y)
 13019  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F0] y)))
 13020  	for {
 13021  		t := v.Type
 13022  		x := v_0
 13023  		y := v_1
 13024  		v.reset(OpPPC64ISEL)
 13025  		v.AuxInt = int32ToAuxInt(2)
 13026  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13027  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13028  		v1.AddArg(x)
 13029  		v0.AddArg2(v1, y)
 13030  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13031  		v2.AuxInt = int64ToAuxInt(0)
 13032  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13033  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13034  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13035  		v4.AddArg(y)
 13036  		v3.AddArg(v4)
 13037  		v.AddArg3(v0, v2, v3)
 13038  		return true
 13039  	}
 13040  }
 13041  func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
 13042  	v_1 := v.Args[1]
 13043  	v_0 := v.Args[0]
 13044  	b := v.Block
 13045  	typ := &b.Func.Config.Types
 13046  	// match: (Rsh16x16 x y)
 13047  	// cond: shiftIsBounded(v)
 13048  	// result: (SRAD (MOVHreg x) y)
 13049  	for {
 13050  		x := v_0
 13051  		y := v_1
 13052  		if !(shiftIsBounded(v)) {
 13053  			break
 13054  		}
 13055  		v.reset(OpPPC64SRAD)
 13056  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13057  		v0.AddArg(x)
 13058  		v.AddArg2(v0, y)
 13059  		return true
 13060  	}
 13061  	// match: (Rsh16x16 <t> x y)
 13062  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF0] y)))
 13063  	for {
 13064  		t := v.Type
 13065  		x := v_0
 13066  		y := v_1
 13067  		v.reset(OpPPC64ISEL)
 13068  		v.AuxInt = int32ToAuxInt(2)
 13069  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13070  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13071  		v1.AddArg(x)
 13072  		v0.AddArg2(v1, y)
 13073  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13074  		v2.AuxInt = int64ToAuxInt(15)
 13075  		v2.AddArg(v1)
 13076  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13077  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13078  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13079  		v4.AddArg(y)
 13080  		v3.AddArg(v4)
 13081  		v.AddArg3(v0, v2, v3)
 13082  		return true
 13083  	}
 13084  }
 13085  func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
 13086  	v_1 := v.Args[1]
 13087  	v_0 := v.Args[0]
 13088  	b := v.Block
 13089  	typ := &b.Func.Config.Types
 13090  	// match: (Rsh16x32 x y)
 13091  	// cond: shiftIsBounded(v)
 13092  	// result: (SRAD (MOVHreg x) y)
 13093  	for {
 13094  		x := v_0
 13095  		y := v_1
 13096  		if !(shiftIsBounded(v)) {
 13097  			break
 13098  		}
 13099  		v.reset(OpPPC64SRAD)
 13100  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13101  		v0.AddArg(x)
 13102  		v.AddArg2(v0, y)
 13103  		return true
 13104  	}
 13105  	// match: (Rsh16x32 <t> x y)
 13106  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPWUconst y [16]))
 13107  	for {
 13108  		t := v.Type
 13109  		x := v_0
 13110  		y := v_1
 13111  		v.reset(OpPPC64ISEL)
 13112  		v.AuxInt = int32ToAuxInt(0)
 13113  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13114  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13115  		v1.AddArg(x)
 13116  		v0.AddArg2(v1, y)
 13117  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13118  		v2.AuxInt = int64ToAuxInt(15)
 13119  		v2.AddArg(v1)
 13120  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13121  		v3.AuxInt = int32ToAuxInt(16)
 13122  		v3.AddArg(y)
 13123  		v.AddArg3(v0, v2, v3)
 13124  		return true
 13125  	}
 13126  }
 13127  func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
 13128  	v_1 := v.Args[1]
 13129  	v_0 := v.Args[0]
 13130  	b := v.Block
 13131  	typ := &b.Func.Config.Types
 13132  	// match: (Rsh16x64 x (MOVDconst [c]))
 13133  	// cond: uint64(c) >= 16
 13134  	// result: (SRAWconst (SignExt16to32 x) [63])
 13135  	for {
 13136  		x := v_0
 13137  		if v_1.Op != OpPPC64MOVDconst {
 13138  			break
 13139  		}
 13140  		c := auxIntToInt64(v_1.AuxInt)
 13141  		if !(uint64(c) >= 16) {
 13142  			break
 13143  		}
 13144  		v.reset(OpPPC64SRAWconst)
 13145  		v.AuxInt = int64ToAuxInt(63)
 13146  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13147  		v0.AddArg(x)
 13148  		v.AddArg(v0)
 13149  		return true
 13150  	}
 13151  	// match: (Rsh16x64 x (MOVDconst [c]))
 13152  	// cond: uint64(c) < 16
 13153  	// result: (SRAWconst (SignExt16to32 x) [c])
 13154  	for {
 13155  		x := v_0
 13156  		if v_1.Op != OpPPC64MOVDconst {
 13157  			break
 13158  		}
 13159  		c := auxIntToInt64(v_1.AuxInt)
 13160  		if !(uint64(c) < 16) {
 13161  			break
 13162  		}
 13163  		v.reset(OpPPC64SRAWconst)
 13164  		v.AuxInt = int64ToAuxInt(c)
 13165  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13166  		v0.AddArg(x)
 13167  		v.AddArg(v0)
 13168  		return true
 13169  	}
 13170  	// match: (Rsh16x64 x y)
 13171  	// cond: shiftIsBounded(v)
 13172  	// result: (SRAD (MOVHreg x) y)
 13173  	for {
 13174  		x := v_0
 13175  		y := v_1
 13176  		if !(shiftIsBounded(v)) {
 13177  			break
 13178  		}
 13179  		v.reset(OpPPC64SRAD)
 13180  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13181  		v0.AddArg(x)
 13182  		v.AddArg2(v0, y)
 13183  		return true
 13184  	}
 13185  	// match: (Rsh16x64 <t> x y)
 13186  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPUconst y [16]))
 13187  	for {
 13188  		t := v.Type
 13189  		x := v_0
 13190  		y := v_1
 13191  		v.reset(OpPPC64ISEL)
 13192  		v.AuxInt = int32ToAuxInt(0)
 13193  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13194  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13195  		v1.AddArg(x)
 13196  		v0.AddArg2(v1, y)
 13197  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13198  		v2.AuxInt = int64ToAuxInt(15)
 13199  		v2.AddArg(v1)
 13200  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13201  		v3.AuxInt = int64ToAuxInt(16)
 13202  		v3.AddArg(y)
 13203  		v.AddArg3(v0, v2, v3)
 13204  		return true
 13205  	}
 13206  }
 13207  func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
 13208  	v_1 := v.Args[1]
 13209  	v_0 := v.Args[0]
 13210  	b := v.Block
 13211  	typ := &b.Func.Config.Types
 13212  	// match: (Rsh16x8 x y)
 13213  	// cond: shiftIsBounded(v)
 13214  	// result: (SRAD (MOVHreg x) y)
 13215  	for {
 13216  		x := v_0
 13217  		y := v_1
 13218  		if !(shiftIsBounded(v)) {
 13219  			break
 13220  		}
 13221  		v.reset(OpPPC64SRAD)
 13222  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13223  		v0.AddArg(x)
 13224  		v.AddArg2(v0, y)
 13225  		return true
 13226  	}
 13227  	// match: (Rsh16x8 <t> x y)
 13228  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F0] y)))
 13229  	for {
 13230  		t := v.Type
 13231  		x := v_0
 13232  		y := v_1
 13233  		v.reset(OpPPC64ISEL)
 13234  		v.AuxInt = int32ToAuxInt(2)
 13235  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13236  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13237  		v1.AddArg(x)
 13238  		v0.AddArg2(v1, y)
 13239  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13240  		v2.AuxInt = int64ToAuxInt(15)
 13241  		v2.AddArg(v1)
 13242  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13243  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13244  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13245  		v4.AddArg(y)
 13246  		v3.AddArg(v4)
 13247  		v.AddArg3(v0, v2, v3)
 13248  		return true
 13249  	}
 13250  }
 13251  func rewriteValuePPC64_OpRsh32Ux16(v *Value) bool {
 13252  	v_1 := v.Args[1]
 13253  	v_0 := v.Args[0]
 13254  	b := v.Block
 13255  	typ := &b.Func.Config.Types
 13256  	// match: (Rsh32Ux16 x y)
 13257  	// cond: shiftIsBounded(v)
 13258  	// result: (SRW x y)
 13259  	for {
 13260  		x := v_0
 13261  		y := v_1
 13262  		if !(shiftIsBounded(v)) {
 13263  			break
 13264  		}
 13265  		v.reset(OpPPC64SRW)
 13266  		v.AddArg2(x, y)
 13267  		return true
 13268  	}
 13269  	// match: (Rsh32Ux16 <t> x y)
 13270  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFE0] y)))
 13271  	for {
 13272  		t := v.Type
 13273  		x := v_0
 13274  		y := v_1
 13275  		v.reset(OpPPC64ISEL)
 13276  		v.AuxInt = int32ToAuxInt(2)
 13277  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13278  		v0.AddArg2(x, y)
 13279  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13280  		v1.AuxInt = int64ToAuxInt(0)
 13281  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13282  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13283  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 13284  		v3.AddArg(y)
 13285  		v2.AddArg(v3)
 13286  		v.AddArg3(v0, v1, v2)
 13287  		return true
 13288  	}
 13289  }
 13290  func rewriteValuePPC64_OpRsh32Ux32(v *Value) bool {
 13291  	v_1 := v.Args[1]
 13292  	v_0 := v.Args[0]
 13293  	b := v.Block
 13294  	typ := &b.Func.Config.Types
 13295  	// match: (Rsh32Ux32 x y)
 13296  	// cond: shiftIsBounded(v)
 13297  	// result: (SRW x y)
 13298  	for {
 13299  		x := v_0
 13300  		y := v_1
 13301  		if !(shiftIsBounded(v)) {
 13302  			break
 13303  		}
 13304  		v.reset(OpPPC64SRW)
 13305  		v.AddArg2(x, y)
 13306  		return true
 13307  	}
 13308  	// match: (Rsh32Ux32 <t> x y)
 13309  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
 13310  	for {
 13311  		t := v.Type
 13312  		x := v_0
 13313  		y := v_1
 13314  		v.reset(OpPPC64ISEL)
 13315  		v.AuxInt = int32ToAuxInt(0)
 13316  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13317  		v0.AddArg2(x, y)
 13318  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13319  		v1.AuxInt = int64ToAuxInt(0)
 13320  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13321  		v2.AuxInt = int32ToAuxInt(32)
 13322  		v2.AddArg(y)
 13323  		v.AddArg3(v0, v1, v2)
 13324  		return true
 13325  	}
 13326  }
 13327  func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
 13328  	v_1 := v.Args[1]
 13329  	v_0 := v.Args[0]
 13330  	b := v.Block
 13331  	typ := &b.Func.Config.Types
 13332  	// match: (Rsh32Ux64 x (MOVDconst [c]))
 13333  	// cond: uint64(c) < 32
 13334  	// result: (SRWconst x [c])
 13335  	for {
 13336  		x := v_0
 13337  		if v_1.Op != OpPPC64MOVDconst {
 13338  			break
 13339  		}
 13340  		c := auxIntToInt64(v_1.AuxInt)
 13341  		if !(uint64(c) < 32) {
 13342  			break
 13343  		}
 13344  		v.reset(OpPPC64SRWconst)
 13345  		v.AuxInt = int64ToAuxInt(c)
 13346  		v.AddArg(x)
 13347  		return true
 13348  	}
 13349  	// match: (Rsh32Ux64 x y)
 13350  	// cond: shiftIsBounded(v)
 13351  	// result: (SRW x y)
 13352  	for {
 13353  		x := v_0
 13354  		y := v_1
 13355  		if !(shiftIsBounded(v)) {
 13356  			break
 13357  		}
 13358  		v.reset(OpPPC64SRW)
 13359  		v.AddArg2(x, y)
 13360  		return true
 13361  	}
 13362  	// match: (Rsh32Ux64 <t> x y)
 13363  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
 13364  	for {
 13365  		t := v.Type
 13366  		x := v_0
 13367  		y := v_1
 13368  		v.reset(OpPPC64ISEL)
 13369  		v.AuxInt = int32ToAuxInt(0)
 13370  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13371  		v0.AddArg2(x, y)
 13372  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13373  		v1.AuxInt = int64ToAuxInt(0)
 13374  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13375  		v2.AuxInt = int64ToAuxInt(32)
 13376  		v2.AddArg(y)
 13377  		v.AddArg3(v0, v1, v2)
 13378  		return true
 13379  	}
 13380  }
 13381  func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
 13382  	v_1 := v.Args[1]
 13383  	v_0 := v.Args[0]
 13384  	b := v.Block
 13385  	typ := &b.Func.Config.Types
 13386  	// match: (Rsh32Ux8 x y)
 13387  	// cond: shiftIsBounded(v)
 13388  	// result: (SRW x y)
 13389  	for {
 13390  		x := v_0
 13391  		y := v_1
 13392  		if !(shiftIsBounded(v)) {
 13393  			break
 13394  		}
 13395  		v.reset(OpPPC64SRW)
 13396  		v.AddArg2(x, y)
 13397  		return true
 13398  	}
 13399  	// match: (Rsh32Ux8 <t> x y)
 13400  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00E0] y)))
 13401  	for {
 13402  		t := v.Type
 13403  		x := v_0
 13404  		y := v_1
 13405  		v.reset(OpPPC64ISEL)
 13406  		v.AuxInt = int32ToAuxInt(2)
 13407  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13408  		v0.AddArg2(x, y)
 13409  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13410  		v1.AuxInt = int64ToAuxInt(0)
 13411  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13412  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13413  		v3.AuxInt = int64ToAuxInt(0x00E0)
 13414  		v3.AddArg(y)
 13415  		v2.AddArg(v3)
 13416  		v.AddArg3(v0, v1, v2)
 13417  		return true
 13418  	}
 13419  }
 13420  func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
 13421  	v_1 := v.Args[1]
 13422  	v_0 := v.Args[0]
 13423  	b := v.Block
 13424  	typ := &b.Func.Config.Types
 13425  	// match: (Rsh32x16 x y)
 13426  	// cond: shiftIsBounded(v)
 13427  	// result: (SRAW x y)
 13428  	for {
 13429  		x := v_0
 13430  		y := v_1
 13431  		if !(shiftIsBounded(v)) {
 13432  			break
 13433  		}
 13434  		v.reset(OpPPC64SRAW)
 13435  		v.AddArg2(x, y)
 13436  		return true
 13437  	}
 13438  	// match: (Rsh32x16 <t> x y)
 13439  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFE0] y)))
 13440  	for {
 13441  		t := v.Type
 13442  		x := v_0
 13443  		y := v_1
 13444  		v.reset(OpPPC64ISEL)
 13445  		v.AuxInt = int32ToAuxInt(2)
 13446  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13447  		v0.AddArg2(x, y)
 13448  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13449  		v1.AuxInt = int64ToAuxInt(31)
 13450  		v1.AddArg(x)
 13451  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13452  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13453  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 13454  		v3.AddArg(y)
 13455  		v2.AddArg(v3)
 13456  		v.AddArg3(v0, v1, v2)
 13457  		return true
 13458  	}
 13459  }
 13460  func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
 13461  	v_1 := v.Args[1]
 13462  	v_0 := v.Args[0]
 13463  	b := v.Block
 13464  	// match: (Rsh32x32 x y)
 13465  	// cond: shiftIsBounded(v)
 13466  	// result: (SRAW x y)
 13467  	for {
 13468  		x := v_0
 13469  		y := v_1
 13470  		if !(shiftIsBounded(v)) {
 13471  			break
 13472  		}
 13473  		v.reset(OpPPC64SRAW)
 13474  		v.AddArg2(x, y)
 13475  		return true
 13476  	}
 13477  	// match: (Rsh32x32 <t> x y)
 13478  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPWUconst y [32]))
 13479  	for {
 13480  		t := v.Type
 13481  		x := v_0
 13482  		y := v_1
 13483  		v.reset(OpPPC64ISEL)
 13484  		v.AuxInt = int32ToAuxInt(0)
 13485  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13486  		v0.AddArg2(x, y)
 13487  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13488  		v1.AuxInt = int64ToAuxInt(31)
 13489  		v1.AddArg(x)
 13490  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13491  		v2.AuxInt = int32ToAuxInt(32)
 13492  		v2.AddArg(y)
 13493  		v.AddArg3(v0, v1, v2)
 13494  		return true
 13495  	}
 13496  }
 13497  func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
 13498  	v_1 := v.Args[1]
 13499  	v_0 := v.Args[0]
 13500  	b := v.Block
 13501  	// match: (Rsh32x64 x (MOVDconst [c]))
 13502  	// cond: uint64(c) >= 32
 13503  	// result: (SRAWconst x [63])
 13504  	for {
 13505  		x := v_0
 13506  		if v_1.Op != OpPPC64MOVDconst {
 13507  			break
 13508  		}
 13509  		c := auxIntToInt64(v_1.AuxInt)
 13510  		if !(uint64(c) >= 32) {
 13511  			break
 13512  		}
 13513  		v.reset(OpPPC64SRAWconst)
 13514  		v.AuxInt = int64ToAuxInt(63)
 13515  		v.AddArg(x)
 13516  		return true
 13517  	}
 13518  	// match: (Rsh32x64 x (MOVDconst [c]))
 13519  	// cond: uint64(c) < 32
 13520  	// result: (SRAWconst x [c])
 13521  	for {
 13522  		x := v_0
 13523  		if v_1.Op != OpPPC64MOVDconst {
 13524  			break
 13525  		}
 13526  		c := auxIntToInt64(v_1.AuxInt)
 13527  		if !(uint64(c) < 32) {
 13528  			break
 13529  		}
 13530  		v.reset(OpPPC64SRAWconst)
 13531  		v.AuxInt = int64ToAuxInt(c)
 13532  		v.AddArg(x)
 13533  		return true
 13534  	}
 13535  	// match: (Rsh32x64 x y)
 13536  	// cond: shiftIsBounded(v)
 13537  	// result: (SRAW x y)
 13538  	for {
 13539  		x := v_0
 13540  		y := v_1
 13541  		if !(shiftIsBounded(v)) {
 13542  			break
 13543  		}
 13544  		v.reset(OpPPC64SRAW)
 13545  		v.AddArg2(x, y)
 13546  		return true
 13547  	}
 13548  	// match: (Rsh32x64 <t> x y)
 13549  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPUconst y [32]))
 13550  	for {
 13551  		t := v.Type
 13552  		x := v_0
 13553  		y := v_1
 13554  		v.reset(OpPPC64ISEL)
 13555  		v.AuxInt = int32ToAuxInt(0)
 13556  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13557  		v0.AddArg2(x, y)
 13558  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13559  		v1.AuxInt = int64ToAuxInt(31)
 13560  		v1.AddArg(x)
 13561  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13562  		v2.AuxInt = int64ToAuxInt(32)
 13563  		v2.AddArg(y)
 13564  		v.AddArg3(v0, v1, v2)
 13565  		return true
 13566  	}
 13567  }
 13568  func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
 13569  	v_1 := v.Args[1]
 13570  	v_0 := v.Args[0]
 13571  	b := v.Block
 13572  	typ := &b.Func.Config.Types
 13573  	// match: (Rsh32x8 x y)
 13574  	// cond: shiftIsBounded(v)
 13575  	// result: (SRAW x y)
 13576  	for {
 13577  		x := v_0
 13578  		y := v_1
 13579  		if !(shiftIsBounded(v)) {
 13580  			break
 13581  		}
 13582  		v.reset(OpPPC64SRAW)
 13583  		v.AddArg2(x, y)
 13584  		return true
 13585  	}
 13586  	// match: (Rsh32x8 <t> x y)
 13587  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (Select1 <types.TypeFlags> (ANDCCconst [0x00E0] y)))
 13588  	for {
 13589  		t := v.Type
 13590  		x := v_0
 13591  		y := v_1
 13592  		v.reset(OpPPC64ISEL)
 13593  		v.AuxInt = int32ToAuxInt(2)
 13594  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13595  		v0.AddArg2(x, y)
 13596  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13597  		v1.AuxInt = int64ToAuxInt(31)
 13598  		v1.AddArg(x)
 13599  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13600  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13601  		v3.AuxInt = int64ToAuxInt(0x00E0)
 13602  		v3.AddArg(y)
 13603  		v2.AddArg(v3)
 13604  		v.AddArg3(v0, v1, v2)
 13605  		return true
 13606  	}
 13607  }
 13608  func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
 13609  	v_1 := v.Args[1]
 13610  	v_0 := v.Args[0]
 13611  	b := v.Block
 13612  	typ := &b.Func.Config.Types
 13613  	// match: (Rsh64Ux16 x y)
 13614  	// cond: shiftIsBounded(v)
 13615  	// result: (SRD x y)
 13616  	for {
 13617  		x := v_0
 13618  		y := v_1
 13619  		if !(shiftIsBounded(v)) {
 13620  			break
 13621  		}
 13622  		v.reset(OpPPC64SRD)
 13623  		v.AddArg2(x, y)
 13624  		return true
 13625  	}
 13626  	// match: (Rsh64Ux16 <t> x y)
 13627  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFC0] y)))
 13628  	for {
 13629  		t := v.Type
 13630  		x := v_0
 13631  		y := v_1
 13632  		v.reset(OpPPC64ISEL)
 13633  		v.AuxInt = int32ToAuxInt(2)
 13634  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13635  		v0.AddArg2(x, y)
 13636  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13637  		v1.AuxInt = int64ToAuxInt(0)
 13638  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13639  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13640  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 13641  		v3.AddArg(y)
 13642  		v2.AddArg(v3)
 13643  		v.AddArg3(v0, v1, v2)
 13644  		return true
 13645  	}
 13646  }
 13647  func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
 13648  	v_1 := v.Args[1]
 13649  	v_0 := v.Args[0]
 13650  	b := v.Block
 13651  	typ := &b.Func.Config.Types
 13652  	// match: (Rsh64Ux32 x y)
 13653  	// cond: shiftIsBounded(v)
 13654  	// result: (SRD x y)
 13655  	for {
 13656  		x := v_0
 13657  		y := v_1
 13658  		if !(shiftIsBounded(v)) {
 13659  			break
 13660  		}
 13661  		v.reset(OpPPC64SRD)
 13662  		v.AddArg2(x, y)
 13663  		return true
 13664  	}
 13665  	// match: (Rsh64Ux32 <t> x y)
 13666  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
 13667  	for {
 13668  		t := v.Type
 13669  		x := v_0
 13670  		y := v_1
 13671  		v.reset(OpPPC64ISEL)
 13672  		v.AuxInt = int32ToAuxInt(0)
 13673  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13674  		v0.AddArg2(x, y)
 13675  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13676  		v1.AuxInt = int64ToAuxInt(0)
 13677  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13678  		v2.AuxInt = int32ToAuxInt(64)
 13679  		v2.AddArg(y)
 13680  		v.AddArg3(v0, v1, v2)
 13681  		return true
 13682  	}
 13683  }
 13684  func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
 13685  	v_1 := v.Args[1]
 13686  	v_0 := v.Args[0]
 13687  	b := v.Block
 13688  	typ := &b.Func.Config.Types
 13689  	// match: (Rsh64Ux64 x (MOVDconst [c]))
 13690  	// cond: uint64(c) < 64
 13691  	// result: (SRDconst x [c])
 13692  	for {
 13693  		x := v_0
 13694  		if v_1.Op != OpPPC64MOVDconst {
 13695  			break
 13696  		}
 13697  		c := auxIntToInt64(v_1.AuxInt)
 13698  		if !(uint64(c) < 64) {
 13699  			break
 13700  		}
 13701  		v.reset(OpPPC64SRDconst)
 13702  		v.AuxInt = int64ToAuxInt(c)
 13703  		v.AddArg(x)
 13704  		return true
 13705  	}
 13706  	// match: (Rsh64Ux64 x y)
 13707  	// cond: shiftIsBounded(v)
 13708  	// result: (SRD x y)
 13709  	for {
 13710  		x := v_0
 13711  		y := v_1
 13712  		if !(shiftIsBounded(v)) {
 13713  			break
 13714  		}
 13715  		v.reset(OpPPC64SRD)
 13716  		v.AddArg2(x, y)
 13717  		return true
 13718  	}
 13719  	// match: (Rsh64Ux64 <t> x y)
 13720  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
 13721  	for {
 13722  		t := v.Type
 13723  		x := v_0
 13724  		y := v_1
 13725  		v.reset(OpPPC64ISEL)
 13726  		v.AuxInt = int32ToAuxInt(0)
 13727  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13728  		v0.AddArg2(x, y)
 13729  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13730  		v1.AuxInt = int64ToAuxInt(0)
 13731  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13732  		v2.AuxInt = int64ToAuxInt(64)
 13733  		v2.AddArg(y)
 13734  		v.AddArg3(v0, v1, v2)
 13735  		return true
 13736  	}
 13737  }
 13738  func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
 13739  	v_1 := v.Args[1]
 13740  	v_0 := v.Args[0]
 13741  	b := v.Block
 13742  	typ := &b.Func.Config.Types
 13743  	// match: (Rsh64Ux8 x y)
 13744  	// cond: shiftIsBounded(v)
 13745  	// result: (SRD x y)
 13746  	for {
 13747  		x := v_0
 13748  		y := v_1
 13749  		if !(shiftIsBounded(v)) {
 13750  			break
 13751  		}
 13752  		v.reset(OpPPC64SRD)
 13753  		v.AddArg2(x, y)
 13754  		return true
 13755  	}
 13756  	// match: (Rsh64Ux8 <t> x y)
 13757  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00C0] y)))
 13758  	for {
 13759  		t := v.Type
 13760  		x := v_0
 13761  		y := v_1
 13762  		v.reset(OpPPC64ISEL)
 13763  		v.AuxInt = int32ToAuxInt(2)
 13764  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13765  		v0.AddArg2(x, y)
 13766  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13767  		v1.AuxInt = int64ToAuxInt(0)
 13768  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13769  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13770  		v3.AuxInt = int64ToAuxInt(0x00C0)
 13771  		v3.AddArg(y)
 13772  		v2.AddArg(v3)
 13773  		v.AddArg3(v0, v1, v2)
 13774  		return true
 13775  	}
 13776  }
 13777  func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
 13778  	v_1 := v.Args[1]
 13779  	v_0 := v.Args[0]
 13780  	b := v.Block
 13781  	typ := &b.Func.Config.Types
 13782  	// match: (Rsh64x16 x y)
 13783  	// cond: shiftIsBounded(v)
 13784  	// result: (SRAD x y)
 13785  	for {
 13786  		x := v_0
 13787  		y := v_1
 13788  		if !(shiftIsBounded(v)) {
 13789  			break
 13790  		}
 13791  		v.reset(OpPPC64SRAD)
 13792  		v.AddArg2(x, y)
 13793  		return true
 13794  	}
 13795  	// match: (Rsh64x16 <t> x y)
 13796  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFC0] y)))
 13797  	for {
 13798  		t := v.Type
 13799  		x := v_0
 13800  		y := v_1
 13801  		v.reset(OpPPC64ISEL)
 13802  		v.AuxInt = int32ToAuxInt(2)
 13803  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13804  		v0.AddArg2(x, y)
 13805  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13806  		v1.AuxInt = int64ToAuxInt(63)
 13807  		v1.AddArg(x)
 13808  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13809  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13810  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 13811  		v3.AddArg(y)
 13812  		v2.AddArg(v3)
 13813  		v.AddArg3(v0, v1, v2)
 13814  		return true
 13815  	}
 13816  }
 13817  func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
 13818  	v_1 := v.Args[1]
 13819  	v_0 := v.Args[0]
 13820  	b := v.Block
 13821  	// match: (Rsh64x32 x y)
 13822  	// cond: shiftIsBounded(v)
 13823  	// result: (SRAD x y)
 13824  	for {
 13825  		x := v_0
 13826  		y := v_1
 13827  		if !(shiftIsBounded(v)) {
 13828  			break
 13829  		}
 13830  		v.reset(OpPPC64SRAD)
 13831  		v.AddArg2(x, y)
 13832  		return true
 13833  	}
 13834  	// match: (Rsh64x32 <t> x y)
 13835  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPWUconst y [64]))
 13836  	for {
 13837  		t := v.Type
 13838  		x := v_0
 13839  		y := v_1
 13840  		v.reset(OpPPC64ISEL)
 13841  		v.AuxInt = int32ToAuxInt(0)
 13842  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13843  		v0.AddArg2(x, y)
 13844  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13845  		v1.AuxInt = int64ToAuxInt(63)
 13846  		v1.AddArg(x)
 13847  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13848  		v2.AuxInt = int32ToAuxInt(64)
 13849  		v2.AddArg(y)
 13850  		v.AddArg3(v0, v1, v2)
 13851  		return true
 13852  	}
 13853  }
 13854  func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
 13855  	v_1 := v.Args[1]
 13856  	v_0 := v.Args[0]
 13857  	b := v.Block
 13858  	// match: (Rsh64x64 x (MOVDconst [c]))
 13859  	// cond: uint64(c) >= 64
 13860  	// result: (SRADconst x [63])
 13861  	for {
 13862  		x := v_0
 13863  		if v_1.Op != OpPPC64MOVDconst {
 13864  			break
 13865  		}
 13866  		c := auxIntToInt64(v_1.AuxInt)
 13867  		if !(uint64(c) >= 64) {
 13868  			break
 13869  		}
 13870  		v.reset(OpPPC64SRADconst)
 13871  		v.AuxInt = int64ToAuxInt(63)
 13872  		v.AddArg(x)
 13873  		return true
 13874  	}
 13875  	// match: (Rsh64x64 x (MOVDconst [c]))
 13876  	// cond: uint64(c) < 64
 13877  	// result: (SRADconst x [c])
 13878  	for {
 13879  		x := v_0
 13880  		if v_1.Op != OpPPC64MOVDconst {
 13881  			break
 13882  		}
 13883  		c := auxIntToInt64(v_1.AuxInt)
 13884  		if !(uint64(c) < 64) {
 13885  			break
 13886  		}
 13887  		v.reset(OpPPC64SRADconst)
 13888  		v.AuxInt = int64ToAuxInt(c)
 13889  		v.AddArg(x)
 13890  		return true
 13891  	}
 13892  	// match: (Rsh64x64 x y)
 13893  	// cond: shiftIsBounded(v)
 13894  	// result: (SRAD x y)
 13895  	for {
 13896  		x := v_0
 13897  		y := v_1
 13898  		if !(shiftIsBounded(v)) {
 13899  			break
 13900  		}
 13901  		v.reset(OpPPC64SRAD)
 13902  		v.AddArg2(x, y)
 13903  		return true
 13904  	}
 13905  	// match: (Rsh64x64 <t> x y)
 13906  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPUconst y [64]))
 13907  	for {
 13908  		t := v.Type
 13909  		x := v_0
 13910  		y := v_1
 13911  		v.reset(OpPPC64ISEL)
 13912  		v.AuxInt = int32ToAuxInt(0)
 13913  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13914  		v0.AddArg2(x, y)
 13915  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13916  		v1.AuxInt = int64ToAuxInt(63)
 13917  		v1.AddArg(x)
 13918  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13919  		v2.AuxInt = int64ToAuxInt(64)
 13920  		v2.AddArg(y)
 13921  		v.AddArg3(v0, v1, v2)
 13922  		return true
 13923  	}
 13924  }
 13925  func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
 13926  	v_1 := v.Args[1]
 13927  	v_0 := v.Args[0]
 13928  	b := v.Block
 13929  	typ := &b.Func.Config.Types
 13930  	// match: (Rsh64x8 x y)
 13931  	// cond: shiftIsBounded(v)
 13932  	// result: (SRAD x y)
 13933  	for {
 13934  		x := v_0
 13935  		y := v_1
 13936  		if !(shiftIsBounded(v)) {
 13937  			break
 13938  		}
 13939  		v.reset(OpPPC64SRAD)
 13940  		v.AddArg2(x, y)
 13941  		return true
 13942  	}
 13943  	// match: (Rsh64x8 <t> x y)
 13944  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (Select1 <types.TypeFlags> (ANDCCconst [0x00C0] y)))
 13945  	for {
 13946  		t := v.Type
 13947  		x := v_0
 13948  		y := v_1
 13949  		v.reset(OpPPC64ISEL)
 13950  		v.AuxInt = int32ToAuxInt(2)
 13951  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13952  		v0.AddArg2(x, y)
 13953  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13954  		v1.AuxInt = int64ToAuxInt(63)
 13955  		v1.AddArg(x)
 13956  		v2 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 13957  		v3 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 13958  		v3.AuxInt = int64ToAuxInt(0x00C0)
 13959  		v3.AddArg(y)
 13960  		v2.AddArg(v3)
 13961  		v.AddArg3(v0, v1, v2)
 13962  		return true
 13963  	}
 13964  }
 13965  func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
 13966  	v_1 := v.Args[1]
 13967  	v_0 := v.Args[0]
 13968  	b := v.Block
 13969  	typ := &b.Func.Config.Types
 13970  	// match: (Rsh8Ux16 x y)
 13971  	// cond: shiftIsBounded(v)
 13972  	// result: (SRD (MOVBZreg x) y)
 13973  	for {
 13974  		x := v_0
 13975  		y := v_1
 13976  		if !(shiftIsBounded(v)) {
 13977  			break
 13978  		}
 13979  		v.reset(OpPPC64SRD)
 13980  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 13981  		v0.AddArg(x)
 13982  		v.AddArg2(v0, y)
 13983  		return true
 13984  	}
 13985  	// match: (Rsh8Ux16 <t> x y)
 13986  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF8] y)))
 13987  	for {
 13988  		t := v.Type
 13989  		x := v_0
 13990  		y := v_1
 13991  		v.reset(OpPPC64ISEL)
 13992  		v.AuxInt = int32ToAuxInt(2)
 13993  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13994  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 13995  		v1.AddArg(x)
 13996  		v0.AddArg2(v1, y)
 13997  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13998  		v2.AuxInt = int64ToAuxInt(0)
 13999  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 14000  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 14001  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14002  		v4.AddArg(y)
 14003  		v3.AddArg(v4)
 14004  		v.AddArg3(v0, v2, v3)
 14005  		return true
 14006  	}
 14007  }
 14008  func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
 14009  	v_1 := v.Args[1]
 14010  	v_0 := v.Args[0]
 14011  	b := v.Block
 14012  	typ := &b.Func.Config.Types
 14013  	// match: (Rsh8Ux32 x y)
 14014  	// cond: shiftIsBounded(v)
 14015  	// result: (SRD (MOVBZreg x) y)
 14016  	for {
 14017  		x := v_0
 14018  		y := v_1
 14019  		if !(shiftIsBounded(v)) {
 14020  			break
 14021  		}
 14022  		v.reset(OpPPC64SRD)
 14023  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14024  		v0.AddArg(x)
 14025  		v.AddArg2(v0, y)
 14026  		return true
 14027  	}
 14028  	// match: (Rsh8Ux32 <t> x y)
 14029  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
 14030  	for {
 14031  		t := v.Type
 14032  		x := v_0
 14033  		y := v_1
 14034  		v.reset(OpPPC64ISEL)
 14035  		v.AuxInt = int32ToAuxInt(0)
 14036  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14037  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14038  		v1.AddArg(x)
 14039  		v0.AddArg2(v1, y)
 14040  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14041  		v2.AuxInt = int64ToAuxInt(0)
 14042  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14043  		v3.AuxInt = int32ToAuxInt(8)
 14044  		v3.AddArg(y)
 14045  		v.AddArg3(v0, v2, v3)
 14046  		return true
 14047  	}
 14048  }
 14049  func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
 14050  	v_1 := v.Args[1]
 14051  	v_0 := v.Args[0]
 14052  	b := v.Block
 14053  	typ := &b.Func.Config.Types
 14054  	// match: (Rsh8Ux64 x (MOVDconst [c]))
 14055  	// cond: uint64(c) < 8
 14056  	// result: (SRWconst (ZeroExt8to32 x) [c])
 14057  	for {
 14058  		x := v_0
 14059  		if v_1.Op != OpPPC64MOVDconst {
 14060  			break
 14061  		}
 14062  		c := auxIntToInt64(v_1.AuxInt)
 14063  		if !(uint64(c) < 8) {
 14064  			break
 14065  		}
 14066  		v.reset(OpPPC64SRWconst)
 14067  		v.AuxInt = int64ToAuxInt(c)
 14068  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 14069  		v0.AddArg(x)
 14070  		v.AddArg(v0)
 14071  		return true
 14072  	}
 14073  	// match: (Rsh8Ux64 x y)
 14074  	// cond: shiftIsBounded(v)
 14075  	// result: (SRD (MOVBZreg x) y)
 14076  	for {
 14077  		x := v_0
 14078  		y := v_1
 14079  		if !(shiftIsBounded(v)) {
 14080  			break
 14081  		}
 14082  		v.reset(OpPPC64SRD)
 14083  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14084  		v0.AddArg(x)
 14085  		v.AddArg2(v0, y)
 14086  		return true
 14087  	}
 14088  	// match: (Rsh8Ux64 <t> x y)
 14089  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
 14090  	for {
 14091  		t := v.Type
 14092  		x := v_0
 14093  		y := v_1
 14094  		v.reset(OpPPC64ISEL)
 14095  		v.AuxInt = int32ToAuxInt(0)
 14096  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14097  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14098  		v1.AddArg(x)
 14099  		v0.AddArg2(v1, y)
 14100  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14101  		v2.AuxInt = int64ToAuxInt(0)
 14102  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14103  		v3.AuxInt = int64ToAuxInt(8)
 14104  		v3.AddArg(y)
 14105  		v.AddArg3(v0, v2, v3)
 14106  		return true
 14107  	}
 14108  }
 14109  func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
 14110  	v_1 := v.Args[1]
 14111  	v_0 := v.Args[0]
 14112  	b := v.Block
 14113  	typ := &b.Func.Config.Types
 14114  	// match: (Rsh8Ux8 x y)
 14115  	// cond: shiftIsBounded(v)
 14116  	// result: (SRD (MOVBZreg x) y)
 14117  	for {
 14118  		x := v_0
 14119  		y := v_1
 14120  		if !(shiftIsBounded(v)) {
 14121  			break
 14122  		}
 14123  		v.reset(OpPPC64SRD)
 14124  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14125  		v0.AddArg(x)
 14126  		v.AddArg2(v0, y)
 14127  		return true
 14128  	}
 14129  	// match: (Rsh8Ux8 <t> x y)
 14130  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F8] y)))
 14131  	for {
 14132  		t := v.Type
 14133  		x := v_0
 14134  		y := v_1
 14135  		v.reset(OpPPC64ISEL)
 14136  		v.AuxInt = int32ToAuxInt(2)
 14137  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14138  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14139  		v1.AddArg(x)
 14140  		v0.AddArg2(v1, y)
 14141  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14142  		v2.AuxInt = int64ToAuxInt(0)
 14143  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 14144  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 14145  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14146  		v4.AddArg(y)
 14147  		v3.AddArg(v4)
 14148  		v.AddArg3(v0, v2, v3)
 14149  		return true
 14150  	}
 14151  }
 14152  func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
 14153  	v_1 := v.Args[1]
 14154  	v_0 := v.Args[0]
 14155  	b := v.Block
 14156  	typ := &b.Func.Config.Types
 14157  	// match: (Rsh8x16 x y)
 14158  	// cond: shiftIsBounded(v)
 14159  	// result: (SRAD (MOVBreg x) y)
 14160  	for {
 14161  		x := v_0
 14162  		y := v_1
 14163  		if !(shiftIsBounded(v)) {
 14164  			break
 14165  		}
 14166  		v.reset(OpPPC64SRAD)
 14167  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14168  		v0.AddArg(x)
 14169  		v.AddArg2(v0, y)
 14170  		return true
 14171  	}
 14172  	// match: (Rsh8x16 <t> x y)
 14173  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (Select1 <types.TypeFlags> (ANDCCconst [0xFFF8] y)))
 14174  	for {
 14175  		t := v.Type
 14176  		x := v_0
 14177  		y := v_1
 14178  		v.reset(OpPPC64ISEL)
 14179  		v.AuxInt = int32ToAuxInt(2)
 14180  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14181  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14182  		v1.AddArg(x)
 14183  		v0.AddArg2(v1, y)
 14184  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14185  		v2.AuxInt = int64ToAuxInt(7)
 14186  		v2.AddArg(v1)
 14187  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 14188  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 14189  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14190  		v4.AddArg(y)
 14191  		v3.AddArg(v4)
 14192  		v.AddArg3(v0, v2, v3)
 14193  		return true
 14194  	}
 14195  }
 14196  func rewriteValuePPC64_OpRsh8x32(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: (Rsh8x32 x y)
 14202  	// cond: shiftIsBounded(v)
 14203  	// result: (SRAD (MOVBreg x) y)
 14204  	for {
 14205  		x := v_0
 14206  		y := v_1
 14207  		if !(shiftIsBounded(v)) {
 14208  			break
 14209  		}
 14210  		v.reset(OpPPC64SRAD)
 14211  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14212  		v0.AddArg(x)
 14213  		v.AddArg2(v0, y)
 14214  		return true
 14215  	}
 14216  	// match: (Rsh8x32 <t> x y)
 14217  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPWUconst y [8]))
 14218  	for {
 14219  		t := v.Type
 14220  		x := v_0
 14221  		y := v_1
 14222  		v.reset(OpPPC64ISEL)
 14223  		v.AuxInt = int32ToAuxInt(0)
 14224  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14225  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14226  		v1.AddArg(x)
 14227  		v0.AddArg2(v1, y)
 14228  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14229  		v2.AuxInt = int64ToAuxInt(7)
 14230  		v2.AddArg(v1)
 14231  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14232  		v3.AuxInt = int32ToAuxInt(8)
 14233  		v3.AddArg(y)
 14234  		v.AddArg3(v0, v2, v3)
 14235  		return true
 14236  	}
 14237  }
 14238  func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
 14239  	v_1 := v.Args[1]
 14240  	v_0 := v.Args[0]
 14241  	b := v.Block
 14242  	typ := &b.Func.Config.Types
 14243  	// match: (Rsh8x64 x (MOVDconst [c]))
 14244  	// cond: uint64(c) >= 8
 14245  	// result: (SRAWconst (SignExt8to32 x) [63])
 14246  	for {
 14247  		x := v_0
 14248  		if v_1.Op != OpPPC64MOVDconst {
 14249  			break
 14250  		}
 14251  		c := auxIntToInt64(v_1.AuxInt)
 14252  		if !(uint64(c) >= 8) {
 14253  			break
 14254  		}
 14255  		v.reset(OpPPC64SRAWconst)
 14256  		v.AuxInt = int64ToAuxInt(63)
 14257  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14258  		v0.AddArg(x)
 14259  		v.AddArg(v0)
 14260  		return true
 14261  	}
 14262  	// match: (Rsh8x64 x (MOVDconst [c]))
 14263  	// cond: uint64(c) < 8
 14264  	// result: (SRAWconst (SignExt8to32 x) [c])
 14265  	for {
 14266  		x := v_0
 14267  		if v_1.Op != OpPPC64MOVDconst {
 14268  			break
 14269  		}
 14270  		c := auxIntToInt64(v_1.AuxInt)
 14271  		if !(uint64(c) < 8) {
 14272  			break
 14273  		}
 14274  		v.reset(OpPPC64SRAWconst)
 14275  		v.AuxInt = int64ToAuxInt(c)
 14276  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14277  		v0.AddArg(x)
 14278  		v.AddArg(v0)
 14279  		return true
 14280  	}
 14281  	// match: (Rsh8x64 x y)
 14282  	// cond: shiftIsBounded(v)
 14283  	// result: (SRAD (MOVBreg x) y)
 14284  	for {
 14285  		x := v_0
 14286  		y := v_1
 14287  		if !(shiftIsBounded(v)) {
 14288  			break
 14289  		}
 14290  		v.reset(OpPPC64SRAD)
 14291  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14292  		v0.AddArg(x)
 14293  		v.AddArg2(v0, y)
 14294  		return true
 14295  	}
 14296  	// match: (Rsh8x64 <t> x y)
 14297  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPUconst y [8]))
 14298  	for {
 14299  		t := v.Type
 14300  		x := v_0
 14301  		y := v_1
 14302  		v.reset(OpPPC64ISEL)
 14303  		v.AuxInt = int32ToAuxInt(0)
 14304  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14305  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14306  		v1.AddArg(x)
 14307  		v0.AddArg2(v1, y)
 14308  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14309  		v2.AuxInt = int64ToAuxInt(7)
 14310  		v2.AddArg(v1)
 14311  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14312  		v3.AuxInt = int64ToAuxInt(8)
 14313  		v3.AddArg(y)
 14314  		v.AddArg3(v0, v2, v3)
 14315  		return true
 14316  	}
 14317  }
 14318  func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
 14319  	v_1 := v.Args[1]
 14320  	v_0 := v.Args[0]
 14321  	b := v.Block
 14322  	typ := &b.Func.Config.Types
 14323  	// match: (Rsh8x8 x y)
 14324  	// cond: shiftIsBounded(v)
 14325  	// result: (SRAD (MOVBreg x) y)
 14326  	for {
 14327  		x := v_0
 14328  		y := v_1
 14329  		if !(shiftIsBounded(v)) {
 14330  			break
 14331  		}
 14332  		v.reset(OpPPC64SRAD)
 14333  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14334  		v0.AddArg(x)
 14335  		v.AddArg2(v0, y)
 14336  		return true
 14337  	}
 14338  	// match: (Rsh8x8 <t> x y)
 14339  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (Select1 <types.TypeFlags> (ANDCCconst [0x00F8] y)))
 14340  	for {
 14341  		t := v.Type
 14342  		x := v_0
 14343  		y := v_1
 14344  		v.reset(OpPPC64ISEL)
 14345  		v.AuxInt = int32ToAuxInt(2)
 14346  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14347  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14348  		v1.AddArg(x)
 14349  		v0.AddArg2(v1, y)
 14350  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14351  		v2.AuxInt = int64ToAuxInt(7)
 14352  		v2.AddArg(v1)
 14353  		v3 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 14354  		v4 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 14355  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14356  		v4.AddArg(y)
 14357  		v3.AddArg(v4)
 14358  		v.AddArg3(v0, v2, v3)
 14359  		return true
 14360  	}
 14361  }
 14362  func rewriteValuePPC64_OpSelect0(v *Value) bool {
 14363  	v_0 := v.Args[0]
 14364  	b := v.Block
 14365  	typ := &b.Func.Config.Types
 14366  	// match: (Select0 (Mul64uhilo x y))
 14367  	// result: (MULHDU x y)
 14368  	for {
 14369  		if v_0.Op != OpMul64uhilo {
 14370  			break
 14371  		}
 14372  		y := v_0.Args[1]
 14373  		x := v_0.Args[0]
 14374  		v.reset(OpPPC64MULHDU)
 14375  		v.AddArg2(x, y)
 14376  		return true
 14377  	}
 14378  	// match: (Select0 (Add64carry x y c))
 14379  	// result: (Select0 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1]))))
 14380  	for {
 14381  		if v_0.Op != OpAdd64carry {
 14382  			break
 14383  		}
 14384  		c := v_0.Args[2]
 14385  		x := v_0.Args[0]
 14386  		y := v_0.Args[1]
 14387  		v.reset(OpSelect0)
 14388  		v.Type = typ.UInt64
 14389  		v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 14390  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14391  		v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14392  		v2.AuxInt = int64ToAuxInt(-1)
 14393  		v2.AddArg(c)
 14394  		v1.AddArg(v2)
 14395  		v0.AddArg3(x, y, v1)
 14396  		v.AddArg(v0)
 14397  		return true
 14398  	}
 14399  	// match: (Select0 (Sub64borrow x y c))
 14400  	// result: (Select0 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))
 14401  	for {
 14402  		if v_0.Op != OpSub64borrow {
 14403  			break
 14404  		}
 14405  		c := v_0.Args[2]
 14406  		x := v_0.Args[0]
 14407  		y := v_0.Args[1]
 14408  		v.reset(OpSelect0)
 14409  		v.Type = typ.UInt64
 14410  		v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 14411  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14412  		v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14413  		v2.AuxInt = int64ToAuxInt(0)
 14414  		v2.AddArg(c)
 14415  		v1.AddArg(v2)
 14416  		v0.AddArg3(x, y, v1)
 14417  		v.AddArg(v0)
 14418  		return true
 14419  	}
 14420  	// match: (Select0 (ANDCCconst [m] (ROTLWconst [r] x)))
 14421  	// cond: isPPC64WordRotateMask(m)
 14422  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
 14423  	for {
 14424  		if v_0.Op != OpPPC64ANDCCconst {
 14425  			break
 14426  		}
 14427  		m := auxIntToInt64(v_0.AuxInt)
 14428  		v_0_0 := v_0.Args[0]
 14429  		if v_0_0.Op != OpPPC64ROTLWconst {
 14430  			break
 14431  		}
 14432  		r := auxIntToInt64(v_0_0.AuxInt)
 14433  		x := v_0_0.Args[0]
 14434  		if !(isPPC64WordRotateMask(m)) {
 14435  			break
 14436  		}
 14437  		v.reset(OpPPC64RLWINM)
 14438  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
 14439  		v.AddArg(x)
 14440  		return true
 14441  	}
 14442  	// match: (Select0 (ANDCCconst [m] (ROTLW x r)))
 14443  	// cond: isPPC64WordRotateMask(m)
 14444  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
 14445  	for {
 14446  		if v_0.Op != OpPPC64ANDCCconst {
 14447  			break
 14448  		}
 14449  		m := auxIntToInt64(v_0.AuxInt)
 14450  		v_0_0 := v_0.Args[0]
 14451  		if v_0_0.Op != OpPPC64ROTLW {
 14452  			break
 14453  		}
 14454  		r := v_0_0.Args[1]
 14455  		x := v_0_0.Args[0]
 14456  		if !(isPPC64WordRotateMask(m)) {
 14457  			break
 14458  		}
 14459  		v.reset(OpPPC64RLWNM)
 14460  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
 14461  		v.AddArg2(x, r)
 14462  		return true
 14463  	}
 14464  	// match: (Select0 (ANDCCconst [m] (SRWconst x [s])))
 14465  	// cond: mergePPC64RShiftMask(m,s,32) == 0
 14466  	// result: (MOVDconst [0])
 14467  	for {
 14468  		if v_0.Op != OpPPC64ANDCCconst {
 14469  			break
 14470  		}
 14471  		m := auxIntToInt64(v_0.AuxInt)
 14472  		v_0_0 := v_0.Args[0]
 14473  		if v_0_0.Op != OpPPC64SRWconst {
 14474  			break
 14475  		}
 14476  		s := auxIntToInt64(v_0_0.AuxInt)
 14477  		if !(mergePPC64RShiftMask(m, s, 32) == 0) {
 14478  			break
 14479  		}
 14480  		v.reset(OpPPC64MOVDconst)
 14481  		v.AuxInt = int64ToAuxInt(0)
 14482  		return true
 14483  	}
 14484  	// match: (Select0 (ANDCCconst [m] (SRWconst x [s])))
 14485  	// cond: mergePPC64AndSrwi(m,s) != 0
 14486  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
 14487  	for {
 14488  		if v_0.Op != OpPPC64ANDCCconst {
 14489  			break
 14490  		}
 14491  		m := auxIntToInt64(v_0.AuxInt)
 14492  		v_0_0 := v_0.Args[0]
 14493  		if v_0_0.Op != OpPPC64SRWconst {
 14494  			break
 14495  		}
 14496  		s := auxIntToInt64(v_0_0.AuxInt)
 14497  		x := v_0_0.Args[0]
 14498  		if !(mergePPC64AndSrwi(m, s) != 0) {
 14499  			break
 14500  		}
 14501  		v.reset(OpPPC64RLWINM)
 14502  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
 14503  		v.AddArg(x)
 14504  		return true
 14505  	}
 14506  	// match: (Select0 (ANDCCconst [-1] x))
 14507  	// result: x
 14508  	for {
 14509  		if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != -1 {
 14510  			break
 14511  		}
 14512  		x := v_0.Args[0]
 14513  		v.copyOf(x)
 14514  		return true
 14515  	}
 14516  	// match: (Select0 (ANDCCconst [0] _))
 14517  	// result: (MOVDconst [0])
 14518  	for {
 14519  		if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14520  			break
 14521  		}
 14522  		v.reset(OpPPC64MOVDconst)
 14523  		v.AuxInt = int64ToAuxInt(0)
 14524  		return true
 14525  	}
 14526  	// match: (Select0 (ANDCCconst [c] y:(MOVBZreg _)))
 14527  	// cond: c&0xFF == 0xFF
 14528  	// result: y
 14529  	for {
 14530  		if v_0.Op != OpPPC64ANDCCconst {
 14531  			break
 14532  		}
 14533  		c := auxIntToInt64(v_0.AuxInt)
 14534  		y := v_0.Args[0]
 14535  		if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
 14536  			break
 14537  		}
 14538  		v.copyOf(y)
 14539  		return true
 14540  	}
 14541  	// match: (Select0 (ANDCCconst [0xFF] (MOVBreg x)))
 14542  	// result: (MOVBZreg x)
 14543  	for {
 14544  		if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0xFF {
 14545  			break
 14546  		}
 14547  		v_0_0 := v_0.Args[0]
 14548  		if v_0_0.Op != OpPPC64MOVBreg {
 14549  			break
 14550  		}
 14551  		x := v_0_0.Args[0]
 14552  		v.reset(OpPPC64MOVBZreg)
 14553  		v.AddArg(x)
 14554  		return true
 14555  	}
 14556  	// match: (Select0 (ANDCCconst [c] y:(MOVHZreg _)))
 14557  	// cond: c&0xFFFF == 0xFFFF
 14558  	// result: y
 14559  	for {
 14560  		if v_0.Op != OpPPC64ANDCCconst {
 14561  			break
 14562  		}
 14563  		c := auxIntToInt64(v_0.AuxInt)
 14564  		y := v_0.Args[0]
 14565  		if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
 14566  			break
 14567  		}
 14568  		v.copyOf(y)
 14569  		return true
 14570  	}
 14571  	// match: (Select0 (ANDCCconst [0xFFFF] (MOVHreg x)))
 14572  	// result: (MOVHZreg x)
 14573  	for {
 14574  		if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0xFFFF {
 14575  			break
 14576  		}
 14577  		v_0_0 := v_0.Args[0]
 14578  		if v_0_0.Op != OpPPC64MOVHreg {
 14579  			break
 14580  		}
 14581  		x := v_0_0.Args[0]
 14582  		v.reset(OpPPC64MOVHZreg)
 14583  		v.AddArg(x)
 14584  		return true
 14585  	}
 14586  	// match: (Select0 (ANDCCconst [c] (MOVBZreg x)))
 14587  	// result: (Select0 (ANDCCconst [c&0xFF] x))
 14588  	for {
 14589  		if v_0.Op != OpPPC64ANDCCconst {
 14590  			break
 14591  		}
 14592  		c := auxIntToInt64(v_0.AuxInt)
 14593  		v_0_0 := v_0.Args[0]
 14594  		if v_0_0.Op != OpPPC64MOVBZreg {
 14595  			break
 14596  		}
 14597  		x := v_0_0.Args[0]
 14598  		v.reset(OpSelect0)
 14599  		v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 14600  		v0.AuxInt = int64ToAuxInt(c & 0xFF)
 14601  		v0.AddArg(x)
 14602  		v.AddArg(v0)
 14603  		return true
 14604  	}
 14605  	// match: (Select0 (ANDCCconst [c] (MOVHZreg x)))
 14606  	// result: (Select0 (ANDCCconst [c&0xFFFF] x))
 14607  	for {
 14608  		if v_0.Op != OpPPC64ANDCCconst {
 14609  			break
 14610  		}
 14611  		c := auxIntToInt64(v_0.AuxInt)
 14612  		v_0_0 := v_0.Args[0]
 14613  		if v_0_0.Op != OpPPC64MOVHZreg {
 14614  			break
 14615  		}
 14616  		x := v_0_0.Args[0]
 14617  		v.reset(OpSelect0)
 14618  		v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 14619  		v0.AuxInt = int64ToAuxInt(c & 0xFFFF)
 14620  		v0.AddArg(x)
 14621  		v.AddArg(v0)
 14622  		return true
 14623  	}
 14624  	// match: (Select0 (ANDCCconst [c] (MOVWZreg x)))
 14625  	// result: (Select0 (ANDCCconst [c&0xFFFFFFFF] x))
 14626  	for {
 14627  		if v_0.Op != OpPPC64ANDCCconst {
 14628  			break
 14629  		}
 14630  		c := auxIntToInt64(v_0.AuxInt)
 14631  		v_0_0 := v_0.Args[0]
 14632  		if v_0_0.Op != OpPPC64MOVWZreg {
 14633  			break
 14634  		}
 14635  		x := v_0_0.Args[0]
 14636  		v.reset(OpSelect0)
 14637  		v0 := b.NewValue0(v.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 14638  		v0.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
 14639  		v0.AddArg(x)
 14640  		v.AddArg(v0)
 14641  		return true
 14642  	}
 14643  	// match: (Select0 (ANDCCconst [m] (RLWINM [r] y)))
 14644  	// cond: mergePPC64AndRlwinm(uint32(m),r) != 0
 14645  	// result: (RLWINM [mergePPC64AndRlwinm(uint32(m),r)] y)
 14646  	for {
 14647  		if v_0.Op != OpPPC64ANDCCconst {
 14648  			break
 14649  		}
 14650  		m := auxIntToInt64(v_0.AuxInt)
 14651  		v_0_0 := v_0.Args[0]
 14652  		if v_0_0.Op != OpPPC64RLWINM {
 14653  			break
 14654  		}
 14655  		r := auxIntToInt64(v_0_0.AuxInt)
 14656  		y := v_0_0.Args[0]
 14657  		if !(mergePPC64AndRlwinm(uint32(m), r) != 0) {
 14658  			break
 14659  		}
 14660  		v.reset(OpPPC64RLWINM)
 14661  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(uint32(m), r))
 14662  		v.AddArg(y)
 14663  		return true
 14664  	}
 14665  	// match: (Select0 (ANDCCconst [1] z:(SRADconst [63] x)))
 14666  	// cond: z.Uses == 1
 14667  	// result: (SRDconst [63] x)
 14668  	for {
 14669  		if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 1 {
 14670  			break
 14671  		}
 14672  		z := v_0.Args[0]
 14673  		if z.Op != OpPPC64SRADconst || auxIntToInt64(z.AuxInt) != 63 {
 14674  			break
 14675  		}
 14676  		x := z.Args[0]
 14677  		if !(z.Uses == 1) {
 14678  			break
 14679  		}
 14680  		v.reset(OpPPC64SRDconst)
 14681  		v.AuxInt = int64ToAuxInt(63)
 14682  		v.AddArg(x)
 14683  		return true
 14684  	}
 14685  	return false
 14686  }
 14687  func rewriteValuePPC64_OpSelect1(v *Value) bool {
 14688  	v_0 := v.Args[0]
 14689  	b := v.Block
 14690  	typ := &b.Func.Config.Types
 14691  	// match: (Select1 (Mul64uhilo x y))
 14692  	// result: (MULLD x y)
 14693  	for {
 14694  		if v_0.Op != OpMul64uhilo {
 14695  			break
 14696  		}
 14697  		y := v_0.Args[1]
 14698  		x := v_0.Args[0]
 14699  		v.reset(OpPPC64MULLD)
 14700  		v.AddArg2(x, y)
 14701  		return true
 14702  	}
 14703  	// match: (Select1 (Add64carry x y c))
 14704  	// result: (ADDZEzero (Select1 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1])))))
 14705  	for {
 14706  		if v_0.Op != OpAdd64carry {
 14707  			break
 14708  		}
 14709  		c := v_0.Args[2]
 14710  		x := v_0.Args[0]
 14711  		y := v_0.Args[1]
 14712  		v.reset(OpPPC64ADDZEzero)
 14713  		v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14714  		v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 14715  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14716  		v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14717  		v3.AuxInt = int64ToAuxInt(-1)
 14718  		v3.AddArg(c)
 14719  		v2.AddArg(v3)
 14720  		v1.AddArg3(x, y, v2)
 14721  		v0.AddArg(v1)
 14722  		v.AddArg(v0)
 14723  		return true
 14724  	}
 14725  	// match: (Select1 (ADDCconst n:(ADDZEzero x) [-1]))
 14726  	// cond: n.Uses <= 2
 14727  	// result: x
 14728  	for {
 14729  		if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
 14730  			break
 14731  		}
 14732  		n := v_0.Args[0]
 14733  		if n.Op != OpPPC64ADDZEzero {
 14734  			break
 14735  		}
 14736  		x := n.Args[0]
 14737  		if !(n.Uses <= 2) {
 14738  			break
 14739  		}
 14740  		v.copyOf(x)
 14741  		return true
 14742  	}
 14743  	// match: (Select1 (Sub64borrow x y c))
 14744  	// result: (NEG (SUBZEzero (Select1 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))))
 14745  	for {
 14746  		if v_0.Op != OpSub64borrow {
 14747  			break
 14748  		}
 14749  		c := v_0.Args[2]
 14750  		x := v_0.Args[0]
 14751  		y := v_0.Args[1]
 14752  		v.reset(OpPPC64NEG)
 14753  		v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
 14754  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14755  		v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 14756  		v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14757  		v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14758  		v4.AuxInt = int64ToAuxInt(0)
 14759  		v4.AddArg(c)
 14760  		v3.AddArg(v4)
 14761  		v2.AddArg3(x, y, v3)
 14762  		v1.AddArg(v2)
 14763  		v0.AddArg(v1)
 14764  		v.AddArg(v0)
 14765  		return true
 14766  	}
 14767  	// match: (Select1 (SUBCconst n:(NEG (SUBZEzero x)) [0]))
 14768  	// cond: n.Uses <= 2
 14769  	// result: x
 14770  	for {
 14771  		if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14772  			break
 14773  		}
 14774  		n := v_0.Args[0]
 14775  		if n.Op != OpPPC64NEG {
 14776  			break
 14777  		}
 14778  		n_0 := n.Args[0]
 14779  		if n_0.Op != OpPPC64SUBZEzero {
 14780  			break
 14781  		}
 14782  		x := n_0.Args[0]
 14783  		if !(n.Uses <= 2) {
 14784  			break
 14785  		}
 14786  		v.copyOf(x)
 14787  		return true
 14788  	}
 14789  	// match: (Select1 (ANDCCconst [0] _))
 14790  	// result: (FlagEQ)
 14791  	for {
 14792  		if v_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14793  			break
 14794  		}
 14795  		v.reset(OpPPC64FlagEQ)
 14796  		return true
 14797  	}
 14798  	return false
 14799  }
 14800  func rewriteValuePPC64_OpSelectN(v *Value) bool {
 14801  	v_0 := v.Args[0]
 14802  	b := v.Block
 14803  	config := b.Func.Config
 14804  	// match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
 14805  	// 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)
 14806  	// result: (Move [sz] dst src mem)
 14807  	for {
 14808  		if auxIntToInt64(v.AuxInt) != 0 {
 14809  			break
 14810  		}
 14811  		call := v_0
 14812  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
 14813  			break
 14814  		}
 14815  		sym := auxToCall(call.Aux)
 14816  		s1 := call.Args[0]
 14817  		if s1.Op != OpPPC64MOVDstore {
 14818  			break
 14819  		}
 14820  		_ = s1.Args[2]
 14821  		s1_1 := s1.Args[1]
 14822  		if s1_1.Op != OpPPC64MOVDconst {
 14823  			break
 14824  		}
 14825  		sz := auxIntToInt64(s1_1.AuxInt)
 14826  		s2 := s1.Args[2]
 14827  		if s2.Op != OpPPC64MOVDstore {
 14828  			break
 14829  		}
 14830  		_ = s2.Args[2]
 14831  		src := s2.Args[1]
 14832  		s3 := s2.Args[2]
 14833  		if s3.Op != OpPPC64MOVDstore {
 14834  			break
 14835  		}
 14836  		mem := s3.Args[2]
 14837  		dst := s3.Args[1]
 14838  		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)) {
 14839  			break
 14840  		}
 14841  		v.reset(OpMove)
 14842  		v.AuxInt = int64ToAuxInt(sz)
 14843  		v.AddArg3(dst, src, mem)
 14844  		return true
 14845  	}
 14846  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
 14847  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 14848  	// result: (Move [sz] dst src mem)
 14849  	for {
 14850  		if auxIntToInt64(v.AuxInt) != 0 {
 14851  			break
 14852  		}
 14853  		call := v_0
 14854  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
 14855  			break
 14856  		}
 14857  		sym := auxToCall(call.Aux)
 14858  		mem := call.Args[3]
 14859  		dst := call.Args[0]
 14860  		src := call.Args[1]
 14861  		call_2 := call.Args[2]
 14862  		if call_2.Op != OpPPC64MOVDconst {
 14863  			break
 14864  		}
 14865  		sz := auxIntToInt64(call_2.AuxInt)
 14866  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 14867  			break
 14868  		}
 14869  		v.reset(OpMove)
 14870  		v.AuxInt = int64ToAuxInt(sz)
 14871  		v.AddArg3(dst, src, mem)
 14872  		return true
 14873  	}
 14874  	return false
 14875  }
 14876  func rewriteValuePPC64_OpSlicemask(v *Value) bool {
 14877  	v_0 := v.Args[0]
 14878  	b := v.Block
 14879  	// match: (Slicemask <t> x)
 14880  	// result: (SRADconst (NEG <t> x) [63])
 14881  	for {
 14882  		t := v.Type
 14883  		x := v_0
 14884  		v.reset(OpPPC64SRADconst)
 14885  		v.AuxInt = int64ToAuxInt(63)
 14886  		v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
 14887  		v0.AddArg(x)
 14888  		v.AddArg(v0)
 14889  		return true
 14890  	}
 14891  }
 14892  func rewriteValuePPC64_OpStore(v *Value) bool {
 14893  	v_2 := v.Args[2]
 14894  	v_1 := v.Args[1]
 14895  	v_0 := v.Args[0]
 14896  	// match: (Store {t} ptr val mem)
 14897  	// cond: t.Size() == 8 && t.IsFloat()
 14898  	// result: (FMOVDstore ptr val mem)
 14899  	for {
 14900  		t := auxToType(v.Aux)
 14901  		ptr := v_0
 14902  		val := v_1
 14903  		mem := v_2
 14904  		if !(t.Size() == 8 && t.IsFloat()) {
 14905  			break
 14906  		}
 14907  		v.reset(OpPPC64FMOVDstore)
 14908  		v.AddArg3(ptr, val, mem)
 14909  		return true
 14910  	}
 14911  	// match: (Store {t} ptr val mem)
 14912  	// cond: t.Size() == 4 && t.IsFloat()
 14913  	// result: (FMOVSstore ptr val mem)
 14914  	for {
 14915  		t := auxToType(v.Aux)
 14916  		ptr := v_0
 14917  		val := v_1
 14918  		mem := v_2
 14919  		if !(t.Size() == 4 && t.IsFloat()) {
 14920  			break
 14921  		}
 14922  		v.reset(OpPPC64FMOVSstore)
 14923  		v.AddArg3(ptr, val, mem)
 14924  		return true
 14925  	}
 14926  	// match: (Store {t} ptr val mem)
 14927  	// cond: t.Size() == 8 && !t.IsFloat()
 14928  	// result: (MOVDstore ptr val mem)
 14929  	for {
 14930  		t := auxToType(v.Aux)
 14931  		ptr := v_0
 14932  		val := v_1
 14933  		mem := v_2
 14934  		if !(t.Size() == 8 && !t.IsFloat()) {
 14935  			break
 14936  		}
 14937  		v.reset(OpPPC64MOVDstore)
 14938  		v.AddArg3(ptr, val, mem)
 14939  		return true
 14940  	}
 14941  	// match: (Store {t} ptr val mem)
 14942  	// cond: t.Size() == 4 && !t.IsFloat()
 14943  	// result: (MOVWstore ptr val mem)
 14944  	for {
 14945  		t := auxToType(v.Aux)
 14946  		ptr := v_0
 14947  		val := v_1
 14948  		mem := v_2
 14949  		if !(t.Size() == 4 && !t.IsFloat()) {
 14950  			break
 14951  		}
 14952  		v.reset(OpPPC64MOVWstore)
 14953  		v.AddArg3(ptr, val, mem)
 14954  		return true
 14955  	}
 14956  	// match: (Store {t} ptr val mem)
 14957  	// cond: t.Size() == 2
 14958  	// result: (MOVHstore ptr val mem)
 14959  	for {
 14960  		t := auxToType(v.Aux)
 14961  		ptr := v_0
 14962  		val := v_1
 14963  		mem := v_2
 14964  		if !(t.Size() == 2) {
 14965  			break
 14966  		}
 14967  		v.reset(OpPPC64MOVHstore)
 14968  		v.AddArg3(ptr, val, mem)
 14969  		return true
 14970  	}
 14971  	// match: (Store {t} ptr val mem)
 14972  	// cond: t.Size() == 1
 14973  	// result: (MOVBstore ptr val mem)
 14974  	for {
 14975  		t := auxToType(v.Aux)
 14976  		ptr := v_0
 14977  		val := v_1
 14978  		mem := v_2
 14979  		if !(t.Size() == 1) {
 14980  			break
 14981  		}
 14982  		v.reset(OpPPC64MOVBstore)
 14983  		v.AddArg3(ptr, val, mem)
 14984  		return true
 14985  	}
 14986  	return false
 14987  }
 14988  func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
 14989  	v_0 := v.Args[0]
 14990  	// match: (Trunc16to8 <t> x)
 14991  	// cond: t.IsSigned()
 14992  	// result: (MOVBreg x)
 14993  	for {
 14994  		t := v.Type
 14995  		x := v_0
 14996  		if !(t.IsSigned()) {
 14997  			break
 14998  		}
 14999  		v.reset(OpPPC64MOVBreg)
 15000  		v.AddArg(x)
 15001  		return true
 15002  	}
 15003  	// match: (Trunc16to8 x)
 15004  	// result: (MOVBZreg x)
 15005  	for {
 15006  		x := v_0
 15007  		v.reset(OpPPC64MOVBZreg)
 15008  		v.AddArg(x)
 15009  		return true
 15010  	}
 15011  }
 15012  func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
 15013  	v_0 := v.Args[0]
 15014  	// match: (Trunc32to16 <t> x)
 15015  	// cond: t.IsSigned()
 15016  	// result: (MOVHreg x)
 15017  	for {
 15018  		t := v.Type
 15019  		x := v_0
 15020  		if !(t.IsSigned()) {
 15021  			break
 15022  		}
 15023  		v.reset(OpPPC64MOVHreg)
 15024  		v.AddArg(x)
 15025  		return true
 15026  	}
 15027  	// match: (Trunc32to16 x)
 15028  	// result: (MOVHZreg x)
 15029  	for {
 15030  		x := v_0
 15031  		v.reset(OpPPC64MOVHZreg)
 15032  		v.AddArg(x)
 15033  		return true
 15034  	}
 15035  }
 15036  func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
 15037  	v_0 := v.Args[0]
 15038  	// match: (Trunc32to8 <t> x)
 15039  	// cond: t.IsSigned()
 15040  	// result: (MOVBreg x)
 15041  	for {
 15042  		t := v.Type
 15043  		x := v_0
 15044  		if !(t.IsSigned()) {
 15045  			break
 15046  		}
 15047  		v.reset(OpPPC64MOVBreg)
 15048  		v.AddArg(x)
 15049  		return true
 15050  	}
 15051  	// match: (Trunc32to8 x)
 15052  	// result: (MOVBZreg x)
 15053  	for {
 15054  		x := v_0
 15055  		v.reset(OpPPC64MOVBZreg)
 15056  		v.AddArg(x)
 15057  		return true
 15058  	}
 15059  }
 15060  func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
 15061  	v_0 := v.Args[0]
 15062  	// match: (Trunc64to16 <t> x)
 15063  	// cond: t.IsSigned()
 15064  	// result: (MOVHreg x)
 15065  	for {
 15066  		t := v.Type
 15067  		x := v_0
 15068  		if !(t.IsSigned()) {
 15069  			break
 15070  		}
 15071  		v.reset(OpPPC64MOVHreg)
 15072  		v.AddArg(x)
 15073  		return true
 15074  	}
 15075  	// match: (Trunc64to16 x)
 15076  	// result: (MOVHZreg x)
 15077  	for {
 15078  		x := v_0
 15079  		v.reset(OpPPC64MOVHZreg)
 15080  		v.AddArg(x)
 15081  		return true
 15082  	}
 15083  }
 15084  func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
 15085  	v_0 := v.Args[0]
 15086  	// match: (Trunc64to32 <t> x)
 15087  	// cond: t.IsSigned()
 15088  	// result: (MOVWreg x)
 15089  	for {
 15090  		t := v.Type
 15091  		x := v_0
 15092  		if !(t.IsSigned()) {
 15093  			break
 15094  		}
 15095  		v.reset(OpPPC64MOVWreg)
 15096  		v.AddArg(x)
 15097  		return true
 15098  	}
 15099  	// match: (Trunc64to32 x)
 15100  	// result: (MOVWZreg x)
 15101  	for {
 15102  		x := v_0
 15103  		v.reset(OpPPC64MOVWZreg)
 15104  		v.AddArg(x)
 15105  		return true
 15106  	}
 15107  }
 15108  func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
 15109  	v_0 := v.Args[0]
 15110  	// match: (Trunc64to8 <t> x)
 15111  	// cond: t.IsSigned()
 15112  	// result: (MOVBreg x)
 15113  	for {
 15114  		t := v.Type
 15115  		x := v_0
 15116  		if !(t.IsSigned()) {
 15117  			break
 15118  		}
 15119  		v.reset(OpPPC64MOVBreg)
 15120  		v.AddArg(x)
 15121  		return true
 15122  	}
 15123  	// match: (Trunc64to8 x)
 15124  	// result: (MOVBZreg x)
 15125  	for {
 15126  		x := v_0
 15127  		v.reset(OpPPC64MOVBZreg)
 15128  		v.AddArg(x)
 15129  		return true
 15130  	}
 15131  }
 15132  func rewriteValuePPC64_OpZero(v *Value) bool {
 15133  	v_1 := v.Args[1]
 15134  	v_0 := v.Args[0]
 15135  	b := v.Block
 15136  	// match: (Zero [0] _ mem)
 15137  	// result: mem
 15138  	for {
 15139  		if auxIntToInt64(v.AuxInt) != 0 {
 15140  			break
 15141  		}
 15142  		mem := v_1
 15143  		v.copyOf(mem)
 15144  		return true
 15145  	}
 15146  	// match: (Zero [1] destptr mem)
 15147  	// result: (MOVBstorezero destptr mem)
 15148  	for {
 15149  		if auxIntToInt64(v.AuxInt) != 1 {
 15150  			break
 15151  		}
 15152  		destptr := v_0
 15153  		mem := v_1
 15154  		v.reset(OpPPC64MOVBstorezero)
 15155  		v.AddArg2(destptr, mem)
 15156  		return true
 15157  	}
 15158  	// match: (Zero [2] destptr mem)
 15159  	// result: (MOVHstorezero destptr mem)
 15160  	for {
 15161  		if auxIntToInt64(v.AuxInt) != 2 {
 15162  			break
 15163  		}
 15164  		destptr := v_0
 15165  		mem := v_1
 15166  		v.reset(OpPPC64MOVHstorezero)
 15167  		v.AddArg2(destptr, mem)
 15168  		return true
 15169  	}
 15170  	// match: (Zero [3] destptr mem)
 15171  	// result: (MOVBstorezero [2] destptr (MOVHstorezero destptr mem))
 15172  	for {
 15173  		if auxIntToInt64(v.AuxInt) != 3 {
 15174  			break
 15175  		}
 15176  		destptr := v_0
 15177  		mem := v_1
 15178  		v.reset(OpPPC64MOVBstorezero)
 15179  		v.AuxInt = int32ToAuxInt(2)
 15180  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15181  		v0.AddArg2(destptr, mem)
 15182  		v.AddArg2(destptr, v0)
 15183  		return true
 15184  	}
 15185  	// match: (Zero [4] destptr mem)
 15186  	// result: (MOVWstorezero destptr mem)
 15187  	for {
 15188  		if auxIntToInt64(v.AuxInt) != 4 {
 15189  			break
 15190  		}
 15191  		destptr := v_0
 15192  		mem := v_1
 15193  		v.reset(OpPPC64MOVWstorezero)
 15194  		v.AddArg2(destptr, mem)
 15195  		return true
 15196  	}
 15197  	// match: (Zero [5] destptr mem)
 15198  	// result: (MOVBstorezero [4] destptr (MOVWstorezero destptr mem))
 15199  	for {
 15200  		if auxIntToInt64(v.AuxInt) != 5 {
 15201  			break
 15202  		}
 15203  		destptr := v_0
 15204  		mem := v_1
 15205  		v.reset(OpPPC64MOVBstorezero)
 15206  		v.AuxInt = int32ToAuxInt(4)
 15207  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15208  		v0.AddArg2(destptr, mem)
 15209  		v.AddArg2(destptr, v0)
 15210  		return true
 15211  	}
 15212  	// match: (Zero [6] destptr mem)
 15213  	// result: (MOVHstorezero [4] destptr (MOVWstorezero destptr mem))
 15214  	for {
 15215  		if auxIntToInt64(v.AuxInt) != 6 {
 15216  			break
 15217  		}
 15218  		destptr := v_0
 15219  		mem := v_1
 15220  		v.reset(OpPPC64MOVHstorezero)
 15221  		v.AuxInt = int32ToAuxInt(4)
 15222  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15223  		v0.AddArg2(destptr, mem)
 15224  		v.AddArg2(destptr, v0)
 15225  		return true
 15226  	}
 15227  	// match: (Zero [7] destptr mem)
 15228  	// result: (MOVBstorezero [6] destptr (MOVHstorezero [4] destptr (MOVWstorezero destptr mem)))
 15229  	for {
 15230  		if auxIntToInt64(v.AuxInt) != 7 {
 15231  			break
 15232  		}
 15233  		destptr := v_0
 15234  		mem := v_1
 15235  		v.reset(OpPPC64MOVBstorezero)
 15236  		v.AuxInt = int32ToAuxInt(6)
 15237  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15238  		v0.AuxInt = int32ToAuxInt(4)
 15239  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15240  		v1.AddArg2(destptr, mem)
 15241  		v0.AddArg2(destptr, v1)
 15242  		v.AddArg2(destptr, v0)
 15243  		return true
 15244  	}
 15245  	// match: (Zero [8] {t} destptr mem)
 15246  	// result: (MOVDstorezero destptr mem)
 15247  	for {
 15248  		if auxIntToInt64(v.AuxInt) != 8 {
 15249  			break
 15250  		}
 15251  		destptr := v_0
 15252  		mem := v_1
 15253  		v.reset(OpPPC64MOVDstorezero)
 15254  		v.AddArg2(destptr, mem)
 15255  		return true
 15256  	}
 15257  	// match: (Zero [12] {t} destptr mem)
 15258  	// result: (MOVWstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15259  	for {
 15260  		if auxIntToInt64(v.AuxInt) != 12 {
 15261  			break
 15262  		}
 15263  		destptr := v_0
 15264  		mem := v_1
 15265  		v.reset(OpPPC64MOVWstorezero)
 15266  		v.AuxInt = int32ToAuxInt(8)
 15267  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15268  		v0.AuxInt = int32ToAuxInt(0)
 15269  		v0.AddArg2(destptr, mem)
 15270  		v.AddArg2(destptr, v0)
 15271  		return true
 15272  	}
 15273  	// match: (Zero [16] {t} destptr mem)
 15274  	// result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15275  	for {
 15276  		if auxIntToInt64(v.AuxInt) != 16 {
 15277  			break
 15278  		}
 15279  		destptr := v_0
 15280  		mem := v_1
 15281  		v.reset(OpPPC64MOVDstorezero)
 15282  		v.AuxInt = int32ToAuxInt(8)
 15283  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15284  		v0.AuxInt = int32ToAuxInt(0)
 15285  		v0.AddArg2(destptr, mem)
 15286  		v.AddArg2(destptr, v0)
 15287  		return true
 15288  	}
 15289  	// match: (Zero [24] {t} destptr mem)
 15290  	// result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))
 15291  	for {
 15292  		if auxIntToInt64(v.AuxInt) != 24 {
 15293  			break
 15294  		}
 15295  		destptr := v_0
 15296  		mem := v_1
 15297  		v.reset(OpPPC64MOVDstorezero)
 15298  		v.AuxInt = int32ToAuxInt(16)
 15299  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15300  		v0.AuxInt = int32ToAuxInt(8)
 15301  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15302  		v1.AuxInt = int32ToAuxInt(0)
 15303  		v1.AddArg2(destptr, mem)
 15304  		v0.AddArg2(destptr, v1)
 15305  		v.AddArg2(destptr, v0)
 15306  		return true
 15307  	}
 15308  	// match: (Zero [32] {t} destptr mem)
 15309  	// result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))))
 15310  	for {
 15311  		if auxIntToInt64(v.AuxInt) != 32 {
 15312  			break
 15313  		}
 15314  		destptr := v_0
 15315  		mem := v_1
 15316  		v.reset(OpPPC64MOVDstorezero)
 15317  		v.AuxInt = int32ToAuxInt(24)
 15318  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15319  		v0.AuxInt = int32ToAuxInt(16)
 15320  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15321  		v1.AuxInt = int32ToAuxInt(8)
 15322  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15323  		v2.AuxInt = int32ToAuxInt(0)
 15324  		v2.AddArg2(destptr, mem)
 15325  		v1.AddArg2(destptr, v2)
 15326  		v0.AddArg2(destptr, v1)
 15327  		v.AddArg2(destptr, v0)
 15328  		return true
 15329  	}
 15330  	// match: (Zero [s] ptr mem)
 15331  	// cond: buildcfg.GOPPC64 <= 8 && s < 64
 15332  	// result: (LoweredZeroShort [s] ptr mem)
 15333  	for {
 15334  		s := auxIntToInt64(v.AuxInt)
 15335  		ptr := v_0
 15336  		mem := v_1
 15337  		if !(buildcfg.GOPPC64 <= 8 && s < 64) {
 15338  			break
 15339  		}
 15340  		v.reset(OpPPC64LoweredZeroShort)
 15341  		v.AuxInt = int64ToAuxInt(s)
 15342  		v.AddArg2(ptr, mem)
 15343  		return true
 15344  	}
 15345  	// match: (Zero [s] ptr mem)
 15346  	// cond: buildcfg.GOPPC64 <= 8
 15347  	// result: (LoweredZero [s] ptr mem)
 15348  	for {
 15349  		s := auxIntToInt64(v.AuxInt)
 15350  		ptr := v_0
 15351  		mem := v_1
 15352  		if !(buildcfg.GOPPC64 <= 8) {
 15353  			break
 15354  		}
 15355  		v.reset(OpPPC64LoweredZero)
 15356  		v.AuxInt = int64ToAuxInt(s)
 15357  		v.AddArg2(ptr, mem)
 15358  		return true
 15359  	}
 15360  	// match: (Zero [s] ptr mem)
 15361  	// cond: s < 128 && buildcfg.GOPPC64 >= 9
 15362  	// result: (LoweredQuadZeroShort [s] ptr mem)
 15363  	for {
 15364  		s := auxIntToInt64(v.AuxInt)
 15365  		ptr := v_0
 15366  		mem := v_1
 15367  		if !(s < 128 && buildcfg.GOPPC64 >= 9) {
 15368  			break
 15369  		}
 15370  		v.reset(OpPPC64LoweredQuadZeroShort)
 15371  		v.AuxInt = int64ToAuxInt(s)
 15372  		v.AddArg2(ptr, mem)
 15373  		return true
 15374  	}
 15375  	// match: (Zero [s] ptr mem)
 15376  	// cond: buildcfg.GOPPC64 >= 9
 15377  	// result: (LoweredQuadZero [s] ptr mem)
 15378  	for {
 15379  		s := auxIntToInt64(v.AuxInt)
 15380  		ptr := v_0
 15381  		mem := v_1
 15382  		if !(buildcfg.GOPPC64 >= 9) {
 15383  			break
 15384  		}
 15385  		v.reset(OpPPC64LoweredQuadZero)
 15386  		v.AuxInt = int64ToAuxInt(s)
 15387  		v.AddArg2(ptr, mem)
 15388  		return true
 15389  	}
 15390  	return false
 15391  }
 15392  func rewriteBlockPPC64(b *Block) bool {
 15393  	typ := &b.Func.Config.Types
 15394  	switch b.Kind {
 15395  	case BlockPPC64EQ:
 15396  		// match: (EQ (FlagEQ) yes no)
 15397  		// result: (First yes no)
 15398  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15399  			b.Reset(BlockFirst)
 15400  			return true
 15401  		}
 15402  		// match: (EQ (FlagLT) yes no)
 15403  		// result: (First no yes)
 15404  		for b.Controls[0].Op == OpPPC64FlagLT {
 15405  			b.Reset(BlockFirst)
 15406  			b.swapSuccessors()
 15407  			return true
 15408  		}
 15409  		// match: (EQ (FlagGT) yes no)
 15410  		// result: (First no yes)
 15411  		for b.Controls[0].Op == OpPPC64FlagGT {
 15412  			b.Reset(BlockFirst)
 15413  			b.swapSuccessors()
 15414  			return true
 15415  		}
 15416  		// match: (EQ (InvertFlags cmp) yes no)
 15417  		// result: (EQ cmp yes no)
 15418  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15419  			v_0 := b.Controls[0]
 15420  			cmp := v_0.Args[0]
 15421  			b.resetWithControl(BlockPPC64EQ, cmp)
 15422  			return true
 15423  		}
 15424  		// match: (EQ (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 15425  		// result: (EQ (Select1 <types.TypeFlags> z) yes no)
 15426  		for b.Controls[0].Op == OpPPC64CMPconst {
 15427  			v_0 := b.Controls[0]
 15428  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15429  				break
 15430  			}
 15431  			v_0_0 := v_0.Args[0]
 15432  			if v_0_0.Op != OpSelect0 {
 15433  				break
 15434  			}
 15435  			z := v_0_0.Args[0]
 15436  			if z.Op != OpPPC64ANDCCconst {
 15437  				break
 15438  			}
 15439  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15440  			v0.AddArg(z)
 15441  			b.resetWithControl(BlockPPC64EQ, v0)
 15442  			return true
 15443  		}
 15444  		// match: (EQ (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 15445  		// result: (EQ (Select1 <types.TypeFlags> z) yes no)
 15446  		for b.Controls[0].Op == OpPPC64CMPWconst {
 15447  			v_0 := b.Controls[0]
 15448  			if auxIntToInt32(v_0.AuxInt) != 0 {
 15449  				break
 15450  			}
 15451  			v_0_0 := v_0.Args[0]
 15452  			if v_0_0.Op != OpSelect0 {
 15453  				break
 15454  			}
 15455  			z := v_0_0.Args[0]
 15456  			if z.Op != OpPPC64ANDCCconst {
 15457  				break
 15458  			}
 15459  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15460  			v0.AddArg(z)
 15461  			b.resetWithControl(BlockPPC64EQ, v0)
 15462  			return true
 15463  		}
 15464  		// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
 15465  		// cond: z.Uses == 1
 15466  		// result: (EQ (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15467  		for b.Controls[0].Op == OpPPC64CMPconst {
 15468  			v_0 := b.Controls[0]
 15469  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15470  				break
 15471  			}
 15472  			z := v_0.Args[0]
 15473  			if z.Op != OpPPC64AND {
 15474  				break
 15475  			}
 15476  			_ = z.Args[1]
 15477  			z_0 := z.Args[0]
 15478  			z_1 := z.Args[1]
 15479  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15480  				x := z_0
 15481  				y := z_1
 15482  				if !(z.Uses == 1) {
 15483  					continue
 15484  				}
 15485  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15486  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15487  				v1.AddArg2(x, y)
 15488  				v0.AddArg(v1)
 15489  				b.resetWithControl(BlockPPC64EQ, v0)
 15490  				return true
 15491  			}
 15492  			break
 15493  		}
 15494  		// match: (EQ (CMPconst [0] z:(OR x y)) yes no)
 15495  		// cond: z.Uses == 1
 15496  		// result: (EQ (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15497  		for b.Controls[0].Op == OpPPC64CMPconst {
 15498  			v_0 := b.Controls[0]
 15499  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15500  				break
 15501  			}
 15502  			z := v_0.Args[0]
 15503  			if z.Op != OpPPC64OR {
 15504  				break
 15505  			}
 15506  			_ = z.Args[1]
 15507  			z_0 := z.Args[0]
 15508  			z_1 := z.Args[1]
 15509  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15510  				x := z_0
 15511  				y := z_1
 15512  				if !(z.Uses == 1) {
 15513  					continue
 15514  				}
 15515  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15516  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15517  				v1.AddArg2(x, y)
 15518  				v0.AddArg(v1)
 15519  				b.resetWithControl(BlockPPC64EQ, v0)
 15520  				return true
 15521  			}
 15522  			break
 15523  		}
 15524  		// match: (EQ (CMPconst [0] z:(XOR x y)) yes no)
 15525  		// cond: z.Uses == 1
 15526  		// result: (EQ (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15527  		for b.Controls[0].Op == OpPPC64CMPconst {
 15528  			v_0 := b.Controls[0]
 15529  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15530  				break
 15531  			}
 15532  			z := v_0.Args[0]
 15533  			if z.Op != OpPPC64XOR {
 15534  				break
 15535  			}
 15536  			_ = z.Args[1]
 15537  			z_0 := z.Args[0]
 15538  			z_1 := z.Args[1]
 15539  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15540  				x := z_0
 15541  				y := z_1
 15542  				if !(z.Uses == 1) {
 15543  					continue
 15544  				}
 15545  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15546  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15547  				v1.AddArg2(x, y)
 15548  				v0.AddArg(v1)
 15549  				b.resetWithControl(BlockPPC64EQ, v0)
 15550  				return true
 15551  			}
 15552  			break
 15553  		}
 15554  	case BlockPPC64GE:
 15555  		// match: (GE (FlagEQ) yes no)
 15556  		// result: (First yes no)
 15557  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15558  			b.Reset(BlockFirst)
 15559  			return true
 15560  		}
 15561  		// match: (GE (FlagLT) yes no)
 15562  		// result: (First no yes)
 15563  		for b.Controls[0].Op == OpPPC64FlagLT {
 15564  			b.Reset(BlockFirst)
 15565  			b.swapSuccessors()
 15566  			return true
 15567  		}
 15568  		// match: (GE (FlagGT) yes no)
 15569  		// result: (First yes no)
 15570  		for b.Controls[0].Op == OpPPC64FlagGT {
 15571  			b.Reset(BlockFirst)
 15572  			return true
 15573  		}
 15574  		// match: (GE (InvertFlags cmp) yes no)
 15575  		// result: (LE cmp yes no)
 15576  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15577  			v_0 := b.Controls[0]
 15578  			cmp := v_0.Args[0]
 15579  			b.resetWithControl(BlockPPC64LE, cmp)
 15580  			return true
 15581  		}
 15582  		// match: (GE (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 15583  		// result: (GE (Select1 <types.TypeFlags> z) yes no)
 15584  		for b.Controls[0].Op == OpPPC64CMPconst {
 15585  			v_0 := b.Controls[0]
 15586  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15587  				break
 15588  			}
 15589  			v_0_0 := v_0.Args[0]
 15590  			if v_0_0.Op != OpSelect0 {
 15591  				break
 15592  			}
 15593  			z := v_0_0.Args[0]
 15594  			if z.Op != OpPPC64ANDCCconst {
 15595  				break
 15596  			}
 15597  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15598  			v0.AddArg(z)
 15599  			b.resetWithControl(BlockPPC64GE, v0)
 15600  			return true
 15601  		}
 15602  		// match: (GE (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 15603  		// result: (GE (Select1 <types.TypeFlags> z) yes no)
 15604  		for b.Controls[0].Op == OpPPC64CMPWconst {
 15605  			v_0 := b.Controls[0]
 15606  			if auxIntToInt32(v_0.AuxInt) != 0 {
 15607  				break
 15608  			}
 15609  			v_0_0 := v_0.Args[0]
 15610  			if v_0_0.Op != OpSelect0 {
 15611  				break
 15612  			}
 15613  			z := v_0_0.Args[0]
 15614  			if z.Op != OpPPC64ANDCCconst {
 15615  				break
 15616  			}
 15617  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15618  			v0.AddArg(z)
 15619  			b.resetWithControl(BlockPPC64GE, v0)
 15620  			return true
 15621  		}
 15622  		// match: (GE (CMPconst [0] z:(AND x y)) yes no)
 15623  		// cond: z.Uses == 1
 15624  		// result: (GE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15625  		for b.Controls[0].Op == OpPPC64CMPconst {
 15626  			v_0 := b.Controls[0]
 15627  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15628  				break
 15629  			}
 15630  			z := v_0.Args[0]
 15631  			if z.Op != OpPPC64AND {
 15632  				break
 15633  			}
 15634  			_ = z.Args[1]
 15635  			z_0 := z.Args[0]
 15636  			z_1 := z.Args[1]
 15637  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15638  				x := z_0
 15639  				y := z_1
 15640  				if !(z.Uses == 1) {
 15641  					continue
 15642  				}
 15643  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15644  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15645  				v1.AddArg2(x, y)
 15646  				v0.AddArg(v1)
 15647  				b.resetWithControl(BlockPPC64GE, v0)
 15648  				return true
 15649  			}
 15650  			break
 15651  		}
 15652  		// match: (GE (CMPconst [0] z:(OR x y)) yes no)
 15653  		// cond: z.Uses == 1
 15654  		// result: (GE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15655  		for b.Controls[0].Op == OpPPC64CMPconst {
 15656  			v_0 := b.Controls[0]
 15657  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15658  				break
 15659  			}
 15660  			z := v_0.Args[0]
 15661  			if z.Op != OpPPC64OR {
 15662  				break
 15663  			}
 15664  			_ = z.Args[1]
 15665  			z_0 := z.Args[0]
 15666  			z_1 := z.Args[1]
 15667  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15668  				x := z_0
 15669  				y := z_1
 15670  				if !(z.Uses == 1) {
 15671  					continue
 15672  				}
 15673  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15674  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15675  				v1.AddArg2(x, y)
 15676  				v0.AddArg(v1)
 15677  				b.resetWithControl(BlockPPC64GE, v0)
 15678  				return true
 15679  			}
 15680  			break
 15681  		}
 15682  		// match: (GE (CMPconst [0] z:(XOR x y)) yes no)
 15683  		// cond: z.Uses == 1
 15684  		// result: (GE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15685  		for b.Controls[0].Op == OpPPC64CMPconst {
 15686  			v_0 := b.Controls[0]
 15687  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15688  				break
 15689  			}
 15690  			z := v_0.Args[0]
 15691  			if z.Op != OpPPC64XOR {
 15692  				break
 15693  			}
 15694  			_ = z.Args[1]
 15695  			z_0 := z.Args[0]
 15696  			z_1 := z.Args[1]
 15697  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15698  				x := z_0
 15699  				y := z_1
 15700  				if !(z.Uses == 1) {
 15701  					continue
 15702  				}
 15703  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15704  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15705  				v1.AddArg2(x, y)
 15706  				v0.AddArg(v1)
 15707  				b.resetWithControl(BlockPPC64GE, v0)
 15708  				return true
 15709  			}
 15710  			break
 15711  		}
 15712  	case BlockPPC64GT:
 15713  		// match: (GT (FlagEQ) yes no)
 15714  		// result: (First no yes)
 15715  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15716  			b.Reset(BlockFirst)
 15717  			b.swapSuccessors()
 15718  			return true
 15719  		}
 15720  		// match: (GT (FlagLT) yes no)
 15721  		// result: (First no yes)
 15722  		for b.Controls[0].Op == OpPPC64FlagLT {
 15723  			b.Reset(BlockFirst)
 15724  			b.swapSuccessors()
 15725  			return true
 15726  		}
 15727  		// match: (GT (FlagGT) yes no)
 15728  		// result: (First yes no)
 15729  		for b.Controls[0].Op == OpPPC64FlagGT {
 15730  			b.Reset(BlockFirst)
 15731  			return true
 15732  		}
 15733  		// match: (GT (InvertFlags cmp) yes no)
 15734  		// result: (LT cmp yes no)
 15735  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15736  			v_0 := b.Controls[0]
 15737  			cmp := v_0.Args[0]
 15738  			b.resetWithControl(BlockPPC64LT, cmp)
 15739  			return true
 15740  		}
 15741  		// match: (GT (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 15742  		// result: (GT (Select1 <types.TypeFlags> z) yes no)
 15743  		for b.Controls[0].Op == OpPPC64CMPconst {
 15744  			v_0 := b.Controls[0]
 15745  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15746  				break
 15747  			}
 15748  			v_0_0 := v_0.Args[0]
 15749  			if v_0_0.Op != OpSelect0 {
 15750  				break
 15751  			}
 15752  			z := v_0_0.Args[0]
 15753  			if z.Op != OpPPC64ANDCCconst {
 15754  				break
 15755  			}
 15756  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15757  			v0.AddArg(z)
 15758  			b.resetWithControl(BlockPPC64GT, v0)
 15759  			return true
 15760  		}
 15761  		// match: (GT (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 15762  		// result: (GT (Select1 <types.TypeFlags> z) yes no)
 15763  		for b.Controls[0].Op == OpPPC64CMPWconst {
 15764  			v_0 := b.Controls[0]
 15765  			if auxIntToInt32(v_0.AuxInt) != 0 {
 15766  				break
 15767  			}
 15768  			v_0_0 := v_0.Args[0]
 15769  			if v_0_0.Op != OpSelect0 {
 15770  				break
 15771  			}
 15772  			z := v_0_0.Args[0]
 15773  			if z.Op != OpPPC64ANDCCconst {
 15774  				break
 15775  			}
 15776  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15777  			v0.AddArg(z)
 15778  			b.resetWithControl(BlockPPC64GT, v0)
 15779  			return true
 15780  		}
 15781  		// match: (GT (CMPconst [0] z:(AND x y)) yes no)
 15782  		// cond: z.Uses == 1
 15783  		// result: (GT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15784  		for b.Controls[0].Op == OpPPC64CMPconst {
 15785  			v_0 := b.Controls[0]
 15786  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15787  				break
 15788  			}
 15789  			z := v_0.Args[0]
 15790  			if z.Op != OpPPC64AND {
 15791  				break
 15792  			}
 15793  			_ = z.Args[1]
 15794  			z_0 := z.Args[0]
 15795  			z_1 := z.Args[1]
 15796  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15797  				x := z_0
 15798  				y := z_1
 15799  				if !(z.Uses == 1) {
 15800  					continue
 15801  				}
 15802  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15803  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15804  				v1.AddArg2(x, y)
 15805  				v0.AddArg(v1)
 15806  				b.resetWithControl(BlockPPC64GT, v0)
 15807  				return true
 15808  			}
 15809  			break
 15810  		}
 15811  		// match: (GT (CMPconst [0] z:(OR x y)) yes no)
 15812  		// cond: z.Uses == 1
 15813  		// result: (GT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15814  		for b.Controls[0].Op == OpPPC64CMPconst {
 15815  			v_0 := b.Controls[0]
 15816  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15817  				break
 15818  			}
 15819  			z := v_0.Args[0]
 15820  			if z.Op != OpPPC64OR {
 15821  				break
 15822  			}
 15823  			_ = z.Args[1]
 15824  			z_0 := z.Args[0]
 15825  			z_1 := z.Args[1]
 15826  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15827  				x := z_0
 15828  				y := z_1
 15829  				if !(z.Uses == 1) {
 15830  					continue
 15831  				}
 15832  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15833  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15834  				v1.AddArg2(x, y)
 15835  				v0.AddArg(v1)
 15836  				b.resetWithControl(BlockPPC64GT, v0)
 15837  				return true
 15838  			}
 15839  			break
 15840  		}
 15841  		// match: (GT (CMPconst [0] z:(XOR x y)) yes no)
 15842  		// cond: z.Uses == 1
 15843  		// result: (GT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15844  		for b.Controls[0].Op == OpPPC64CMPconst {
 15845  			v_0 := b.Controls[0]
 15846  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15847  				break
 15848  			}
 15849  			z := v_0.Args[0]
 15850  			if z.Op != OpPPC64XOR {
 15851  				break
 15852  			}
 15853  			_ = z.Args[1]
 15854  			z_0 := z.Args[0]
 15855  			z_1 := z.Args[1]
 15856  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15857  				x := z_0
 15858  				y := z_1
 15859  				if !(z.Uses == 1) {
 15860  					continue
 15861  				}
 15862  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15863  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15864  				v1.AddArg2(x, y)
 15865  				v0.AddArg(v1)
 15866  				b.resetWithControl(BlockPPC64GT, v0)
 15867  				return true
 15868  			}
 15869  			break
 15870  		}
 15871  	case BlockIf:
 15872  		// match: (If (Equal cc) yes no)
 15873  		// result: (EQ cc yes no)
 15874  		for b.Controls[0].Op == OpPPC64Equal {
 15875  			v_0 := b.Controls[0]
 15876  			cc := v_0.Args[0]
 15877  			b.resetWithControl(BlockPPC64EQ, cc)
 15878  			return true
 15879  		}
 15880  		// match: (If (NotEqual cc) yes no)
 15881  		// result: (NE cc yes no)
 15882  		for b.Controls[0].Op == OpPPC64NotEqual {
 15883  			v_0 := b.Controls[0]
 15884  			cc := v_0.Args[0]
 15885  			b.resetWithControl(BlockPPC64NE, cc)
 15886  			return true
 15887  		}
 15888  		// match: (If (LessThan cc) yes no)
 15889  		// result: (LT cc yes no)
 15890  		for b.Controls[0].Op == OpPPC64LessThan {
 15891  			v_0 := b.Controls[0]
 15892  			cc := v_0.Args[0]
 15893  			b.resetWithControl(BlockPPC64LT, cc)
 15894  			return true
 15895  		}
 15896  		// match: (If (LessEqual cc) yes no)
 15897  		// result: (LE cc yes no)
 15898  		for b.Controls[0].Op == OpPPC64LessEqual {
 15899  			v_0 := b.Controls[0]
 15900  			cc := v_0.Args[0]
 15901  			b.resetWithControl(BlockPPC64LE, cc)
 15902  			return true
 15903  		}
 15904  		// match: (If (GreaterThan cc) yes no)
 15905  		// result: (GT cc yes no)
 15906  		for b.Controls[0].Op == OpPPC64GreaterThan {
 15907  			v_0 := b.Controls[0]
 15908  			cc := v_0.Args[0]
 15909  			b.resetWithControl(BlockPPC64GT, cc)
 15910  			return true
 15911  		}
 15912  		// match: (If (GreaterEqual cc) yes no)
 15913  		// result: (GE cc yes no)
 15914  		for b.Controls[0].Op == OpPPC64GreaterEqual {
 15915  			v_0 := b.Controls[0]
 15916  			cc := v_0.Args[0]
 15917  			b.resetWithControl(BlockPPC64GE, cc)
 15918  			return true
 15919  		}
 15920  		// match: (If (FLessThan cc) yes no)
 15921  		// result: (FLT cc yes no)
 15922  		for b.Controls[0].Op == OpPPC64FLessThan {
 15923  			v_0 := b.Controls[0]
 15924  			cc := v_0.Args[0]
 15925  			b.resetWithControl(BlockPPC64FLT, cc)
 15926  			return true
 15927  		}
 15928  		// match: (If (FLessEqual cc) yes no)
 15929  		// result: (FLE cc yes no)
 15930  		for b.Controls[0].Op == OpPPC64FLessEqual {
 15931  			v_0 := b.Controls[0]
 15932  			cc := v_0.Args[0]
 15933  			b.resetWithControl(BlockPPC64FLE, cc)
 15934  			return true
 15935  		}
 15936  		// match: (If (FGreaterThan cc) yes no)
 15937  		// result: (FGT cc yes no)
 15938  		for b.Controls[0].Op == OpPPC64FGreaterThan {
 15939  			v_0 := b.Controls[0]
 15940  			cc := v_0.Args[0]
 15941  			b.resetWithControl(BlockPPC64FGT, cc)
 15942  			return true
 15943  		}
 15944  		// match: (If (FGreaterEqual cc) yes no)
 15945  		// result: (FGE cc yes no)
 15946  		for b.Controls[0].Op == OpPPC64FGreaterEqual {
 15947  			v_0 := b.Controls[0]
 15948  			cc := v_0.Args[0]
 15949  			b.resetWithControl(BlockPPC64FGE, cc)
 15950  			return true
 15951  		}
 15952  		// match: (If cond yes no)
 15953  		// result: (NE (Select1 <types.TypeFlags> (ANDCCconst [1] cond)) yes no)
 15954  		for {
 15955  			cond := b.Controls[0]
 15956  			v0 := b.NewValue0(cond.Pos, OpSelect1, types.TypeFlags)
 15957  			v1 := b.NewValue0(cond.Pos, OpPPC64ANDCCconst, types.NewTuple(typ.Int, types.TypeFlags))
 15958  			v1.AuxInt = int64ToAuxInt(1)
 15959  			v1.AddArg(cond)
 15960  			v0.AddArg(v1)
 15961  			b.resetWithControl(BlockPPC64NE, v0)
 15962  			return true
 15963  		}
 15964  	case BlockPPC64LE:
 15965  		// match: (LE (FlagEQ) yes no)
 15966  		// result: (First yes no)
 15967  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15968  			b.Reset(BlockFirst)
 15969  			return true
 15970  		}
 15971  		// match: (LE (FlagLT) yes no)
 15972  		// result: (First yes no)
 15973  		for b.Controls[0].Op == OpPPC64FlagLT {
 15974  			b.Reset(BlockFirst)
 15975  			return true
 15976  		}
 15977  		// match: (LE (FlagGT) yes no)
 15978  		// result: (First no yes)
 15979  		for b.Controls[0].Op == OpPPC64FlagGT {
 15980  			b.Reset(BlockFirst)
 15981  			b.swapSuccessors()
 15982  			return true
 15983  		}
 15984  		// match: (LE (InvertFlags cmp) yes no)
 15985  		// result: (GE cmp yes no)
 15986  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15987  			v_0 := b.Controls[0]
 15988  			cmp := v_0.Args[0]
 15989  			b.resetWithControl(BlockPPC64GE, cmp)
 15990  			return true
 15991  		}
 15992  		// match: (LE (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 15993  		// result: (LE (Select1 <types.TypeFlags> z) yes no)
 15994  		for b.Controls[0].Op == OpPPC64CMPconst {
 15995  			v_0 := b.Controls[0]
 15996  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15997  				break
 15998  			}
 15999  			v_0_0 := v_0.Args[0]
 16000  			if v_0_0.Op != OpSelect0 {
 16001  				break
 16002  			}
 16003  			z := v_0_0.Args[0]
 16004  			if z.Op != OpPPC64ANDCCconst {
 16005  				break
 16006  			}
 16007  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16008  			v0.AddArg(z)
 16009  			b.resetWithControl(BlockPPC64LE, v0)
 16010  			return true
 16011  		}
 16012  		// match: (LE (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 16013  		// result: (LE (Select1 <types.TypeFlags> z) yes no)
 16014  		for b.Controls[0].Op == OpPPC64CMPWconst {
 16015  			v_0 := b.Controls[0]
 16016  			if auxIntToInt32(v_0.AuxInt) != 0 {
 16017  				break
 16018  			}
 16019  			v_0_0 := v_0.Args[0]
 16020  			if v_0_0.Op != OpSelect0 {
 16021  				break
 16022  			}
 16023  			z := v_0_0.Args[0]
 16024  			if z.Op != OpPPC64ANDCCconst {
 16025  				break
 16026  			}
 16027  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16028  			v0.AddArg(z)
 16029  			b.resetWithControl(BlockPPC64LE, v0)
 16030  			return true
 16031  		}
 16032  		// match: (LE (CMPconst [0] z:(AND x y)) yes no)
 16033  		// cond: z.Uses == 1
 16034  		// result: (LE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16035  		for b.Controls[0].Op == OpPPC64CMPconst {
 16036  			v_0 := b.Controls[0]
 16037  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16038  				break
 16039  			}
 16040  			z := v_0.Args[0]
 16041  			if z.Op != OpPPC64AND {
 16042  				break
 16043  			}
 16044  			_ = z.Args[1]
 16045  			z_0 := z.Args[0]
 16046  			z_1 := z.Args[1]
 16047  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16048  				x := z_0
 16049  				y := z_1
 16050  				if !(z.Uses == 1) {
 16051  					continue
 16052  				}
 16053  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16054  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16055  				v1.AddArg2(x, y)
 16056  				v0.AddArg(v1)
 16057  				b.resetWithControl(BlockPPC64LE, v0)
 16058  				return true
 16059  			}
 16060  			break
 16061  		}
 16062  		// match: (LE (CMPconst [0] z:(OR x y)) yes no)
 16063  		// cond: z.Uses == 1
 16064  		// result: (LE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16065  		for b.Controls[0].Op == OpPPC64CMPconst {
 16066  			v_0 := b.Controls[0]
 16067  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16068  				break
 16069  			}
 16070  			z := v_0.Args[0]
 16071  			if z.Op != OpPPC64OR {
 16072  				break
 16073  			}
 16074  			_ = z.Args[1]
 16075  			z_0 := z.Args[0]
 16076  			z_1 := z.Args[1]
 16077  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16078  				x := z_0
 16079  				y := z_1
 16080  				if !(z.Uses == 1) {
 16081  					continue
 16082  				}
 16083  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16084  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16085  				v1.AddArg2(x, y)
 16086  				v0.AddArg(v1)
 16087  				b.resetWithControl(BlockPPC64LE, v0)
 16088  				return true
 16089  			}
 16090  			break
 16091  		}
 16092  		// match: (LE (CMPconst [0] z:(XOR x y)) yes no)
 16093  		// cond: z.Uses == 1
 16094  		// result: (LE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16095  		for b.Controls[0].Op == OpPPC64CMPconst {
 16096  			v_0 := b.Controls[0]
 16097  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16098  				break
 16099  			}
 16100  			z := v_0.Args[0]
 16101  			if z.Op != OpPPC64XOR {
 16102  				break
 16103  			}
 16104  			_ = z.Args[1]
 16105  			z_0 := z.Args[0]
 16106  			z_1 := z.Args[1]
 16107  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16108  				x := z_0
 16109  				y := z_1
 16110  				if !(z.Uses == 1) {
 16111  					continue
 16112  				}
 16113  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16114  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16115  				v1.AddArg2(x, y)
 16116  				v0.AddArg(v1)
 16117  				b.resetWithControl(BlockPPC64LE, v0)
 16118  				return true
 16119  			}
 16120  			break
 16121  		}
 16122  	case BlockPPC64LT:
 16123  		// match: (LT (FlagEQ) yes no)
 16124  		// result: (First no yes)
 16125  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16126  			b.Reset(BlockFirst)
 16127  			b.swapSuccessors()
 16128  			return true
 16129  		}
 16130  		// match: (LT (FlagLT) yes no)
 16131  		// result: (First yes no)
 16132  		for b.Controls[0].Op == OpPPC64FlagLT {
 16133  			b.Reset(BlockFirst)
 16134  			return true
 16135  		}
 16136  		// match: (LT (FlagGT) yes no)
 16137  		// result: (First no yes)
 16138  		for b.Controls[0].Op == OpPPC64FlagGT {
 16139  			b.Reset(BlockFirst)
 16140  			b.swapSuccessors()
 16141  			return true
 16142  		}
 16143  		// match: (LT (InvertFlags cmp) yes no)
 16144  		// result: (GT cmp yes no)
 16145  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16146  			v_0 := b.Controls[0]
 16147  			cmp := v_0.Args[0]
 16148  			b.resetWithControl(BlockPPC64GT, cmp)
 16149  			return true
 16150  		}
 16151  		// match: (LT (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 16152  		// result: (LT (Select1 <types.TypeFlags> z) yes no)
 16153  		for b.Controls[0].Op == OpPPC64CMPconst {
 16154  			v_0 := b.Controls[0]
 16155  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16156  				break
 16157  			}
 16158  			v_0_0 := v_0.Args[0]
 16159  			if v_0_0.Op != OpSelect0 {
 16160  				break
 16161  			}
 16162  			z := v_0_0.Args[0]
 16163  			if z.Op != OpPPC64ANDCCconst {
 16164  				break
 16165  			}
 16166  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16167  			v0.AddArg(z)
 16168  			b.resetWithControl(BlockPPC64LT, v0)
 16169  			return true
 16170  		}
 16171  		// match: (LT (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 16172  		// result: (LT (Select1 <types.TypeFlags> z) yes no)
 16173  		for b.Controls[0].Op == OpPPC64CMPWconst {
 16174  			v_0 := b.Controls[0]
 16175  			if auxIntToInt32(v_0.AuxInt) != 0 {
 16176  				break
 16177  			}
 16178  			v_0_0 := v_0.Args[0]
 16179  			if v_0_0.Op != OpSelect0 {
 16180  				break
 16181  			}
 16182  			z := v_0_0.Args[0]
 16183  			if z.Op != OpPPC64ANDCCconst {
 16184  				break
 16185  			}
 16186  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16187  			v0.AddArg(z)
 16188  			b.resetWithControl(BlockPPC64LT, v0)
 16189  			return true
 16190  		}
 16191  		// match: (LT (CMPconst [0] z:(AND x y)) yes no)
 16192  		// cond: z.Uses == 1
 16193  		// result: (LT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16194  		for b.Controls[0].Op == OpPPC64CMPconst {
 16195  			v_0 := b.Controls[0]
 16196  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16197  				break
 16198  			}
 16199  			z := v_0.Args[0]
 16200  			if z.Op != OpPPC64AND {
 16201  				break
 16202  			}
 16203  			_ = z.Args[1]
 16204  			z_0 := z.Args[0]
 16205  			z_1 := z.Args[1]
 16206  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16207  				x := z_0
 16208  				y := z_1
 16209  				if !(z.Uses == 1) {
 16210  					continue
 16211  				}
 16212  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16213  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16214  				v1.AddArg2(x, y)
 16215  				v0.AddArg(v1)
 16216  				b.resetWithControl(BlockPPC64LT, v0)
 16217  				return true
 16218  			}
 16219  			break
 16220  		}
 16221  		// match: (LT (CMPconst [0] z:(OR x y)) yes no)
 16222  		// cond: z.Uses == 1
 16223  		// result: (LT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16224  		for b.Controls[0].Op == OpPPC64CMPconst {
 16225  			v_0 := b.Controls[0]
 16226  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16227  				break
 16228  			}
 16229  			z := v_0.Args[0]
 16230  			if z.Op != OpPPC64OR {
 16231  				break
 16232  			}
 16233  			_ = z.Args[1]
 16234  			z_0 := z.Args[0]
 16235  			z_1 := z.Args[1]
 16236  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16237  				x := z_0
 16238  				y := z_1
 16239  				if !(z.Uses == 1) {
 16240  					continue
 16241  				}
 16242  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16243  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16244  				v1.AddArg2(x, y)
 16245  				v0.AddArg(v1)
 16246  				b.resetWithControl(BlockPPC64LT, v0)
 16247  				return true
 16248  			}
 16249  			break
 16250  		}
 16251  		// match: (LT (CMPconst [0] z:(XOR x y)) yes no)
 16252  		// cond: z.Uses == 1
 16253  		// result: (LT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16254  		for b.Controls[0].Op == OpPPC64CMPconst {
 16255  			v_0 := b.Controls[0]
 16256  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16257  				break
 16258  			}
 16259  			z := v_0.Args[0]
 16260  			if z.Op != OpPPC64XOR {
 16261  				break
 16262  			}
 16263  			_ = z.Args[1]
 16264  			z_0 := z.Args[0]
 16265  			z_1 := z.Args[1]
 16266  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16267  				x := z_0
 16268  				y := z_1
 16269  				if !(z.Uses == 1) {
 16270  					continue
 16271  				}
 16272  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16273  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16274  				v1.AddArg2(x, y)
 16275  				v0.AddArg(v1)
 16276  				b.resetWithControl(BlockPPC64LT, v0)
 16277  				return true
 16278  			}
 16279  			break
 16280  		}
 16281  	case BlockPPC64NE:
 16282  		// match: (NE (Select1 (ANDCCconst [1] (Equal cc))) yes no)
 16283  		// result: (EQ cc yes no)
 16284  		for b.Controls[0].Op == OpSelect1 {
 16285  			v_0 := b.Controls[0]
 16286  			v_0_0 := v_0.Args[0]
 16287  			if v_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16288  				break
 16289  			}
 16290  			v_0_0_0 := v_0_0.Args[0]
 16291  			if v_0_0_0.Op != OpPPC64Equal {
 16292  				break
 16293  			}
 16294  			cc := v_0_0_0.Args[0]
 16295  			b.resetWithControl(BlockPPC64EQ, cc)
 16296  			return true
 16297  		}
 16298  		// match: (NE (Select1 (ANDCCconst [1] (NotEqual cc))) yes no)
 16299  		// result: (NE cc yes no)
 16300  		for b.Controls[0].Op == OpSelect1 {
 16301  			v_0 := b.Controls[0]
 16302  			v_0_0 := v_0.Args[0]
 16303  			if v_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16304  				break
 16305  			}
 16306  			v_0_0_0 := v_0_0.Args[0]
 16307  			if v_0_0_0.Op != OpPPC64NotEqual {
 16308  				break
 16309  			}
 16310  			cc := v_0_0_0.Args[0]
 16311  			b.resetWithControl(BlockPPC64NE, cc)
 16312  			return true
 16313  		}
 16314  		// match: (NE (Select1 (ANDCCconst [1] (LessThan cc))) yes no)
 16315  		// result: (LT cc yes no)
 16316  		for b.Controls[0].Op == OpSelect1 {
 16317  			v_0 := b.Controls[0]
 16318  			v_0_0 := v_0.Args[0]
 16319  			if v_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16320  				break
 16321  			}
 16322  			v_0_0_0 := v_0_0.Args[0]
 16323  			if v_0_0_0.Op != OpPPC64LessThan {
 16324  				break
 16325  			}
 16326  			cc := v_0_0_0.Args[0]
 16327  			b.resetWithControl(BlockPPC64LT, cc)
 16328  			return true
 16329  		}
 16330  		// match: (NE (Select1 (ANDCCconst [1] (LessEqual cc))) yes no)
 16331  		// result: (LE cc yes no)
 16332  		for b.Controls[0].Op == OpSelect1 {
 16333  			v_0 := b.Controls[0]
 16334  			v_0_0 := v_0.Args[0]
 16335  			if v_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16336  				break
 16337  			}
 16338  			v_0_0_0 := v_0_0.Args[0]
 16339  			if v_0_0_0.Op != OpPPC64LessEqual {
 16340  				break
 16341  			}
 16342  			cc := v_0_0_0.Args[0]
 16343  			b.resetWithControl(BlockPPC64LE, cc)
 16344  			return true
 16345  		}
 16346  		// match: (NE (Select1 (ANDCCconst [1] (GreaterThan cc))) yes no)
 16347  		// result: (GT cc yes no)
 16348  		for b.Controls[0].Op == OpSelect1 {
 16349  			v_0 := b.Controls[0]
 16350  			v_0_0 := v_0.Args[0]
 16351  			if v_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16352  				break
 16353  			}
 16354  			v_0_0_0 := v_0_0.Args[0]
 16355  			if v_0_0_0.Op != OpPPC64GreaterThan {
 16356  				break
 16357  			}
 16358  			cc := v_0_0_0.Args[0]
 16359  			b.resetWithControl(BlockPPC64GT, cc)
 16360  			return true
 16361  		}
 16362  		// match: (NE (Select1 (ANDCCconst [1] (GreaterEqual cc))) yes no)
 16363  		// result: (GE cc yes no)
 16364  		for b.Controls[0].Op == OpSelect1 {
 16365  			v_0 := b.Controls[0]
 16366  			v_0_0 := v_0.Args[0]
 16367  			if v_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16368  				break
 16369  			}
 16370  			v_0_0_0 := v_0_0.Args[0]
 16371  			if v_0_0_0.Op != OpPPC64GreaterEqual {
 16372  				break
 16373  			}
 16374  			cc := v_0_0_0.Args[0]
 16375  			b.resetWithControl(BlockPPC64GE, cc)
 16376  			return true
 16377  		}
 16378  		// match: (NE (Select1 (ANDCCconst [1] (FLessThan cc))) yes no)
 16379  		// result: (FLT cc yes no)
 16380  		for b.Controls[0].Op == OpSelect1 {
 16381  			v_0 := b.Controls[0]
 16382  			v_0_0 := v_0.Args[0]
 16383  			if v_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16384  				break
 16385  			}
 16386  			v_0_0_0 := v_0_0.Args[0]
 16387  			if v_0_0_0.Op != OpPPC64FLessThan {
 16388  				break
 16389  			}
 16390  			cc := v_0_0_0.Args[0]
 16391  			b.resetWithControl(BlockPPC64FLT, cc)
 16392  			return true
 16393  		}
 16394  		// match: (NE (Select1 (ANDCCconst [1] (FLessEqual cc))) yes no)
 16395  		// result: (FLE cc yes no)
 16396  		for b.Controls[0].Op == OpSelect1 {
 16397  			v_0 := b.Controls[0]
 16398  			v_0_0 := v_0.Args[0]
 16399  			if v_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16400  				break
 16401  			}
 16402  			v_0_0_0 := v_0_0.Args[0]
 16403  			if v_0_0_0.Op != OpPPC64FLessEqual {
 16404  				break
 16405  			}
 16406  			cc := v_0_0_0.Args[0]
 16407  			b.resetWithControl(BlockPPC64FLE, cc)
 16408  			return true
 16409  		}
 16410  		// match: (NE (Select1 (ANDCCconst [1] (FGreaterThan cc))) yes no)
 16411  		// result: (FGT cc yes no)
 16412  		for b.Controls[0].Op == OpSelect1 {
 16413  			v_0 := b.Controls[0]
 16414  			v_0_0 := v_0.Args[0]
 16415  			if v_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16416  				break
 16417  			}
 16418  			v_0_0_0 := v_0_0.Args[0]
 16419  			if v_0_0_0.Op != OpPPC64FGreaterThan {
 16420  				break
 16421  			}
 16422  			cc := v_0_0_0.Args[0]
 16423  			b.resetWithControl(BlockPPC64FGT, cc)
 16424  			return true
 16425  		}
 16426  		// match: (NE (Select1 (ANDCCconst [1] (FGreaterEqual cc))) yes no)
 16427  		// result: (FGE cc yes no)
 16428  		for b.Controls[0].Op == OpSelect1 {
 16429  			v_0 := b.Controls[0]
 16430  			v_0_0 := v_0.Args[0]
 16431  			if v_0_0.Op != OpPPC64ANDCCconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16432  				break
 16433  			}
 16434  			v_0_0_0 := v_0_0.Args[0]
 16435  			if v_0_0_0.Op != OpPPC64FGreaterEqual {
 16436  				break
 16437  			}
 16438  			cc := v_0_0_0.Args[0]
 16439  			b.resetWithControl(BlockPPC64FGE, cc)
 16440  			return true
 16441  		}
 16442  		// match: (NE (FlagEQ) yes no)
 16443  		// result: (First no yes)
 16444  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16445  			b.Reset(BlockFirst)
 16446  			b.swapSuccessors()
 16447  			return true
 16448  		}
 16449  		// match: (NE (FlagLT) yes no)
 16450  		// result: (First yes no)
 16451  		for b.Controls[0].Op == OpPPC64FlagLT {
 16452  			b.Reset(BlockFirst)
 16453  			return true
 16454  		}
 16455  		// match: (NE (FlagGT) yes no)
 16456  		// result: (First yes no)
 16457  		for b.Controls[0].Op == OpPPC64FlagGT {
 16458  			b.Reset(BlockFirst)
 16459  			return true
 16460  		}
 16461  		// match: (NE (InvertFlags cmp) yes no)
 16462  		// result: (NE cmp yes no)
 16463  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16464  			v_0 := b.Controls[0]
 16465  			cmp := v_0.Args[0]
 16466  			b.resetWithControl(BlockPPC64NE, cmp)
 16467  			return true
 16468  		}
 16469  		// match: (NE (CMPconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 16470  		// result: (NE (Select1 <types.TypeFlags> z) yes no)
 16471  		for b.Controls[0].Op == OpPPC64CMPconst {
 16472  			v_0 := b.Controls[0]
 16473  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16474  				break
 16475  			}
 16476  			v_0_0 := v_0.Args[0]
 16477  			if v_0_0.Op != OpSelect0 {
 16478  				break
 16479  			}
 16480  			z := v_0_0.Args[0]
 16481  			if z.Op != OpPPC64ANDCCconst {
 16482  				break
 16483  			}
 16484  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16485  			v0.AddArg(z)
 16486  			b.resetWithControl(BlockPPC64NE, v0)
 16487  			return true
 16488  		}
 16489  		// match: (NE (CMPWconst [0] (Select0 z:(ANDCCconst [c] x))) yes no)
 16490  		// result: (NE (Select1 <types.TypeFlags> z) yes no)
 16491  		for b.Controls[0].Op == OpPPC64CMPWconst {
 16492  			v_0 := b.Controls[0]
 16493  			if auxIntToInt32(v_0.AuxInt) != 0 {
 16494  				break
 16495  			}
 16496  			v_0_0 := v_0.Args[0]
 16497  			if v_0_0.Op != OpSelect0 {
 16498  				break
 16499  			}
 16500  			z := v_0_0.Args[0]
 16501  			if z.Op != OpPPC64ANDCCconst {
 16502  				break
 16503  			}
 16504  			v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16505  			v0.AddArg(z)
 16506  			b.resetWithControl(BlockPPC64NE, v0)
 16507  			return true
 16508  		}
 16509  		// match: (NE (CMPconst [0] z:(AND x y)) yes no)
 16510  		// cond: z.Uses == 1
 16511  		// result: (NE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16512  		for b.Controls[0].Op == OpPPC64CMPconst {
 16513  			v_0 := b.Controls[0]
 16514  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16515  				break
 16516  			}
 16517  			z := v_0.Args[0]
 16518  			if z.Op != OpPPC64AND {
 16519  				break
 16520  			}
 16521  			_ = z.Args[1]
 16522  			z_0 := z.Args[0]
 16523  			z_1 := z.Args[1]
 16524  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16525  				x := z_0
 16526  				y := z_1
 16527  				if !(z.Uses == 1) {
 16528  					continue
 16529  				}
 16530  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16531  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16532  				v1.AddArg2(x, y)
 16533  				v0.AddArg(v1)
 16534  				b.resetWithControl(BlockPPC64NE, v0)
 16535  				return true
 16536  			}
 16537  			break
 16538  		}
 16539  		// match: (NE (CMPconst [0] z:(OR x y)) yes no)
 16540  		// cond: z.Uses == 1
 16541  		// result: (NE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16542  		for b.Controls[0].Op == OpPPC64CMPconst {
 16543  			v_0 := b.Controls[0]
 16544  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16545  				break
 16546  			}
 16547  			z := v_0.Args[0]
 16548  			if z.Op != OpPPC64OR {
 16549  				break
 16550  			}
 16551  			_ = z.Args[1]
 16552  			z_0 := z.Args[0]
 16553  			z_1 := z.Args[1]
 16554  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16555  				x := z_0
 16556  				y := z_1
 16557  				if !(z.Uses == 1) {
 16558  					continue
 16559  				}
 16560  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16561  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16562  				v1.AddArg2(x, y)
 16563  				v0.AddArg(v1)
 16564  				b.resetWithControl(BlockPPC64NE, v0)
 16565  				return true
 16566  			}
 16567  			break
 16568  		}
 16569  		// match: (NE (CMPconst [0] z:(XOR x y)) yes no)
 16570  		// cond: z.Uses == 1
 16571  		// result: (NE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16572  		for b.Controls[0].Op == OpPPC64CMPconst {
 16573  			v_0 := b.Controls[0]
 16574  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16575  				break
 16576  			}
 16577  			z := v_0.Args[0]
 16578  			if z.Op != OpPPC64XOR {
 16579  				break
 16580  			}
 16581  			_ = z.Args[1]
 16582  			z_0 := z.Args[0]
 16583  			z_1 := z.Args[1]
 16584  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16585  				x := z_0
 16586  				y := z_1
 16587  				if !(z.Uses == 1) {
 16588  					continue
 16589  				}
 16590  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16591  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16592  				v1.AddArg2(x, y)
 16593  				v0.AddArg(v1)
 16594  				b.resetWithControl(BlockPPC64NE, v0)
 16595  				return true
 16596  			}
 16597  			break
 16598  		}
 16599  	}
 16600  	return false
 16601  }
 16602  

View as plain text