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

     1  // Code generated from _gen/PPC64.rules using 'go generate'; DO NOT EDIT.
     2  
     3  package ssa
     4  
     5  import "internal/buildcfg"
     6  import "math"
     7  import "cmd/compile/internal/types"
     8  
     9  func rewriteValuePPC64(v *Value) bool {
    10  	switch v.Op {
    11  	case OpAbs:
    12  		v.Op = OpPPC64FABS
    13  		return true
    14  	case OpAdd16:
    15  		v.Op = OpPPC64ADD
    16  		return true
    17  	case OpAdd32:
    18  		v.Op = OpPPC64ADD
    19  		return true
    20  	case OpAdd32F:
    21  		v.Op = OpPPC64FADDS
    22  		return true
    23  	case OpAdd64:
    24  		v.Op = OpPPC64ADD
    25  		return true
    26  	case OpAdd64F:
    27  		v.Op = OpPPC64FADD
    28  		return true
    29  	case OpAdd8:
    30  		v.Op = OpPPC64ADD
    31  		return true
    32  	case OpAddPtr:
    33  		v.Op = OpPPC64ADD
    34  		return true
    35  	case OpAddr:
    36  		return rewriteValuePPC64_OpAddr(v)
    37  	case OpAnd16:
    38  		v.Op = OpPPC64AND
    39  		return true
    40  	case OpAnd32:
    41  		v.Op = OpPPC64AND
    42  		return true
    43  	case OpAnd64:
    44  		v.Op = OpPPC64AND
    45  		return true
    46  	case OpAnd8:
    47  		v.Op = OpPPC64AND
    48  		return true
    49  	case OpAndB:
    50  		v.Op = OpPPC64AND
    51  		return true
    52  	case OpAtomicAdd32:
    53  		v.Op = OpPPC64LoweredAtomicAdd32
    54  		return true
    55  	case OpAtomicAdd64:
    56  		v.Op = OpPPC64LoweredAtomicAdd64
    57  		return true
    58  	case OpAtomicAnd32:
    59  		v.Op = OpPPC64LoweredAtomicAnd32
    60  		return true
    61  	case OpAtomicAnd8:
    62  		v.Op = OpPPC64LoweredAtomicAnd8
    63  		return true
    64  	case OpAtomicCompareAndSwap32:
    65  		return rewriteValuePPC64_OpAtomicCompareAndSwap32(v)
    66  	case OpAtomicCompareAndSwap64:
    67  		return rewriteValuePPC64_OpAtomicCompareAndSwap64(v)
    68  	case OpAtomicCompareAndSwapRel32:
    69  		return rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v)
    70  	case OpAtomicExchange32:
    71  		v.Op = OpPPC64LoweredAtomicExchange32
    72  		return true
    73  	case OpAtomicExchange64:
    74  		v.Op = OpPPC64LoweredAtomicExchange64
    75  		return true
    76  	case OpAtomicExchange8:
    77  		v.Op = OpPPC64LoweredAtomicExchange8
    78  		return true
    79  	case OpAtomicLoad32:
    80  		return rewriteValuePPC64_OpAtomicLoad32(v)
    81  	case OpAtomicLoad64:
    82  		return rewriteValuePPC64_OpAtomicLoad64(v)
    83  	case OpAtomicLoad8:
    84  		return rewriteValuePPC64_OpAtomicLoad8(v)
    85  	case OpAtomicLoadAcq32:
    86  		return rewriteValuePPC64_OpAtomicLoadAcq32(v)
    87  	case OpAtomicLoadAcq64:
    88  		return rewriteValuePPC64_OpAtomicLoadAcq64(v)
    89  	case OpAtomicLoadPtr:
    90  		return rewriteValuePPC64_OpAtomicLoadPtr(v)
    91  	case OpAtomicOr32:
    92  		v.Op = OpPPC64LoweredAtomicOr32
    93  		return true
    94  	case OpAtomicOr8:
    95  		v.Op = OpPPC64LoweredAtomicOr8
    96  		return true
    97  	case OpAtomicStore32:
    98  		return rewriteValuePPC64_OpAtomicStore32(v)
    99  	case OpAtomicStore64:
   100  		return rewriteValuePPC64_OpAtomicStore64(v)
   101  	case OpAtomicStore8:
   102  		return rewriteValuePPC64_OpAtomicStore8(v)
   103  	case OpAtomicStoreRel32:
   104  		return rewriteValuePPC64_OpAtomicStoreRel32(v)
   105  	case OpAtomicStoreRel64:
   106  		return rewriteValuePPC64_OpAtomicStoreRel64(v)
   107  	case OpAvg64u:
   108  		return rewriteValuePPC64_OpAvg64u(v)
   109  	case OpBitLen16:
   110  		return rewriteValuePPC64_OpBitLen16(v)
   111  	case OpBitLen32:
   112  		return rewriteValuePPC64_OpBitLen32(v)
   113  	case OpBitLen64:
   114  		return rewriteValuePPC64_OpBitLen64(v)
   115  	case OpBitLen8:
   116  		return rewriteValuePPC64_OpBitLen8(v)
   117  	case OpBswap16:
   118  		return rewriteValuePPC64_OpBswap16(v)
   119  	case OpBswap32:
   120  		return rewriteValuePPC64_OpBswap32(v)
   121  	case OpBswap64:
   122  		return rewriteValuePPC64_OpBswap64(v)
   123  	case OpCeil:
   124  		v.Op = OpPPC64FCEIL
   125  		return true
   126  	case OpClosureCall:
   127  		v.Op = OpPPC64CALLclosure
   128  		return true
   129  	case OpCom16:
   130  		return rewriteValuePPC64_OpCom16(v)
   131  	case OpCom32:
   132  		return rewriteValuePPC64_OpCom32(v)
   133  	case OpCom64:
   134  		return rewriteValuePPC64_OpCom64(v)
   135  	case OpCom8:
   136  		return rewriteValuePPC64_OpCom8(v)
   137  	case OpCondSelect:
   138  		return rewriteValuePPC64_OpCondSelect(v)
   139  	case OpConst16:
   140  		return rewriteValuePPC64_OpConst16(v)
   141  	case OpConst32:
   142  		return rewriteValuePPC64_OpConst32(v)
   143  	case OpConst32F:
   144  		v.Op = OpPPC64FMOVSconst
   145  		return true
   146  	case OpConst64:
   147  		return rewriteValuePPC64_OpConst64(v)
   148  	case OpConst64F:
   149  		v.Op = OpPPC64FMOVDconst
   150  		return true
   151  	case OpConst8:
   152  		return rewriteValuePPC64_OpConst8(v)
   153  	case OpConstBool:
   154  		return rewriteValuePPC64_OpConstBool(v)
   155  	case OpConstNil:
   156  		return rewriteValuePPC64_OpConstNil(v)
   157  	case OpCopysign:
   158  		return rewriteValuePPC64_OpCopysign(v)
   159  	case OpCtz16:
   160  		return rewriteValuePPC64_OpCtz16(v)
   161  	case OpCtz16NonZero:
   162  		v.Op = OpCtz64
   163  		return true
   164  	case OpCtz32:
   165  		return rewriteValuePPC64_OpCtz32(v)
   166  	case OpCtz32NonZero:
   167  		v.Op = OpCtz64
   168  		return true
   169  	case OpCtz64:
   170  		return rewriteValuePPC64_OpCtz64(v)
   171  	case OpCtz64NonZero:
   172  		v.Op = OpCtz64
   173  		return true
   174  	case OpCtz8:
   175  		return rewriteValuePPC64_OpCtz8(v)
   176  	case OpCtz8NonZero:
   177  		v.Op = OpCtz64
   178  		return true
   179  	case OpCvt32Fto32:
   180  		return rewriteValuePPC64_OpCvt32Fto32(v)
   181  	case OpCvt32Fto64:
   182  		return rewriteValuePPC64_OpCvt32Fto64(v)
   183  	case OpCvt32Fto64F:
   184  		v.Op = OpCopy
   185  		return true
   186  	case OpCvt32to32F:
   187  		return rewriteValuePPC64_OpCvt32to32F(v)
   188  	case OpCvt32to64F:
   189  		return rewriteValuePPC64_OpCvt32to64F(v)
   190  	case OpCvt64Fto32:
   191  		return rewriteValuePPC64_OpCvt64Fto32(v)
   192  	case OpCvt64Fto32F:
   193  		v.Op = OpPPC64FRSP
   194  		return true
   195  	case OpCvt64Fto64:
   196  		return rewriteValuePPC64_OpCvt64Fto64(v)
   197  	case OpCvt64to32F:
   198  		return rewriteValuePPC64_OpCvt64to32F(v)
   199  	case OpCvt64to64F:
   200  		return rewriteValuePPC64_OpCvt64to64F(v)
   201  	case OpCvtBoolToUint8:
   202  		v.Op = OpCopy
   203  		return true
   204  	case OpDiv16:
   205  		return rewriteValuePPC64_OpDiv16(v)
   206  	case OpDiv16u:
   207  		return rewriteValuePPC64_OpDiv16u(v)
   208  	case OpDiv32:
   209  		return rewriteValuePPC64_OpDiv32(v)
   210  	case OpDiv32F:
   211  		v.Op = OpPPC64FDIVS
   212  		return true
   213  	case OpDiv32u:
   214  		v.Op = OpPPC64DIVWU
   215  		return true
   216  	case OpDiv64:
   217  		return rewriteValuePPC64_OpDiv64(v)
   218  	case OpDiv64F:
   219  		v.Op = OpPPC64FDIV
   220  		return true
   221  	case OpDiv64u:
   222  		v.Op = OpPPC64DIVDU
   223  		return true
   224  	case OpDiv8:
   225  		return rewriteValuePPC64_OpDiv8(v)
   226  	case OpDiv8u:
   227  		return rewriteValuePPC64_OpDiv8u(v)
   228  	case OpEq16:
   229  		return rewriteValuePPC64_OpEq16(v)
   230  	case OpEq32:
   231  		return rewriteValuePPC64_OpEq32(v)
   232  	case OpEq32F:
   233  		return rewriteValuePPC64_OpEq32F(v)
   234  	case OpEq64:
   235  		return rewriteValuePPC64_OpEq64(v)
   236  	case OpEq64F:
   237  		return rewriteValuePPC64_OpEq64F(v)
   238  	case OpEq8:
   239  		return rewriteValuePPC64_OpEq8(v)
   240  	case OpEqB:
   241  		return rewriteValuePPC64_OpEqB(v)
   242  	case OpEqPtr:
   243  		return rewriteValuePPC64_OpEqPtr(v)
   244  	case OpFMA:
   245  		v.Op = OpPPC64FMADD
   246  		return true
   247  	case OpFloor:
   248  		v.Op = OpPPC64FFLOOR
   249  		return true
   250  	case OpGetCallerPC:
   251  		v.Op = OpPPC64LoweredGetCallerPC
   252  		return true
   253  	case OpGetCallerSP:
   254  		v.Op = OpPPC64LoweredGetCallerSP
   255  		return true
   256  	case OpGetClosurePtr:
   257  		v.Op = OpPPC64LoweredGetClosurePtr
   258  		return true
   259  	case OpHmul32:
   260  		v.Op = OpPPC64MULHW
   261  		return true
   262  	case OpHmul32u:
   263  		v.Op = OpPPC64MULHWU
   264  		return true
   265  	case OpHmul64:
   266  		v.Op = OpPPC64MULHD
   267  		return true
   268  	case OpHmul64u:
   269  		v.Op = OpPPC64MULHDU
   270  		return true
   271  	case OpInterCall:
   272  		v.Op = OpPPC64CALLinter
   273  		return true
   274  	case OpIsInBounds:
   275  		return rewriteValuePPC64_OpIsInBounds(v)
   276  	case OpIsNonNil:
   277  		return rewriteValuePPC64_OpIsNonNil(v)
   278  	case OpIsSliceInBounds:
   279  		return rewriteValuePPC64_OpIsSliceInBounds(v)
   280  	case OpLeq16:
   281  		return rewriteValuePPC64_OpLeq16(v)
   282  	case OpLeq16U:
   283  		return rewriteValuePPC64_OpLeq16U(v)
   284  	case OpLeq32:
   285  		return rewriteValuePPC64_OpLeq32(v)
   286  	case OpLeq32F:
   287  		return rewriteValuePPC64_OpLeq32F(v)
   288  	case OpLeq32U:
   289  		return rewriteValuePPC64_OpLeq32U(v)
   290  	case OpLeq64:
   291  		return rewriteValuePPC64_OpLeq64(v)
   292  	case OpLeq64F:
   293  		return rewriteValuePPC64_OpLeq64F(v)
   294  	case OpLeq64U:
   295  		return rewriteValuePPC64_OpLeq64U(v)
   296  	case OpLeq8:
   297  		return rewriteValuePPC64_OpLeq8(v)
   298  	case OpLeq8U:
   299  		return rewriteValuePPC64_OpLeq8U(v)
   300  	case OpLess16:
   301  		return rewriteValuePPC64_OpLess16(v)
   302  	case OpLess16U:
   303  		return rewriteValuePPC64_OpLess16U(v)
   304  	case OpLess32:
   305  		return rewriteValuePPC64_OpLess32(v)
   306  	case OpLess32F:
   307  		return rewriteValuePPC64_OpLess32F(v)
   308  	case OpLess32U:
   309  		return rewriteValuePPC64_OpLess32U(v)
   310  	case OpLess64:
   311  		return rewriteValuePPC64_OpLess64(v)
   312  	case OpLess64F:
   313  		return rewriteValuePPC64_OpLess64F(v)
   314  	case OpLess64U:
   315  		return rewriteValuePPC64_OpLess64U(v)
   316  	case OpLess8:
   317  		return rewriteValuePPC64_OpLess8(v)
   318  	case OpLess8U:
   319  		return rewriteValuePPC64_OpLess8U(v)
   320  	case OpLoad:
   321  		return rewriteValuePPC64_OpLoad(v)
   322  	case OpLocalAddr:
   323  		return rewriteValuePPC64_OpLocalAddr(v)
   324  	case OpLsh16x16:
   325  		return rewriteValuePPC64_OpLsh16x16(v)
   326  	case OpLsh16x32:
   327  		return rewriteValuePPC64_OpLsh16x32(v)
   328  	case OpLsh16x64:
   329  		return rewriteValuePPC64_OpLsh16x64(v)
   330  	case OpLsh16x8:
   331  		return rewriteValuePPC64_OpLsh16x8(v)
   332  	case OpLsh32x16:
   333  		return rewriteValuePPC64_OpLsh32x16(v)
   334  	case OpLsh32x32:
   335  		return rewriteValuePPC64_OpLsh32x32(v)
   336  	case OpLsh32x64:
   337  		return rewriteValuePPC64_OpLsh32x64(v)
   338  	case OpLsh32x8:
   339  		return rewriteValuePPC64_OpLsh32x8(v)
   340  	case OpLsh64x16:
   341  		return rewriteValuePPC64_OpLsh64x16(v)
   342  	case OpLsh64x32:
   343  		return rewriteValuePPC64_OpLsh64x32(v)
   344  	case OpLsh64x64:
   345  		return rewriteValuePPC64_OpLsh64x64(v)
   346  	case OpLsh64x8:
   347  		return rewriteValuePPC64_OpLsh64x8(v)
   348  	case OpLsh8x16:
   349  		return rewriteValuePPC64_OpLsh8x16(v)
   350  	case OpLsh8x32:
   351  		return rewriteValuePPC64_OpLsh8x32(v)
   352  	case OpLsh8x64:
   353  		return rewriteValuePPC64_OpLsh8x64(v)
   354  	case OpLsh8x8:
   355  		return rewriteValuePPC64_OpLsh8x8(v)
   356  	case OpMax32F:
   357  		return rewriteValuePPC64_OpMax32F(v)
   358  	case OpMax64F:
   359  		return rewriteValuePPC64_OpMax64F(v)
   360  	case OpMin32F:
   361  		return rewriteValuePPC64_OpMin32F(v)
   362  	case OpMin64F:
   363  		return rewriteValuePPC64_OpMin64F(v)
   364  	case OpMod16:
   365  		return rewriteValuePPC64_OpMod16(v)
   366  	case OpMod16u:
   367  		return rewriteValuePPC64_OpMod16u(v)
   368  	case OpMod32:
   369  		return rewriteValuePPC64_OpMod32(v)
   370  	case OpMod32u:
   371  		return rewriteValuePPC64_OpMod32u(v)
   372  	case OpMod64:
   373  		return rewriteValuePPC64_OpMod64(v)
   374  	case OpMod64u:
   375  		return rewriteValuePPC64_OpMod64u(v)
   376  	case OpMod8:
   377  		return rewriteValuePPC64_OpMod8(v)
   378  	case OpMod8u:
   379  		return rewriteValuePPC64_OpMod8u(v)
   380  	case OpMove:
   381  		return rewriteValuePPC64_OpMove(v)
   382  	case OpMul16:
   383  		v.Op = OpPPC64MULLW
   384  		return true
   385  	case OpMul32:
   386  		v.Op = OpPPC64MULLW
   387  		return true
   388  	case OpMul32F:
   389  		v.Op = OpPPC64FMULS
   390  		return true
   391  	case OpMul64:
   392  		v.Op = OpPPC64MULLD
   393  		return true
   394  	case OpMul64F:
   395  		v.Op = OpPPC64FMUL
   396  		return true
   397  	case OpMul8:
   398  		v.Op = OpPPC64MULLW
   399  		return true
   400  	case OpNeg16:
   401  		v.Op = OpPPC64NEG
   402  		return true
   403  	case OpNeg32:
   404  		v.Op = OpPPC64NEG
   405  		return true
   406  	case OpNeg32F:
   407  		v.Op = OpPPC64FNEG
   408  		return true
   409  	case OpNeg64:
   410  		v.Op = OpPPC64NEG
   411  		return true
   412  	case OpNeg64F:
   413  		v.Op = OpPPC64FNEG
   414  		return true
   415  	case OpNeg8:
   416  		v.Op = OpPPC64NEG
   417  		return true
   418  	case OpNeq16:
   419  		return rewriteValuePPC64_OpNeq16(v)
   420  	case OpNeq32:
   421  		return rewriteValuePPC64_OpNeq32(v)
   422  	case OpNeq32F:
   423  		return rewriteValuePPC64_OpNeq32F(v)
   424  	case OpNeq64:
   425  		return rewriteValuePPC64_OpNeq64(v)
   426  	case OpNeq64F:
   427  		return rewriteValuePPC64_OpNeq64F(v)
   428  	case OpNeq8:
   429  		return rewriteValuePPC64_OpNeq8(v)
   430  	case OpNeqB:
   431  		v.Op = OpPPC64XOR
   432  		return true
   433  	case OpNeqPtr:
   434  		return rewriteValuePPC64_OpNeqPtr(v)
   435  	case OpNilCheck:
   436  		v.Op = OpPPC64LoweredNilCheck
   437  		return true
   438  	case OpNot:
   439  		return rewriteValuePPC64_OpNot(v)
   440  	case OpOffPtr:
   441  		return rewriteValuePPC64_OpOffPtr(v)
   442  	case OpOr16:
   443  		v.Op = OpPPC64OR
   444  		return true
   445  	case OpOr32:
   446  		v.Op = OpPPC64OR
   447  		return true
   448  	case OpOr64:
   449  		v.Op = OpPPC64OR
   450  		return true
   451  	case OpOr8:
   452  		v.Op = OpPPC64OR
   453  		return true
   454  	case OpOrB:
   455  		v.Op = OpPPC64OR
   456  		return true
   457  	case OpPPC64ADD:
   458  		return rewriteValuePPC64_OpPPC64ADD(v)
   459  	case OpPPC64ADDC:
   460  		return rewriteValuePPC64_OpPPC64ADDC(v)
   461  	case OpPPC64ADDE:
   462  		return rewriteValuePPC64_OpPPC64ADDE(v)
   463  	case OpPPC64ADDconst:
   464  		return rewriteValuePPC64_OpPPC64ADDconst(v)
   465  	case OpPPC64AND:
   466  		return rewriteValuePPC64_OpPPC64AND(v)
   467  	case OpPPC64ANDN:
   468  		return rewriteValuePPC64_OpPPC64ANDN(v)
   469  	case OpPPC64ANDconst:
   470  		return rewriteValuePPC64_OpPPC64ANDconst(v)
   471  	case OpPPC64BRD:
   472  		return rewriteValuePPC64_OpPPC64BRD(v)
   473  	case OpPPC64BRH:
   474  		return rewriteValuePPC64_OpPPC64BRH(v)
   475  	case OpPPC64BRW:
   476  		return rewriteValuePPC64_OpPPC64BRW(v)
   477  	case OpPPC64CLRLSLDI:
   478  		return rewriteValuePPC64_OpPPC64CLRLSLDI(v)
   479  	case OpPPC64CMP:
   480  		return rewriteValuePPC64_OpPPC64CMP(v)
   481  	case OpPPC64CMPU:
   482  		return rewriteValuePPC64_OpPPC64CMPU(v)
   483  	case OpPPC64CMPUconst:
   484  		return rewriteValuePPC64_OpPPC64CMPUconst(v)
   485  	case OpPPC64CMPW:
   486  		return rewriteValuePPC64_OpPPC64CMPW(v)
   487  	case OpPPC64CMPWU:
   488  		return rewriteValuePPC64_OpPPC64CMPWU(v)
   489  	case OpPPC64CMPWUconst:
   490  		return rewriteValuePPC64_OpPPC64CMPWUconst(v)
   491  	case OpPPC64CMPWconst:
   492  		return rewriteValuePPC64_OpPPC64CMPWconst(v)
   493  	case OpPPC64CMPconst:
   494  		return rewriteValuePPC64_OpPPC64CMPconst(v)
   495  	case OpPPC64Equal:
   496  		return rewriteValuePPC64_OpPPC64Equal(v)
   497  	case OpPPC64FABS:
   498  		return rewriteValuePPC64_OpPPC64FABS(v)
   499  	case OpPPC64FADD:
   500  		return rewriteValuePPC64_OpPPC64FADD(v)
   501  	case OpPPC64FADDS:
   502  		return rewriteValuePPC64_OpPPC64FADDS(v)
   503  	case OpPPC64FCEIL:
   504  		return rewriteValuePPC64_OpPPC64FCEIL(v)
   505  	case OpPPC64FFLOOR:
   506  		return rewriteValuePPC64_OpPPC64FFLOOR(v)
   507  	case OpPPC64FGreaterEqual:
   508  		return rewriteValuePPC64_OpPPC64FGreaterEqual(v)
   509  	case OpPPC64FGreaterThan:
   510  		return rewriteValuePPC64_OpPPC64FGreaterThan(v)
   511  	case OpPPC64FLessEqual:
   512  		return rewriteValuePPC64_OpPPC64FLessEqual(v)
   513  	case OpPPC64FLessThan:
   514  		return rewriteValuePPC64_OpPPC64FLessThan(v)
   515  	case OpPPC64FMOVDload:
   516  		return rewriteValuePPC64_OpPPC64FMOVDload(v)
   517  	case OpPPC64FMOVDstore:
   518  		return rewriteValuePPC64_OpPPC64FMOVDstore(v)
   519  	case OpPPC64FMOVSload:
   520  		return rewriteValuePPC64_OpPPC64FMOVSload(v)
   521  	case OpPPC64FMOVSstore:
   522  		return rewriteValuePPC64_OpPPC64FMOVSstore(v)
   523  	case OpPPC64FNEG:
   524  		return rewriteValuePPC64_OpPPC64FNEG(v)
   525  	case OpPPC64FSQRT:
   526  		return rewriteValuePPC64_OpPPC64FSQRT(v)
   527  	case OpPPC64FSUB:
   528  		return rewriteValuePPC64_OpPPC64FSUB(v)
   529  	case OpPPC64FSUBS:
   530  		return rewriteValuePPC64_OpPPC64FSUBS(v)
   531  	case OpPPC64FTRUNC:
   532  		return rewriteValuePPC64_OpPPC64FTRUNC(v)
   533  	case OpPPC64GreaterEqual:
   534  		return rewriteValuePPC64_OpPPC64GreaterEqual(v)
   535  	case OpPPC64GreaterThan:
   536  		return rewriteValuePPC64_OpPPC64GreaterThan(v)
   537  	case OpPPC64ISEL:
   538  		return rewriteValuePPC64_OpPPC64ISEL(v)
   539  	case OpPPC64LessEqual:
   540  		return rewriteValuePPC64_OpPPC64LessEqual(v)
   541  	case OpPPC64LessThan:
   542  		return rewriteValuePPC64_OpPPC64LessThan(v)
   543  	case OpPPC64MFVSRD:
   544  		return rewriteValuePPC64_OpPPC64MFVSRD(v)
   545  	case OpPPC64MOVBZload:
   546  		return rewriteValuePPC64_OpPPC64MOVBZload(v)
   547  	case OpPPC64MOVBZloadidx:
   548  		return rewriteValuePPC64_OpPPC64MOVBZloadidx(v)
   549  	case OpPPC64MOVBZreg:
   550  		return rewriteValuePPC64_OpPPC64MOVBZreg(v)
   551  	case OpPPC64MOVBreg:
   552  		return rewriteValuePPC64_OpPPC64MOVBreg(v)
   553  	case OpPPC64MOVBstore:
   554  		return rewriteValuePPC64_OpPPC64MOVBstore(v)
   555  	case OpPPC64MOVBstoreidx:
   556  		return rewriteValuePPC64_OpPPC64MOVBstoreidx(v)
   557  	case OpPPC64MOVBstorezero:
   558  		return rewriteValuePPC64_OpPPC64MOVBstorezero(v)
   559  	case OpPPC64MOVDaddr:
   560  		return rewriteValuePPC64_OpPPC64MOVDaddr(v)
   561  	case OpPPC64MOVDload:
   562  		return rewriteValuePPC64_OpPPC64MOVDload(v)
   563  	case OpPPC64MOVDloadidx:
   564  		return rewriteValuePPC64_OpPPC64MOVDloadidx(v)
   565  	case OpPPC64MOVDstore:
   566  		return rewriteValuePPC64_OpPPC64MOVDstore(v)
   567  	case OpPPC64MOVDstoreidx:
   568  		return rewriteValuePPC64_OpPPC64MOVDstoreidx(v)
   569  	case OpPPC64MOVDstorezero:
   570  		return rewriteValuePPC64_OpPPC64MOVDstorezero(v)
   571  	case OpPPC64MOVHBRstore:
   572  		return rewriteValuePPC64_OpPPC64MOVHBRstore(v)
   573  	case OpPPC64MOVHZload:
   574  		return rewriteValuePPC64_OpPPC64MOVHZload(v)
   575  	case OpPPC64MOVHZloadidx:
   576  		return rewriteValuePPC64_OpPPC64MOVHZloadidx(v)
   577  	case OpPPC64MOVHZreg:
   578  		return rewriteValuePPC64_OpPPC64MOVHZreg(v)
   579  	case OpPPC64MOVHload:
   580  		return rewriteValuePPC64_OpPPC64MOVHload(v)
   581  	case OpPPC64MOVHloadidx:
   582  		return rewriteValuePPC64_OpPPC64MOVHloadidx(v)
   583  	case OpPPC64MOVHreg:
   584  		return rewriteValuePPC64_OpPPC64MOVHreg(v)
   585  	case OpPPC64MOVHstore:
   586  		return rewriteValuePPC64_OpPPC64MOVHstore(v)
   587  	case OpPPC64MOVHstoreidx:
   588  		return rewriteValuePPC64_OpPPC64MOVHstoreidx(v)
   589  	case OpPPC64MOVHstorezero:
   590  		return rewriteValuePPC64_OpPPC64MOVHstorezero(v)
   591  	case OpPPC64MOVWBRstore:
   592  		return rewriteValuePPC64_OpPPC64MOVWBRstore(v)
   593  	case OpPPC64MOVWZload:
   594  		return rewriteValuePPC64_OpPPC64MOVWZload(v)
   595  	case OpPPC64MOVWZloadidx:
   596  		return rewriteValuePPC64_OpPPC64MOVWZloadidx(v)
   597  	case OpPPC64MOVWZreg:
   598  		return rewriteValuePPC64_OpPPC64MOVWZreg(v)
   599  	case OpPPC64MOVWload:
   600  		return rewriteValuePPC64_OpPPC64MOVWload(v)
   601  	case OpPPC64MOVWloadidx:
   602  		return rewriteValuePPC64_OpPPC64MOVWloadidx(v)
   603  	case OpPPC64MOVWreg:
   604  		return rewriteValuePPC64_OpPPC64MOVWreg(v)
   605  	case OpPPC64MOVWstore:
   606  		return rewriteValuePPC64_OpPPC64MOVWstore(v)
   607  	case OpPPC64MOVWstoreidx:
   608  		return rewriteValuePPC64_OpPPC64MOVWstoreidx(v)
   609  	case OpPPC64MOVWstorezero:
   610  		return rewriteValuePPC64_OpPPC64MOVWstorezero(v)
   611  	case OpPPC64MTVSRD:
   612  		return rewriteValuePPC64_OpPPC64MTVSRD(v)
   613  	case OpPPC64MULLD:
   614  		return rewriteValuePPC64_OpPPC64MULLD(v)
   615  	case OpPPC64MULLW:
   616  		return rewriteValuePPC64_OpPPC64MULLW(v)
   617  	case OpPPC64NEG:
   618  		return rewriteValuePPC64_OpPPC64NEG(v)
   619  	case OpPPC64NOR:
   620  		return rewriteValuePPC64_OpPPC64NOR(v)
   621  	case OpPPC64NotEqual:
   622  		return rewriteValuePPC64_OpPPC64NotEqual(v)
   623  	case OpPPC64OR:
   624  		return rewriteValuePPC64_OpPPC64OR(v)
   625  	case OpPPC64ORN:
   626  		return rewriteValuePPC64_OpPPC64ORN(v)
   627  	case OpPPC64ORconst:
   628  		return rewriteValuePPC64_OpPPC64ORconst(v)
   629  	case OpPPC64RLWINM:
   630  		return rewriteValuePPC64_OpPPC64RLWINM(v)
   631  	case OpPPC64ROTL:
   632  		return rewriteValuePPC64_OpPPC64ROTL(v)
   633  	case OpPPC64ROTLW:
   634  		return rewriteValuePPC64_OpPPC64ROTLW(v)
   635  	case OpPPC64ROTLWconst:
   636  		return rewriteValuePPC64_OpPPC64ROTLWconst(v)
   637  	case OpPPC64SETBC:
   638  		return rewriteValuePPC64_OpPPC64SETBC(v)
   639  	case OpPPC64SETBCR:
   640  		return rewriteValuePPC64_OpPPC64SETBCR(v)
   641  	case OpPPC64SLD:
   642  		return rewriteValuePPC64_OpPPC64SLD(v)
   643  	case OpPPC64SLDconst:
   644  		return rewriteValuePPC64_OpPPC64SLDconst(v)
   645  	case OpPPC64SLW:
   646  		return rewriteValuePPC64_OpPPC64SLW(v)
   647  	case OpPPC64SLWconst:
   648  		return rewriteValuePPC64_OpPPC64SLWconst(v)
   649  	case OpPPC64SRAD:
   650  		return rewriteValuePPC64_OpPPC64SRAD(v)
   651  	case OpPPC64SRAW:
   652  		return rewriteValuePPC64_OpPPC64SRAW(v)
   653  	case OpPPC64SRD:
   654  		return rewriteValuePPC64_OpPPC64SRD(v)
   655  	case OpPPC64SRW:
   656  		return rewriteValuePPC64_OpPPC64SRW(v)
   657  	case OpPPC64SRWconst:
   658  		return rewriteValuePPC64_OpPPC64SRWconst(v)
   659  	case OpPPC64SUB:
   660  		return rewriteValuePPC64_OpPPC64SUB(v)
   661  	case OpPPC64SUBE:
   662  		return rewriteValuePPC64_OpPPC64SUBE(v)
   663  	case OpPPC64SUBFCconst:
   664  		return rewriteValuePPC64_OpPPC64SUBFCconst(v)
   665  	case OpPPC64XOR:
   666  		return rewriteValuePPC64_OpPPC64XOR(v)
   667  	case OpPPC64XORconst:
   668  		return rewriteValuePPC64_OpPPC64XORconst(v)
   669  	case OpPanicBounds:
   670  		return rewriteValuePPC64_OpPanicBounds(v)
   671  	case OpPopCount16:
   672  		return rewriteValuePPC64_OpPopCount16(v)
   673  	case OpPopCount32:
   674  		return rewriteValuePPC64_OpPopCount32(v)
   675  	case OpPopCount64:
   676  		v.Op = OpPPC64POPCNTD
   677  		return true
   678  	case OpPopCount8:
   679  		return rewriteValuePPC64_OpPopCount8(v)
   680  	case OpPrefetchCache:
   681  		return rewriteValuePPC64_OpPrefetchCache(v)
   682  	case OpPrefetchCacheStreamed:
   683  		return rewriteValuePPC64_OpPrefetchCacheStreamed(v)
   684  	case OpPubBarrier:
   685  		v.Op = OpPPC64LoweredPubBarrier
   686  		return true
   687  	case OpRotateLeft16:
   688  		return rewriteValuePPC64_OpRotateLeft16(v)
   689  	case OpRotateLeft32:
   690  		v.Op = OpPPC64ROTLW
   691  		return true
   692  	case OpRotateLeft64:
   693  		v.Op = OpPPC64ROTL
   694  		return true
   695  	case OpRotateLeft8:
   696  		return rewriteValuePPC64_OpRotateLeft8(v)
   697  	case OpRound:
   698  		v.Op = OpPPC64FROUND
   699  		return true
   700  	case OpRound32F:
   701  		v.Op = OpPPC64LoweredRound32F
   702  		return true
   703  	case OpRound64F:
   704  		v.Op = OpPPC64LoweredRound64F
   705  		return true
   706  	case OpRsh16Ux16:
   707  		return rewriteValuePPC64_OpRsh16Ux16(v)
   708  	case OpRsh16Ux32:
   709  		return rewriteValuePPC64_OpRsh16Ux32(v)
   710  	case OpRsh16Ux64:
   711  		return rewriteValuePPC64_OpRsh16Ux64(v)
   712  	case OpRsh16Ux8:
   713  		return rewriteValuePPC64_OpRsh16Ux8(v)
   714  	case OpRsh16x16:
   715  		return rewriteValuePPC64_OpRsh16x16(v)
   716  	case OpRsh16x32:
   717  		return rewriteValuePPC64_OpRsh16x32(v)
   718  	case OpRsh16x64:
   719  		return rewriteValuePPC64_OpRsh16x64(v)
   720  	case OpRsh16x8:
   721  		return rewriteValuePPC64_OpRsh16x8(v)
   722  	case OpRsh32Ux16:
   723  		return rewriteValuePPC64_OpRsh32Ux16(v)
   724  	case OpRsh32Ux32:
   725  		return rewriteValuePPC64_OpRsh32Ux32(v)
   726  	case OpRsh32Ux64:
   727  		return rewriteValuePPC64_OpRsh32Ux64(v)
   728  	case OpRsh32Ux8:
   729  		return rewriteValuePPC64_OpRsh32Ux8(v)
   730  	case OpRsh32x16:
   731  		return rewriteValuePPC64_OpRsh32x16(v)
   732  	case OpRsh32x32:
   733  		return rewriteValuePPC64_OpRsh32x32(v)
   734  	case OpRsh32x64:
   735  		return rewriteValuePPC64_OpRsh32x64(v)
   736  	case OpRsh32x8:
   737  		return rewriteValuePPC64_OpRsh32x8(v)
   738  	case OpRsh64Ux16:
   739  		return rewriteValuePPC64_OpRsh64Ux16(v)
   740  	case OpRsh64Ux32:
   741  		return rewriteValuePPC64_OpRsh64Ux32(v)
   742  	case OpRsh64Ux64:
   743  		return rewriteValuePPC64_OpRsh64Ux64(v)
   744  	case OpRsh64Ux8:
   745  		return rewriteValuePPC64_OpRsh64Ux8(v)
   746  	case OpRsh64x16:
   747  		return rewriteValuePPC64_OpRsh64x16(v)
   748  	case OpRsh64x32:
   749  		return rewriteValuePPC64_OpRsh64x32(v)
   750  	case OpRsh64x64:
   751  		return rewriteValuePPC64_OpRsh64x64(v)
   752  	case OpRsh64x8:
   753  		return rewriteValuePPC64_OpRsh64x8(v)
   754  	case OpRsh8Ux16:
   755  		return rewriteValuePPC64_OpRsh8Ux16(v)
   756  	case OpRsh8Ux32:
   757  		return rewriteValuePPC64_OpRsh8Ux32(v)
   758  	case OpRsh8Ux64:
   759  		return rewriteValuePPC64_OpRsh8Ux64(v)
   760  	case OpRsh8Ux8:
   761  		return rewriteValuePPC64_OpRsh8Ux8(v)
   762  	case OpRsh8x16:
   763  		return rewriteValuePPC64_OpRsh8x16(v)
   764  	case OpRsh8x32:
   765  		return rewriteValuePPC64_OpRsh8x32(v)
   766  	case OpRsh8x64:
   767  		return rewriteValuePPC64_OpRsh8x64(v)
   768  	case OpRsh8x8:
   769  		return rewriteValuePPC64_OpRsh8x8(v)
   770  	case OpSelect0:
   771  		return rewriteValuePPC64_OpSelect0(v)
   772  	case OpSelect1:
   773  		return rewriteValuePPC64_OpSelect1(v)
   774  	case OpSelectN:
   775  		return rewriteValuePPC64_OpSelectN(v)
   776  	case OpSignExt16to32:
   777  		v.Op = OpPPC64MOVHreg
   778  		return true
   779  	case OpSignExt16to64:
   780  		v.Op = OpPPC64MOVHreg
   781  		return true
   782  	case OpSignExt32to64:
   783  		v.Op = OpPPC64MOVWreg
   784  		return true
   785  	case OpSignExt8to16:
   786  		v.Op = OpPPC64MOVBreg
   787  		return true
   788  	case OpSignExt8to32:
   789  		v.Op = OpPPC64MOVBreg
   790  		return true
   791  	case OpSignExt8to64:
   792  		v.Op = OpPPC64MOVBreg
   793  		return true
   794  	case OpSlicemask:
   795  		return rewriteValuePPC64_OpSlicemask(v)
   796  	case OpSqrt:
   797  		v.Op = OpPPC64FSQRT
   798  		return true
   799  	case OpSqrt32:
   800  		v.Op = OpPPC64FSQRTS
   801  		return true
   802  	case OpStaticCall:
   803  		v.Op = OpPPC64CALLstatic
   804  		return true
   805  	case OpStore:
   806  		return rewriteValuePPC64_OpStore(v)
   807  	case OpSub16:
   808  		v.Op = OpPPC64SUB
   809  		return true
   810  	case OpSub32:
   811  		v.Op = OpPPC64SUB
   812  		return true
   813  	case OpSub32F:
   814  		v.Op = OpPPC64FSUBS
   815  		return true
   816  	case OpSub64:
   817  		v.Op = OpPPC64SUB
   818  		return true
   819  	case OpSub64F:
   820  		v.Op = OpPPC64FSUB
   821  		return true
   822  	case OpSub8:
   823  		v.Op = OpPPC64SUB
   824  		return true
   825  	case OpSubPtr:
   826  		v.Op = OpPPC64SUB
   827  		return true
   828  	case OpTailCall:
   829  		v.Op = OpPPC64CALLtail
   830  		return true
   831  	case OpTrunc:
   832  		v.Op = OpPPC64FTRUNC
   833  		return true
   834  	case OpTrunc16to8:
   835  		return rewriteValuePPC64_OpTrunc16to8(v)
   836  	case OpTrunc32to16:
   837  		return rewriteValuePPC64_OpTrunc32to16(v)
   838  	case OpTrunc32to8:
   839  		return rewriteValuePPC64_OpTrunc32to8(v)
   840  	case OpTrunc64to16:
   841  		return rewriteValuePPC64_OpTrunc64to16(v)
   842  	case OpTrunc64to32:
   843  		return rewriteValuePPC64_OpTrunc64to32(v)
   844  	case OpTrunc64to8:
   845  		return rewriteValuePPC64_OpTrunc64to8(v)
   846  	case OpWB:
   847  		v.Op = OpPPC64LoweredWB
   848  		return true
   849  	case OpXor16:
   850  		v.Op = OpPPC64XOR
   851  		return true
   852  	case OpXor32:
   853  		v.Op = OpPPC64XOR
   854  		return true
   855  	case OpXor64:
   856  		v.Op = OpPPC64XOR
   857  		return true
   858  	case OpXor8:
   859  		v.Op = OpPPC64XOR
   860  		return true
   861  	case OpZero:
   862  		return rewriteValuePPC64_OpZero(v)
   863  	case OpZeroExt16to32:
   864  		v.Op = OpPPC64MOVHZreg
   865  		return true
   866  	case OpZeroExt16to64:
   867  		v.Op = OpPPC64MOVHZreg
   868  		return true
   869  	case OpZeroExt32to64:
   870  		v.Op = OpPPC64MOVWZreg
   871  		return true
   872  	case OpZeroExt8to16:
   873  		v.Op = OpPPC64MOVBZreg
   874  		return true
   875  	case OpZeroExt8to32:
   876  		v.Op = OpPPC64MOVBZreg
   877  		return true
   878  	case OpZeroExt8to64:
   879  		v.Op = OpPPC64MOVBZreg
   880  		return true
   881  	}
   882  	return false
   883  }
   884  func rewriteValuePPC64_OpAddr(v *Value) bool {
   885  	v_0 := v.Args[0]
   886  	// match: (Addr {sym} base)
   887  	// result: (MOVDaddr {sym} [0] base)
   888  	for {
   889  		sym := auxToSym(v.Aux)
   890  		base := v_0
   891  		v.reset(OpPPC64MOVDaddr)
   892  		v.AuxInt = int32ToAuxInt(0)
   893  		v.Aux = symToAux(sym)
   894  		v.AddArg(base)
   895  		return true
   896  	}
   897  }
   898  func rewriteValuePPC64_OpAtomicCompareAndSwap32(v *Value) bool {
   899  	v_3 := v.Args[3]
   900  	v_2 := v.Args[2]
   901  	v_1 := v.Args[1]
   902  	v_0 := v.Args[0]
   903  	// match: (AtomicCompareAndSwap32 ptr old new_ mem)
   904  	// result: (LoweredAtomicCas32 [1] ptr old new_ mem)
   905  	for {
   906  		ptr := v_0
   907  		old := v_1
   908  		new_ := v_2
   909  		mem := v_3
   910  		v.reset(OpPPC64LoweredAtomicCas32)
   911  		v.AuxInt = int64ToAuxInt(1)
   912  		v.AddArg4(ptr, old, new_, mem)
   913  		return true
   914  	}
   915  }
   916  func rewriteValuePPC64_OpAtomicCompareAndSwap64(v *Value) bool {
   917  	v_3 := v.Args[3]
   918  	v_2 := v.Args[2]
   919  	v_1 := v.Args[1]
   920  	v_0 := v.Args[0]
   921  	// match: (AtomicCompareAndSwap64 ptr old new_ mem)
   922  	// result: (LoweredAtomicCas64 [1] ptr old new_ mem)
   923  	for {
   924  		ptr := v_0
   925  		old := v_1
   926  		new_ := v_2
   927  		mem := v_3
   928  		v.reset(OpPPC64LoweredAtomicCas64)
   929  		v.AuxInt = int64ToAuxInt(1)
   930  		v.AddArg4(ptr, old, new_, mem)
   931  		return true
   932  	}
   933  }
   934  func rewriteValuePPC64_OpAtomicCompareAndSwapRel32(v *Value) bool {
   935  	v_3 := v.Args[3]
   936  	v_2 := v.Args[2]
   937  	v_1 := v.Args[1]
   938  	v_0 := v.Args[0]
   939  	// match: (AtomicCompareAndSwapRel32 ptr old new_ mem)
   940  	// result: (LoweredAtomicCas32 [0] ptr old new_ mem)
   941  	for {
   942  		ptr := v_0
   943  		old := v_1
   944  		new_ := v_2
   945  		mem := v_3
   946  		v.reset(OpPPC64LoweredAtomicCas32)
   947  		v.AuxInt = int64ToAuxInt(0)
   948  		v.AddArg4(ptr, old, new_, mem)
   949  		return true
   950  	}
   951  }
   952  func rewriteValuePPC64_OpAtomicLoad32(v *Value) bool {
   953  	v_1 := v.Args[1]
   954  	v_0 := v.Args[0]
   955  	// match: (AtomicLoad32 ptr mem)
   956  	// result: (LoweredAtomicLoad32 [1] ptr mem)
   957  	for {
   958  		ptr := v_0
   959  		mem := v_1
   960  		v.reset(OpPPC64LoweredAtomicLoad32)
   961  		v.AuxInt = int64ToAuxInt(1)
   962  		v.AddArg2(ptr, mem)
   963  		return true
   964  	}
   965  }
   966  func rewriteValuePPC64_OpAtomicLoad64(v *Value) bool {
   967  	v_1 := v.Args[1]
   968  	v_0 := v.Args[0]
   969  	// match: (AtomicLoad64 ptr mem)
   970  	// result: (LoweredAtomicLoad64 [1] ptr mem)
   971  	for {
   972  		ptr := v_0
   973  		mem := v_1
   974  		v.reset(OpPPC64LoweredAtomicLoad64)
   975  		v.AuxInt = int64ToAuxInt(1)
   976  		v.AddArg2(ptr, mem)
   977  		return true
   978  	}
   979  }
   980  func rewriteValuePPC64_OpAtomicLoad8(v *Value) bool {
   981  	v_1 := v.Args[1]
   982  	v_0 := v.Args[0]
   983  	// match: (AtomicLoad8 ptr mem)
   984  	// result: (LoweredAtomicLoad8 [1] ptr mem)
   985  	for {
   986  		ptr := v_0
   987  		mem := v_1
   988  		v.reset(OpPPC64LoweredAtomicLoad8)
   989  		v.AuxInt = int64ToAuxInt(1)
   990  		v.AddArg2(ptr, mem)
   991  		return true
   992  	}
   993  }
   994  func rewriteValuePPC64_OpAtomicLoadAcq32(v *Value) bool {
   995  	v_1 := v.Args[1]
   996  	v_0 := v.Args[0]
   997  	// match: (AtomicLoadAcq32 ptr mem)
   998  	// result: (LoweredAtomicLoad32 [0] ptr mem)
   999  	for {
  1000  		ptr := v_0
  1001  		mem := v_1
  1002  		v.reset(OpPPC64LoweredAtomicLoad32)
  1003  		v.AuxInt = int64ToAuxInt(0)
  1004  		v.AddArg2(ptr, mem)
  1005  		return true
  1006  	}
  1007  }
  1008  func rewriteValuePPC64_OpAtomicLoadAcq64(v *Value) bool {
  1009  	v_1 := v.Args[1]
  1010  	v_0 := v.Args[0]
  1011  	// match: (AtomicLoadAcq64 ptr mem)
  1012  	// result: (LoweredAtomicLoad64 [0] ptr mem)
  1013  	for {
  1014  		ptr := v_0
  1015  		mem := v_1
  1016  		v.reset(OpPPC64LoweredAtomicLoad64)
  1017  		v.AuxInt = int64ToAuxInt(0)
  1018  		v.AddArg2(ptr, mem)
  1019  		return true
  1020  	}
  1021  }
  1022  func rewriteValuePPC64_OpAtomicLoadPtr(v *Value) bool {
  1023  	v_1 := v.Args[1]
  1024  	v_0 := v.Args[0]
  1025  	// match: (AtomicLoadPtr ptr mem)
  1026  	// result: (LoweredAtomicLoadPtr [1] ptr mem)
  1027  	for {
  1028  		ptr := v_0
  1029  		mem := v_1
  1030  		v.reset(OpPPC64LoweredAtomicLoadPtr)
  1031  		v.AuxInt = int64ToAuxInt(1)
  1032  		v.AddArg2(ptr, mem)
  1033  		return true
  1034  	}
  1035  }
  1036  func rewriteValuePPC64_OpAtomicStore32(v *Value) bool {
  1037  	v_2 := v.Args[2]
  1038  	v_1 := v.Args[1]
  1039  	v_0 := v.Args[0]
  1040  	// match: (AtomicStore32 ptr val mem)
  1041  	// result: (LoweredAtomicStore32 [1] ptr val mem)
  1042  	for {
  1043  		ptr := v_0
  1044  		val := v_1
  1045  		mem := v_2
  1046  		v.reset(OpPPC64LoweredAtomicStore32)
  1047  		v.AuxInt = int64ToAuxInt(1)
  1048  		v.AddArg3(ptr, val, mem)
  1049  		return true
  1050  	}
  1051  }
  1052  func rewriteValuePPC64_OpAtomicStore64(v *Value) bool {
  1053  	v_2 := v.Args[2]
  1054  	v_1 := v.Args[1]
  1055  	v_0 := v.Args[0]
  1056  	// match: (AtomicStore64 ptr val mem)
  1057  	// result: (LoweredAtomicStore64 [1] ptr val mem)
  1058  	for {
  1059  		ptr := v_0
  1060  		val := v_1
  1061  		mem := v_2
  1062  		v.reset(OpPPC64LoweredAtomicStore64)
  1063  		v.AuxInt = int64ToAuxInt(1)
  1064  		v.AddArg3(ptr, val, mem)
  1065  		return true
  1066  	}
  1067  }
  1068  func rewriteValuePPC64_OpAtomicStore8(v *Value) bool {
  1069  	v_2 := v.Args[2]
  1070  	v_1 := v.Args[1]
  1071  	v_0 := v.Args[0]
  1072  	// match: (AtomicStore8 ptr val mem)
  1073  	// result: (LoweredAtomicStore8 [1] ptr val mem)
  1074  	for {
  1075  		ptr := v_0
  1076  		val := v_1
  1077  		mem := v_2
  1078  		v.reset(OpPPC64LoweredAtomicStore8)
  1079  		v.AuxInt = int64ToAuxInt(1)
  1080  		v.AddArg3(ptr, val, mem)
  1081  		return true
  1082  	}
  1083  }
  1084  func rewriteValuePPC64_OpAtomicStoreRel32(v *Value) bool {
  1085  	v_2 := v.Args[2]
  1086  	v_1 := v.Args[1]
  1087  	v_0 := v.Args[0]
  1088  	// match: (AtomicStoreRel32 ptr val mem)
  1089  	// result: (LoweredAtomicStore32 [0] ptr val mem)
  1090  	for {
  1091  		ptr := v_0
  1092  		val := v_1
  1093  		mem := v_2
  1094  		v.reset(OpPPC64LoweredAtomicStore32)
  1095  		v.AuxInt = int64ToAuxInt(0)
  1096  		v.AddArg3(ptr, val, mem)
  1097  		return true
  1098  	}
  1099  }
  1100  func rewriteValuePPC64_OpAtomicStoreRel64(v *Value) bool {
  1101  	v_2 := v.Args[2]
  1102  	v_1 := v.Args[1]
  1103  	v_0 := v.Args[0]
  1104  	// match: (AtomicStoreRel64 ptr val mem)
  1105  	// result: (LoweredAtomicStore64 [0] ptr val mem)
  1106  	for {
  1107  		ptr := v_0
  1108  		val := v_1
  1109  		mem := v_2
  1110  		v.reset(OpPPC64LoweredAtomicStore64)
  1111  		v.AuxInt = int64ToAuxInt(0)
  1112  		v.AddArg3(ptr, val, mem)
  1113  		return true
  1114  	}
  1115  }
  1116  func rewriteValuePPC64_OpAvg64u(v *Value) bool {
  1117  	v_1 := v.Args[1]
  1118  	v_0 := v.Args[0]
  1119  	b := v.Block
  1120  	// match: (Avg64u <t> x y)
  1121  	// result: (ADD (SRDconst <t> (SUB <t> x y) [1]) y)
  1122  	for {
  1123  		t := v.Type
  1124  		x := v_0
  1125  		y := v_1
  1126  		v.reset(OpPPC64ADD)
  1127  		v0 := b.NewValue0(v.Pos, OpPPC64SRDconst, t)
  1128  		v0.AuxInt = int64ToAuxInt(1)
  1129  		v1 := b.NewValue0(v.Pos, OpPPC64SUB, t)
  1130  		v1.AddArg2(x, y)
  1131  		v0.AddArg(v1)
  1132  		v.AddArg2(v0, y)
  1133  		return true
  1134  	}
  1135  }
  1136  func rewriteValuePPC64_OpBitLen16(v *Value) bool {
  1137  	v_0 := v.Args[0]
  1138  	b := v.Block
  1139  	typ := &b.Func.Config.Types
  1140  	// match: (BitLen16 x)
  1141  	// result: (BitLen64 (ZeroExt16to64 x))
  1142  	for {
  1143  		x := v_0
  1144  		v.reset(OpBitLen64)
  1145  		v0 := b.NewValue0(v.Pos, OpZeroExt16to64, typ.UInt64)
  1146  		v0.AddArg(x)
  1147  		v.AddArg(v0)
  1148  		return true
  1149  	}
  1150  }
  1151  func rewriteValuePPC64_OpBitLen32(v *Value) bool {
  1152  	v_0 := v.Args[0]
  1153  	b := v.Block
  1154  	typ := &b.Func.Config.Types
  1155  	// match: (BitLen32 x)
  1156  	// result: (SUBFCconst [32] (CNTLZW <typ.Int> x))
  1157  	for {
  1158  		x := v_0
  1159  		v.reset(OpPPC64SUBFCconst)
  1160  		v.AuxInt = int64ToAuxInt(32)
  1161  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZW, typ.Int)
  1162  		v0.AddArg(x)
  1163  		v.AddArg(v0)
  1164  		return true
  1165  	}
  1166  }
  1167  func rewriteValuePPC64_OpBitLen64(v *Value) bool {
  1168  	v_0 := v.Args[0]
  1169  	b := v.Block
  1170  	typ := &b.Func.Config.Types
  1171  	// match: (BitLen64 x)
  1172  	// result: (SUBFCconst [64] (CNTLZD <typ.Int> x))
  1173  	for {
  1174  		x := v_0
  1175  		v.reset(OpPPC64SUBFCconst)
  1176  		v.AuxInt = int64ToAuxInt(64)
  1177  		v0 := b.NewValue0(v.Pos, OpPPC64CNTLZD, typ.Int)
  1178  		v0.AddArg(x)
  1179  		v.AddArg(v0)
  1180  		return true
  1181  	}
  1182  }
  1183  func rewriteValuePPC64_OpBitLen8(v *Value) bool {
  1184  	v_0 := v.Args[0]
  1185  	b := v.Block
  1186  	typ := &b.Func.Config.Types
  1187  	// match: (BitLen8 x)
  1188  	// result: (BitLen64 (ZeroExt8to64 x))
  1189  	for {
  1190  		x := v_0
  1191  		v.reset(OpBitLen64)
  1192  		v0 := b.NewValue0(v.Pos, OpZeroExt8to64, typ.UInt64)
  1193  		v0.AddArg(x)
  1194  		v.AddArg(v0)
  1195  		return true
  1196  	}
  1197  }
  1198  func rewriteValuePPC64_OpBswap16(v *Value) bool {
  1199  	v_0 := v.Args[0]
  1200  	b := v.Block
  1201  	typ := &b.Func.Config.Types
  1202  	// match: (Bswap16 x)
  1203  	// cond: buildcfg.GOPPC64>=10
  1204  	// result: (BRH x)
  1205  	for {
  1206  		x := v_0
  1207  		if !(buildcfg.GOPPC64 >= 10) {
  1208  			break
  1209  		}
  1210  		v.reset(OpPPC64BRH)
  1211  		v.AddArg(x)
  1212  		return true
  1213  	}
  1214  	// match: (Bswap16 x:(MOVHZload [off] {sym} ptr mem))
  1215  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1216  	for {
  1217  		x := v_0
  1218  		if x.Op != OpPPC64MOVHZload {
  1219  			break
  1220  		}
  1221  		off := auxIntToInt32(x.AuxInt)
  1222  		sym := auxToSym(x.Aux)
  1223  		mem := x.Args[1]
  1224  		ptr := x.Args[0]
  1225  		b = x.Block
  1226  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  1227  		v.copyOf(v0)
  1228  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1229  		v1.AuxInt = int32ToAuxInt(off)
  1230  		v1.Aux = symToAux(sym)
  1231  		v1.AddArg(ptr)
  1232  		v0.AddArg2(v1, mem)
  1233  		return true
  1234  	}
  1235  	// match: (Bswap16 x:(MOVHZloadidx ptr idx mem))
  1236  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  1237  	for {
  1238  		x := v_0
  1239  		if x.Op != OpPPC64MOVHZloadidx {
  1240  			break
  1241  		}
  1242  		mem := x.Args[2]
  1243  		ptr := x.Args[0]
  1244  		idx := x.Args[1]
  1245  		b = x.Block
  1246  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  1247  		v.copyOf(v0)
  1248  		v0.AddArg3(ptr, idx, mem)
  1249  		return true
  1250  	}
  1251  	return false
  1252  }
  1253  func rewriteValuePPC64_OpBswap32(v *Value) bool {
  1254  	v_0 := v.Args[0]
  1255  	b := v.Block
  1256  	typ := &b.Func.Config.Types
  1257  	// match: (Bswap32 x)
  1258  	// cond: buildcfg.GOPPC64>=10
  1259  	// result: (BRW x)
  1260  	for {
  1261  		x := v_0
  1262  		if !(buildcfg.GOPPC64 >= 10) {
  1263  			break
  1264  		}
  1265  		v.reset(OpPPC64BRW)
  1266  		v.AddArg(x)
  1267  		return true
  1268  	}
  1269  	// match: (Bswap32 x:(MOVWZload [off] {sym} ptr mem))
  1270  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1271  	for {
  1272  		x := v_0
  1273  		if x.Op != OpPPC64MOVWZload {
  1274  			break
  1275  		}
  1276  		off := auxIntToInt32(x.AuxInt)
  1277  		sym := auxToSym(x.Aux)
  1278  		mem := x.Args[1]
  1279  		ptr := x.Args[0]
  1280  		b = x.Block
  1281  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  1282  		v.copyOf(v0)
  1283  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1284  		v1.AuxInt = int32ToAuxInt(off)
  1285  		v1.Aux = symToAux(sym)
  1286  		v1.AddArg(ptr)
  1287  		v0.AddArg2(v1, mem)
  1288  		return true
  1289  	}
  1290  	// match: (Bswap32 x:(MOVWZloadidx ptr idx mem))
  1291  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  1292  	for {
  1293  		x := v_0
  1294  		if x.Op != OpPPC64MOVWZloadidx {
  1295  			break
  1296  		}
  1297  		mem := x.Args[2]
  1298  		ptr := x.Args[0]
  1299  		idx := x.Args[1]
  1300  		b = x.Block
  1301  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  1302  		v.copyOf(v0)
  1303  		v0.AddArg3(ptr, idx, mem)
  1304  		return true
  1305  	}
  1306  	return false
  1307  }
  1308  func rewriteValuePPC64_OpBswap64(v *Value) bool {
  1309  	v_0 := v.Args[0]
  1310  	b := v.Block
  1311  	typ := &b.Func.Config.Types
  1312  	// match: (Bswap64 x)
  1313  	// cond: buildcfg.GOPPC64>=10
  1314  	// result: (BRD x)
  1315  	for {
  1316  		x := v_0
  1317  		if !(buildcfg.GOPPC64 >= 10) {
  1318  			break
  1319  		}
  1320  		v.reset(OpPPC64BRD)
  1321  		v.AddArg(x)
  1322  		return true
  1323  	}
  1324  	// match: (Bswap64 x:(MOVDload [off] {sym} ptr mem))
  1325  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  1326  	for {
  1327  		x := v_0
  1328  		if x.Op != OpPPC64MOVDload {
  1329  			break
  1330  		}
  1331  		off := auxIntToInt32(x.AuxInt)
  1332  		sym := auxToSym(x.Aux)
  1333  		mem := x.Args[1]
  1334  		ptr := x.Args[0]
  1335  		b = x.Block
  1336  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  1337  		v.copyOf(v0)
  1338  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  1339  		v1.AuxInt = int32ToAuxInt(off)
  1340  		v1.Aux = symToAux(sym)
  1341  		v1.AddArg(ptr)
  1342  		v0.AddArg2(v1, mem)
  1343  		return true
  1344  	}
  1345  	// match: (Bswap64 x:(MOVDloadidx ptr idx mem))
  1346  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  1347  	for {
  1348  		x := v_0
  1349  		if x.Op != OpPPC64MOVDloadidx {
  1350  			break
  1351  		}
  1352  		mem := x.Args[2]
  1353  		ptr := x.Args[0]
  1354  		idx := x.Args[1]
  1355  		b = x.Block
  1356  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  1357  		v.copyOf(v0)
  1358  		v0.AddArg3(ptr, idx, mem)
  1359  		return true
  1360  	}
  1361  	return false
  1362  }
  1363  func rewriteValuePPC64_OpCom16(v *Value) bool {
  1364  	v_0 := v.Args[0]
  1365  	// match: (Com16 x)
  1366  	// result: (NOR x x)
  1367  	for {
  1368  		x := v_0
  1369  		v.reset(OpPPC64NOR)
  1370  		v.AddArg2(x, x)
  1371  		return true
  1372  	}
  1373  }
  1374  func rewriteValuePPC64_OpCom32(v *Value) bool {
  1375  	v_0 := v.Args[0]
  1376  	// match: (Com32 x)
  1377  	// result: (NOR x x)
  1378  	for {
  1379  		x := v_0
  1380  		v.reset(OpPPC64NOR)
  1381  		v.AddArg2(x, x)
  1382  		return true
  1383  	}
  1384  }
  1385  func rewriteValuePPC64_OpCom64(v *Value) bool {
  1386  	v_0 := v.Args[0]
  1387  	// match: (Com64 x)
  1388  	// result: (NOR x x)
  1389  	for {
  1390  		x := v_0
  1391  		v.reset(OpPPC64NOR)
  1392  		v.AddArg2(x, x)
  1393  		return true
  1394  	}
  1395  }
  1396  func rewriteValuePPC64_OpCom8(v *Value) bool {
  1397  	v_0 := v.Args[0]
  1398  	// match: (Com8 x)
  1399  	// result: (NOR x x)
  1400  	for {
  1401  		x := v_0
  1402  		v.reset(OpPPC64NOR)
  1403  		v.AddArg2(x, x)
  1404  		return true
  1405  	}
  1406  }
  1407  func rewriteValuePPC64_OpCondSelect(v *Value) bool {
  1408  	v_2 := v.Args[2]
  1409  	v_1 := v.Args[1]
  1410  	v_0 := v.Args[0]
  1411  	b := v.Block
  1412  	typ := &b.Func.Config.Types
  1413  	// match: (CondSelect x y (SETBC [a] cmp))
  1414  	// result: (ISEL [a] x y cmp)
  1415  	for {
  1416  		x := v_0
  1417  		y := v_1
  1418  		if v_2.Op != OpPPC64SETBC {
  1419  			break
  1420  		}
  1421  		a := auxIntToInt32(v_2.AuxInt)
  1422  		cmp := v_2.Args[0]
  1423  		v.reset(OpPPC64ISEL)
  1424  		v.AuxInt = int32ToAuxInt(a)
  1425  		v.AddArg3(x, y, cmp)
  1426  		return true
  1427  	}
  1428  	// match: (CondSelect x y (SETBCR [a] cmp))
  1429  	// result: (ISEL [a+4] x y cmp)
  1430  	for {
  1431  		x := v_0
  1432  		y := v_1
  1433  		if v_2.Op != OpPPC64SETBCR {
  1434  			break
  1435  		}
  1436  		a := auxIntToInt32(v_2.AuxInt)
  1437  		cmp := v_2.Args[0]
  1438  		v.reset(OpPPC64ISEL)
  1439  		v.AuxInt = int32ToAuxInt(a + 4)
  1440  		v.AddArg3(x, y, cmp)
  1441  		return true
  1442  	}
  1443  	// match: (CondSelect x y bool)
  1444  	// cond: flagArg(bool) == nil
  1445  	// result: (ISEL [6] x y (CMPconst [0] (ANDconst [1] bool)))
  1446  	for {
  1447  		x := v_0
  1448  		y := v_1
  1449  		bool := v_2
  1450  		if !(flagArg(bool) == nil) {
  1451  			break
  1452  		}
  1453  		v.reset(OpPPC64ISEL)
  1454  		v.AuxInt = int32ToAuxInt(6)
  1455  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  1456  		v0.AuxInt = int64ToAuxInt(0)
  1457  		v1 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  1458  		v1.AuxInt = int64ToAuxInt(1)
  1459  		v1.AddArg(bool)
  1460  		v0.AddArg(v1)
  1461  		v.AddArg3(x, y, v0)
  1462  		return true
  1463  	}
  1464  	return false
  1465  }
  1466  func rewriteValuePPC64_OpConst16(v *Value) bool {
  1467  	// match: (Const16 [val])
  1468  	// result: (MOVDconst [int64(val)])
  1469  	for {
  1470  		val := auxIntToInt16(v.AuxInt)
  1471  		v.reset(OpPPC64MOVDconst)
  1472  		v.AuxInt = int64ToAuxInt(int64(val))
  1473  		return true
  1474  	}
  1475  }
  1476  func rewriteValuePPC64_OpConst32(v *Value) bool {
  1477  	// match: (Const32 [val])
  1478  	// result: (MOVDconst [int64(val)])
  1479  	for {
  1480  		val := auxIntToInt32(v.AuxInt)
  1481  		v.reset(OpPPC64MOVDconst)
  1482  		v.AuxInt = int64ToAuxInt(int64(val))
  1483  		return true
  1484  	}
  1485  }
  1486  func rewriteValuePPC64_OpConst64(v *Value) bool {
  1487  	// match: (Const64 [val])
  1488  	// result: (MOVDconst [int64(val)])
  1489  	for {
  1490  		val := auxIntToInt64(v.AuxInt)
  1491  		v.reset(OpPPC64MOVDconst)
  1492  		v.AuxInt = int64ToAuxInt(int64(val))
  1493  		return true
  1494  	}
  1495  }
  1496  func rewriteValuePPC64_OpConst8(v *Value) bool {
  1497  	// match: (Const8 [val])
  1498  	// result: (MOVDconst [int64(val)])
  1499  	for {
  1500  		val := auxIntToInt8(v.AuxInt)
  1501  		v.reset(OpPPC64MOVDconst)
  1502  		v.AuxInt = int64ToAuxInt(int64(val))
  1503  		return true
  1504  	}
  1505  }
  1506  func rewriteValuePPC64_OpConstBool(v *Value) bool {
  1507  	// match: (ConstBool [t])
  1508  	// result: (MOVDconst [b2i(t)])
  1509  	for {
  1510  		t := auxIntToBool(v.AuxInt)
  1511  		v.reset(OpPPC64MOVDconst)
  1512  		v.AuxInt = int64ToAuxInt(b2i(t))
  1513  		return true
  1514  	}
  1515  }
  1516  func rewriteValuePPC64_OpConstNil(v *Value) bool {
  1517  	// match: (ConstNil)
  1518  	// result: (MOVDconst [0])
  1519  	for {
  1520  		v.reset(OpPPC64MOVDconst)
  1521  		v.AuxInt = int64ToAuxInt(0)
  1522  		return true
  1523  	}
  1524  }
  1525  func rewriteValuePPC64_OpCopysign(v *Value) bool {
  1526  	v_1 := v.Args[1]
  1527  	v_0 := v.Args[0]
  1528  	// match: (Copysign x y)
  1529  	// result: (FCPSGN y x)
  1530  	for {
  1531  		x := v_0
  1532  		y := v_1
  1533  		v.reset(OpPPC64FCPSGN)
  1534  		v.AddArg2(y, x)
  1535  		return true
  1536  	}
  1537  }
  1538  func rewriteValuePPC64_OpCtz16(v *Value) bool {
  1539  	v_0 := v.Args[0]
  1540  	b := v.Block
  1541  	typ := &b.Func.Config.Types
  1542  	// match: (Ctz16 x)
  1543  	// cond: buildcfg.GOPPC64 <= 8
  1544  	// result: (POPCNTW (MOVHZreg (ANDN <typ.Int16> (ADDconst <typ.Int16> [-1] x) x)))
  1545  	for {
  1546  		x := v_0
  1547  		if !(buildcfg.GOPPC64 <= 8) {
  1548  			break
  1549  		}
  1550  		v.reset(OpPPC64POPCNTW)
  1551  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  1552  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int16)
  1553  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int16)
  1554  		v2.AuxInt = int64ToAuxInt(-1)
  1555  		v2.AddArg(x)
  1556  		v1.AddArg2(v2, x)
  1557  		v0.AddArg(v1)
  1558  		v.AddArg(v0)
  1559  		return true
  1560  	}
  1561  	// match: (Ctz16 x)
  1562  	// cond: buildcfg.GOPPC64 >= 9
  1563  	// result: (CNTTZD (OR <typ.UInt64> x (MOVDconst [1<<16])))
  1564  	for {
  1565  		x := v_0
  1566  		if !(buildcfg.GOPPC64 >= 9) {
  1567  			break
  1568  		}
  1569  		v.reset(OpPPC64CNTTZD)
  1570  		v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
  1571  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  1572  		v1.AuxInt = int64ToAuxInt(1 << 16)
  1573  		v0.AddArg2(x, v1)
  1574  		v.AddArg(v0)
  1575  		return true
  1576  	}
  1577  	return false
  1578  }
  1579  func rewriteValuePPC64_OpCtz32(v *Value) bool {
  1580  	v_0 := v.Args[0]
  1581  	b := v.Block
  1582  	typ := &b.Func.Config.Types
  1583  	// match: (Ctz32 x)
  1584  	// cond: buildcfg.GOPPC64 <= 8
  1585  	// result: (POPCNTW (MOVWZreg (ANDN <typ.Int> (ADDconst <typ.Int> [-1] x) x)))
  1586  	for {
  1587  		x := v_0
  1588  		if !(buildcfg.GOPPC64 <= 8) {
  1589  			break
  1590  		}
  1591  		v.reset(OpPPC64POPCNTW)
  1592  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1593  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int)
  1594  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int)
  1595  		v2.AuxInt = int64ToAuxInt(-1)
  1596  		v2.AddArg(x)
  1597  		v1.AddArg2(v2, x)
  1598  		v0.AddArg(v1)
  1599  		v.AddArg(v0)
  1600  		return true
  1601  	}
  1602  	// match: (Ctz32 x)
  1603  	// cond: buildcfg.GOPPC64 >= 9
  1604  	// result: (CNTTZW (MOVWZreg x))
  1605  	for {
  1606  		x := v_0
  1607  		if !(buildcfg.GOPPC64 >= 9) {
  1608  			break
  1609  		}
  1610  		v.reset(OpPPC64CNTTZW)
  1611  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
  1612  		v0.AddArg(x)
  1613  		v.AddArg(v0)
  1614  		return true
  1615  	}
  1616  	return false
  1617  }
  1618  func rewriteValuePPC64_OpCtz64(v *Value) bool {
  1619  	v_0 := v.Args[0]
  1620  	b := v.Block
  1621  	typ := &b.Func.Config.Types
  1622  	// match: (Ctz64 x)
  1623  	// cond: buildcfg.GOPPC64 <= 8
  1624  	// result: (POPCNTD (ANDN <typ.Int64> (ADDconst <typ.Int64> [-1] x) x))
  1625  	for {
  1626  		x := v_0
  1627  		if !(buildcfg.GOPPC64 <= 8) {
  1628  			break
  1629  		}
  1630  		v.reset(OpPPC64POPCNTD)
  1631  		v0 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.Int64)
  1632  		v1 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.Int64)
  1633  		v1.AuxInt = int64ToAuxInt(-1)
  1634  		v1.AddArg(x)
  1635  		v0.AddArg2(v1, x)
  1636  		v.AddArg(v0)
  1637  		return true
  1638  	}
  1639  	// match: (Ctz64 x)
  1640  	// cond: buildcfg.GOPPC64 >= 9
  1641  	// result: (CNTTZD x)
  1642  	for {
  1643  		x := v_0
  1644  		if !(buildcfg.GOPPC64 >= 9) {
  1645  			break
  1646  		}
  1647  		v.reset(OpPPC64CNTTZD)
  1648  		v.AddArg(x)
  1649  		return true
  1650  	}
  1651  	return false
  1652  }
  1653  func rewriteValuePPC64_OpCtz8(v *Value) bool {
  1654  	v_0 := v.Args[0]
  1655  	b := v.Block
  1656  	typ := &b.Func.Config.Types
  1657  	// match: (Ctz8 x)
  1658  	// cond: buildcfg.GOPPC64 <= 8
  1659  	// result: (POPCNTB (MOVBZreg (ANDN <typ.UInt8> (ADDconst <typ.UInt8> [-1] x) x)))
  1660  	for {
  1661  		x := v_0
  1662  		if !(buildcfg.GOPPC64 <= 8) {
  1663  			break
  1664  		}
  1665  		v.reset(OpPPC64POPCNTB)
  1666  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  1667  		v1 := b.NewValue0(v.Pos, OpPPC64ANDN, typ.UInt8)
  1668  		v2 := b.NewValue0(v.Pos, OpPPC64ADDconst, typ.UInt8)
  1669  		v2.AuxInt = int64ToAuxInt(-1)
  1670  		v2.AddArg(x)
  1671  		v1.AddArg2(v2, x)
  1672  		v0.AddArg(v1)
  1673  		v.AddArg(v0)
  1674  		return true
  1675  	}
  1676  	// match: (Ctz8 x)
  1677  	// cond: buildcfg.GOPPC64 >= 9
  1678  	// result: (CNTTZD (OR <typ.UInt64> x (MOVDconst [1<<8])))
  1679  	for {
  1680  		x := v_0
  1681  		if !(buildcfg.GOPPC64 >= 9) {
  1682  			break
  1683  		}
  1684  		v.reset(OpPPC64CNTTZD)
  1685  		v0 := b.NewValue0(v.Pos, OpPPC64OR, typ.UInt64)
  1686  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  1687  		v1.AuxInt = int64ToAuxInt(1 << 8)
  1688  		v0.AddArg2(x, v1)
  1689  		v.AddArg(v0)
  1690  		return true
  1691  	}
  1692  	return false
  1693  }
  1694  func rewriteValuePPC64_OpCvt32Fto32(v *Value) bool {
  1695  	v_0 := v.Args[0]
  1696  	b := v.Block
  1697  	typ := &b.Func.Config.Types
  1698  	// match: (Cvt32Fto32 x)
  1699  	// result: (MFVSRD (FCTIWZ x))
  1700  	for {
  1701  		x := v_0
  1702  		v.reset(OpPPC64MFVSRD)
  1703  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1704  		v0.AddArg(x)
  1705  		v.AddArg(v0)
  1706  		return true
  1707  	}
  1708  }
  1709  func rewriteValuePPC64_OpCvt32Fto64(v *Value) bool {
  1710  	v_0 := v.Args[0]
  1711  	b := v.Block
  1712  	typ := &b.Func.Config.Types
  1713  	// match: (Cvt32Fto64 x)
  1714  	// result: (MFVSRD (FCTIDZ x))
  1715  	for {
  1716  		x := v_0
  1717  		v.reset(OpPPC64MFVSRD)
  1718  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1719  		v0.AddArg(x)
  1720  		v.AddArg(v0)
  1721  		return true
  1722  	}
  1723  }
  1724  func rewriteValuePPC64_OpCvt32to32F(v *Value) bool {
  1725  	v_0 := v.Args[0]
  1726  	b := v.Block
  1727  	typ := &b.Func.Config.Types
  1728  	// match: (Cvt32to32F x)
  1729  	// result: (FCFIDS (MTVSRD (SignExt32to64 x)))
  1730  	for {
  1731  		x := v_0
  1732  		v.reset(OpPPC64FCFIDS)
  1733  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1734  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1735  		v1.AddArg(x)
  1736  		v0.AddArg(v1)
  1737  		v.AddArg(v0)
  1738  		return true
  1739  	}
  1740  }
  1741  func rewriteValuePPC64_OpCvt32to64F(v *Value) bool {
  1742  	v_0 := v.Args[0]
  1743  	b := v.Block
  1744  	typ := &b.Func.Config.Types
  1745  	// match: (Cvt32to64F x)
  1746  	// result: (FCFID (MTVSRD (SignExt32to64 x)))
  1747  	for {
  1748  		x := v_0
  1749  		v.reset(OpPPC64FCFID)
  1750  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1751  		v1 := b.NewValue0(v.Pos, OpSignExt32to64, typ.Int64)
  1752  		v1.AddArg(x)
  1753  		v0.AddArg(v1)
  1754  		v.AddArg(v0)
  1755  		return true
  1756  	}
  1757  }
  1758  func rewriteValuePPC64_OpCvt64Fto32(v *Value) bool {
  1759  	v_0 := v.Args[0]
  1760  	b := v.Block
  1761  	typ := &b.Func.Config.Types
  1762  	// match: (Cvt64Fto32 x)
  1763  	// result: (MFVSRD (FCTIWZ x))
  1764  	for {
  1765  		x := v_0
  1766  		v.reset(OpPPC64MFVSRD)
  1767  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIWZ, typ.Float64)
  1768  		v0.AddArg(x)
  1769  		v.AddArg(v0)
  1770  		return true
  1771  	}
  1772  }
  1773  func rewriteValuePPC64_OpCvt64Fto64(v *Value) bool {
  1774  	v_0 := v.Args[0]
  1775  	b := v.Block
  1776  	typ := &b.Func.Config.Types
  1777  	// match: (Cvt64Fto64 x)
  1778  	// result: (MFVSRD (FCTIDZ x))
  1779  	for {
  1780  		x := v_0
  1781  		v.reset(OpPPC64MFVSRD)
  1782  		v0 := b.NewValue0(v.Pos, OpPPC64FCTIDZ, typ.Float64)
  1783  		v0.AddArg(x)
  1784  		v.AddArg(v0)
  1785  		return true
  1786  	}
  1787  }
  1788  func rewriteValuePPC64_OpCvt64to32F(v *Value) bool {
  1789  	v_0 := v.Args[0]
  1790  	b := v.Block
  1791  	typ := &b.Func.Config.Types
  1792  	// match: (Cvt64to32F x)
  1793  	// result: (FCFIDS (MTVSRD x))
  1794  	for {
  1795  		x := v_0
  1796  		v.reset(OpPPC64FCFIDS)
  1797  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1798  		v0.AddArg(x)
  1799  		v.AddArg(v0)
  1800  		return true
  1801  	}
  1802  }
  1803  func rewriteValuePPC64_OpCvt64to64F(v *Value) bool {
  1804  	v_0 := v.Args[0]
  1805  	b := v.Block
  1806  	typ := &b.Func.Config.Types
  1807  	// match: (Cvt64to64F x)
  1808  	// result: (FCFID (MTVSRD x))
  1809  	for {
  1810  		x := v_0
  1811  		v.reset(OpPPC64FCFID)
  1812  		v0 := b.NewValue0(v.Pos, OpPPC64MTVSRD, typ.Float64)
  1813  		v0.AddArg(x)
  1814  		v.AddArg(v0)
  1815  		return true
  1816  	}
  1817  }
  1818  func rewriteValuePPC64_OpDiv16(v *Value) bool {
  1819  	v_1 := v.Args[1]
  1820  	v_0 := v.Args[0]
  1821  	b := v.Block
  1822  	typ := &b.Func.Config.Types
  1823  	// match: (Div16 [false] x y)
  1824  	// result: (DIVW (SignExt16to32 x) (SignExt16to32 y))
  1825  	for {
  1826  		if auxIntToBool(v.AuxInt) != false {
  1827  			break
  1828  		}
  1829  		x := v_0
  1830  		y := v_1
  1831  		v.reset(OpPPC64DIVW)
  1832  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1833  		v0.AddArg(x)
  1834  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1835  		v1.AddArg(y)
  1836  		v.AddArg2(v0, v1)
  1837  		return true
  1838  	}
  1839  	return false
  1840  }
  1841  func rewriteValuePPC64_OpDiv16u(v *Value) bool {
  1842  	v_1 := v.Args[1]
  1843  	v_0 := v.Args[0]
  1844  	b := v.Block
  1845  	typ := &b.Func.Config.Types
  1846  	// match: (Div16u x y)
  1847  	// result: (DIVWU (ZeroExt16to32 x) (ZeroExt16to32 y))
  1848  	for {
  1849  		x := v_0
  1850  		y := v_1
  1851  		v.reset(OpPPC64DIVWU)
  1852  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1853  		v0.AddArg(x)
  1854  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1855  		v1.AddArg(y)
  1856  		v.AddArg2(v0, v1)
  1857  		return true
  1858  	}
  1859  }
  1860  func rewriteValuePPC64_OpDiv32(v *Value) bool {
  1861  	v_1 := v.Args[1]
  1862  	v_0 := v.Args[0]
  1863  	// match: (Div32 [false] x y)
  1864  	// result: (DIVW x y)
  1865  	for {
  1866  		if auxIntToBool(v.AuxInt) != false {
  1867  			break
  1868  		}
  1869  		x := v_0
  1870  		y := v_1
  1871  		v.reset(OpPPC64DIVW)
  1872  		v.AddArg2(x, y)
  1873  		return true
  1874  	}
  1875  	return false
  1876  }
  1877  func rewriteValuePPC64_OpDiv64(v *Value) bool {
  1878  	v_1 := v.Args[1]
  1879  	v_0 := v.Args[0]
  1880  	// match: (Div64 [false] x y)
  1881  	// result: (DIVD x y)
  1882  	for {
  1883  		if auxIntToBool(v.AuxInt) != false {
  1884  			break
  1885  		}
  1886  		x := v_0
  1887  		y := v_1
  1888  		v.reset(OpPPC64DIVD)
  1889  		v.AddArg2(x, y)
  1890  		return true
  1891  	}
  1892  	return false
  1893  }
  1894  func rewriteValuePPC64_OpDiv8(v *Value) bool {
  1895  	v_1 := v.Args[1]
  1896  	v_0 := v.Args[0]
  1897  	b := v.Block
  1898  	typ := &b.Func.Config.Types
  1899  	// match: (Div8 x y)
  1900  	// result: (DIVW (SignExt8to32 x) (SignExt8to32 y))
  1901  	for {
  1902  		x := v_0
  1903  		y := v_1
  1904  		v.reset(OpPPC64DIVW)
  1905  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1906  		v0.AddArg(x)
  1907  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  1908  		v1.AddArg(y)
  1909  		v.AddArg2(v0, v1)
  1910  		return true
  1911  	}
  1912  }
  1913  func rewriteValuePPC64_OpDiv8u(v *Value) bool {
  1914  	v_1 := v.Args[1]
  1915  	v_0 := v.Args[0]
  1916  	b := v.Block
  1917  	typ := &b.Func.Config.Types
  1918  	// match: (Div8u x y)
  1919  	// result: (DIVWU (ZeroExt8to32 x) (ZeroExt8to32 y))
  1920  	for {
  1921  		x := v_0
  1922  		y := v_1
  1923  		v.reset(OpPPC64DIVWU)
  1924  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1925  		v0.AddArg(x)
  1926  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  1927  		v1.AddArg(y)
  1928  		v.AddArg2(v0, v1)
  1929  		return true
  1930  	}
  1931  }
  1932  func rewriteValuePPC64_OpEq16(v *Value) bool {
  1933  	v_1 := v.Args[1]
  1934  	v_0 := v.Args[0]
  1935  	b := v.Block
  1936  	typ := &b.Func.Config.Types
  1937  	// match: (Eq16 x y)
  1938  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  1939  	// result: (Equal (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  1940  	for {
  1941  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  1942  			x := v_0
  1943  			y := v_1
  1944  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  1945  				continue
  1946  			}
  1947  			v.reset(OpPPC64Equal)
  1948  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1949  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1950  			v1.AddArg(x)
  1951  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  1952  			v2.AddArg(y)
  1953  			v0.AddArg2(v1, v2)
  1954  			v.AddArg(v0)
  1955  			return true
  1956  		}
  1957  		break
  1958  	}
  1959  	// match: (Eq16 x y)
  1960  	// result: (Equal (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  1961  	for {
  1962  		x := v_0
  1963  		y := v_1
  1964  		v.reset(OpPPC64Equal)
  1965  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1966  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1967  		v1.AddArg(x)
  1968  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  1969  		v2.AddArg(y)
  1970  		v0.AddArg2(v1, v2)
  1971  		v.AddArg(v0)
  1972  		return true
  1973  	}
  1974  }
  1975  func rewriteValuePPC64_OpEq32(v *Value) bool {
  1976  	v_1 := v.Args[1]
  1977  	v_0 := v.Args[0]
  1978  	b := v.Block
  1979  	// match: (Eq32 x y)
  1980  	// result: (Equal (CMPW x y))
  1981  	for {
  1982  		x := v_0
  1983  		y := v_1
  1984  		v.reset(OpPPC64Equal)
  1985  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  1986  		v0.AddArg2(x, y)
  1987  		v.AddArg(v0)
  1988  		return true
  1989  	}
  1990  }
  1991  func rewriteValuePPC64_OpEq32F(v *Value) bool {
  1992  	v_1 := v.Args[1]
  1993  	v_0 := v.Args[0]
  1994  	b := v.Block
  1995  	// match: (Eq32F x y)
  1996  	// result: (Equal (FCMPU x y))
  1997  	for {
  1998  		x := v_0
  1999  		y := v_1
  2000  		v.reset(OpPPC64Equal)
  2001  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2002  		v0.AddArg2(x, y)
  2003  		v.AddArg(v0)
  2004  		return true
  2005  	}
  2006  }
  2007  func rewriteValuePPC64_OpEq64(v *Value) bool {
  2008  	v_1 := v.Args[1]
  2009  	v_0 := v.Args[0]
  2010  	b := v.Block
  2011  	// match: (Eq64 x y)
  2012  	// result: (Equal (CMP x y))
  2013  	for {
  2014  		x := v_0
  2015  		y := v_1
  2016  		v.reset(OpPPC64Equal)
  2017  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2018  		v0.AddArg2(x, y)
  2019  		v.AddArg(v0)
  2020  		return true
  2021  	}
  2022  }
  2023  func rewriteValuePPC64_OpEq64F(v *Value) bool {
  2024  	v_1 := v.Args[1]
  2025  	v_0 := v.Args[0]
  2026  	b := v.Block
  2027  	// match: (Eq64F x y)
  2028  	// result: (Equal (FCMPU x y))
  2029  	for {
  2030  		x := v_0
  2031  		y := v_1
  2032  		v.reset(OpPPC64Equal)
  2033  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2034  		v0.AddArg2(x, y)
  2035  		v.AddArg(v0)
  2036  		return true
  2037  	}
  2038  }
  2039  func rewriteValuePPC64_OpEq8(v *Value) bool {
  2040  	v_1 := v.Args[1]
  2041  	v_0 := v.Args[0]
  2042  	b := v.Block
  2043  	typ := &b.Func.Config.Types
  2044  	// match: (Eq8 x y)
  2045  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  2046  	// result: (Equal (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2047  	for {
  2048  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  2049  			x := v_0
  2050  			y := v_1
  2051  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  2052  				continue
  2053  			}
  2054  			v.reset(OpPPC64Equal)
  2055  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2056  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2057  			v1.AddArg(x)
  2058  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2059  			v2.AddArg(y)
  2060  			v0.AddArg2(v1, v2)
  2061  			v.AddArg(v0)
  2062  			return true
  2063  		}
  2064  		break
  2065  	}
  2066  	// match: (Eq8 x y)
  2067  	// result: (Equal (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2068  	for {
  2069  		x := v_0
  2070  		y := v_1
  2071  		v.reset(OpPPC64Equal)
  2072  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2073  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2074  		v1.AddArg(x)
  2075  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2076  		v2.AddArg(y)
  2077  		v0.AddArg2(v1, v2)
  2078  		v.AddArg(v0)
  2079  		return true
  2080  	}
  2081  }
  2082  func rewriteValuePPC64_OpEqB(v *Value) bool {
  2083  	v_1 := v.Args[1]
  2084  	v_0 := v.Args[0]
  2085  	b := v.Block
  2086  	typ := &b.Func.Config.Types
  2087  	// match: (EqB x y)
  2088  	// result: (ANDconst [1] (EQV x y))
  2089  	for {
  2090  		x := v_0
  2091  		y := v_1
  2092  		v.reset(OpPPC64ANDconst)
  2093  		v.AuxInt = int64ToAuxInt(1)
  2094  		v0 := b.NewValue0(v.Pos, OpPPC64EQV, typ.Int64)
  2095  		v0.AddArg2(x, y)
  2096  		v.AddArg(v0)
  2097  		return true
  2098  	}
  2099  }
  2100  func rewriteValuePPC64_OpEqPtr(v *Value) bool {
  2101  	v_1 := v.Args[1]
  2102  	v_0 := v.Args[0]
  2103  	b := v.Block
  2104  	// match: (EqPtr x y)
  2105  	// result: (Equal (CMP x y))
  2106  	for {
  2107  		x := v_0
  2108  		y := v_1
  2109  		v.reset(OpPPC64Equal)
  2110  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2111  		v0.AddArg2(x, y)
  2112  		v.AddArg(v0)
  2113  		return true
  2114  	}
  2115  }
  2116  func rewriteValuePPC64_OpIsInBounds(v *Value) bool {
  2117  	v_1 := v.Args[1]
  2118  	v_0 := v.Args[0]
  2119  	b := v.Block
  2120  	// match: (IsInBounds idx len)
  2121  	// result: (LessThan (CMPU idx len))
  2122  	for {
  2123  		idx := v_0
  2124  		len := v_1
  2125  		v.reset(OpPPC64LessThan)
  2126  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2127  		v0.AddArg2(idx, len)
  2128  		v.AddArg(v0)
  2129  		return true
  2130  	}
  2131  }
  2132  func rewriteValuePPC64_OpIsNonNil(v *Value) bool {
  2133  	v_0 := v.Args[0]
  2134  	b := v.Block
  2135  	// match: (IsNonNil ptr)
  2136  	// result: (NotEqual (CMPconst [0] ptr))
  2137  	for {
  2138  		ptr := v_0
  2139  		v.reset(OpPPC64NotEqual)
  2140  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2141  		v0.AuxInt = int64ToAuxInt(0)
  2142  		v0.AddArg(ptr)
  2143  		v.AddArg(v0)
  2144  		return true
  2145  	}
  2146  }
  2147  func rewriteValuePPC64_OpIsSliceInBounds(v *Value) bool {
  2148  	v_1 := v.Args[1]
  2149  	v_0 := v.Args[0]
  2150  	b := v.Block
  2151  	// match: (IsSliceInBounds idx len)
  2152  	// result: (LessEqual (CMPU idx len))
  2153  	for {
  2154  		idx := v_0
  2155  		len := v_1
  2156  		v.reset(OpPPC64LessEqual)
  2157  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2158  		v0.AddArg2(idx, len)
  2159  		v.AddArg(v0)
  2160  		return true
  2161  	}
  2162  }
  2163  func rewriteValuePPC64_OpLeq16(v *Value) bool {
  2164  	v_1 := v.Args[1]
  2165  	v_0 := v.Args[0]
  2166  	b := v.Block
  2167  	typ := &b.Func.Config.Types
  2168  	// match: (Leq16 x y)
  2169  	// result: (LessEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2170  	for {
  2171  		x := v_0
  2172  		y := v_1
  2173  		v.reset(OpPPC64LessEqual)
  2174  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2175  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2176  		v1.AddArg(x)
  2177  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2178  		v2.AddArg(y)
  2179  		v0.AddArg2(v1, v2)
  2180  		v.AddArg(v0)
  2181  		return true
  2182  	}
  2183  }
  2184  func rewriteValuePPC64_OpLeq16U(v *Value) bool {
  2185  	v_1 := v.Args[1]
  2186  	v_0 := v.Args[0]
  2187  	b := v.Block
  2188  	typ := &b.Func.Config.Types
  2189  	// match: (Leq16U x y)
  2190  	// result: (LessEqual (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2191  	for {
  2192  		x := v_0
  2193  		y := v_1
  2194  		v.reset(OpPPC64LessEqual)
  2195  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2196  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2197  		v1.AddArg(x)
  2198  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2199  		v2.AddArg(y)
  2200  		v0.AddArg2(v1, v2)
  2201  		v.AddArg(v0)
  2202  		return true
  2203  	}
  2204  }
  2205  func rewriteValuePPC64_OpLeq32(v *Value) bool {
  2206  	v_1 := v.Args[1]
  2207  	v_0 := v.Args[0]
  2208  	b := v.Block
  2209  	// match: (Leq32 x y)
  2210  	// result: (LessEqual (CMPW x y))
  2211  	for {
  2212  		x := v_0
  2213  		y := v_1
  2214  		v.reset(OpPPC64LessEqual)
  2215  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2216  		v0.AddArg2(x, y)
  2217  		v.AddArg(v0)
  2218  		return true
  2219  	}
  2220  }
  2221  func rewriteValuePPC64_OpLeq32F(v *Value) bool {
  2222  	v_1 := v.Args[1]
  2223  	v_0 := v.Args[0]
  2224  	b := v.Block
  2225  	// match: (Leq32F x y)
  2226  	// result: (FLessEqual (FCMPU x y))
  2227  	for {
  2228  		x := v_0
  2229  		y := v_1
  2230  		v.reset(OpPPC64FLessEqual)
  2231  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2232  		v0.AddArg2(x, y)
  2233  		v.AddArg(v0)
  2234  		return true
  2235  	}
  2236  }
  2237  func rewriteValuePPC64_OpLeq32U(v *Value) bool {
  2238  	v_1 := v.Args[1]
  2239  	v_0 := v.Args[0]
  2240  	b := v.Block
  2241  	// match: (Leq32U x y)
  2242  	// result: (LessEqual (CMPWU x y))
  2243  	for {
  2244  		x := v_0
  2245  		y := v_1
  2246  		v.reset(OpPPC64LessEqual)
  2247  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2248  		v0.AddArg2(x, y)
  2249  		v.AddArg(v0)
  2250  		return true
  2251  	}
  2252  }
  2253  func rewriteValuePPC64_OpLeq64(v *Value) bool {
  2254  	v_1 := v.Args[1]
  2255  	v_0 := v.Args[0]
  2256  	b := v.Block
  2257  	// match: (Leq64 x y)
  2258  	// result: (LessEqual (CMP x y))
  2259  	for {
  2260  		x := v_0
  2261  		y := v_1
  2262  		v.reset(OpPPC64LessEqual)
  2263  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2264  		v0.AddArg2(x, y)
  2265  		v.AddArg(v0)
  2266  		return true
  2267  	}
  2268  }
  2269  func rewriteValuePPC64_OpLeq64F(v *Value) bool {
  2270  	v_1 := v.Args[1]
  2271  	v_0 := v.Args[0]
  2272  	b := v.Block
  2273  	// match: (Leq64F x y)
  2274  	// result: (FLessEqual (FCMPU x y))
  2275  	for {
  2276  		x := v_0
  2277  		y := v_1
  2278  		v.reset(OpPPC64FLessEqual)
  2279  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2280  		v0.AddArg2(x, y)
  2281  		v.AddArg(v0)
  2282  		return true
  2283  	}
  2284  }
  2285  func rewriteValuePPC64_OpLeq64U(v *Value) bool {
  2286  	v_1 := v.Args[1]
  2287  	v_0 := v.Args[0]
  2288  	b := v.Block
  2289  	// match: (Leq64U x y)
  2290  	// result: (LessEqual (CMPU x y))
  2291  	for {
  2292  		x := v_0
  2293  		y := v_1
  2294  		v.reset(OpPPC64LessEqual)
  2295  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2296  		v0.AddArg2(x, y)
  2297  		v.AddArg(v0)
  2298  		return true
  2299  	}
  2300  }
  2301  func rewriteValuePPC64_OpLeq8(v *Value) bool {
  2302  	v_1 := v.Args[1]
  2303  	v_0 := v.Args[0]
  2304  	b := v.Block
  2305  	typ := &b.Func.Config.Types
  2306  	// match: (Leq8 x y)
  2307  	// result: (LessEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2308  	for {
  2309  		x := v_0
  2310  		y := v_1
  2311  		v.reset(OpPPC64LessEqual)
  2312  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2313  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2314  		v1.AddArg(x)
  2315  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2316  		v2.AddArg(y)
  2317  		v0.AddArg2(v1, v2)
  2318  		v.AddArg(v0)
  2319  		return true
  2320  	}
  2321  }
  2322  func rewriteValuePPC64_OpLeq8U(v *Value) bool {
  2323  	v_1 := v.Args[1]
  2324  	v_0 := v.Args[0]
  2325  	b := v.Block
  2326  	typ := &b.Func.Config.Types
  2327  	// match: (Leq8U x y)
  2328  	// result: (LessEqual (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2329  	for {
  2330  		x := v_0
  2331  		y := v_1
  2332  		v.reset(OpPPC64LessEqual)
  2333  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2334  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2335  		v1.AddArg(x)
  2336  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2337  		v2.AddArg(y)
  2338  		v0.AddArg2(v1, v2)
  2339  		v.AddArg(v0)
  2340  		return true
  2341  	}
  2342  }
  2343  func rewriteValuePPC64_OpLess16(v *Value) bool {
  2344  	v_1 := v.Args[1]
  2345  	v_0 := v.Args[0]
  2346  	b := v.Block
  2347  	typ := &b.Func.Config.Types
  2348  	// match: (Less16 x y)
  2349  	// result: (LessThan (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  2350  	for {
  2351  		x := v_0
  2352  		y := v_1
  2353  		v.reset(OpPPC64LessThan)
  2354  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2355  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2356  		v1.AddArg(x)
  2357  		v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  2358  		v2.AddArg(y)
  2359  		v0.AddArg2(v1, v2)
  2360  		v.AddArg(v0)
  2361  		return true
  2362  	}
  2363  }
  2364  func rewriteValuePPC64_OpLess16U(v *Value) bool {
  2365  	v_1 := v.Args[1]
  2366  	v_0 := v.Args[0]
  2367  	b := v.Block
  2368  	typ := &b.Func.Config.Types
  2369  	// match: (Less16U x y)
  2370  	// result: (LessThan (CMPWU (ZeroExt16to32 x) (ZeroExt16to32 y)))
  2371  	for {
  2372  		x := v_0
  2373  		y := v_1
  2374  		v.reset(OpPPC64LessThan)
  2375  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2376  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2377  		v1.AddArg(x)
  2378  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  2379  		v2.AddArg(y)
  2380  		v0.AddArg2(v1, v2)
  2381  		v.AddArg(v0)
  2382  		return true
  2383  	}
  2384  }
  2385  func rewriteValuePPC64_OpLess32(v *Value) bool {
  2386  	v_1 := v.Args[1]
  2387  	v_0 := v.Args[0]
  2388  	b := v.Block
  2389  	// match: (Less32 x y)
  2390  	// result: (LessThan (CMPW x y))
  2391  	for {
  2392  		x := v_0
  2393  		y := v_1
  2394  		v.reset(OpPPC64LessThan)
  2395  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2396  		v0.AddArg2(x, y)
  2397  		v.AddArg(v0)
  2398  		return true
  2399  	}
  2400  }
  2401  func rewriteValuePPC64_OpLess32F(v *Value) bool {
  2402  	v_1 := v.Args[1]
  2403  	v_0 := v.Args[0]
  2404  	b := v.Block
  2405  	// match: (Less32F x y)
  2406  	// result: (FLessThan (FCMPU x y))
  2407  	for {
  2408  		x := v_0
  2409  		y := v_1
  2410  		v.reset(OpPPC64FLessThan)
  2411  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2412  		v0.AddArg2(x, y)
  2413  		v.AddArg(v0)
  2414  		return true
  2415  	}
  2416  }
  2417  func rewriteValuePPC64_OpLess32U(v *Value) bool {
  2418  	v_1 := v.Args[1]
  2419  	v_0 := v.Args[0]
  2420  	b := v.Block
  2421  	// match: (Less32U x y)
  2422  	// result: (LessThan (CMPWU x y))
  2423  	for {
  2424  		x := v_0
  2425  		y := v_1
  2426  		v.reset(OpPPC64LessThan)
  2427  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2428  		v0.AddArg2(x, y)
  2429  		v.AddArg(v0)
  2430  		return true
  2431  	}
  2432  }
  2433  func rewriteValuePPC64_OpLess64(v *Value) bool {
  2434  	v_1 := v.Args[1]
  2435  	v_0 := v.Args[0]
  2436  	b := v.Block
  2437  	// match: (Less64 x y)
  2438  	// result: (LessThan (CMP x y))
  2439  	for {
  2440  		x := v_0
  2441  		y := v_1
  2442  		v.reset(OpPPC64LessThan)
  2443  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  2444  		v0.AddArg2(x, y)
  2445  		v.AddArg(v0)
  2446  		return true
  2447  	}
  2448  }
  2449  func rewriteValuePPC64_OpLess64F(v *Value) bool {
  2450  	v_1 := v.Args[1]
  2451  	v_0 := v.Args[0]
  2452  	b := v.Block
  2453  	// match: (Less64F x y)
  2454  	// result: (FLessThan (FCMPU x y))
  2455  	for {
  2456  		x := v_0
  2457  		y := v_1
  2458  		v.reset(OpPPC64FLessThan)
  2459  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  2460  		v0.AddArg2(x, y)
  2461  		v.AddArg(v0)
  2462  		return true
  2463  	}
  2464  }
  2465  func rewriteValuePPC64_OpLess64U(v *Value) bool {
  2466  	v_1 := v.Args[1]
  2467  	v_0 := v.Args[0]
  2468  	b := v.Block
  2469  	// match: (Less64U x y)
  2470  	// result: (LessThan (CMPU x y))
  2471  	for {
  2472  		x := v_0
  2473  		y := v_1
  2474  		v.reset(OpPPC64LessThan)
  2475  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  2476  		v0.AddArg2(x, y)
  2477  		v.AddArg(v0)
  2478  		return true
  2479  	}
  2480  }
  2481  func rewriteValuePPC64_OpLess8(v *Value) bool {
  2482  	v_1 := v.Args[1]
  2483  	v_0 := v.Args[0]
  2484  	b := v.Block
  2485  	typ := &b.Func.Config.Types
  2486  	// match: (Less8 x y)
  2487  	// result: (LessThan (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  2488  	for {
  2489  		x := v_0
  2490  		y := v_1
  2491  		v.reset(OpPPC64LessThan)
  2492  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  2493  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2494  		v1.AddArg(x)
  2495  		v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  2496  		v2.AddArg(y)
  2497  		v0.AddArg2(v1, v2)
  2498  		v.AddArg(v0)
  2499  		return true
  2500  	}
  2501  }
  2502  func rewriteValuePPC64_OpLess8U(v *Value) bool {
  2503  	v_1 := v.Args[1]
  2504  	v_0 := v.Args[0]
  2505  	b := v.Block
  2506  	typ := &b.Func.Config.Types
  2507  	// match: (Less8U x y)
  2508  	// result: (LessThan (CMPWU (ZeroExt8to32 x) (ZeroExt8to32 y)))
  2509  	for {
  2510  		x := v_0
  2511  		y := v_1
  2512  		v.reset(OpPPC64LessThan)
  2513  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  2514  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2515  		v1.AddArg(x)
  2516  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  2517  		v2.AddArg(y)
  2518  		v0.AddArg2(v1, v2)
  2519  		v.AddArg(v0)
  2520  		return true
  2521  	}
  2522  }
  2523  func rewriteValuePPC64_OpLoad(v *Value) bool {
  2524  	v_1 := v.Args[1]
  2525  	v_0 := v.Args[0]
  2526  	b := v.Block
  2527  	typ := &b.Func.Config.Types
  2528  	// match: (Load <t> ptr mem)
  2529  	// cond: (is64BitInt(t) || isPtr(t))
  2530  	// result: (MOVDload ptr mem)
  2531  	for {
  2532  		t := v.Type
  2533  		ptr := v_0
  2534  		mem := v_1
  2535  		if !(is64BitInt(t) || isPtr(t)) {
  2536  			break
  2537  		}
  2538  		v.reset(OpPPC64MOVDload)
  2539  		v.AddArg2(ptr, mem)
  2540  		return true
  2541  	}
  2542  	// match: (Load <t> ptr mem)
  2543  	// cond: is32BitInt(t) && t.IsSigned()
  2544  	// result: (MOVWload ptr mem)
  2545  	for {
  2546  		t := v.Type
  2547  		ptr := v_0
  2548  		mem := v_1
  2549  		if !(is32BitInt(t) && t.IsSigned()) {
  2550  			break
  2551  		}
  2552  		v.reset(OpPPC64MOVWload)
  2553  		v.AddArg2(ptr, mem)
  2554  		return true
  2555  	}
  2556  	// match: (Load <t> ptr mem)
  2557  	// cond: is32BitInt(t) && !t.IsSigned()
  2558  	// result: (MOVWZload ptr mem)
  2559  	for {
  2560  		t := v.Type
  2561  		ptr := v_0
  2562  		mem := v_1
  2563  		if !(is32BitInt(t) && !t.IsSigned()) {
  2564  			break
  2565  		}
  2566  		v.reset(OpPPC64MOVWZload)
  2567  		v.AddArg2(ptr, mem)
  2568  		return true
  2569  	}
  2570  	// match: (Load <t> ptr mem)
  2571  	// cond: is16BitInt(t) && t.IsSigned()
  2572  	// result: (MOVHload ptr mem)
  2573  	for {
  2574  		t := v.Type
  2575  		ptr := v_0
  2576  		mem := v_1
  2577  		if !(is16BitInt(t) && t.IsSigned()) {
  2578  			break
  2579  		}
  2580  		v.reset(OpPPC64MOVHload)
  2581  		v.AddArg2(ptr, mem)
  2582  		return true
  2583  	}
  2584  	// match: (Load <t> ptr mem)
  2585  	// cond: is16BitInt(t) && !t.IsSigned()
  2586  	// result: (MOVHZload ptr mem)
  2587  	for {
  2588  		t := v.Type
  2589  		ptr := v_0
  2590  		mem := v_1
  2591  		if !(is16BitInt(t) && !t.IsSigned()) {
  2592  			break
  2593  		}
  2594  		v.reset(OpPPC64MOVHZload)
  2595  		v.AddArg2(ptr, mem)
  2596  		return true
  2597  	}
  2598  	// match: (Load <t> ptr mem)
  2599  	// cond: t.IsBoolean()
  2600  	// result: (MOVBZload ptr mem)
  2601  	for {
  2602  		t := v.Type
  2603  		ptr := v_0
  2604  		mem := v_1
  2605  		if !(t.IsBoolean()) {
  2606  			break
  2607  		}
  2608  		v.reset(OpPPC64MOVBZload)
  2609  		v.AddArg2(ptr, mem)
  2610  		return true
  2611  	}
  2612  	// match: (Load <t> ptr mem)
  2613  	// cond: is8BitInt(t) && t.IsSigned()
  2614  	// result: (MOVBreg (MOVBZload ptr mem))
  2615  	for {
  2616  		t := v.Type
  2617  		ptr := v_0
  2618  		mem := v_1
  2619  		if !(is8BitInt(t) && t.IsSigned()) {
  2620  			break
  2621  		}
  2622  		v.reset(OpPPC64MOVBreg)
  2623  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  2624  		v0.AddArg2(ptr, mem)
  2625  		v.AddArg(v0)
  2626  		return true
  2627  	}
  2628  	// match: (Load <t> ptr mem)
  2629  	// cond: is8BitInt(t) && !t.IsSigned()
  2630  	// result: (MOVBZload ptr mem)
  2631  	for {
  2632  		t := v.Type
  2633  		ptr := v_0
  2634  		mem := v_1
  2635  		if !(is8BitInt(t) && !t.IsSigned()) {
  2636  			break
  2637  		}
  2638  		v.reset(OpPPC64MOVBZload)
  2639  		v.AddArg2(ptr, mem)
  2640  		return true
  2641  	}
  2642  	// match: (Load <t> ptr mem)
  2643  	// cond: is32BitFloat(t)
  2644  	// result: (FMOVSload ptr mem)
  2645  	for {
  2646  		t := v.Type
  2647  		ptr := v_0
  2648  		mem := v_1
  2649  		if !(is32BitFloat(t)) {
  2650  			break
  2651  		}
  2652  		v.reset(OpPPC64FMOVSload)
  2653  		v.AddArg2(ptr, mem)
  2654  		return true
  2655  	}
  2656  	// match: (Load <t> ptr mem)
  2657  	// cond: is64BitFloat(t)
  2658  	// result: (FMOVDload ptr mem)
  2659  	for {
  2660  		t := v.Type
  2661  		ptr := v_0
  2662  		mem := v_1
  2663  		if !(is64BitFloat(t)) {
  2664  			break
  2665  		}
  2666  		v.reset(OpPPC64FMOVDload)
  2667  		v.AddArg2(ptr, mem)
  2668  		return true
  2669  	}
  2670  	return false
  2671  }
  2672  func rewriteValuePPC64_OpLocalAddr(v *Value) bool {
  2673  	v_1 := v.Args[1]
  2674  	v_0 := v.Args[0]
  2675  	b := v.Block
  2676  	typ := &b.Func.Config.Types
  2677  	// match: (LocalAddr <t> {sym} base mem)
  2678  	// cond: t.Elem().HasPointers()
  2679  	// result: (MOVDaddr {sym} (SPanchored base mem))
  2680  	for {
  2681  		t := v.Type
  2682  		sym := auxToSym(v.Aux)
  2683  		base := v_0
  2684  		mem := v_1
  2685  		if !(t.Elem().HasPointers()) {
  2686  			break
  2687  		}
  2688  		v.reset(OpPPC64MOVDaddr)
  2689  		v.Aux = symToAux(sym)
  2690  		v0 := b.NewValue0(v.Pos, OpSPanchored, typ.Uintptr)
  2691  		v0.AddArg2(base, mem)
  2692  		v.AddArg(v0)
  2693  		return true
  2694  	}
  2695  	// match: (LocalAddr <t> {sym} base _)
  2696  	// cond: !t.Elem().HasPointers()
  2697  	// result: (MOVDaddr {sym} base)
  2698  	for {
  2699  		t := v.Type
  2700  		sym := auxToSym(v.Aux)
  2701  		base := v_0
  2702  		if !(!t.Elem().HasPointers()) {
  2703  			break
  2704  		}
  2705  		v.reset(OpPPC64MOVDaddr)
  2706  		v.Aux = symToAux(sym)
  2707  		v.AddArg(base)
  2708  		return true
  2709  	}
  2710  	return false
  2711  }
  2712  func rewriteValuePPC64_OpLsh16x16(v *Value) bool {
  2713  	v_1 := v.Args[1]
  2714  	v_0 := v.Args[0]
  2715  	b := v.Block
  2716  	typ := &b.Func.Config.Types
  2717  	// match: (Lsh16x16 x y)
  2718  	// cond: shiftIsBounded(v)
  2719  	// result: (SLD x y)
  2720  	for {
  2721  		x := v_0
  2722  		y := v_1
  2723  		if !(shiftIsBounded(v)) {
  2724  			break
  2725  		}
  2726  		v.reset(OpPPC64SLD)
  2727  		v.AddArg2(x, y)
  2728  		return true
  2729  	}
  2730  	// match: (Lsh16x16 <t> x y)
  2731  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF0] y)))
  2732  	for {
  2733  		t := v.Type
  2734  		x := v_0
  2735  		y := v_1
  2736  		v.reset(OpPPC64ISEL)
  2737  		v.AuxInt = int32ToAuxInt(2)
  2738  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2739  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2740  		v1.AddArg(x)
  2741  		v0.AddArg2(v1, y)
  2742  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2743  		v2.AuxInt = int64ToAuxInt(0)
  2744  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2745  		v3.AuxInt = int64ToAuxInt(0)
  2746  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2747  		v4.AuxInt = int64ToAuxInt(0xFFF0)
  2748  		v4.AddArg(y)
  2749  		v3.AddArg(v4)
  2750  		v.AddArg3(v0, v2, v3)
  2751  		return true
  2752  	}
  2753  }
  2754  func rewriteValuePPC64_OpLsh16x32(v *Value) bool {
  2755  	v_1 := v.Args[1]
  2756  	v_0 := v.Args[0]
  2757  	b := v.Block
  2758  	typ := &b.Func.Config.Types
  2759  	// match: (Lsh16x32 x y)
  2760  	// cond: shiftIsBounded(v)
  2761  	// result: (SLD x y)
  2762  	for {
  2763  		x := v_0
  2764  		y := v_1
  2765  		if !(shiftIsBounded(v)) {
  2766  			break
  2767  		}
  2768  		v.reset(OpPPC64SLD)
  2769  		v.AddArg2(x, y)
  2770  		return true
  2771  	}
  2772  	// match: (Lsh16x32 <t> x y)
  2773  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
  2774  	for {
  2775  		t := v.Type
  2776  		x := v_0
  2777  		y := v_1
  2778  		v.reset(OpPPC64ISEL)
  2779  		v.AuxInt = int32ToAuxInt(0)
  2780  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2781  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2782  		v1.AddArg(x)
  2783  		v0.AddArg2(v1, y)
  2784  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2785  		v2.AuxInt = int64ToAuxInt(0)
  2786  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2787  		v3.AuxInt = int32ToAuxInt(16)
  2788  		v3.AddArg(y)
  2789  		v.AddArg3(v0, v2, v3)
  2790  		return true
  2791  	}
  2792  }
  2793  func rewriteValuePPC64_OpLsh16x64(v *Value) bool {
  2794  	v_1 := v.Args[1]
  2795  	v_0 := v.Args[0]
  2796  	b := v.Block
  2797  	typ := &b.Func.Config.Types
  2798  	// match: (Lsh16x64 x (MOVDconst [c]))
  2799  	// cond: uint64(c) < 16
  2800  	// result: (SLWconst x [c])
  2801  	for {
  2802  		x := v_0
  2803  		if v_1.Op != OpPPC64MOVDconst {
  2804  			break
  2805  		}
  2806  		c := auxIntToInt64(v_1.AuxInt)
  2807  		if !(uint64(c) < 16) {
  2808  			break
  2809  		}
  2810  		v.reset(OpPPC64SLWconst)
  2811  		v.AuxInt = int64ToAuxInt(c)
  2812  		v.AddArg(x)
  2813  		return true
  2814  	}
  2815  	// match: (Lsh16x64 x y)
  2816  	// cond: shiftIsBounded(v)
  2817  	// result: (SLD x y)
  2818  	for {
  2819  		x := v_0
  2820  		y := v_1
  2821  		if !(shiftIsBounded(v)) {
  2822  			break
  2823  		}
  2824  		v.reset(OpPPC64SLD)
  2825  		v.AddArg2(x, y)
  2826  		return true
  2827  	}
  2828  	// match: (Lsh16x64 <t> x y)
  2829  	// result: (ISEL [0] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
  2830  	for {
  2831  		t := v.Type
  2832  		x := v_0
  2833  		y := v_1
  2834  		v.reset(OpPPC64ISEL)
  2835  		v.AuxInt = int32ToAuxInt(0)
  2836  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2837  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2838  		v1.AddArg(x)
  2839  		v0.AddArg2(v1, y)
  2840  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2841  		v2.AuxInt = int64ToAuxInt(0)
  2842  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  2843  		v3.AuxInt = int64ToAuxInt(16)
  2844  		v3.AddArg(y)
  2845  		v.AddArg3(v0, v2, v3)
  2846  		return true
  2847  	}
  2848  }
  2849  func rewriteValuePPC64_OpLsh16x8(v *Value) bool {
  2850  	v_1 := v.Args[1]
  2851  	v_0 := v.Args[0]
  2852  	b := v.Block
  2853  	typ := &b.Func.Config.Types
  2854  	// match: (Lsh16x8 x y)
  2855  	// cond: shiftIsBounded(v)
  2856  	// result: (SLD x y)
  2857  	for {
  2858  		x := v_0
  2859  		y := v_1
  2860  		if !(shiftIsBounded(v)) {
  2861  			break
  2862  		}
  2863  		v.reset(OpPPC64SLD)
  2864  		v.AddArg2(x, y)
  2865  		return true
  2866  	}
  2867  	// match: (Lsh16x8 <t> x y)
  2868  	// result: (ISEL [2] (SLD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F0] y)))
  2869  	for {
  2870  		t := v.Type
  2871  		x := v_0
  2872  		y := v_1
  2873  		v.reset(OpPPC64ISEL)
  2874  		v.AuxInt = int32ToAuxInt(2)
  2875  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  2876  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  2877  		v1.AddArg(x)
  2878  		v0.AddArg2(v1, y)
  2879  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2880  		v2.AuxInt = int64ToAuxInt(0)
  2881  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2882  		v3.AuxInt = int64ToAuxInt(0)
  2883  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2884  		v4.AuxInt = int64ToAuxInt(0x00F0)
  2885  		v4.AddArg(y)
  2886  		v3.AddArg(v4)
  2887  		v.AddArg3(v0, v2, v3)
  2888  		return true
  2889  	}
  2890  }
  2891  func rewriteValuePPC64_OpLsh32x16(v *Value) bool {
  2892  	v_1 := v.Args[1]
  2893  	v_0 := v.Args[0]
  2894  	b := v.Block
  2895  	typ := &b.Func.Config.Types
  2896  	// match: (Lsh32x16 x y)
  2897  	// cond: shiftIsBounded(v)
  2898  	// result: (SLW x y)
  2899  	for {
  2900  		x := v_0
  2901  		y := v_1
  2902  		if !(shiftIsBounded(v)) {
  2903  			break
  2904  		}
  2905  		v.reset(OpPPC64SLW)
  2906  		v.AddArg2(x, y)
  2907  		return true
  2908  	}
  2909  	// match: (Lsh32x16 <t> x y)
  2910  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFE0] y)))
  2911  	for {
  2912  		t := v.Type
  2913  		x := v_0
  2914  		y := v_1
  2915  		v.reset(OpPPC64ISEL)
  2916  		v.AuxInt = int32ToAuxInt(2)
  2917  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2918  		v0.AddArg2(x, y)
  2919  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2920  		v1.AuxInt = int64ToAuxInt(0)
  2921  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  2922  		v2.AuxInt = int64ToAuxInt(0)
  2923  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  2924  		v3.AuxInt = int64ToAuxInt(0xFFE0)
  2925  		v3.AddArg(y)
  2926  		v2.AddArg(v3)
  2927  		v.AddArg3(v0, v1, v2)
  2928  		return true
  2929  	}
  2930  }
  2931  func rewriteValuePPC64_OpLsh32x32(v *Value) bool {
  2932  	v_1 := v.Args[1]
  2933  	v_0 := v.Args[0]
  2934  	b := v.Block
  2935  	typ := &b.Func.Config.Types
  2936  	// match: (Lsh32x32 x y)
  2937  	// cond: shiftIsBounded(v)
  2938  	// result: (SLW x y)
  2939  	for {
  2940  		x := v_0
  2941  		y := v_1
  2942  		if !(shiftIsBounded(v)) {
  2943  			break
  2944  		}
  2945  		v.reset(OpPPC64SLW)
  2946  		v.AddArg2(x, y)
  2947  		return true
  2948  	}
  2949  	// match: (Lsh32x32 <t> x y)
  2950  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
  2951  	for {
  2952  		t := v.Type
  2953  		x := v_0
  2954  		y := v_1
  2955  		v.reset(OpPPC64ISEL)
  2956  		v.AuxInt = int32ToAuxInt(0)
  2957  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  2958  		v0.AddArg2(x, y)
  2959  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  2960  		v1.AuxInt = int64ToAuxInt(0)
  2961  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  2962  		v2.AuxInt = int32ToAuxInt(32)
  2963  		v2.AddArg(y)
  2964  		v.AddArg3(v0, v1, v2)
  2965  		return true
  2966  	}
  2967  }
  2968  func rewriteValuePPC64_OpLsh32x64(v *Value) bool {
  2969  	v_1 := v.Args[1]
  2970  	v_0 := v.Args[0]
  2971  	b := v.Block
  2972  	typ := &b.Func.Config.Types
  2973  	// match: (Lsh32x64 x (MOVDconst [c]))
  2974  	// cond: uint64(c) < 32
  2975  	// result: (SLWconst x [c])
  2976  	for {
  2977  		x := v_0
  2978  		if v_1.Op != OpPPC64MOVDconst {
  2979  			break
  2980  		}
  2981  		c := auxIntToInt64(v_1.AuxInt)
  2982  		if !(uint64(c) < 32) {
  2983  			break
  2984  		}
  2985  		v.reset(OpPPC64SLWconst)
  2986  		v.AuxInt = int64ToAuxInt(c)
  2987  		v.AddArg(x)
  2988  		return true
  2989  	}
  2990  	// match: (Lsh32x64 x y)
  2991  	// cond: shiftIsBounded(v)
  2992  	// result: (SLW x y)
  2993  	for {
  2994  		x := v_0
  2995  		y := v_1
  2996  		if !(shiftIsBounded(v)) {
  2997  			break
  2998  		}
  2999  		v.reset(OpPPC64SLW)
  3000  		v.AddArg2(x, y)
  3001  		return true
  3002  	}
  3003  	// match: (Lsh32x64 <t> x y)
  3004  	// result: (ISEL [0] (SLW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
  3005  	for {
  3006  		t := v.Type
  3007  		x := v_0
  3008  		y := v_1
  3009  		v.reset(OpPPC64ISEL)
  3010  		v.AuxInt = int32ToAuxInt(0)
  3011  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  3012  		v0.AddArg2(x, y)
  3013  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3014  		v1.AuxInt = int64ToAuxInt(0)
  3015  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3016  		v2.AuxInt = int64ToAuxInt(32)
  3017  		v2.AddArg(y)
  3018  		v.AddArg3(v0, v1, v2)
  3019  		return true
  3020  	}
  3021  }
  3022  func rewriteValuePPC64_OpLsh32x8(v *Value) bool {
  3023  	v_1 := v.Args[1]
  3024  	v_0 := v.Args[0]
  3025  	b := v.Block
  3026  	typ := &b.Func.Config.Types
  3027  	// match: (Lsh32x8 x y)
  3028  	// cond: shiftIsBounded(v)
  3029  	// result: (SLW x y)
  3030  	for {
  3031  		x := v_0
  3032  		y := v_1
  3033  		if !(shiftIsBounded(v)) {
  3034  			break
  3035  		}
  3036  		v.reset(OpPPC64SLW)
  3037  		v.AddArg2(x, y)
  3038  		return true
  3039  	}
  3040  	// match: (Lsh32x8 <t> x y)
  3041  	// result: (ISEL [2] (SLW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00E0] y)))
  3042  	for {
  3043  		t := v.Type
  3044  		x := v_0
  3045  		y := v_1
  3046  		v.reset(OpPPC64ISEL)
  3047  		v.AuxInt = int32ToAuxInt(2)
  3048  		v0 := b.NewValue0(v.Pos, OpPPC64SLW, t)
  3049  		v0.AddArg2(x, y)
  3050  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3051  		v1.AuxInt = int64ToAuxInt(0)
  3052  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3053  		v2.AuxInt = int64ToAuxInt(0)
  3054  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3055  		v3.AuxInt = int64ToAuxInt(0x00E0)
  3056  		v3.AddArg(y)
  3057  		v2.AddArg(v3)
  3058  		v.AddArg3(v0, v1, v2)
  3059  		return true
  3060  	}
  3061  }
  3062  func rewriteValuePPC64_OpLsh64x16(v *Value) bool {
  3063  	v_1 := v.Args[1]
  3064  	v_0 := v.Args[0]
  3065  	b := v.Block
  3066  	typ := &b.Func.Config.Types
  3067  	// match: (Lsh64x16 x y)
  3068  	// cond: shiftIsBounded(v)
  3069  	// result: (SLD x y)
  3070  	for {
  3071  		x := v_0
  3072  		y := v_1
  3073  		if !(shiftIsBounded(v)) {
  3074  			break
  3075  		}
  3076  		v.reset(OpPPC64SLD)
  3077  		v.AddArg2(x, y)
  3078  		return true
  3079  	}
  3080  	// match: (Lsh64x16 <t> x y)
  3081  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFC0] y)))
  3082  	for {
  3083  		t := v.Type
  3084  		x := v_0
  3085  		y := v_1
  3086  		v.reset(OpPPC64ISEL)
  3087  		v.AuxInt = int32ToAuxInt(2)
  3088  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3089  		v0.AddArg2(x, y)
  3090  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3091  		v1.AuxInt = int64ToAuxInt(0)
  3092  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3093  		v2.AuxInt = int64ToAuxInt(0)
  3094  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3095  		v3.AuxInt = int64ToAuxInt(0xFFC0)
  3096  		v3.AddArg(y)
  3097  		v2.AddArg(v3)
  3098  		v.AddArg3(v0, v1, v2)
  3099  		return true
  3100  	}
  3101  }
  3102  func rewriteValuePPC64_OpLsh64x32(v *Value) bool {
  3103  	v_1 := v.Args[1]
  3104  	v_0 := v.Args[0]
  3105  	b := v.Block
  3106  	typ := &b.Func.Config.Types
  3107  	// match: (Lsh64x32 x y)
  3108  	// cond: shiftIsBounded(v)
  3109  	// result: (SLD x y)
  3110  	for {
  3111  		x := v_0
  3112  		y := v_1
  3113  		if !(shiftIsBounded(v)) {
  3114  			break
  3115  		}
  3116  		v.reset(OpPPC64SLD)
  3117  		v.AddArg2(x, y)
  3118  		return true
  3119  	}
  3120  	// match: (Lsh64x32 <t> x y)
  3121  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
  3122  	for {
  3123  		t := v.Type
  3124  		x := v_0
  3125  		y := v_1
  3126  		v.reset(OpPPC64ISEL)
  3127  		v.AuxInt = int32ToAuxInt(0)
  3128  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3129  		v0.AddArg2(x, y)
  3130  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3131  		v1.AuxInt = int64ToAuxInt(0)
  3132  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3133  		v2.AuxInt = int32ToAuxInt(64)
  3134  		v2.AddArg(y)
  3135  		v.AddArg3(v0, v1, v2)
  3136  		return true
  3137  	}
  3138  }
  3139  func rewriteValuePPC64_OpLsh64x64(v *Value) bool {
  3140  	v_1 := v.Args[1]
  3141  	v_0 := v.Args[0]
  3142  	b := v.Block
  3143  	typ := &b.Func.Config.Types
  3144  	// match: (Lsh64x64 x (MOVDconst [c]))
  3145  	// cond: uint64(c) < 64
  3146  	// result: (SLDconst x [c])
  3147  	for {
  3148  		x := v_0
  3149  		if v_1.Op != OpPPC64MOVDconst {
  3150  			break
  3151  		}
  3152  		c := auxIntToInt64(v_1.AuxInt)
  3153  		if !(uint64(c) < 64) {
  3154  			break
  3155  		}
  3156  		v.reset(OpPPC64SLDconst)
  3157  		v.AuxInt = int64ToAuxInt(c)
  3158  		v.AddArg(x)
  3159  		return true
  3160  	}
  3161  	// match: (Lsh64x64 x y)
  3162  	// cond: shiftIsBounded(v)
  3163  	// result: (SLD x y)
  3164  	for {
  3165  		x := v_0
  3166  		y := v_1
  3167  		if !(shiftIsBounded(v)) {
  3168  			break
  3169  		}
  3170  		v.reset(OpPPC64SLD)
  3171  		v.AddArg2(x, y)
  3172  		return true
  3173  	}
  3174  	// match: (Lsh64x64 <t> x y)
  3175  	// result: (ISEL [0] (SLD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
  3176  	for {
  3177  		t := v.Type
  3178  		x := v_0
  3179  		y := v_1
  3180  		v.reset(OpPPC64ISEL)
  3181  		v.AuxInt = int32ToAuxInt(0)
  3182  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3183  		v0.AddArg2(x, y)
  3184  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3185  		v1.AuxInt = int64ToAuxInt(0)
  3186  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3187  		v2.AuxInt = int64ToAuxInt(64)
  3188  		v2.AddArg(y)
  3189  		v.AddArg3(v0, v1, v2)
  3190  		return true
  3191  	}
  3192  }
  3193  func rewriteValuePPC64_OpLsh64x8(v *Value) bool {
  3194  	v_1 := v.Args[1]
  3195  	v_0 := v.Args[0]
  3196  	b := v.Block
  3197  	typ := &b.Func.Config.Types
  3198  	// match: (Lsh64x8 x y)
  3199  	// cond: shiftIsBounded(v)
  3200  	// result: (SLD x y)
  3201  	for {
  3202  		x := v_0
  3203  		y := v_1
  3204  		if !(shiftIsBounded(v)) {
  3205  			break
  3206  		}
  3207  		v.reset(OpPPC64SLD)
  3208  		v.AddArg2(x, y)
  3209  		return true
  3210  	}
  3211  	// match: (Lsh64x8 <t> x y)
  3212  	// result: (ISEL [2] (SLD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00C0] y)))
  3213  	for {
  3214  		t := v.Type
  3215  		x := v_0
  3216  		y := v_1
  3217  		v.reset(OpPPC64ISEL)
  3218  		v.AuxInt = int32ToAuxInt(2)
  3219  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3220  		v0.AddArg2(x, y)
  3221  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3222  		v1.AuxInt = int64ToAuxInt(0)
  3223  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3224  		v2.AuxInt = int64ToAuxInt(0)
  3225  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3226  		v3.AuxInt = int64ToAuxInt(0x00C0)
  3227  		v3.AddArg(y)
  3228  		v2.AddArg(v3)
  3229  		v.AddArg3(v0, v1, v2)
  3230  		return true
  3231  	}
  3232  }
  3233  func rewriteValuePPC64_OpLsh8x16(v *Value) bool {
  3234  	v_1 := v.Args[1]
  3235  	v_0 := v.Args[0]
  3236  	b := v.Block
  3237  	typ := &b.Func.Config.Types
  3238  	// match: (Lsh8x16 x y)
  3239  	// cond: shiftIsBounded(v)
  3240  	// result: (SLD x y)
  3241  	for {
  3242  		x := v_0
  3243  		y := v_1
  3244  		if !(shiftIsBounded(v)) {
  3245  			break
  3246  		}
  3247  		v.reset(OpPPC64SLD)
  3248  		v.AddArg2(x, y)
  3249  		return true
  3250  	}
  3251  	// match: (Lsh8x16 <t> x y)
  3252  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF8] y)))
  3253  	for {
  3254  		t := v.Type
  3255  		x := v_0
  3256  		y := v_1
  3257  		v.reset(OpPPC64ISEL)
  3258  		v.AuxInt = int32ToAuxInt(2)
  3259  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3260  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3261  		v1.AddArg(x)
  3262  		v0.AddArg2(v1, y)
  3263  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3264  		v2.AuxInt = int64ToAuxInt(0)
  3265  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3266  		v3.AuxInt = int64ToAuxInt(0)
  3267  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3268  		v4.AuxInt = int64ToAuxInt(0xFFF8)
  3269  		v4.AddArg(y)
  3270  		v3.AddArg(v4)
  3271  		v.AddArg3(v0, v2, v3)
  3272  		return true
  3273  	}
  3274  }
  3275  func rewriteValuePPC64_OpLsh8x32(v *Value) bool {
  3276  	v_1 := v.Args[1]
  3277  	v_0 := v.Args[0]
  3278  	b := v.Block
  3279  	typ := &b.Func.Config.Types
  3280  	// match: (Lsh8x32 x y)
  3281  	// cond: shiftIsBounded(v)
  3282  	// result: (SLD x y)
  3283  	for {
  3284  		x := v_0
  3285  		y := v_1
  3286  		if !(shiftIsBounded(v)) {
  3287  			break
  3288  		}
  3289  		v.reset(OpPPC64SLD)
  3290  		v.AddArg2(x, y)
  3291  		return true
  3292  	}
  3293  	// match: (Lsh8x32 <t> x y)
  3294  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
  3295  	for {
  3296  		t := v.Type
  3297  		x := v_0
  3298  		y := v_1
  3299  		v.reset(OpPPC64ISEL)
  3300  		v.AuxInt = int32ToAuxInt(0)
  3301  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3302  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3303  		v1.AddArg(x)
  3304  		v0.AddArg2(v1, y)
  3305  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3306  		v2.AuxInt = int64ToAuxInt(0)
  3307  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  3308  		v3.AuxInt = int32ToAuxInt(8)
  3309  		v3.AddArg(y)
  3310  		v.AddArg3(v0, v2, v3)
  3311  		return true
  3312  	}
  3313  }
  3314  func rewriteValuePPC64_OpLsh8x64(v *Value) bool {
  3315  	v_1 := v.Args[1]
  3316  	v_0 := v.Args[0]
  3317  	b := v.Block
  3318  	typ := &b.Func.Config.Types
  3319  	// match: (Lsh8x64 x (MOVDconst [c]))
  3320  	// cond: uint64(c) < 8
  3321  	// result: (SLWconst x [c])
  3322  	for {
  3323  		x := v_0
  3324  		if v_1.Op != OpPPC64MOVDconst {
  3325  			break
  3326  		}
  3327  		c := auxIntToInt64(v_1.AuxInt)
  3328  		if !(uint64(c) < 8) {
  3329  			break
  3330  		}
  3331  		v.reset(OpPPC64SLWconst)
  3332  		v.AuxInt = int64ToAuxInt(c)
  3333  		v.AddArg(x)
  3334  		return true
  3335  	}
  3336  	// match: (Lsh8x64 x y)
  3337  	// cond: shiftIsBounded(v)
  3338  	// result: (SLD x y)
  3339  	for {
  3340  		x := v_0
  3341  		y := v_1
  3342  		if !(shiftIsBounded(v)) {
  3343  			break
  3344  		}
  3345  		v.reset(OpPPC64SLD)
  3346  		v.AddArg2(x, y)
  3347  		return true
  3348  	}
  3349  	// match: (Lsh8x64 <t> x y)
  3350  	// result: (ISEL [0] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
  3351  	for {
  3352  		t := v.Type
  3353  		x := v_0
  3354  		y := v_1
  3355  		v.reset(OpPPC64ISEL)
  3356  		v.AuxInt = int32ToAuxInt(0)
  3357  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3358  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3359  		v1.AddArg(x)
  3360  		v0.AddArg2(v1, y)
  3361  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3362  		v2.AuxInt = int64ToAuxInt(0)
  3363  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  3364  		v3.AuxInt = int64ToAuxInt(8)
  3365  		v3.AddArg(y)
  3366  		v.AddArg3(v0, v2, v3)
  3367  		return true
  3368  	}
  3369  }
  3370  func rewriteValuePPC64_OpLsh8x8(v *Value) bool {
  3371  	v_1 := v.Args[1]
  3372  	v_0 := v.Args[0]
  3373  	b := v.Block
  3374  	typ := &b.Func.Config.Types
  3375  	// match: (Lsh8x8 x y)
  3376  	// cond: shiftIsBounded(v)
  3377  	// result: (SLD x y)
  3378  	for {
  3379  		x := v_0
  3380  		y := v_1
  3381  		if !(shiftIsBounded(v)) {
  3382  			break
  3383  		}
  3384  		v.reset(OpPPC64SLD)
  3385  		v.AddArg2(x, y)
  3386  		return true
  3387  	}
  3388  	// match: (Lsh8x8 <t> x y)
  3389  	// result: (ISEL [2] (SLD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F8] y)))
  3390  	for {
  3391  		t := v.Type
  3392  		x := v_0
  3393  		y := v_1
  3394  		v.reset(OpPPC64ISEL)
  3395  		v.AuxInt = int32ToAuxInt(2)
  3396  		v0 := b.NewValue0(v.Pos, OpPPC64SLD, t)
  3397  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  3398  		v1.AddArg(x)
  3399  		v0.AddArg2(v1, y)
  3400  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  3401  		v2.AuxInt = int64ToAuxInt(0)
  3402  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  3403  		v3.AuxInt = int64ToAuxInt(0)
  3404  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
  3405  		v4.AuxInt = int64ToAuxInt(0x00F8)
  3406  		v4.AddArg(y)
  3407  		v3.AddArg(v4)
  3408  		v.AddArg3(v0, v2, v3)
  3409  		return true
  3410  	}
  3411  }
  3412  func rewriteValuePPC64_OpMax32F(v *Value) bool {
  3413  	v_1 := v.Args[1]
  3414  	v_0 := v.Args[0]
  3415  	// match: (Max32F x y)
  3416  	// cond: buildcfg.GOPPC64 >= 9
  3417  	// result: (XSMAXJDP x y)
  3418  	for {
  3419  		x := v_0
  3420  		y := v_1
  3421  		if !(buildcfg.GOPPC64 >= 9) {
  3422  			break
  3423  		}
  3424  		v.reset(OpPPC64XSMAXJDP)
  3425  		v.AddArg2(x, y)
  3426  		return true
  3427  	}
  3428  	return false
  3429  }
  3430  func rewriteValuePPC64_OpMax64F(v *Value) bool {
  3431  	v_1 := v.Args[1]
  3432  	v_0 := v.Args[0]
  3433  	// match: (Max64F x y)
  3434  	// cond: buildcfg.GOPPC64 >= 9
  3435  	// result: (XSMAXJDP x y)
  3436  	for {
  3437  		x := v_0
  3438  		y := v_1
  3439  		if !(buildcfg.GOPPC64 >= 9) {
  3440  			break
  3441  		}
  3442  		v.reset(OpPPC64XSMAXJDP)
  3443  		v.AddArg2(x, y)
  3444  		return true
  3445  	}
  3446  	return false
  3447  }
  3448  func rewriteValuePPC64_OpMin32F(v *Value) bool {
  3449  	v_1 := v.Args[1]
  3450  	v_0 := v.Args[0]
  3451  	// match: (Min32F x y)
  3452  	// cond: buildcfg.GOPPC64 >= 9
  3453  	// result: (XSMINJDP x y)
  3454  	for {
  3455  		x := v_0
  3456  		y := v_1
  3457  		if !(buildcfg.GOPPC64 >= 9) {
  3458  			break
  3459  		}
  3460  		v.reset(OpPPC64XSMINJDP)
  3461  		v.AddArg2(x, y)
  3462  		return true
  3463  	}
  3464  	return false
  3465  }
  3466  func rewriteValuePPC64_OpMin64F(v *Value) bool {
  3467  	v_1 := v.Args[1]
  3468  	v_0 := v.Args[0]
  3469  	// match: (Min64F x y)
  3470  	// cond: buildcfg.GOPPC64 >= 9
  3471  	// result: (XSMINJDP x y)
  3472  	for {
  3473  		x := v_0
  3474  		y := v_1
  3475  		if !(buildcfg.GOPPC64 >= 9) {
  3476  			break
  3477  		}
  3478  		v.reset(OpPPC64XSMINJDP)
  3479  		v.AddArg2(x, y)
  3480  		return true
  3481  	}
  3482  	return false
  3483  }
  3484  func rewriteValuePPC64_OpMod16(v *Value) bool {
  3485  	v_1 := v.Args[1]
  3486  	v_0 := v.Args[0]
  3487  	b := v.Block
  3488  	typ := &b.Func.Config.Types
  3489  	// match: (Mod16 x y)
  3490  	// result: (Mod32 (SignExt16to32 x) (SignExt16to32 y))
  3491  	for {
  3492  		x := v_0
  3493  		y := v_1
  3494  		v.reset(OpMod32)
  3495  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3496  		v0.AddArg(x)
  3497  		v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3498  		v1.AddArg(y)
  3499  		v.AddArg2(v0, v1)
  3500  		return true
  3501  	}
  3502  }
  3503  func rewriteValuePPC64_OpMod16u(v *Value) bool {
  3504  	v_1 := v.Args[1]
  3505  	v_0 := v.Args[0]
  3506  	b := v.Block
  3507  	typ := &b.Func.Config.Types
  3508  	// match: (Mod16u x y)
  3509  	// result: (Mod32u (ZeroExt16to32 x) (ZeroExt16to32 y))
  3510  	for {
  3511  		x := v_0
  3512  		y := v_1
  3513  		v.reset(OpMod32u)
  3514  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3515  		v0.AddArg(x)
  3516  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3517  		v1.AddArg(y)
  3518  		v.AddArg2(v0, v1)
  3519  		return true
  3520  	}
  3521  }
  3522  func rewriteValuePPC64_OpMod32(v *Value) bool {
  3523  	v_1 := v.Args[1]
  3524  	v_0 := v.Args[0]
  3525  	b := v.Block
  3526  	typ := &b.Func.Config.Types
  3527  	// match: (Mod32 x y)
  3528  	// cond: buildcfg.GOPPC64 >= 9
  3529  	// result: (MODSW x y)
  3530  	for {
  3531  		x := v_0
  3532  		y := v_1
  3533  		if !(buildcfg.GOPPC64 >= 9) {
  3534  			break
  3535  		}
  3536  		v.reset(OpPPC64MODSW)
  3537  		v.AddArg2(x, y)
  3538  		return true
  3539  	}
  3540  	// match: (Mod32 x y)
  3541  	// cond: buildcfg.GOPPC64 <= 8
  3542  	// result: (SUB x (MULLW y (DIVW x y)))
  3543  	for {
  3544  		x := v_0
  3545  		y := v_1
  3546  		if !(buildcfg.GOPPC64 <= 8) {
  3547  			break
  3548  		}
  3549  		v.reset(OpPPC64SUB)
  3550  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3551  		v1 := b.NewValue0(v.Pos, OpPPC64DIVW, typ.Int32)
  3552  		v1.AddArg2(x, y)
  3553  		v0.AddArg2(y, v1)
  3554  		v.AddArg2(x, v0)
  3555  		return true
  3556  	}
  3557  	return false
  3558  }
  3559  func rewriteValuePPC64_OpMod32u(v *Value) bool {
  3560  	v_1 := v.Args[1]
  3561  	v_0 := v.Args[0]
  3562  	b := v.Block
  3563  	typ := &b.Func.Config.Types
  3564  	// match: (Mod32u x y)
  3565  	// cond: buildcfg.GOPPC64 >= 9
  3566  	// result: (MODUW x y)
  3567  	for {
  3568  		x := v_0
  3569  		y := v_1
  3570  		if !(buildcfg.GOPPC64 >= 9) {
  3571  			break
  3572  		}
  3573  		v.reset(OpPPC64MODUW)
  3574  		v.AddArg2(x, y)
  3575  		return true
  3576  	}
  3577  	// match: (Mod32u x y)
  3578  	// cond: buildcfg.GOPPC64 <= 8
  3579  	// result: (SUB x (MULLW y (DIVWU x y)))
  3580  	for {
  3581  		x := v_0
  3582  		y := v_1
  3583  		if !(buildcfg.GOPPC64 <= 8) {
  3584  			break
  3585  		}
  3586  		v.reset(OpPPC64SUB)
  3587  		v0 := b.NewValue0(v.Pos, OpPPC64MULLW, typ.Int32)
  3588  		v1 := b.NewValue0(v.Pos, OpPPC64DIVWU, typ.Int32)
  3589  		v1.AddArg2(x, y)
  3590  		v0.AddArg2(y, v1)
  3591  		v.AddArg2(x, v0)
  3592  		return true
  3593  	}
  3594  	return false
  3595  }
  3596  func rewriteValuePPC64_OpMod64(v *Value) bool {
  3597  	v_1 := v.Args[1]
  3598  	v_0 := v.Args[0]
  3599  	b := v.Block
  3600  	typ := &b.Func.Config.Types
  3601  	// match: (Mod64 x y)
  3602  	// cond: buildcfg.GOPPC64 >=9
  3603  	// result: (MODSD x y)
  3604  	for {
  3605  		x := v_0
  3606  		y := v_1
  3607  		if !(buildcfg.GOPPC64 >= 9) {
  3608  			break
  3609  		}
  3610  		v.reset(OpPPC64MODSD)
  3611  		v.AddArg2(x, y)
  3612  		return true
  3613  	}
  3614  	// match: (Mod64 x y)
  3615  	// cond: buildcfg.GOPPC64 <=8
  3616  	// result: (SUB x (MULLD y (DIVD x y)))
  3617  	for {
  3618  		x := v_0
  3619  		y := v_1
  3620  		if !(buildcfg.GOPPC64 <= 8) {
  3621  			break
  3622  		}
  3623  		v.reset(OpPPC64SUB)
  3624  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3625  		v1 := b.NewValue0(v.Pos, OpPPC64DIVD, typ.Int64)
  3626  		v1.AddArg2(x, y)
  3627  		v0.AddArg2(y, v1)
  3628  		v.AddArg2(x, v0)
  3629  		return true
  3630  	}
  3631  	return false
  3632  }
  3633  func rewriteValuePPC64_OpMod64u(v *Value) bool {
  3634  	v_1 := v.Args[1]
  3635  	v_0 := v.Args[0]
  3636  	b := v.Block
  3637  	typ := &b.Func.Config.Types
  3638  	// match: (Mod64u x y)
  3639  	// cond: buildcfg.GOPPC64 >= 9
  3640  	// result: (MODUD x y)
  3641  	for {
  3642  		x := v_0
  3643  		y := v_1
  3644  		if !(buildcfg.GOPPC64 >= 9) {
  3645  			break
  3646  		}
  3647  		v.reset(OpPPC64MODUD)
  3648  		v.AddArg2(x, y)
  3649  		return true
  3650  	}
  3651  	// match: (Mod64u x y)
  3652  	// cond: buildcfg.GOPPC64 <= 8
  3653  	// result: (SUB x (MULLD y (DIVDU x y)))
  3654  	for {
  3655  		x := v_0
  3656  		y := v_1
  3657  		if !(buildcfg.GOPPC64 <= 8) {
  3658  			break
  3659  		}
  3660  		v.reset(OpPPC64SUB)
  3661  		v0 := b.NewValue0(v.Pos, OpPPC64MULLD, typ.Int64)
  3662  		v1 := b.NewValue0(v.Pos, OpPPC64DIVDU, typ.Int64)
  3663  		v1.AddArg2(x, y)
  3664  		v0.AddArg2(y, v1)
  3665  		v.AddArg2(x, v0)
  3666  		return true
  3667  	}
  3668  	return false
  3669  }
  3670  func rewriteValuePPC64_OpMod8(v *Value) bool {
  3671  	v_1 := v.Args[1]
  3672  	v_0 := v.Args[0]
  3673  	b := v.Block
  3674  	typ := &b.Func.Config.Types
  3675  	// match: (Mod8 x y)
  3676  	// result: (Mod32 (SignExt8to32 x) (SignExt8to32 y))
  3677  	for {
  3678  		x := v_0
  3679  		y := v_1
  3680  		v.reset(OpMod32)
  3681  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3682  		v0.AddArg(x)
  3683  		v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  3684  		v1.AddArg(y)
  3685  		v.AddArg2(v0, v1)
  3686  		return true
  3687  	}
  3688  }
  3689  func rewriteValuePPC64_OpMod8u(v *Value) bool {
  3690  	v_1 := v.Args[1]
  3691  	v_0 := v.Args[0]
  3692  	b := v.Block
  3693  	typ := &b.Func.Config.Types
  3694  	// match: (Mod8u x y)
  3695  	// result: (Mod32u (ZeroExt8to32 x) (ZeroExt8to32 y))
  3696  	for {
  3697  		x := v_0
  3698  		y := v_1
  3699  		v.reset(OpMod32u)
  3700  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3701  		v0.AddArg(x)
  3702  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  3703  		v1.AddArg(y)
  3704  		v.AddArg2(v0, v1)
  3705  		return true
  3706  	}
  3707  }
  3708  func rewriteValuePPC64_OpMove(v *Value) bool {
  3709  	v_2 := v.Args[2]
  3710  	v_1 := v.Args[1]
  3711  	v_0 := v.Args[0]
  3712  	b := v.Block
  3713  	typ := &b.Func.Config.Types
  3714  	// match: (Move [0] _ _ mem)
  3715  	// result: mem
  3716  	for {
  3717  		if auxIntToInt64(v.AuxInt) != 0 {
  3718  			break
  3719  		}
  3720  		mem := v_2
  3721  		v.copyOf(mem)
  3722  		return true
  3723  	}
  3724  	// match: (Move [1] dst src mem)
  3725  	// result: (MOVBstore dst (MOVBZload src mem) mem)
  3726  	for {
  3727  		if auxIntToInt64(v.AuxInt) != 1 {
  3728  			break
  3729  		}
  3730  		dst := v_0
  3731  		src := v_1
  3732  		mem := v_2
  3733  		v.reset(OpPPC64MOVBstore)
  3734  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3735  		v0.AddArg2(src, mem)
  3736  		v.AddArg3(dst, v0, mem)
  3737  		return true
  3738  	}
  3739  	// match: (Move [2] dst src mem)
  3740  	// result: (MOVHstore dst (MOVHZload src mem) mem)
  3741  	for {
  3742  		if auxIntToInt64(v.AuxInt) != 2 {
  3743  			break
  3744  		}
  3745  		dst := v_0
  3746  		src := v_1
  3747  		mem := v_2
  3748  		v.reset(OpPPC64MOVHstore)
  3749  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3750  		v0.AddArg2(src, mem)
  3751  		v.AddArg3(dst, v0, mem)
  3752  		return true
  3753  	}
  3754  	// match: (Move [4] dst src mem)
  3755  	// result: (MOVWstore dst (MOVWZload src mem) mem)
  3756  	for {
  3757  		if auxIntToInt64(v.AuxInt) != 4 {
  3758  			break
  3759  		}
  3760  		dst := v_0
  3761  		src := v_1
  3762  		mem := v_2
  3763  		v.reset(OpPPC64MOVWstore)
  3764  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3765  		v0.AddArg2(src, mem)
  3766  		v.AddArg3(dst, v0, mem)
  3767  		return true
  3768  	}
  3769  	// match: (Move [8] {t} dst src mem)
  3770  	// result: (MOVDstore dst (MOVDload src mem) mem)
  3771  	for {
  3772  		if auxIntToInt64(v.AuxInt) != 8 {
  3773  			break
  3774  		}
  3775  		dst := v_0
  3776  		src := v_1
  3777  		mem := v_2
  3778  		v.reset(OpPPC64MOVDstore)
  3779  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDload, typ.Int64)
  3780  		v0.AddArg2(src, mem)
  3781  		v.AddArg3(dst, v0, mem)
  3782  		return true
  3783  	}
  3784  	// match: (Move [3] dst src mem)
  3785  	// result: (MOVBstore [2] dst (MOVBZload [2] src mem) (MOVHstore dst (MOVHload src mem) mem))
  3786  	for {
  3787  		if auxIntToInt64(v.AuxInt) != 3 {
  3788  			break
  3789  		}
  3790  		dst := v_0
  3791  		src := v_1
  3792  		mem := v_2
  3793  		v.reset(OpPPC64MOVBstore)
  3794  		v.AuxInt = int32ToAuxInt(2)
  3795  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3796  		v0.AuxInt = int32ToAuxInt(2)
  3797  		v0.AddArg2(src, mem)
  3798  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3799  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHload, typ.Int16)
  3800  		v2.AddArg2(src, mem)
  3801  		v1.AddArg3(dst, v2, mem)
  3802  		v.AddArg3(dst, v0, v1)
  3803  		return true
  3804  	}
  3805  	// match: (Move [5] dst src mem)
  3806  	// result: (MOVBstore [4] dst (MOVBZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3807  	for {
  3808  		if auxIntToInt64(v.AuxInt) != 5 {
  3809  			break
  3810  		}
  3811  		dst := v_0
  3812  		src := v_1
  3813  		mem := v_2
  3814  		v.reset(OpPPC64MOVBstore)
  3815  		v.AuxInt = int32ToAuxInt(4)
  3816  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3817  		v0.AuxInt = int32ToAuxInt(4)
  3818  		v0.AddArg2(src, mem)
  3819  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3820  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3821  		v2.AddArg2(src, mem)
  3822  		v1.AddArg3(dst, v2, mem)
  3823  		v.AddArg3(dst, v0, v1)
  3824  		return true
  3825  	}
  3826  	// match: (Move [6] dst src mem)
  3827  	// result: (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem))
  3828  	for {
  3829  		if auxIntToInt64(v.AuxInt) != 6 {
  3830  			break
  3831  		}
  3832  		dst := v_0
  3833  		src := v_1
  3834  		mem := v_2
  3835  		v.reset(OpPPC64MOVHstore)
  3836  		v.AuxInt = int32ToAuxInt(4)
  3837  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3838  		v0.AuxInt = int32ToAuxInt(4)
  3839  		v0.AddArg2(src, mem)
  3840  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3841  		v2 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3842  		v2.AddArg2(src, mem)
  3843  		v1.AddArg3(dst, v2, mem)
  3844  		v.AddArg3(dst, v0, v1)
  3845  		return true
  3846  	}
  3847  	// match: (Move [7] dst src mem)
  3848  	// result: (MOVBstore [6] dst (MOVBZload [6] src mem) (MOVHstore [4] dst (MOVHZload [4] src mem) (MOVWstore dst (MOVWZload src mem) mem)))
  3849  	for {
  3850  		if auxIntToInt64(v.AuxInt) != 7 {
  3851  			break
  3852  		}
  3853  		dst := v_0
  3854  		src := v_1
  3855  		mem := v_2
  3856  		v.reset(OpPPC64MOVBstore)
  3857  		v.AuxInt = int32ToAuxInt(6)
  3858  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZload, typ.UInt8)
  3859  		v0.AuxInt = int32ToAuxInt(6)
  3860  		v0.AddArg2(src, mem)
  3861  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHstore, types.TypeMem)
  3862  		v1.AuxInt = int32ToAuxInt(4)
  3863  		v2 := b.NewValue0(v.Pos, OpPPC64MOVHZload, typ.UInt16)
  3864  		v2.AuxInt = int32ToAuxInt(4)
  3865  		v2.AddArg2(src, mem)
  3866  		v3 := b.NewValue0(v.Pos, OpPPC64MOVWstore, types.TypeMem)
  3867  		v4 := b.NewValue0(v.Pos, OpPPC64MOVWZload, typ.UInt32)
  3868  		v4.AddArg2(src, mem)
  3869  		v3.AddArg3(dst, v4, mem)
  3870  		v1.AddArg3(dst, v2, v3)
  3871  		v.AddArg3(dst, v0, v1)
  3872  		return true
  3873  	}
  3874  	// match: (Move [s] dst src mem)
  3875  	// cond: s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)
  3876  	// result: (LoweredMove [s] dst src mem)
  3877  	for {
  3878  		s := auxIntToInt64(v.AuxInt)
  3879  		dst := v_0
  3880  		src := v_1
  3881  		mem := v_2
  3882  		if !(s > 8 && buildcfg.GOPPC64 <= 8 && logLargeCopy(v, s)) {
  3883  			break
  3884  		}
  3885  		v.reset(OpPPC64LoweredMove)
  3886  		v.AuxInt = int64ToAuxInt(s)
  3887  		v.AddArg3(dst, src, mem)
  3888  		return true
  3889  	}
  3890  	// match: (Move [s] dst src mem)
  3891  	// cond: s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9
  3892  	// result: (LoweredQuadMoveShort [s] dst src mem)
  3893  	for {
  3894  		s := auxIntToInt64(v.AuxInt)
  3895  		dst := v_0
  3896  		src := v_1
  3897  		mem := v_2
  3898  		if !(s > 8 && s <= 64 && buildcfg.GOPPC64 >= 9) {
  3899  			break
  3900  		}
  3901  		v.reset(OpPPC64LoweredQuadMoveShort)
  3902  		v.AuxInt = int64ToAuxInt(s)
  3903  		v.AddArg3(dst, src, mem)
  3904  		return true
  3905  	}
  3906  	// match: (Move [s] dst src mem)
  3907  	// cond: s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)
  3908  	// result: (LoweredQuadMove [s] dst src mem)
  3909  	for {
  3910  		s := auxIntToInt64(v.AuxInt)
  3911  		dst := v_0
  3912  		src := v_1
  3913  		mem := v_2
  3914  		if !(s > 8 && buildcfg.GOPPC64 >= 9 && logLargeCopy(v, s)) {
  3915  			break
  3916  		}
  3917  		v.reset(OpPPC64LoweredQuadMove)
  3918  		v.AuxInt = int64ToAuxInt(s)
  3919  		v.AddArg3(dst, src, mem)
  3920  		return true
  3921  	}
  3922  	return false
  3923  }
  3924  func rewriteValuePPC64_OpNeq16(v *Value) bool {
  3925  	v_1 := v.Args[1]
  3926  	v_0 := v.Args[0]
  3927  	b := v.Block
  3928  	typ := &b.Func.Config.Types
  3929  	// match: (Neq16 x y)
  3930  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  3931  	// result: (NotEqual (CMPW (SignExt16to32 x) (SignExt16to32 y)))
  3932  	for {
  3933  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  3934  			x := v_0
  3935  			y := v_1
  3936  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  3937  				continue
  3938  			}
  3939  			v.reset(OpPPC64NotEqual)
  3940  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3941  			v1 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3942  			v1.AddArg(x)
  3943  			v2 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
  3944  			v2.AddArg(y)
  3945  			v0.AddArg2(v1, v2)
  3946  			v.AddArg(v0)
  3947  			return true
  3948  		}
  3949  		break
  3950  	}
  3951  	// match: (Neq16 x y)
  3952  	// result: (NotEqual (CMPW (ZeroExt16to32 x) (ZeroExt16to32 y)))
  3953  	for {
  3954  		x := v_0
  3955  		y := v_1
  3956  		v.reset(OpPPC64NotEqual)
  3957  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3958  		v1 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3959  		v1.AddArg(x)
  3960  		v2 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
  3961  		v2.AddArg(y)
  3962  		v0.AddArg2(v1, v2)
  3963  		v.AddArg(v0)
  3964  		return true
  3965  	}
  3966  }
  3967  func rewriteValuePPC64_OpNeq32(v *Value) bool {
  3968  	v_1 := v.Args[1]
  3969  	v_0 := v.Args[0]
  3970  	b := v.Block
  3971  	// match: (Neq32 x y)
  3972  	// result: (NotEqual (CMPW x y))
  3973  	for {
  3974  		x := v_0
  3975  		y := v_1
  3976  		v.reset(OpPPC64NotEqual)
  3977  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  3978  		v0.AddArg2(x, y)
  3979  		v.AddArg(v0)
  3980  		return true
  3981  	}
  3982  }
  3983  func rewriteValuePPC64_OpNeq32F(v *Value) bool {
  3984  	v_1 := v.Args[1]
  3985  	v_0 := v.Args[0]
  3986  	b := v.Block
  3987  	// match: (Neq32F x y)
  3988  	// result: (NotEqual (FCMPU x y))
  3989  	for {
  3990  		x := v_0
  3991  		y := v_1
  3992  		v.reset(OpPPC64NotEqual)
  3993  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  3994  		v0.AddArg2(x, y)
  3995  		v.AddArg(v0)
  3996  		return true
  3997  	}
  3998  }
  3999  func rewriteValuePPC64_OpNeq64(v *Value) bool {
  4000  	v_1 := v.Args[1]
  4001  	v_0 := v.Args[0]
  4002  	b := v.Block
  4003  	// match: (Neq64 x y)
  4004  	// result: (NotEqual (CMP x y))
  4005  	for {
  4006  		x := v_0
  4007  		y := v_1
  4008  		v.reset(OpPPC64NotEqual)
  4009  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  4010  		v0.AddArg2(x, y)
  4011  		v.AddArg(v0)
  4012  		return true
  4013  	}
  4014  }
  4015  func rewriteValuePPC64_OpNeq64F(v *Value) bool {
  4016  	v_1 := v.Args[1]
  4017  	v_0 := v.Args[0]
  4018  	b := v.Block
  4019  	// match: (Neq64F x y)
  4020  	// result: (NotEqual (FCMPU x y))
  4021  	for {
  4022  		x := v_0
  4023  		y := v_1
  4024  		v.reset(OpPPC64NotEqual)
  4025  		v0 := b.NewValue0(v.Pos, OpPPC64FCMPU, types.TypeFlags)
  4026  		v0.AddArg2(x, y)
  4027  		v.AddArg(v0)
  4028  		return true
  4029  	}
  4030  }
  4031  func rewriteValuePPC64_OpNeq8(v *Value) bool {
  4032  	v_1 := v.Args[1]
  4033  	v_0 := v.Args[0]
  4034  	b := v.Block
  4035  	typ := &b.Func.Config.Types
  4036  	// match: (Neq8 x y)
  4037  	// cond: x.Type.IsSigned() && y.Type.IsSigned()
  4038  	// result: (NotEqual (CMPW (SignExt8to32 x) (SignExt8to32 y)))
  4039  	for {
  4040  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4041  			x := v_0
  4042  			y := v_1
  4043  			if !(x.Type.IsSigned() && y.Type.IsSigned()) {
  4044  				continue
  4045  			}
  4046  			v.reset(OpPPC64NotEqual)
  4047  			v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  4048  			v1 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  4049  			v1.AddArg(x)
  4050  			v2 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
  4051  			v2.AddArg(y)
  4052  			v0.AddArg2(v1, v2)
  4053  			v.AddArg(v0)
  4054  			return true
  4055  		}
  4056  		break
  4057  	}
  4058  	// match: (Neq8 x y)
  4059  	// result: (NotEqual (CMPW (ZeroExt8to32 x) (ZeroExt8to32 y)))
  4060  	for {
  4061  		x := v_0
  4062  		y := v_1
  4063  		v.reset(OpPPC64NotEqual)
  4064  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  4065  		v1 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  4066  		v1.AddArg(x)
  4067  		v2 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
  4068  		v2.AddArg(y)
  4069  		v0.AddArg2(v1, v2)
  4070  		v.AddArg(v0)
  4071  		return true
  4072  	}
  4073  }
  4074  func rewriteValuePPC64_OpNeqPtr(v *Value) bool {
  4075  	v_1 := v.Args[1]
  4076  	v_0 := v.Args[0]
  4077  	b := v.Block
  4078  	// match: (NeqPtr x y)
  4079  	// result: (NotEqual (CMP x y))
  4080  	for {
  4081  		x := v_0
  4082  		y := v_1
  4083  		v.reset(OpPPC64NotEqual)
  4084  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  4085  		v0.AddArg2(x, y)
  4086  		v.AddArg(v0)
  4087  		return true
  4088  	}
  4089  }
  4090  func rewriteValuePPC64_OpNot(v *Value) bool {
  4091  	v_0 := v.Args[0]
  4092  	// match: (Not x)
  4093  	// result: (XORconst [1] x)
  4094  	for {
  4095  		x := v_0
  4096  		v.reset(OpPPC64XORconst)
  4097  		v.AuxInt = int64ToAuxInt(1)
  4098  		v.AddArg(x)
  4099  		return true
  4100  	}
  4101  }
  4102  func rewriteValuePPC64_OpOffPtr(v *Value) bool {
  4103  	v_0 := v.Args[0]
  4104  	b := v.Block
  4105  	typ := &b.Func.Config.Types
  4106  	// match: (OffPtr [off] ptr)
  4107  	// result: (ADD (MOVDconst <typ.Int64> [off]) ptr)
  4108  	for {
  4109  		off := auxIntToInt64(v.AuxInt)
  4110  		ptr := v_0
  4111  		v.reset(OpPPC64ADD)
  4112  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
  4113  		v0.AuxInt = int64ToAuxInt(off)
  4114  		v.AddArg2(v0, ptr)
  4115  		return true
  4116  	}
  4117  }
  4118  func rewriteValuePPC64_OpPPC64ADD(v *Value) bool {
  4119  	v_1 := v.Args[1]
  4120  	v_0 := v.Args[0]
  4121  	// match: (ADD l:(MULLD x y) z)
  4122  	// cond: buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)
  4123  	// result: (MADDLD x y z)
  4124  	for {
  4125  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4126  			l := v_0
  4127  			if l.Op != OpPPC64MULLD {
  4128  				continue
  4129  			}
  4130  			y := l.Args[1]
  4131  			x := l.Args[0]
  4132  			z := v_1
  4133  			if !(buildcfg.GOPPC64 >= 9 && l.Uses == 1 && clobber(l)) {
  4134  				continue
  4135  			}
  4136  			v.reset(OpPPC64MADDLD)
  4137  			v.AddArg3(x, y, z)
  4138  			return true
  4139  		}
  4140  		break
  4141  	}
  4142  	// match: (ADD x (MOVDconst <t> [c]))
  4143  	// cond: is32Bit(c) && !t.IsPtr()
  4144  	// result: (ADDconst [c] x)
  4145  	for {
  4146  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4147  			x := v_0
  4148  			if v_1.Op != OpPPC64MOVDconst {
  4149  				continue
  4150  			}
  4151  			t := v_1.Type
  4152  			c := auxIntToInt64(v_1.AuxInt)
  4153  			if !(is32Bit(c) && !t.IsPtr()) {
  4154  				continue
  4155  			}
  4156  			v.reset(OpPPC64ADDconst)
  4157  			v.AuxInt = int64ToAuxInt(c)
  4158  			v.AddArg(x)
  4159  			return true
  4160  		}
  4161  		break
  4162  	}
  4163  	return false
  4164  }
  4165  func rewriteValuePPC64_OpPPC64ADDC(v *Value) bool {
  4166  	v_1 := v.Args[1]
  4167  	v_0 := v.Args[0]
  4168  	// match: (ADDC x (MOVDconst [y]))
  4169  	// cond: is16Bit(y)
  4170  	// result: (ADDCconst [y] x)
  4171  	for {
  4172  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4173  			x := v_0
  4174  			if v_1.Op != OpPPC64MOVDconst {
  4175  				continue
  4176  			}
  4177  			y := auxIntToInt64(v_1.AuxInt)
  4178  			if !(is16Bit(y)) {
  4179  				continue
  4180  			}
  4181  			v.reset(OpPPC64ADDCconst)
  4182  			v.AuxInt = int64ToAuxInt(y)
  4183  			v.AddArg(x)
  4184  			return true
  4185  		}
  4186  		break
  4187  	}
  4188  	return false
  4189  }
  4190  func rewriteValuePPC64_OpPPC64ADDE(v *Value) bool {
  4191  	v_2 := v.Args[2]
  4192  	v_1 := v.Args[1]
  4193  	v_0 := v.Args[0]
  4194  	b := v.Block
  4195  	typ := &b.Func.Config.Types
  4196  	// match: (ADDE x y (Select1 <typ.UInt64> (ADDCconst (MOVDconst [0]) [-1])))
  4197  	// result: (ADDC x y)
  4198  	for {
  4199  		x := v_0
  4200  		y := v_1
  4201  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
  4202  			break
  4203  		}
  4204  		v_2_0 := v_2.Args[0]
  4205  		if v_2_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_2_0.AuxInt) != -1 {
  4206  			break
  4207  		}
  4208  		v_2_0_0 := v_2_0.Args[0]
  4209  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
  4210  			break
  4211  		}
  4212  		v.reset(OpPPC64ADDC)
  4213  		v.AddArg2(x, y)
  4214  		return true
  4215  	}
  4216  	// match: (ADDE (MOVDconst [0]) y c)
  4217  	// result: (ADDZE y c)
  4218  	for {
  4219  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4220  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0 {
  4221  				continue
  4222  			}
  4223  			y := v_1
  4224  			c := v_2
  4225  			v.reset(OpPPC64ADDZE)
  4226  			v.AddArg2(y, c)
  4227  			return true
  4228  		}
  4229  		break
  4230  	}
  4231  	return false
  4232  }
  4233  func rewriteValuePPC64_OpPPC64ADDconst(v *Value) bool {
  4234  	v_0 := v.Args[0]
  4235  	// match: (ADDconst [c] (ADDconst [d] x))
  4236  	// cond: is32Bit(c+d)
  4237  	// result: (ADDconst [c+d] x)
  4238  	for {
  4239  		c := auxIntToInt64(v.AuxInt)
  4240  		if v_0.Op != OpPPC64ADDconst {
  4241  			break
  4242  		}
  4243  		d := auxIntToInt64(v_0.AuxInt)
  4244  		x := v_0.Args[0]
  4245  		if !(is32Bit(c + d)) {
  4246  			break
  4247  		}
  4248  		v.reset(OpPPC64ADDconst)
  4249  		v.AuxInt = int64ToAuxInt(c + d)
  4250  		v.AddArg(x)
  4251  		return true
  4252  	}
  4253  	// match: (ADDconst [0] x)
  4254  	// result: x
  4255  	for {
  4256  		if auxIntToInt64(v.AuxInt) != 0 {
  4257  			break
  4258  		}
  4259  		x := v_0
  4260  		v.copyOf(x)
  4261  		return true
  4262  	}
  4263  	// match: (ADDconst [c] (MOVDaddr [d] {sym} x))
  4264  	// cond: is32Bit(c+int64(d))
  4265  	// result: (MOVDaddr [int32(c+int64(d))] {sym} x)
  4266  	for {
  4267  		c := auxIntToInt64(v.AuxInt)
  4268  		if v_0.Op != OpPPC64MOVDaddr {
  4269  			break
  4270  		}
  4271  		d := auxIntToInt32(v_0.AuxInt)
  4272  		sym := auxToSym(v_0.Aux)
  4273  		x := v_0.Args[0]
  4274  		if !(is32Bit(c + int64(d))) {
  4275  			break
  4276  		}
  4277  		v.reset(OpPPC64MOVDaddr)
  4278  		v.AuxInt = int32ToAuxInt(int32(c + int64(d)))
  4279  		v.Aux = symToAux(sym)
  4280  		v.AddArg(x)
  4281  		return true
  4282  	}
  4283  	// match: (ADDconst [c] x:(SP))
  4284  	// cond: is32Bit(c)
  4285  	// result: (MOVDaddr [int32(c)] x)
  4286  	for {
  4287  		c := auxIntToInt64(v.AuxInt)
  4288  		x := v_0
  4289  		if x.Op != OpSP || !(is32Bit(c)) {
  4290  			break
  4291  		}
  4292  		v.reset(OpPPC64MOVDaddr)
  4293  		v.AuxInt = int32ToAuxInt(int32(c))
  4294  		v.AddArg(x)
  4295  		return true
  4296  	}
  4297  	// match: (ADDconst [c] (SUBFCconst [d] x))
  4298  	// cond: is32Bit(c+d)
  4299  	// result: (SUBFCconst [c+d] x)
  4300  	for {
  4301  		c := auxIntToInt64(v.AuxInt)
  4302  		if v_0.Op != OpPPC64SUBFCconst {
  4303  			break
  4304  		}
  4305  		d := auxIntToInt64(v_0.AuxInt)
  4306  		x := v_0.Args[0]
  4307  		if !(is32Bit(c + d)) {
  4308  			break
  4309  		}
  4310  		v.reset(OpPPC64SUBFCconst)
  4311  		v.AuxInt = int64ToAuxInt(c + d)
  4312  		v.AddArg(x)
  4313  		return true
  4314  	}
  4315  	return false
  4316  }
  4317  func rewriteValuePPC64_OpPPC64AND(v *Value) bool {
  4318  	v_1 := v.Args[1]
  4319  	v_0 := v.Args[0]
  4320  	// match: (AND (MOVDconst [m]) (ROTLWconst [r] x))
  4321  	// cond: isPPC64WordRotateMask(m)
  4322  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4323  	for {
  4324  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4325  			if v_0.Op != OpPPC64MOVDconst {
  4326  				continue
  4327  			}
  4328  			m := auxIntToInt64(v_0.AuxInt)
  4329  			if v_1.Op != OpPPC64ROTLWconst {
  4330  				continue
  4331  			}
  4332  			r := auxIntToInt64(v_1.AuxInt)
  4333  			x := v_1.Args[0]
  4334  			if !(isPPC64WordRotateMask(m)) {
  4335  				continue
  4336  			}
  4337  			v.reset(OpPPC64RLWINM)
  4338  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4339  			v.AddArg(x)
  4340  			return true
  4341  		}
  4342  		break
  4343  	}
  4344  	// match: (AND (MOVDconst [m]) (ROTLW x r))
  4345  	// cond: isPPC64WordRotateMask(m)
  4346  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4347  	for {
  4348  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4349  			if v_0.Op != OpPPC64MOVDconst {
  4350  				continue
  4351  			}
  4352  			m := auxIntToInt64(v_0.AuxInt)
  4353  			if v_1.Op != OpPPC64ROTLW {
  4354  				continue
  4355  			}
  4356  			r := v_1.Args[1]
  4357  			x := v_1.Args[0]
  4358  			if !(isPPC64WordRotateMask(m)) {
  4359  				continue
  4360  			}
  4361  			v.reset(OpPPC64RLWNM)
  4362  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4363  			v.AddArg2(x, r)
  4364  			return true
  4365  		}
  4366  		break
  4367  	}
  4368  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4369  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4370  	// result: (MOVDconst [0])
  4371  	for {
  4372  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4373  			if v_0.Op != OpPPC64MOVDconst {
  4374  				continue
  4375  			}
  4376  			m := auxIntToInt64(v_0.AuxInt)
  4377  			if v_1.Op != OpPPC64SRWconst {
  4378  				continue
  4379  			}
  4380  			s := auxIntToInt64(v_1.AuxInt)
  4381  			if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4382  				continue
  4383  			}
  4384  			v.reset(OpPPC64MOVDconst)
  4385  			v.AuxInt = int64ToAuxInt(0)
  4386  			return true
  4387  		}
  4388  		break
  4389  	}
  4390  	// match: (AND (MOVDconst [m]) (SRWconst x [s]))
  4391  	// cond: mergePPC64AndSrwi(m,s) != 0
  4392  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4393  	for {
  4394  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4395  			if v_0.Op != OpPPC64MOVDconst {
  4396  				continue
  4397  			}
  4398  			m := auxIntToInt64(v_0.AuxInt)
  4399  			if v_1.Op != OpPPC64SRWconst {
  4400  				continue
  4401  			}
  4402  			s := auxIntToInt64(v_1.AuxInt)
  4403  			x := v_1.Args[0]
  4404  			if !(mergePPC64AndSrwi(m, s) != 0) {
  4405  				continue
  4406  			}
  4407  			v.reset(OpPPC64RLWINM)
  4408  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4409  			v.AddArg(x)
  4410  			return true
  4411  		}
  4412  		break
  4413  	}
  4414  	// match: (AND (MOVDconst [m]) (SRDconst x [s]))
  4415  	// cond: mergePPC64AndSrdi(m,s) != 0
  4416  	// result: (RLWINM [mergePPC64AndSrdi(m,s)] x)
  4417  	for {
  4418  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4419  			if v_0.Op != OpPPC64MOVDconst {
  4420  				continue
  4421  			}
  4422  			m := auxIntToInt64(v_0.AuxInt)
  4423  			if v_1.Op != OpPPC64SRDconst {
  4424  				continue
  4425  			}
  4426  			s := auxIntToInt64(v_1.AuxInt)
  4427  			x := v_1.Args[0]
  4428  			if !(mergePPC64AndSrdi(m, s) != 0) {
  4429  				continue
  4430  			}
  4431  			v.reset(OpPPC64RLWINM)
  4432  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
  4433  			v.AddArg(x)
  4434  			return true
  4435  		}
  4436  		break
  4437  	}
  4438  	// match: (AND (MOVDconst [m]) (SLDconst x [s]))
  4439  	// cond: mergePPC64AndSldi(m,s) != 0
  4440  	// result: (RLWINM [mergePPC64AndSldi(m,s)] x)
  4441  	for {
  4442  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4443  			if v_0.Op != OpPPC64MOVDconst {
  4444  				continue
  4445  			}
  4446  			m := auxIntToInt64(v_0.AuxInt)
  4447  			if v_1.Op != OpPPC64SLDconst {
  4448  				continue
  4449  			}
  4450  			s := auxIntToInt64(v_1.AuxInt)
  4451  			x := v_1.Args[0]
  4452  			if !(mergePPC64AndSldi(m, s) != 0) {
  4453  				continue
  4454  			}
  4455  			v.reset(OpPPC64RLWINM)
  4456  			v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
  4457  			v.AddArg(x)
  4458  			return true
  4459  		}
  4460  		break
  4461  	}
  4462  	// match: (AND x (NOR y y))
  4463  	// result: (ANDN x y)
  4464  	for {
  4465  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4466  			x := v_0
  4467  			if v_1.Op != OpPPC64NOR {
  4468  				continue
  4469  			}
  4470  			y := v_1.Args[1]
  4471  			if y != v_1.Args[0] {
  4472  				continue
  4473  			}
  4474  			v.reset(OpPPC64ANDN)
  4475  			v.AddArg2(x, y)
  4476  			return true
  4477  		}
  4478  		break
  4479  	}
  4480  	// match: (AND (MOVDconst [c]) (MOVDconst [d]))
  4481  	// result: (MOVDconst [c&d])
  4482  	for {
  4483  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4484  			if v_0.Op != OpPPC64MOVDconst {
  4485  				continue
  4486  			}
  4487  			c := auxIntToInt64(v_0.AuxInt)
  4488  			if v_1.Op != OpPPC64MOVDconst {
  4489  				continue
  4490  			}
  4491  			d := auxIntToInt64(v_1.AuxInt)
  4492  			v.reset(OpPPC64MOVDconst)
  4493  			v.AuxInt = int64ToAuxInt(c & d)
  4494  			return true
  4495  		}
  4496  		break
  4497  	}
  4498  	// match: (AND x (MOVDconst [-1]))
  4499  	// result: x
  4500  	for {
  4501  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4502  			x := v_0
  4503  			if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
  4504  				continue
  4505  			}
  4506  			v.copyOf(x)
  4507  			return true
  4508  		}
  4509  		break
  4510  	}
  4511  	// match: (AND x (MOVDconst [c]))
  4512  	// cond: isU16Bit(c)
  4513  	// result: (ANDconst [c] x)
  4514  	for {
  4515  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4516  			x := v_0
  4517  			if v_1.Op != OpPPC64MOVDconst {
  4518  				continue
  4519  			}
  4520  			c := auxIntToInt64(v_1.AuxInt)
  4521  			if !(isU16Bit(c)) {
  4522  				continue
  4523  			}
  4524  			v.reset(OpPPC64ANDconst)
  4525  			v.AuxInt = int64ToAuxInt(c)
  4526  			v.AddArg(x)
  4527  			return true
  4528  		}
  4529  		break
  4530  	}
  4531  	// match: (AND (MOVDconst [c]) y:(MOVWZreg _))
  4532  	// cond: c&0xFFFFFFFF == 0xFFFFFFFF
  4533  	// result: y
  4534  	for {
  4535  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4536  			if v_0.Op != OpPPC64MOVDconst {
  4537  				continue
  4538  			}
  4539  			c := auxIntToInt64(v_0.AuxInt)
  4540  			y := v_1
  4541  			if y.Op != OpPPC64MOVWZreg || !(c&0xFFFFFFFF == 0xFFFFFFFF) {
  4542  				continue
  4543  			}
  4544  			v.copyOf(y)
  4545  			return true
  4546  		}
  4547  		break
  4548  	}
  4549  	// match: (AND (MOVDconst [0xFFFFFFFF]) y:(MOVWreg x))
  4550  	// result: (MOVWZreg x)
  4551  	for {
  4552  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4553  			if v_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_0.AuxInt) != 0xFFFFFFFF {
  4554  				continue
  4555  			}
  4556  			y := v_1
  4557  			if y.Op != OpPPC64MOVWreg {
  4558  				continue
  4559  			}
  4560  			x := y.Args[0]
  4561  			v.reset(OpPPC64MOVWZreg)
  4562  			v.AddArg(x)
  4563  			return true
  4564  		}
  4565  		break
  4566  	}
  4567  	// match: (AND (MOVDconst [c]) x:(MOVBZload _ _))
  4568  	// result: (ANDconst [c&0xFF] x)
  4569  	for {
  4570  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  4571  			if v_0.Op != OpPPC64MOVDconst {
  4572  				continue
  4573  			}
  4574  			c := auxIntToInt64(v_0.AuxInt)
  4575  			x := v_1
  4576  			if x.Op != OpPPC64MOVBZload {
  4577  				continue
  4578  			}
  4579  			v.reset(OpPPC64ANDconst)
  4580  			v.AuxInt = int64ToAuxInt(c & 0xFF)
  4581  			v.AddArg(x)
  4582  			return true
  4583  		}
  4584  		break
  4585  	}
  4586  	return false
  4587  }
  4588  func rewriteValuePPC64_OpPPC64ANDN(v *Value) bool {
  4589  	v_1 := v.Args[1]
  4590  	v_0 := v.Args[0]
  4591  	// match: (ANDN (MOVDconst [c]) (MOVDconst [d]))
  4592  	// result: (MOVDconst [c&^d])
  4593  	for {
  4594  		if v_0.Op != OpPPC64MOVDconst {
  4595  			break
  4596  		}
  4597  		c := auxIntToInt64(v_0.AuxInt)
  4598  		if v_1.Op != OpPPC64MOVDconst {
  4599  			break
  4600  		}
  4601  		d := auxIntToInt64(v_1.AuxInt)
  4602  		v.reset(OpPPC64MOVDconst)
  4603  		v.AuxInt = int64ToAuxInt(c &^ d)
  4604  		return true
  4605  	}
  4606  	return false
  4607  }
  4608  func rewriteValuePPC64_OpPPC64ANDconst(v *Value) bool {
  4609  	v_0 := v.Args[0]
  4610  	// match: (ANDconst [m] (ROTLWconst [r] x))
  4611  	// cond: isPPC64WordRotateMask(m)
  4612  	// result: (RLWINM [encodePPC64RotateMask(r,m,32)] x)
  4613  	for {
  4614  		m := auxIntToInt64(v.AuxInt)
  4615  		if v_0.Op != OpPPC64ROTLWconst {
  4616  			break
  4617  		}
  4618  		r := auxIntToInt64(v_0.AuxInt)
  4619  		x := v_0.Args[0]
  4620  		if !(isPPC64WordRotateMask(m)) {
  4621  			break
  4622  		}
  4623  		v.reset(OpPPC64RLWINM)
  4624  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, m, 32))
  4625  		v.AddArg(x)
  4626  		return true
  4627  	}
  4628  	// match: (ANDconst [m] (ROTLW x r))
  4629  	// cond: isPPC64WordRotateMask(m)
  4630  	// result: (RLWNM [encodePPC64RotateMask(0,m,32)] x r)
  4631  	for {
  4632  		m := auxIntToInt64(v.AuxInt)
  4633  		if v_0.Op != OpPPC64ROTLW {
  4634  			break
  4635  		}
  4636  		r := v_0.Args[1]
  4637  		x := v_0.Args[0]
  4638  		if !(isPPC64WordRotateMask(m)) {
  4639  			break
  4640  		}
  4641  		v.reset(OpPPC64RLWNM)
  4642  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(0, m, 32))
  4643  		v.AddArg2(x, r)
  4644  		return true
  4645  	}
  4646  	// match: (ANDconst [m] (SRWconst x [s]))
  4647  	// cond: mergePPC64RShiftMask(m,s,32) == 0
  4648  	// result: (MOVDconst [0])
  4649  	for {
  4650  		m := auxIntToInt64(v.AuxInt)
  4651  		if v_0.Op != OpPPC64SRWconst {
  4652  			break
  4653  		}
  4654  		s := auxIntToInt64(v_0.AuxInt)
  4655  		if !(mergePPC64RShiftMask(m, s, 32) == 0) {
  4656  			break
  4657  		}
  4658  		v.reset(OpPPC64MOVDconst)
  4659  		v.AuxInt = int64ToAuxInt(0)
  4660  		return true
  4661  	}
  4662  	// match: (ANDconst [m] (SRWconst x [s]))
  4663  	// cond: mergePPC64AndSrwi(m,s) != 0
  4664  	// result: (RLWINM [mergePPC64AndSrwi(m,s)] x)
  4665  	for {
  4666  		m := auxIntToInt64(v.AuxInt)
  4667  		if v_0.Op != OpPPC64SRWconst {
  4668  			break
  4669  		}
  4670  		s := auxIntToInt64(v_0.AuxInt)
  4671  		x := v_0.Args[0]
  4672  		if !(mergePPC64AndSrwi(m, s) != 0) {
  4673  			break
  4674  		}
  4675  		v.reset(OpPPC64RLWINM)
  4676  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m, s))
  4677  		v.AddArg(x)
  4678  		return true
  4679  	}
  4680  	// match: (ANDconst [m] (SRDconst x [s]))
  4681  	// cond: mergePPC64AndSrdi(m,s) != 0
  4682  	// result: (RLWINM [mergePPC64AndSrdi(m,s)] x)
  4683  	for {
  4684  		m := auxIntToInt64(v.AuxInt)
  4685  		if v_0.Op != OpPPC64SRDconst {
  4686  			break
  4687  		}
  4688  		s := auxIntToInt64(v_0.AuxInt)
  4689  		x := v_0.Args[0]
  4690  		if !(mergePPC64AndSrdi(m, s) != 0) {
  4691  			break
  4692  		}
  4693  		v.reset(OpPPC64RLWINM)
  4694  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrdi(m, s))
  4695  		v.AddArg(x)
  4696  		return true
  4697  	}
  4698  	// match: (ANDconst [m] (SLDconst x [s]))
  4699  	// cond: mergePPC64AndSldi(m,s) != 0
  4700  	// result: (RLWINM [mergePPC64AndSldi(m,s)] x)
  4701  	for {
  4702  		m := auxIntToInt64(v.AuxInt)
  4703  		if v_0.Op != OpPPC64SLDconst {
  4704  			break
  4705  		}
  4706  		s := auxIntToInt64(v_0.AuxInt)
  4707  		x := v_0.Args[0]
  4708  		if !(mergePPC64AndSldi(m, s) != 0) {
  4709  			break
  4710  		}
  4711  		v.reset(OpPPC64RLWINM)
  4712  		v.AuxInt = int64ToAuxInt(mergePPC64AndSldi(m, s))
  4713  		v.AddArg(x)
  4714  		return true
  4715  	}
  4716  	// match: (ANDconst [c] (ANDconst [d] x))
  4717  	// result: (ANDconst [c&d] x)
  4718  	for {
  4719  		c := auxIntToInt64(v.AuxInt)
  4720  		if v_0.Op != OpPPC64ANDconst {
  4721  			break
  4722  		}
  4723  		d := auxIntToInt64(v_0.AuxInt)
  4724  		x := v_0.Args[0]
  4725  		v.reset(OpPPC64ANDconst)
  4726  		v.AuxInt = int64ToAuxInt(c & d)
  4727  		v.AddArg(x)
  4728  		return true
  4729  	}
  4730  	// match: (ANDconst [-1] x)
  4731  	// result: x
  4732  	for {
  4733  		if auxIntToInt64(v.AuxInt) != -1 {
  4734  			break
  4735  		}
  4736  		x := v_0
  4737  		v.copyOf(x)
  4738  		return true
  4739  	}
  4740  	// match: (ANDconst [0] _)
  4741  	// result: (MOVDconst [0])
  4742  	for {
  4743  		if auxIntToInt64(v.AuxInt) != 0 {
  4744  			break
  4745  		}
  4746  		v.reset(OpPPC64MOVDconst)
  4747  		v.AuxInt = int64ToAuxInt(0)
  4748  		return true
  4749  	}
  4750  	// match: (ANDconst [c] y:(MOVBZreg _))
  4751  	// cond: c&0xFF == 0xFF
  4752  	// result: y
  4753  	for {
  4754  		c := auxIntToInt64(v.AuxInt)
  4755  		y := v_0
  4756  		if y.Op != OpPPC64MOVBZreg || !(c&0xFF == 0xFF) {
  4757  			break
  4758  		}
  4759  		v.copyOf(y)
  4760  		return true
  4761  	}
  4762  	// match: (ANDconst [0xFF] (MOVBreg x))
  4763  	// result: (MOVBZreg x)
  4764  	for {
  4765  		if auxIntToInt64(v.AuxInt) != 0xFF || v_0.Op != OpPPC64MOVBreg {
  4766  			break
  4767  		}
  4768  		x := v_0.Args[0]
  4769  		v.reset(OpPPC64MOVBZreg)
  4770  		v.AddArg(x)
  4771  		return true
  4772  	}
  4773  	// match: (ANDconst [c] y:(MOVHZreg _))
  4774  	// cond: c&0xFFFF == 0xFFFF
  4775  	// result: y
  4776  	for {
  4777  		c := auxIntToInt64(v.AuxInt)
  4778  		y := v_0
  4779  		if y.Op != OpPPC64MOVHZreg || !(c&0xFFFF == 0xFFFF) {
  4780  			break
  4781  		}
  4782  		v.copyOf(y)
  4783  		return true
  4784  	}
  4785  	// match: (ANDconst [0xFFFF] (MOVHreg x))
  4786  	// result: (MOVHZreg x)
  4787  	for {
  4788  		if auxIntToInt64(v.AuxInt) != 0xFFFF || v_0.Op != OpPPC64MOVHreg {
  4789  			break
  4790  		}
  4791  		x := v_0.Args[0]
  4792  		v.reset(OpPPC64MOVHZreg)
  4793  		v.AddArg(x)
  4794  		return true
  4795  	}
  4796  	// match: (ANDconst [c] (MOVBZreg x))
  4797  	// result: (ANDconst [c&0xFF] x)
  4798  	for {
  4799  		c := auxIntToInt64(v.AuxInt)
  4800  		if v_0.Op != OpPPC64MOVBZreg {
  4801  			break
  4802  		}
  4803  		x := v_0.Args[0]
  4804  		v.reset(OpPPC64ANDconst)
  4805  		v.AuxInt = int64ToAuxInt(c & 0xFF)
  4806  		v.AddArg(x)
  4807  		return true
  4808  	}
  4809  	// match: (ANDconst [c] (MOVHZreg x))
  4810  	// result: (ANDconst [c&0xFFFF] x)
  4811  	for {
  4812  		c := auxIntToInt64(v.AuxInt)
  4813  		if v_0.Op != OpPPC64MOVHZreg {
  4814  			break
  4815  		}
  4816  		x := v_0.Args[0]
  4817  		v.reset(OpPPC64ANDconst)
  4818  		v.AuxInt = int64ToAuxInt(c & 0xFFFF)
  4819  		v.AddArg(x)
  4820  		return true
  4821  	}
  4822  	// match: (ANDconst [c] (MOVWZreg x))
  4823  	// result: (ANDconst [c&0xFFFFFFFF] x)
  4824  	for {
  4825  		c := auxIntToInt64(v.AuxInt)
  4826  		if v_0.Op != OpPPC64MOVWZreg {
  4827  			break
  4828  		}
  4829  		x := v_0.Args[0]
  4830  		v.reset(OpPPC64ANDconst)
  4831  		v.AuxInt = int64ToAuxInt(c & 0xFFFFFFFF)
  4832  		v.AddArg(x)
  4833  		return true
  4834  	}
  4835  	// match: (ANDconst [m] (RLWINM [r] y))
  4836  	// cond: mergePPC64AndRlwinm(uint32(m),r) != 0
  4837  	// result: (RLWINM [mergePPC64AndRlwinm(uint32(m),r)] y)
  4838  	for {
  4839  		m := auxIntToInt64(v.AuxInt)
  4840  		if v_0.Op != OpPPC64RLWINM {
  4841  			break
  4842  		}
  4843  		r := auxIntToInt64(v_0.AuxInt)
  4844  		y := v_0.Args[0]
  4845  		if !(mergePPC64AndRlwinm(uint32(m), r) != 0) {
  4846  			break
  4847  		}
  4848  		v.reset(OpPPC64RLWINM)
  4849  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(uint32(m), r))
  4850  		v.AddArg(y)
  4851  		return true
  4852  	}
  4853  	// match: (ANDconst [1] z:(SRADconst [63] x))
  4854  	// cond: z.Uses == 1
  4855  	// result: (SRDconst [63] x)
  4856  	for {
  4857  		if auxIntToInt64(v.AuxInt) != 1 {
  4858  			break
  4859  		}
  4860  		z := v_0
  4861  		if z.Op != OpPPC64SRADconst || auxIntToInt64(z.AuxInt) != 63 {
  4862  			break
  4863  		}
  4864  		x := z.Args[0]
  4865  		if !(z.Uses == 1) {
  4866  			break
  4867  		}
  4868  		v.reset(OpPPC64SRDconst)
  4869  		v.AuxInt = int64ToAuxInt(63)
  4870  		v.AddArg(x)
  4871  		return true
  4872  	}
  4873  	return false
  4874  }
  4875  func rewriteValuePPC64_OpPPC64BRD(v *Value) bool {
  4876  	v_0 := v.Args[0]
  4877  	b := v.Block
  4878  	typ := &b.Func.Config.Types
  4879  	// match: (BRD x:(MOVDload [off] {sym} ptr mem))
  4880  	// cond: x.Uses == 1
  4881  	// result: @x.Block (MOVDBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4882  	for {
  4883  		x := v_0
  4884  		if x.Op != OpPPC64MOVDload {
  4885  			break
  4886  		}
  4887  		off := auxIntToInt32(x.AuxInt)
  4888  		sym := auxToSym(x.Aux)
  4889  		mem := x.Args[1]
  4890  		ptr := x.Args[0]
  4891  		if !(x.Uses == 1) {
  4892  			break
  4893  		}
  4894  		b = x.Block
  4895  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDBRload, typ.UInt64)
  4896  		v.copyOf(v0)
  4897  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  4898  		v1.AuxInt = int32ToAuxInt(off)
  4899  		v1.Aux = symToAux(sym)
  4900  		v1.AddArg(ptr)
  4901  		v0.AddArg2(v1, mem)
  4902  		return true
  4903  	}
  4904  	// match: (BRD x:(MOVDloadidx ptr idx mem))
  4905  	// cond: x.Uses == 1
  4906  	// result: @x.Block (MOVDBRloadidx ptr idx mem)
  4907  	for {
  4908  		x := v_0
  4909  		if x.Op != OpPPC64MOVDloadidx {
  4910  			break
  4911  		}
  4912  		mem := x.Args[2]
  4913  		ptr := x.Args[0]
  4914  		idx := x.Args[1]
  4915  		if !(x.Uses == 1) {
  4916  			break
  4917  		}
  4918  		b = x.Block
  4919  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDBRloadidx, typ.Int64)
  4920  		v.copyOf(v0)
  4921  		v0.AddArg3(ptr, idx, mem)
  4922  		return true
  4923  	}
  4924  	return false
  4925  }
  4926  func rewriteValuePPC64_OpPPC64BRH(v *Value) bool {
  4927  	v_0 := v.Args[0]
  4928  	b := v.Block
  4929  	typ := &b.Func.Config.Types
  4930  	// match: (BRH x:(MOVHZload [off] {sym} ptr mem))
  4931  	// cond: x.Uses == 1
  4932  	// result: @x.Block (MOVHBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4933  	for {
  4934  		x := v_0
  4935  		if x.Op != OpPPC64MOVHZload {
  4936  			break
  4937  		}
  4938  		off := auxIntToInt32(x.AuxInt)
  4939  		sym := auxToSym(x.Aux)
  4940  		mem := x.Args[1]
  4941  		ptr := x.Args[0]
  4942  		if !(x.Uses == 1) {
  4943  			break
  4944  		}
  4945  		b = x.Block
  4946  		v0 := b.NewValue0(x.Pos, OpPPC64MOVHBRload, typ.UInt16)
  4947  		v.copyOf(v0)
  4948  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  4949  		v1.AuxInt = int32ToAuxInt(off)
  4950  		v1.Aux = symToAux(sym)
  4951  		v1.AddArg(ptr)
  4952  		v0.AddArg2(v1, mem)
  4953  		return true
  4954  	}
  4955  	// match: (BRH x:(MOVHZloadidx ptr idx mem))
  4956  	// cond: x.Uses == 1
  4957  	// result: @x.Block (MOVHBRloadidx ptr idx mem)
  4958  	for {
  4959  		x := v_0
  4960  		if x.Op != OpPPC64MOVHZloadidx {
  4961  			break
  4962  		}
  4963  		mem := x.Args[2]
  4964  		ptr := x.Args[0]
  4965  		idx := x.Args[1]
  4966  		if !(x.Uses == 1) {
  4967  			break
  4968  		}
  4969  		b = x.Block
  4970  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHBRloadidx, typ.Int16)
  4971  		v.copyOf(v0)
  4972  		v0.AddArg3(ptr, idx, mem)
  4973  		return true
  4974  	}
  4975  	return false
  4976  }
  4977  func rewriteValuePPC64_OpPPC64BRW(v *Value) bool {
  4978  	v_0 := v.Args[0]
  4979  	b := v.Block
  4980  	typ := &b.Func.Config.Types
  4981  	// match: (BRW x:(MOVWZload [off] {sym} ptr mem))
  4982  	// cond: x.Uses == 1
  4983  	// result: @x.Block (MOVWBRload (MOVDaddr <ptr.Type> [off] {sym} ptr) mem)
  4984  	for {
  4985  		x := v_0
  4986  		if x.Op != OpPPC64MOVWZload {
  4987  			break
  4988  		}
  4989  		off := auxIntToInt32(x.AuxInt)
  4990  		sym := auxToSym(x.Aux)
  4991  		mem := x.Args[1]
  4992  		ptr := x.Args[0]
  4993  		if !(x.Uses == 1) {
  4994  			break
  4995  		}
  4996  		b = x.Block
  4997  		v0 := b.NewValue0(x.Pos, OpPPC64MOVWBRload, typ.UInt32)
  4998  		v.copyOf(v0)
  4999  		v1 := b.NewValue0(x.Pos, OpPPC64MOVDaddr, ptr.Type)
  5000  		v1.AuxInt = int32ToAuxInt(off)
  5001  		v1.Aux = symToAux(sym)
  5002  		v1.AddArg(ptr)
  5003  		v0.AddArg2(v1, mem)
  5004  		return true
  5005  	}
  5006  	// match: (BRW x:(MOVWZloadidx ptr idx mem))
  5007  	// cond: x.Uses == 1
  5008  	// result: @x.Block (MOVWBRloadidx ptr idx mem)
  5009  	for {
  5010  		x := v_0
  5011  		if x.Op != OpPPC64MOVWZloadidx {
  5012  			break
  5013  		}
  5014  		mem := x.Args[2]
  5015  		ptr := x.Args[0]
  5016  		idx := x.Args[1]
  5017  		if !(x.Uses == 1) {
  5018  			break
  5019  		}
  5020  		b = x.Block
  5021  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWBRloadidx, typ.Int32)
  5022  		v.copyOf(v0)
  5023  		v0.AddArg3(ptr, idx, mem)
  5024  		return true
  5025  	}
  5026  	return false
  5027  }
  5028  func rewriteValuePPC64_OpPPC64CLRLSLDI(v *Value) bool {
  5029  	v_0 := v.Args[0]
  5030  	// match: (CLRLSLDI [c] (SRWconst [s] x))
  5031  	// cond: mergePPC64ClrlsldiSrw(int64(c),s) != 0
  5032  	// result: (RLWINM [mergePPC64ClrlsldiSrw(int64(c),s)] x)
  5033  	for {
  5034  		c := auxIntToInt32(v.AuxInt)
  5035  		if v_0.Op != OpPPC64SRWconst {
  5036  			break
  5037  		}
  5038  		s := auxIntToInt64(v_0.AuxInt)
  5039  		x := v_0.Args[0]
  5040  		if !(mergePPC64ClrlsldiSrw(int64(c), s) != 0) {
  5041  			break
  5042  		}
  5043  		v.reset(OpPPC64RLWINM)
  5044  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrw(int64(c), s))
  5045  		v.AddArg(x)
  5046  		return true
  5047  	}
  5048  	// match: (CLRLSLDI [c] (SRDconst [s] x))
  5049  	// cond: mergePPC64ClrlsldiSrd(int64(c),s) != 0
  5050  	// result: (RLWINM [mergePPC64ClrlsldiSrd(int64(c),s)] x)
  5051  	for {
  5052  		c := auxIntToInt32(v.AuxInt)
  5053  		if v_0.Op != OpPPC64SRDconst {
  5054  			break
  5055  		}
  5056  		s := auxIntToInt64(v_0.AuxInt)
  5057  		x := v_0.Args[0]
  5058  		if !(mergePPC64ClrlsldiSrd(int64(c), s) != 0) {
  5059  			break
  5060  		}
  5061  		v.reset(OpPPC64RLWINM)
  5062  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiSrd(int64(c), s))
  5063  		v.AddArg(x)
  5064  		return true
  5065  	}
  5066  	// match: (CLRLSLDI [c] i:(RLWINM [s] x))
  5067  	// cond: mergePPC64ClrlsldiRlwinm(c,s) != 0
  5068  	// result: (RLWINM [mergePPC64ClrlsldiRlwinm(c,s)] x)
  5069  	for {
  5070  		c := auxIntToInt32(v.AuxInt)
  5071  		i := v_0
  5072  		if i.Op != OpPPC64RLWINM {
  5073  			break
  5074  		}
  5075  		s := auxIntToInt64(i.AuxInt)
  5076  		x := i.Args[0]
  5077  		if !(mergePPC64ClrlsldiRlwinm(c, s) != 0) {
  5078  			break
  5079  		}
  5080  		v.reset(OpPPC64RLWINM)
  5081  		v.AuxInt = int64ToAuxInt(mergePPC64ClrlsldiRlwinm(c, s))
  5082  		v.AddArg(x)
  5083  		return true
  5084  	}
  5085  	return false
  5086  }
  5087  func rewriteValuePPC64_OpPPC64CMP(v *Value) bool {
  5088  	v_1 := v.Args[1]
  5089  	v_0 := v.Args[0]
  5090  	b := v.Block
  5091  	// match: (CMP x (MOVDconst [c]))
  5092  	// cond: is16Bit(c)
  5093  	// result: (CMPconst x [c])
  5094  	for {
  5095  		x := v_0
  5096  		if v_1.Op != OpPPC64MOVDconst {
  5097  			break
  5098  		}
  5099  		c := auxIntToInt64(v_1.AuxInt)
  5100  		if !(is16Bit(c)) {
  5101  			break
  5102  		}
  5103  		v.reset(OpPPC64CMPconst)
  5104  		v.AuxInt = int64ToAuxInt(c)
  5105  		v.AddArg(x)
  5106  		return true
  5107  	}
  5108  	// match: (CMP (MOVDconst [c]) y)
  5109  	// cond: is16Bit(c)
  5110  	// result: (InvertFlags (CMPconst y [c]))
  5111  	for {
  5112  		if v_0.Op != OpPPC64MOVDconst {
  5113  			break
  5114  		}
  5115  		c := auxIntToInt64(v_0.AuxInt)
  5116  		y := v_1
  5117  		if !(is16Bit(c)) {
  5118  			break
  5119  		}
  5120  		v.reset(OpPPC64InvertFlags)
  5121  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
  5122  		v0.AuxInt = int64ToAuxInt(c)
  5123  		v0.AddArg(y)
  5124  		v.AddArg(v0)
  5125  		return true
  5126  	}
  5127  	// match: (CMP x y)
  5128  	// cond: canonLessThan(x,y)
  5129  	// result: (InvertFlags (CMP y x))
  5130  	for {
  5131  		x := v_0
  5132  		y := v_1
  5133  		if !(canonLessThan(x, y)) {
  5134  			break
  5135  		}
  5136  		v.reset(OpPPC64InvertFlags)
  5137  		v0 := b.NewValue0(v.Pos, OpPPC64CMP, types.TypeFlags)
  5138  		v0.AddArg2(y, x)
  5139  		v.AddArg(v0)
  5140  		return true
  5141  	}
  5142  	return false
  5143  }
  5144  func rewriteValuePPC64_OpPPC64CMPU(v *Value) bool {
  5145  	v_1 := v.Args[1]
  5146  	v_0 := v.Args[0]
  5147  	b := v.Block
  5148  	// match: (CMPU x (MOVDconst [c]))
  5149  	// cond: isU16Bit(c)
  5150  	// result: (CMPUconst x [c])
  5151  	for {
  5152  		x := v_0
  5153  		if v_1.Op != OpPPC64MOVDconst {
  5154  			break
  5155  		}
  5156  		c := auxIntToInt64(v_1.AuxInt)
  5157  		if !(isU16Bit(c)) {
  5158  			break
  5159  		}
  5160  		v.reset(OpPPC64CMPUconst)
  5161  		v.AuxInt = int64ToAuxInt(c)
  5162  		v.AddArg(x)
  5163  		return true
  5164  	}
  5165  	// match: (CMPU (MOVDconst [c]) y)
  5166  	// cond: isU16Bit(c)
  5167  	// result: (InvertFlags (CMPUconst y [c]))
  5168  	for {
  5169  		if v_0.Op != OpPPC64MOVDconst {
  5170  			break
  5171  		}
  5172  		c := auxIntToInt64(v_0.AuxInt)
  5173  		y := v_1
  5174  		if !(isU16Bit(c)) {
  5175  			break
  5176  		}
  5177  		v.reset(OpPPC64InvertFlags)
  5178  		v0 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
  5179  		v0.AuxInt = int64ToAuxInt(c)
  5180  		v0.AddArg(y)
  5181  		v.AddArg(v0)
  5182  		return true
  5183  	}
  5184  	// match: (CMPU x y)
  5185  	// cond: canonLessThan(x,y)
  5186  	// result: (InvertFlags (CMPU y x))
  5187  	for {
  5188  		x := v_0
  5189  		y := v_1
  5190  		if !(canonLessThan(x, y)) {
  5191  			break
  5192  		}
  5193  		v.reset(OpPPC64InvertFlags)
  5194  		v0 := b.NewValue0(v.Pos, OpPPC64CMPU, types.TypeFlags)
  5195  		v0.AddArg2(y, x)
  5196  		v.AddArg(v0)
  5197  		return true
  5198  	}
  5199  	return false
  5200  }
  5201  func rewriteValuePPC64_OpPPC64CMPUconst(v *Value) bool {
  5202  	v_0 := v.Args[0]
  5203  	// match: (CMPUconst [d] (ANDconst z [c]))
  5204  	// cond: uint64(d) > uint64(c)
  5205  	// result: (FlagLT)
  5206  	for {
  5207  		d := auxIntToInt64(v.AuxInt)
  5208  		if v_0.Op != OpPPC64ANDconst {
  5209  			break
  5210  		}
  5211  		c := auxIntToInt64(v_0.AuxInt)
  5212  		if !(uint64(d) > uint64(c)) {
  5213  			break
  5214  		}
  5215  		v.reset(OpPPC64FlagLT)
  5216  		return true
  5217  	}
  5218  	// match: (CMPUconst (MOVDconst [x]) [y])
  5219  	// cond: x==y
  5220  	// result: (FlagEQ)
  5221  	for {
  5222  		y := auxIntToInt64(v.AuxInt)
  5223  		if v_0.Op != OpPPC64MOVDconst {
  5224  			break
  5225  		}
  5226  		x := auxIntToInt64(v_0.AuxInt)
  5227  		if !(x == y) {
  5228  			break
  5229  		}
  5230  		v.reset(OpPPC64FlagEQ)
  5231  		return true
  5232  	}
  5233  	// match: (CMPUconst (MOVDconst [x]) [y])
  5234  	// cond: uint64(x)<uint64(y)
  5235  	// result: (FlagLT)
  5236  	for {
  5237  		y := auxIntToInt64(v.AuxInt)
  5238  		if v_0.Op != OpPPC64MOVDconst {
  5239  			break
  5240  		}
  5241  		x := auxIntToInt64(v_0.AuxInt)
  5242  		if !(uint64(x) < uint64(y)) {
  5243  			break
  5244  		}
  5245  		v.reset(OpPPC64FlagLT)
  5246  		return true
  5247  	}
  5248  	// match: (CMPUconst (MOVDconst [x]) [y])
  5249  	// cond: uint64(x)>uint64(y)
  5250  	// result: (FlagGT)
  5251  	for {
  5252  		y := auxIntToInt64(v.AuxInt)
  5253  		if v_0.Op != OpPPC64MOVDconst {
  5254  			break
  5255  		}
  5256  		x := auxIntToInt64(v_0.AuxInt)
  5257  		if !(uint64(x) > uint64(y)) {
  5258  			break
  5259  		}
  5260  		v.reset(OpPPC64FlagGT)
  5261  		return true
  5262  	}
  5263  	// match: (CMPUconst [0] a:(ANDconst [n] z))
  5264  	// result: (CMPconst [0] a)
  5265  	for {
  5266  		if auxIntToInt64(v.AuxInt) != 0 {
  5267  			break
  5268  		}
  5269  		a := v_0
  5270  		if a.Op != OpPPC64ANDconst {
  5271  			break
  5272  		}
  5273  		v.reset(OpPPC64CMPconst)
  5274  		v.AuxInt = int64ToAuxInt(0)
  5275  		v.AddArg(a)
  5276  		return true
  5277  	}
  5278  	return false
  5279  }
  5280  func rewriteValuePPC64_OpPPC64CMPW(v *Value) bool {
  5281  	v_1 := v.Args[1]
  5282  	v_0 := v.Args[0]
  5283  	b := v.Block
  5284  	// match: (CMPW x (MOVWreg y))
  5285  	// result: (CMPW x y)
  5286  	for {
  5287  		x := v_0
  5288  		if v_1.Op != OpPPC64MOVWreg {
  5289  			break
  5290  		}
  5291  		y := v_1.Args[0]
  5292  		v.reset(OpPPC64CMPW)
  5293  		v.AddArg2(x, y)
  5294  		return true
  5295  	}
  5296  	// match: (CMPW (MOVWreg x) y)
  5297  	// result: (CMPW x y)
  5298  	for {
  5299  		if v_0.Op != OpPPC64MOVWreg {
  5300  			break
  5301  		}
  5302  		x := v_0.Args[0]
  5303  		y := v_1
  5304  		v.reset(OpPPC64CMPW)
  5305  		v.AddArg2(x, y)
  5306  		return true
  5307  	}
  5308  	// match: (CMPW x (MOVDconst [c]))
  5309  	// cond: is16Bit(c)
  5310  	// result: (CMPWconst x [int32(c)])
  5311  	for {
  5312  		x := v_0
  5313  		if v_1.Op != OpPPC64MOVDconst {
  5314  			break
  5315  		}
  5316  		c := auxIntToInt64(v_1.AuxInt)
  5317  		if !(is16Bit(c)) {
  5318  			break
  5319  		}
  5320  		v.reset(OpPPC64CMPWconst)
  5321  		v.AuxInt = int32ToAuxInt(int32(c))
  5322  		v.AddArg(x)
  5323  		return true
  5324  	}
  5325  	// match: (CMPW (MOVDconst [c]) y)
  5326  	// cond: is16Bit(c)
  5327  	// result: (InvertFlags (CMPWconst y [int32(c)]))
  5328  	for {
  5329  		if v_0.Op != OpPPC64MOVDconst {
  5330  			break
  5331  		}
  5332  		c := auxIntToInt64(v_0.AuxInt)
  5333  		y := v_1
  5334  		if !(is16Bit(c)) {
  5335  			break
  5336  		}
  5337  		v.reset(OpPPC64InvertFlags)
  5338  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWconst, types.TypeFlags)
  5339  		v0.AuxInt = int32ToAuxInt(int32(c))
  5340  		v0.AddArg(y)
  5341  		v.AddArg(v0)
  5342  		return true
  5343  	}
  5344  	// match: (CMPW x y)
  5345  	// cond: canonLessThan(x,y)
  5346  	// result: (InvertFlags (CMPW y x))
  5347  	for {
  5348  		x := v_0
  5349  		y := v_1
  5350  		if !(canonLessThan(x, y)) {
  5351  			break
  5352  		}
  5353  		v.reset(OpPPC64InvertFlags)
  5354  		v0 := b.NewValue0(v.Pos, OpPPC64CMPW, types.TypeFlags)
  5355  		v0.AddArg2(y, x)
  5356  		v.AddArg(v0)
  5357  		return true
  5358  	}
  5359  	return false
  5360  }
  5361  func rewriteValuePPC64_OpPPC64CMPWU(v *Value) bool {
  5362  	v_1 := v.Args[1]
  5363  	v_0 := v.Args[0]
  5364  	b := v.Block
  5365  	// match: (CMPWU x (MOVWZreg y))
  5366  	// result: (CMPWU x y)
  5367  	for {
  5368  		x := v_0
  5369  		if v_1.Op != OpPPC64MOVWZreg {
  5370  			break
  5371  		}
  5372  		y := v_1.Args[0]
  5373  		v.reset(OpPPC64CMPWU)
  5374  		v.AddArg2(x, y)
  5375  		return true
  5376  	}
  5377  	// match: (CMPWU (MOVWZreg x) y)
  5378  	// result: (CMPWU x y)
  5379  	for {
  5380  		if v_0.Op != OpPPC64MOVWZreg {
  5381  			break
  5382  		}
  5383  		x := v_0.Args[0]
  5384  		y := v_1
  5385  		v.reset(OpPPC64CMPWU)
  5386  		v.AddArg2(x, y)
  5387  		return true
  5388  	}
  5389  	// match: (CMPWU x (MOVDconst [c]))
  5390  	// cond: isU16Bit(c)
  5391  	// result: (CMPWUconst x [int32(c)])
  5392  	for {
  5393  		x := v_0
  5394  		if v_1.Op != OpPPC64MOVDconst {
  5395  			break
  5396  		}
  5397  		c := auxIntToInt64(v_1.AuxInt)
  5398  		if !(isU16Bit(c)) {
  5399  			break
  5400  		}
  5401  		v.reset(OpPPC64CMPWUconst)
  5402  		v.AuxInt = int32ToAuxInt(int32(c))
  5403  		v.AddArg(x)
  5404  		return true
  5405  	}
  5406  	// match: (CMPWU (MOVDconst [c]) y)
  5407  	// cond: isU16Bit(c)
  5408  	// result: (InvertFlags (CMPWUconst y [int32(c)]))
  5409  	for {
  5410  		if v_0.Op != OpPPC64MOVDconst {
  5411  			break
  5412  		}
  5413  		c := auxIntToInt64(v_0.AuxInt)
  5414  		y := v_1
  5415  		if !(isU16Bit(c)) {
  5416  			break
  5417  		}
  5418  		v.reset(OpPPC64InvertFlags)
  5419  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
  5420  		v0.AuxInt = int32ToAuxInt(int32(c))
  5421  		v0.AddArg(y)
  5422  		v.AddArg(v0)
  5423  		return true
  5424  	}
  5425  	// match: (CMPWU x y)
  5426  	// cond: canonLessThan(x,y)
  5427  	// result: (InvertFlags (CMPWU y x))
  5428  	for {
  5429  		x := v_0
  5430  		y := v_1
  5431  		if !(canonLessThan(x, y)) {
  5432  			break
  5433  		}
  5434  		v.reset(OpPPC64InvertFlags)
  5435  		v0 := b.NewValue0(v.Pos, OpPPC64CMPWU, types.TypeFlags)
  5436  		v0.AddArg2(y, x)
  5437  		v.AddArg(v0)
  5438  		return true
  5439  	}
  5440  	return false
  5441  }
  5442  func rewriteValuePPC64_OpPPC64CMPWUconst(v *Value) bool {
  5443  	v_0 := v.Args[0]
  5444  	// match: (CMPWUconst [d] (ANDconst z [c]))
  5445  	// cond: uint64(d) > uint64(c)
  5446  	// result: (FlagLT)
  5447  	for {
  5448  		d := auxIntToInt32(v.AuxInt)
  5449  		if v_0.Op != OpPPC64ANDconst {
  5450  			break
  5451  		}
  5452  		c := auxIntToInt64(v_0.AuxInt)
  5453  		if !(uint64(d) > uint64(c)) {
  5454  			break
  5455  		}
  5456  		v.reset(OpPPC64FlagLT)
  5457  		return true
  5458  	}
  5459  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5460  	// cond: int32(x)==int32(y)
  5461  	// result: (FlagEQ)
  5462  	for {
  5463  		y := auxIntToInt32(v.AuxInt)
  5464  		if v_0.Op != OpPPC64MOVDconst {
  5465  			break
  5466  		}
  5467  		x := auxIntToInt64(v_0.AuxInt)
  5468  		if !(int32(x) == int32(y)) {
  5469  			break
  5470  		}
  5471  		v.reset(OpPPC64FlagEQ)
  5472  		return true
  5473  	}
  5474  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5475  	// cond: uint32(x)<uint32(y)
  5476  	// result: (FlagLT)
  5477  	for {
  5478  		y := auxIntToInt32(v.AuxInt)
  5479  		if v_0.Op != OpPPC64MOVDconst {
  5480  			break
  5481  		}
  5482  		x := auxIntToInt64(v_0.AuxInt)
  5483  		if !(uint32(x) < uint32(y)) {
  5484  			break
  5485  		}
  5486  		v.reset(OpPPC64FlagLT)
  5487  		return true
  5488  	}
  5489  	// match: (CMPWUconst (MOVDconst [x]) [y])
  5490  	// cond: uint32(x)>uint32(y)
  5491  	// result: (FlagGT)
  5492  	for {
  5493  		y := auxIntToInt32(v.AuxInt)
  5494  		if v_0.Op != OpPPC64MOVDconst {
  5495  			break
  5496  		}
  5497  		x := auxIntToInt64(v_0.AuxInt)
  5498  		if !(uint32(x) > uint32(y)) {
  5499  			break
  5500  		}
  5501  		v.reset(OpPPC64FlagGT)
  5502  		return true
  5503  	}
  5504  	// match: (CMPWUconst [0] a:(ANDconst [n] z))
  5505  	// result: (CMPconst [0] a)
  5506  	for {
  5507  		if auxIntToInt32(v.AuxInt) != 0 {
  5508  			break
  5509  		}
  5510  		a := v_0
  5511  		if a.Op != OpPPC64ANDconst {
  5512  			break
  5513  		}
  5514  		v.reset(OpPPC64CMPconst)
  5515  		v.AuxInt = int64ToAuxInt(0)
  5516  		v.AddArg(a)
  5517  		return true
  5518  	}
  5519  	return false
  5520  }
  5521  func rewriteValuePPC64_OpPPC64CMPWconst(v *Value) bool {
  5522  	v_0 := v.Args[0]
  5523  	// match: (CMPWconst (MOVDconst [x]) [y])
  5524  	// cond: int32(x)==int32(y)
  5525  	// result: (FlagEQ)
  5526  	for {
  5527  		y := auxIntToInt32(v.AuxInt)
  5528  		if v_0.Op != OpPPC64MOVDconst {
  5529  			break
  5530  		}
  5531  		x := auxIntToInt64(v_0.AuxInt)
  5532  		if !(int32(x) == int32(y)) {
  5533  			break
  5534  		}
  5535  		v.reset(OpPPC64FlagEQ)
  5536  		return true
  5537  	}
  5538  	// match: (CMPWconst (MOVDconst [x]) [y])
  5539  	// cond: int32(x)<int32(y)
  5540  	// result: (FlagLT)
  5541  	for {
  5542  		y := auxIntToInt32(v.AuxInt)
  5543  		if v_0.Op != OpPPC64MOVDconst {
  5544  			break
  5545  		}
  5546  		x := auxIntToInt64(v_0.AuxInt)
  5547  		if !(int32(x) < int32(y)) {
  5548  			break
  5549  		}
  5550  		v.reset(OpPPC64FlagLT)
  5551  		return true
  5552  	}
  5553  	// match: (CMPWconst (MOVDconst [x]) [y])
  5554  	// cond: int32(x)>int32(y)
  5555  	// result: (FlagGT)
  5556  	for {
  5557  		y := auxIntToInt32(v.AuxInt)
  5558  		if v_0.Op != OpPPC64MOVDconst {
  5559  			break
  5560  		}
  5561  		x := auxIntToInt64(v_0.AuxInt)
  5562  		if !(int32(x) > int32(y)) {
  5563  			break
  5564  		}
  5565  		v.reset(OpPPC64FlagGT)
  5566  		return true
  5567  	}
  5568  	// match: (CMPWconst [0] a:(ANDconst [n] z))
  5569  	// result: (CMPconst [0] a)
  5570  	for {
  5571  		if auxIntToInt32(v.AuxInt) != 0 {
  5572  			break
  5573  		}
  5574  		a := v_0
  5575  		if a.Op != OpPPC64ANDconst {
  5576  			break
  5577  		}
  5578  		v.reset(OpPPC64CMPconst)
  5579  		v.AuxInt = int64ToAuxInt(0)
  5580  		v.AddArg(a)
  5581  		return true
  5582  	}
  5583  	return false
  5584  }
  5585  func rewriteValuePPC64_OpPPC64CMPconst(v *Value) bool {
  5586  	v_0 := v.Args[0]
  5587  	// match: (CMPconst (MOVDconst [x]) [y])
  5588  	// cond: x==y
  5589  	// result: (FlagEQ)
  5590  	for {
  5591  		y := auxIntToInt64(v.AuxInt)
  5592  		if v_0.Op != OpPPC64MOVDconst {
  5593  			break
  5594  		}
  5595  		x := auxIntToInt64(v_0.AuxInt)
  5596  		if !(x == y) {
  5597  			break
  5598  		}
  5599  		v.reset(OpPPC64FlagEQ)
  5600  		return true
  5601  	}
  5602  	// match: (CMPconst (MOVDconst [x]) [y])
  5603  	// cond: x<y
  5604  	// result: (FlagLT)
  5605  	for {
  5606  		y := auxIntToInt64(v.AuxInt)
  5607  		if v_0.Op != OpPPC64MOVDconst {
  5608  			break
  5609  		}
  5610  		x := auxIntToInt64(v_0.AuxInt)
  5611  		if !(x < y) {
  5612  			break
  5613  		}
  5614  		v.reset(OpPPC64FlagLT)
  5615  		return true
  5616  	}
  5617  	// match: (CMPconst (MOVDconst [x]) [y])
  5618  	// cond: x>y
  5619  	// result: (FlagGT)
  5620  	for {
  5621  		y := auxIntToInt64(v.AuxInt)
  5622  		if v_0.Op != OpPPC64MOVDconst {
  5623  			break
  5624  		}
  5625  		x := auxIntToInt64(v_0.AuxInt)
  5626  		if !(x > y) {
  5627  			break
  5628  		}
  5629  		v.reset(OpPPC64FlagGT)
  5630  		return true
  5631  	}
  5632  	return false
  5633  }
  5634  func rewriteValuePPC64_OpPPC64Equal(v *Value) bool {
  5635  	v_0 := v.Args[0]
  5636  	// match: (Equal (FlagEQ))
  5637  	// result: (MOVDconst [1])
  5638  	for {
  5639  		if v_0.Op != OpPPC64FlagEQ {
  5640  			break
  5641  		}
  5642  		v.reset(OpPPC64MOVDconst)
  5643  		v.AuxInt = int64ToAuxInt(1)
  5644  		return true
  5645  	}
  5646  	// match: (Equal (FlagLT))
  5647  	// result: (MOVDconst [0])
  5648  	for {
  5649  		if v_0.Op != OpPPC64FlagLT {
  5650  			break
  5651  		}
  5652  		v.reset(OpPPC64MOVDconst)
  5653  		v.AuxInt = int64ToAuxInt(0)
  5654  		return true
  5655  	}
  5656  	// match: (Equal (FlagGT))
  5657  	// result: (MOVDconst [0])
  5658  	for {
  5659  		if v_0.Op != OpPPC64FlagGT {
  5660  			break
  5661  		}
  5662  		v.reset(OpPPC64MOVDconst)
  5663  		v.AuxInt = int64ToAuxInt(0)
  5664  		return true
  5665  	}
  5666  	// match: (Equal (InvertFlags x))
  5667  	// result: (Equal x)
  5668  	for {
  5669  		if v_0.Op != OpPPC64InvertFlags {
  5670  			break
  5671  		}
  5672  		x := v_0.Args[0]
  5673  		v.reset(OpPPC64Equal)
  5674  		v.AddArg(x)
  5675  		return true
  5676  	}
  5677  	// match: (Equal cmp)
  5678  	// result: (SETBC [2] cmp)
  5679  	for {
  5680  		cmp := v_0
  5681  		v.reset(OpPPC64SETBC)
  5682  		v.AuxInt = int32ToAuxInt(2)
  5683  		v.AddArg(cmp)
  5684  		return true
  5685  	}
  5686  }
  5687  func rewriteValuePPC64_OpPPC64FABS(v *Value) bool {
  5688  	v_0 := v.Args[0]
  5689  	// match: (FABS (FMOVDconst [x]))
  5690  	// result: (FMOVDconst [math.Abs(x)])
  5691  	for {
  5692  		if v_0.Op != OpPPC64FMOVDconst {
  5693  			break
  5694  		}
  5695  		x := auxIntToFloat64(v_0.AuxInt)
  5696  		v.reset(OpPPC64FMOVDconst)
  5697  		v.AuxInt = float64ToAuxInt(math.Abs(x))
  5698  		return true
  5699  	}
  5700  	return false
  5701  }
  5702  func rewriteValuePPC64_OpPPC64FADD(v *Value) bool {
  5703  	v_1 := v.Args[1]
  5704  	v_0 := v.Args[0]
  5705  	// match: (FADD (FMUL x y) z)
  5706  	// cond: x.Block.Func.useFMA(v)
  5707  	// result: (FMADD x y z)
  5708  	for {
  5709  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5710  			if v_0.Op != OpPPC64FMUL {
  5711  				continue
  5712  			}
  5713  			_ = v_0.Args[1]
  5714  			v_0_0 := v_0.Args[0]
  5715  			v_0_1 := v_0.Args[1]
  5716  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5717  				x := v_0_0
  5718  				y := v_0_1
  5719  				z := v_1
  5720  				if !(x.Block.Func.useFMA(v)) {
  5721  					continue
  5722  				}
  5723  				v.reset(OpPPC64FMADD)
  5724  				v.AddArg3(x, y, z)
  5725  				return true
  5726  			}
  5727  		}
  5728  		break
  5729  	}
  5730  	return false
  5731  }
  5732  func rewriteValuePPC64_OpPPC64FADDS(v *Value) bool {
  5733  	v_1 := v.Args[1]
  5734  	v_0 := v.Args[0]
  5735  	// match: (FADDS (FMULS x y) z)
  5736  	// cond: x.Block.Func.useFMA(v)
  5737  	// result: (FMADDS x y z)
  5738  	for {
  5739  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
  5740  			if v_0.Op != OpPPC64FMULS {
  5741  				continue
  5742  			}
  5743  			_ = v_0.Args[1]
  5744  			v_0_0 := v_0.Args[0]
  5745  			v_0_1 := v_0.Args[1]
  5746  			for _i1 := 0; _i1 <= 1; _i1, v_0_0, v_0_1 = _i1+1, v_0_1, v_0_0 {
  5747  				x := v_0_0
  5748  				y := v_0_1
  5749  				z := v_1
  5750  				if !(x.Block.Func.useFMA(v)) {
  5751  					continue
  5752  				}
  5753  				v.reset(OpPPC64FMADDS)
  5754  				v.AddArg3(x, y, z)
  5755  				return true
  5756  			}
  5757  		}
  5758  		break
  5759  	}
  5760  	return false
  5761  }
  5762  func rewriteValuePPC64_OpPPC64FCEIL(v *Value) bool {
  5763  	v_0 := v.Args[0]
  5764  	// match: (FCEIL (FMOVDconst [x]))
  5765  	// result: (FMOVDconst [math.Ceil(x)])
  5766  	for {
  5767  		if v_0.Op != OpPPC64FMOVDconst {
  5768  			break
  5769  		}
  5770  		x := auxIntToFloat64(v_0.AuxInt)
  5771  		v.reset(OpPPC64FMOVDconst)
  5772  		v.AuxInt = float64ToAuxInt(math.Ceil(x))
  5773  		return true
  5774  	}
  5775  	return false
  5776  }
  5777  func rewriteValuePPC64_OpPPC64FFLOOR(v *Value) bool {
  5778  	v_0 := v.Args[0]
  5779  	// match: (FFLOOR (FMOVDconst [x]))
  5780  	// result: (FMOVDconst [math.Floor(x)])
  5781  	for {
  5782  		if v_0.Op != OpPPC64FMOVDconst {
  5783  			break
  5784  		}
  5785  		x := auxIntToFloat64(v_0.AuxInt)
  5786  		v.reset(OpPPC64FMOVDconst)
  5787  		v.AuxInt = float64ToAuxInt(math.Floor(x))
  5788  		return true
  5789  	}
  5790  	return false
  5791  }
  5792  func rewriteValuePPC64_OpPPC64FGreaterEqual(v *Value) bool {
  5793  	v_0 := v.Args[0]
  5794  	b := v.Block
  5795  	typ := &b.Func.Config.Types
  5796  	// match: (FGreaterEqual cmp)
  5797  	// result: (OR (SETBC [2] cmp) (SETBC [1] cmp))
  5798  	for {
  5799  		cmp := v_0
  5800  		v.reset(OpPPC64OR)
  5801  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5802  		v0.AuxInt = int32ToAuxInt(2)
  5803  		v0.AddArg(cmp)
  5804  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5805  		v1.AuxInt = int32ToAuxInt(1)
  5806  		v1.AddArg(cmp)
  5807  		v.AddArg2(v0, v1)
  5808  		return true
  5809  	}
  5810  }
  5811  func rewriteValuePPC64_OpPPC64FGreaterThan(v *Value) bool {
  5812  	v_0 := v.Args[0]
  5813  	// match: (FGreaterThan cmp)
  5814  	// result: (SETBC [1] cmp)
  5815  	for {
  5816  		cmp := v_0
  5817  		v.reset(OpPPC64SETBC)
  5818  		v.AuxInt = int32ToAuxInt(1)
  5819  		v.AddArg(cmp)
  5820  		return true
  5821  	}
  5822  }
  5823  func rewriteValuePPC64_OpPPC64FLessEqual(v *Value) bool {
  5824  	v_0 := v.Args[0]
  5825  	b := v.Block
  5826  	typ := &b.Func.Config.Types
  5827  	// match: (FLessEqual cmp)
  5828  	// result: (OR (SETBC [2] cmp) (SETBC [0] cmp))
  5829  	for {
  5830  		cmp := v_0
  5831  		v.reset(OpPPC64OR)
  5832  		v0 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5833  		v0.AuxInt = int32ToAuxInt(2)
  5834  		v0.AddArg(cmp)
  5835  		v1 := b.NewValue0(v.Pos, OpPPC64SETBC, typ.Int32)
  5836  		v1.AuxInt = int32ToAuxInt(0)
  5837  		v1.AddArg(cmp)
  5838  		v.AddArg2(v0, v1)
  5839  		return true
  5840  	}
  5841  }
  5842  func rewriteValuePPC64_OpPPC64FLessThan(v *Value) bool {
  5843  	v_0 := v.Args[0]
  5844  	// match: (FLessThan cmp)
  5845  	// result: (SETBC [0] cmp)
  5846  	for {
  5847  		cmp := v_0
  5848  		v.reset(OpPPC64SETBC)
  5849  		v.AuxInt = int32ToAuxInt(0)
  5850  		v.AddArg(cmp)
  5851  		return true
  5852  	}
  5853  }
  5854  func rewriteValuePPC64_OpPPC64FMOVDload(v *Value) bool {
  5855  	v_1 := v.Args[1]
  5856  	v_0 := v.Args[0]
  5857  	// match: (FMOVDload [off] {sym} ptr (MOVDstore [off] {sym} ptr x _))
  5858  	// result: (MTVSRD x)
  5859  	for {
  5860  		off := auxIntToInt32(v.AuxInt)
  5861  		sym := auxToSym(v.Aux)
  5862  		ptr := v_0
  5863  		if v_1.Op != OpPPC64MOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  5864  			break
  5865  		}
  5866  		x := v_1.Args[1]
  5867  		if ptr != v_1.Args[0] {
  5868  			break
  5869  		}
  5870  		v.reset(OpPPC64MTVSRD)
  5871  		v.AddArg(x)
  5872  		return true
  5873  	}
  5874  	// match: (FMOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5875  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5876  	// result: (FMOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5877  	for {
  5878  		off1 := auxIntToInt32(v.AuxInt)
  5879  		sym1 := auxToSym(v.Aux)
  5880  		p := v_0
  5881  		if p.Op != OpPPC64MOVDaddr {
  5882  			break
  5883  		}
  5884  		off2 := auxIntToInt32(p.AuxInt)
  5885  		sym2 := auxToSym(p.Aux)
  5886  		ptr := p.Args[0]
  5887  		mem := v_1
  5888  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5889  			break
  5890  		}
  5891  		v.reset(OpPPC64FMOVDload)
  5892  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5893  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5894  		v.AddArg2(ptr, mem)
  5895  		return true
  5896  	}
  5897  	// match: (FMOVDload [off1] {sym} (ADDconst [off2] ptr) mem)
  5898  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5899  	// result: (FMOVDload [off1+int32(off2)] {sym} ptr mem)
  5900  	for {
  5901  		off1 := auxIntToInt32(v.AuxInt)
  5902  		sym := auxToSym(v.Aux)
  5903  		if v_0.Op != OpPPC64ADDconst {
  5904  			break
  5905  		}
  5906  		off2 := auxIntToInt64(v_0.AuxInt)
  5907  		ptr := v_0.Args[0]
  5908  		mem := v_1
  5909  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5910  			break
  5911  		}
  5912  		v.reset(OpPPC64FMOVDload)
  5913  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5914  		v.Aux = symToAux(sym)
  5915  		v.AddArg2(ptr, mem)
  5916  		return true
  5917  	}
  5918  	return false
  5919  }
  5920  func rewriteValuePPC64_OpPPC64FMOVDstore(v *Value) bool {
  5921  	v_2 := v.Args[2]
  5922  	v_1 := v.Args[1]
  5923  	v_0 := v.Args[0]
  5924  	// match: (FMOVDstore [off] {sym} ptr (MTVSRD x) mem)
  5925  	// result: (MOVDstore [off] {sym} ptr x mem)
  5926  	for {
  5927  		off := auxIntToInt32(v.AuxInt)
  5928  		sym := auxToSym(v.Aux)
  5929  		ptr := v_0
  5930  		if v_1.Op != OpPPC64MTVSRD {
  5931  			break
  5932  		}
  5933  		x := v_1.Args[0]
  5934  		mem := v_2
  5935  		v.reset(OpPPC64MOVDstore)
  5936  		v.AuxInt = int32ToAuxInt(off)
  5937  		v.Aux = symToAux(sym)
  5938  		v.AddArg3(ptr, x, mem)
  5939  		return true
  5940  	}
  5941  	// match: (FMOVDstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  5942  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  5943  	// result: (FMOVDstore [off1+int32(off2)] {sym} ptr val mem)
  5944  	for {
  5945  		off1 := auxIntToInt32(v.AuxInt)
  5946  		sym := auxToSym(v.Aux)
  5947  		if v_0.Op != OpPPC64ADDconst {
  5948  			break
  5949  		}
  5950  		off2 := auxIntToInt64(v_0.AuxInt)
  5951  		ptr := v_0.Args[0]
  5952  		val := v_1
  5953  		mem := v_2
  5954  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  5955  			break
  5956  		}
  5957  		v.reset(OpPPC64FMOVDstore)
  5958  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  5959  		v.Aux = symToAux(sym)
  5960  		v.AddArg3(ptr, val, mem)
  5961  		return true
  5962  	}
  5963  	// match: (FMOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  5964  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5965  	// result: (FMOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  5966  	for {
  5967  		off1 := auxIntToInt32(v.AuxInt)
  5968  		sym1 := auxToSym(v.Aux)
  5969  		p := v_0
  5970  		if p.Op != OpPPC64MOVDaddr {
  5971  			break
  5972  		}
  5973  		off2 := auxIntToInt32(p.AuxInt)
  5974  		sym2 := auxToSym(p.Aux)
  5975  		ptr := p.Args[0]
  5976  		val := v_1
  5977  		mem := v_2
  5978  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  5979  			break
  5980  		}
  5981  		v.reset(OpPPC64FMOVDstore)
  5982  		v.AuxInt = int32ToAuxInt(off1 + off2)
  5983  		v.Aux = symToAux(mergeSym(sym1, sym2))
  5984  		v.AddArg3(ptr, val, mem)
  5985  		return true
  5986  	}
  5987  	return false
  5988  }
  5989  func rewriteValuePPC64_OpPPC64FMOVSload(v *Value) bool {
  5990  	v_1 := v.Args[1]
  5991  	v_0 := v.Args[0]
  5992  	// match: (FMOVSload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  5993  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  5994  	// result: (FMOVSload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  5995  	for {
  5996  		off1 := auxIntToInt32(v.AuxInt)
  5997  		sym1 := auxToSym(v.Aux)
  5998  		p := v_0
  5999  		if p.Op != OpPPC64MOVDaddr {
  6000  			break
  6001  		}
  6002  		off2 := auxIntToInt32(p.AuxInt)
  6003  		sym2 := auxToSym(p.Aux)
  6004  		ptr := p.Args[0]
  6005  		mem := v_1
  6006  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6007  			break
  6008  		}
  6009  		v.reset(OpPPC64FMOVSload)
  6010  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6011  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6012  		v.AddArg2(ptr, mem)
  6013  		return true
  6014  	}
  6015  	// match: (FMOVSload [off1] {sym} (ADDconst [off2] ptr) mem)
  6016  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6017  	// result: (FMOVSload [off1+int32(off2)] {sym} ptr mem)
  6018  	for {
  6019  		off1 := auxIntToInt32(v.AuxInt)
  6020  		sym := auxToSym(v.Aux)
  6021  		if v_0.Op != OpPPC64ADDconst {
  6022  			break
  6023  		}
  6024  		off2 := auxIntToInt64(v_0.AuxInt)
  6025  		ptr := v_0.Args[0]
  6026  		mem := v_1
  6027  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6028  			break
  6029  		}
  6030  		v.reset(OpPPC64FMOVSload)
  6031  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6032  		v.Aux = symToAux(sym)
  6033  		v.AddArg2(ptr, mem)
  6034  		return true
  6035  	}
  6036  	return false
  6037  }
  6038  func rewriteValuePPC64_OpPPC64FMOVSstore(v *Value) bool {
  6039  	v_2 := v.Args[2]
  6040  	v_1 := v.Args[1]
  6041  	v_0 := v.Args[0]
  6042  	// match: (FMOVSstore [off1] {sym} (ADDconst [off2] ptr) val mem)
  6043  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6044  	// result: (FMOVSstore [off1+int32(off2)] {sym} ptr val mem)
  6045  	for {
  6046  		off1 := auxIntToInt32(v.AuxInt)
  6047  		sym := auxToSym(v.Aux)
  6048  		if v_0.Op != OpPPC64ADDconst {
  6049  			break
  6050  		}
  6051  		off2 := auxIntToInt64(v_0.AuxInt)
  6052  		ptr := v_0.Args[0]
  6053  		val := v_1
  6054  		mem := v_2
  6055  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6056  			break
  6057  		}
  6058  		v.reset(OpPPC64FMOVSstore)
  6059  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6060  		v.Aux = symToAux(sym)
  6061  		v.AddArg3(ptr, val, mem)
  6062  		return true
  6063  	}
  6064  	// match: (FMOVSstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  6065  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6066  	// result: (FMOVSstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  6067  	for {
  6068  		off1 := auxIntToInt32(v.AuxInt)
  6069  		sym1 := auxToSym(v.Aux)
  6070  		p := v_0
  6071  		if p.Op != OpPPC64MOVDaddr {
  6072  			break
  6073  		}
  6074  		off2 := auxIntToInt32(p.AuxInt)
  6075  		sym2 := auxToSym(p.Aux)
  6076  		ptr := p.Args[0]
  6077  		val := v_1
  6078  		mem := v_2
  6079  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6080  			break
  6081  		}
  6082  		v.reset(OpPPC64FMOVSstore)
  6083  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6084  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6085  		v.AddArg3(ptr, val, mem)
  6086  		return true
  6087  	}
  6088  	return false
  6089  }
  6090  func rewriteValuePPC64_OpPPC64FNEG(v *Value) bool {
  6091  	v_0 := v.Args[0]
  6092  	// match: (FNEG (FABS x))
  6093  	// result: (FNABS x)
  6094  	for {
  6095  		if v_0.Op != OpPPC64FABS {
  6096  			break
  6097  		}
  6098  		x := v_0.Args[0]
  6099  		v.reset(OpPPC64FNABS)
  6100  		v.AddArg(x)
  6101  		return true
  6102  	}
  6103  	// match: (FNEG (FNABS x))
  6104  	// result: (FABS x)
  6105  	for {
  6106  		if v_0.Op != OpPPC64FNABS {
  6107  			break
  6108  		}
  6109  		x := v_0.Args[0]
  6110  		v.reset(OpPPC64FABS)
  6111  		v.AddArg(x)
  6112  		return true
  6113  	}
  6114  	return false
  6115  }
  6116  func rewriteValuePPC64_OpPPC64FSQRT(v *Value) bool {
  6117  	v_0 := v.Args[0]
  6118  	// match: (FSQRT (FMOVDconst [x]))
  6119  	// cond: x >= 0
  6120  	// result: (FMOVDconst [math.Sqrt(x)])
  6121  	for {
  6122  		if v_0.Op != OpPPC64FMOVDconst {
  6123  			break
  6124  		}
  6125  		x := auxIntToFloat64(v_0.AuxInt)
  6126  		if !(x >= 0) {
  6127  			break
  6128  		}
  6129  		v.reset(OpPPC64FMOVDconst)
  6130  		v.AuxInt = float64ToAuxInt(math.Sqrt(x))
  6131  		return true
  6132  	}
  6133  	return false
  6134  }
  6135  func rewriteValuePPC64_OpPPC64FSUB(v *Value) bool {
  6136  	v_1 := v.Args[1]
  6137  	v_0 := v.Args[0]
  6138  	// match: (FSUB (FMUL x y) z)
  6139  	// cond: x.Block.Func.useFMA(v)
  6140  	// result: (FMSUB x y z)
  6141  	for {
  6142  		if v_0.Op != OpPPC64FMUL {
  6143  			break
  6144  		}
  6145  		_ = v_0.Args[1]
  6146  		v_0_0 := v_0.Args[0]
  6147  		v_0_1 := v_0.Args[1]
  6148  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6149  			x := v_0_0
  6150  			y := v_0_1
  6151  			z := v_1
  6152  			if !(x.Block.Func.useFMA(v)) {
  6153  				continue
  6154  			}
  6155  			v.reset(OpPPC64FMSUB)
  6156  			v.AddArg3(x, y, z)
  6157  			return true
  6158  		}
  6159  		break
  6160  	}
  6161  	return false
  6162  }
  6163  func rewriteValuePPC64_OpPPC64FSUBS(v *Value) bool {
  6164  	v_1 := v.Args[1]
  6165  	v_0 := v.Args[0]
  6166  	// match: (FSUBS (FMULS x y) z)
  6167  	// cond: x.Block.Func.useFMA(v)
  6168  	// result: (FMSUBS x y z)
  6169  	for {
  6170  		if v_0.Op != OpPPC64FMULS {
  6171  			break
  6172  		}
  6173  		_ = v_0.Args[1]
  6174  		v_0_0 := v_0.Args[0]
  6175  		v_0_1 := v_0.Args[1]
  6176  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  6177  			x := v_0_0
  6178  			y := v_0_1
  6179  			z := v_1
  6180  			if !(x.Block.Func.useFMA(v)) {
  6181  				continue
  6182  			}
  6183  			v.reset(OpPPC64FMSUBS)
  6184  			v.AddArg3(x, y, z)
  6185  			return true
  6186  		}
  6187  		break
  6188  	}
  6189  	return false
  6190  }
  6191  func rewriteValuePPC64_OpPPC64FTRUNC(v *Value) bool {
  6192  	v_0 := v.Args[0]
  6193  	// match: (FTRUNC (FMOVDconst [x]))
  6194  	// result: (FMOVDconst [math.Trunc(x)])
  6195  	for {
  6196  		if v_0.Op != OpPPC64FMOVDconst {
  6197  			break
  6198  		}
  6199  		x := auxIntToFloat64(v_0.AuxInt)
  6200  		v.reset(OpPPC64FMOVDconst)
  6201  		v.AuxInt = float64ToAuxInt(math.Trunc(x))
  6202  		return true
  6203  	}
  6204  	return false
  6205  }
  6206  func rewriteValuePPC64_OpPPC64GreaterEqual(v *Value) bool {
  6207  	v_0 := v.Args[0]
  6208  	// match: (GreaterEqual (FlagEQ))
  6209  	// result: (MOVDconst [1])
  6210  	for {
  6211  		if v_0.Op != OpPPC64FlagEQ {
  6212  			break
  6213  		}
  6214  		v.reset(OpPPC64MOVDconst)
  6215  		v.AuxInt = int64ToAuxInt(1)
  6216  		return true
  6217  	}
  6218  	// match: (GreaterEqual (FlagLT))
  6219  	// result: (MOVDconst [0])
  6220  	for {
  6221  		if v_0.Op != OpPPC64FlagLT {
  6222  			break
  6223  		}
  6224  		v.reset(OpPPC64MOVDconst)
  6225  		v.AuxInt = int64ToAuxInt(0)
  6226  		return true
  6227  	}
  6228  	// match: (GreaterEqual (FlagGT))
  6229  	// result: (MOVDconst [1])
  6230  	for {
  6231  		if v_0.Op != OpPPC64FlagGT {
  6232  			break
  6233  		}
  6234  		v.reset(OpPPC64MOVDconst)
  6235  		v.AuxInt = int64ToAuxInt(1)
  6236  		return true
  6237  	}
  6238  	// match: (GreaterEqual (InvertFlags x))
  6239  	// result: (LessEqual x)
  6240  	for {
  6241  		if v_0.Op != OpPPC64InvertFlags {
  6242  			break
  6243  		}
  6244  		x := v_0.Args[0]
  6245  		v.reset(OpPPC64LessEqual)
  6246  		v.AddArg(x)
  6247  		return true
  6248  	}
  6249  	// match: (GreaterEqual cmp)
  6250  	// result: (SETBCR [0] cmp)
  6251  	for {
  6252  		cmp := v_0
  6253  		v.reset(OpPPC64SETBCR)
  6254  		v.AuxInt = int32ToAuxInt(0)
  6255  		v.AddArg(cmp)
  6256  		return true
  6257  	}
  6258  }
  6259  func rewriteValuePPC64_OpPPC64GreaterThan(v *Value) bool {
  6260  	v_0 := v.Args[0]
  6261  	// match: (GreaterThan (FlagEQ))
  6262  	// result: (MOVDconst [0])
  6263  	for {
  6264  		if v_0.Op != OpPPC64FlagEQ {
  6265  			break
  6266  		}
  6267  		v.reset(OpPPC64MOVDconst)
  6268  		v.AuxInt = int64ToAuxInt(0)
  6269  		return true
  6270  	}
  6271  	// match: (GreaterThan (FlagLT))
  6272  	// result: (MOVDconst [0])
  6273  	for {
  6274  		if v_0.Op != OpPPC64FlagLT {
  6275  			break
  6276  		}
  6277  		v.reset(OpPPC64MOVDconst)
  6278  		v.AuxInt = int64ToAuxInt(0)
  6279  		return true
  6280  	}
  6281  	// match: (GreaterThan (FlagGT))
  6282  	// result: (MOVDconst [1])
  6283  	for {
  6284  		if v_0.Op != OpPPC64FlagGT {
  6285  			break
  6286  		}
  6287  		v.reset(OpPPC64MOVDconst)
  6288  		v.AuxInt = int64ToAuxInt(1)
  6289  		return true
  6290  	}
  6291  	// match: (GreaterThan (InvertFlags x))
  6292  	// result: (LessThan x)
  6293  	for {
  6294  		if v_0.Op != OpPPC64InvertFlags {
  6295  			break
  6296  		}
  6297  		x := v_0.Args[0]
  6298  		v.reset(OpPPC64LessThan)
  6299  		v.AddArg(x)
  6300  		return true
  6301  	}
  6302  	// match: (GreaterThan cmp)
  6303  	// result: (SETBC [1] cmp)
  6304  	for {
  6305  		cmp := v_0
  6306  		v.reset(OpPPC64SETBC)
  6307  		v.AuxInt = int32ToAuxInt(1)
  6308  		v.AddArg(cmp)
  6309  		return true
  6310  	}
  6311  }
  6312  func rewriteValuePPC64_OpPPC64ISEL(v *Value) bool {
  6313  	v_2 := v.Args[2]
  6314  	v_1 := v.Args[1]
  6315  	v_0 := v.Args[0]
  6316  	// match: (ISEL [6] x y (CMPconst [0] (ANDconst [1] (SETBC [c] cmp))))
  6317  	// result: (ISEL [c] x y cmp)
  6318  	for {
  6319  		if auxIntToInt32(v.AuxInt) != 6 {
  6320  			break
  6321  		}
  6322  		x := v_0
  6323  		y := v_1
  6324  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6325  			break
  6326  		}
  6327  		v_2_0 := v_2.Args[0]
  6328  		if v_2_0.Op != OpPPC64ANDconst || auxIntToInt64(v_2_0.AuxInt) != 1 {
  6329  			break
  6330  		}
  6331  		v_2_0_0 := v_2_0.Args[0]
  6332  		if v_2_0_0.Op != OpPPC64SETBC {
  6333  			break
  6334  		}
  6335  		c := auxIntToInt32(v_2_0_0.AuxInt)
  6336  		cmp := v_2_0_0.Args[0]
  6337  		v.reset(OpPPC64ISEL)
  6338  		v.AuxInt = int32ToAuxInt(c)
  6339  		v.AddArg3(x, y, cmp)
  6340  		return true
  6341  	}
  6342  	// match: (ISEL [6] x y (CMPconst [0] (SETBC [c] cmp)))
  6343  	// result: (ISEL [c] x y cmp)
  6344  	for {
  6345  		if auxIntToInt32(v.AuxInt) != 6 {
  6346  			break
  6347  		}
  6348  		x := v_0
  6349  		y := v_1
  6350  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6351  			break
  6352  		}
  6353  		v_2_0 := v_2.Args[0]
  6354  		if v_2_0.Op != OpPPC64SETBC {
  6355  			break
  6356  		}
  6357  		c := auxIntToInt32(v_2_0.AuxInt)
  6358  		cmp := v_2_0.Args[0]
  6359  		v.reset(OpPPC64ISEL)
  6360  		v.AuxInt = int32ToAuxInt(c)
  6361  		v.AddArg3(x, y, cmp)
  6362  		return true
  6363  	}
  6364  	// match: (ISEL [6] x y (CMPWconst [0] (SETBC [c] cmp)))
  6365  	// result: (ISEL [c] x y cmp)
  6366  	for {
  6367  		if auxIntToInt32(v.AuxInt) != 6 {
  6368  			break
  6369  		}
  6370  		x := v_0
  6371  		y := v_1
  6372  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6373  			break
  6374  		}
  6375  		v_2_0 := v_2.Args[0]
  6376  		if v_2_0.Op != OpPPC64SETBC {
  6377  			break
  6378  		}
  6379  		c := auxIntToInt32(v_2_0.AuxInt)
  6380  		cmp := v_2_0.Args[0]
  6381  		v.reset(OpPPC64ISEL)
  6382  		v.AuxInt = int32ToAuxInt(c)
  6383  		v.AddArg3(x, y, cmp)
  6384  		return true
  6385  	}
  6386  	// match: (ISEL [6] x y (CMPconst [0] (SETBCR [c] cmp)))
  6387  	// result: (ISEL [c+4] x y cmp)
  6388  	for {
  6389  		if auxIntToInt32(v.AuxInt) != 6 {
  6390  			break
  6391  		}
  6392  		x := v_0
  6393  		y := v_1
  6394  		if v_2.Op != OpPPC64CMPconst || auxIntToInt64(v_2.AuxInt) != 0 {
  6395  			break
  6396  		}
  6397  		v_2_0 := v_2.Args[0]
  6398  		if v_2_0.Op != OpPPC64SETBCR {
  6399  			break
  6400  		}
  6401  		c := auxIntToInt32(v_2_0.AuxInt)
  6402  		cmp := v_2_0.Args[0]
  6403  		v.reset(OpPPC64ISEL)
  6404  		v.AuxInt = int32ToAuxInt(c + 4)
  6405  		v.AddArg3(x, y, cmp)
  6406  		return true
  6407  	}
  6408  	// match: (ISEL [6] x y (CMPWconst [0] (SETBCR [c] cmp)))
  6409  	// result: (ISEL [c+4] x y cmp)
  6410  	for {
  6411  		if auxIntToInt32(v.AuxInt) != 6 {
  6412  			break
  6413  		}
  6414  		x := v_0
  6415  		y := v_1
  6416  		if v_2.Op != OpPPC64CMPWconst || auxIntToInt32(v_2.AuxInt) != 0 {
  6417  			break
  6418  		}
  6419  		v_2_0 := v_2.Args[0]
  6420  		if v_2_0.Op != OpPPC64SETBCR {
  6421  			break
  6422  		}
  6423  		c := auxIntToInt32(v_2_0.AuxInt)
  6424  		cmp := v_2_0.Args[0]
  6425  		v.reset(OpPPC64ISEL)
  6426  		v.AuxInt = int32ToAuxInt(c + 4)
  6427  		v.AddArg3(x, y, cmp)
  6428  		return true
  6429  	}
  6430  	// match: (ISEL [2] x _ (FlagEQ))
  6431  	// result: x
  6432  	for {
  6433  		if auxIntToInt32(v.AuxInt) != 2 {
  6434  			break
  6435  		}
  6436  		x := v_0
  6437  		if v_2.Op != OpPPC64FlagEQ {
  6438  			break
  6439  		}
  6440  		v.copyOf(x)
  6441  		return true
  6442  	}
  6443  	// match: (ISEL [2] _ y (FlagLT))
  6444  	// result: y
  6445  	for {
  6446  		if auxIntToInt32(v.AuxInt) != 2 {
  6447  			break
  6448  		}
  6449  		y := v_1
  6450  		if v_2.Op != OpPPC64FlagLT {
  6451  			break
  6452  		}
  6453  		v.copyOf(y)
  6454  		return true
  6455  	}
  6456  	// match: (ISEL [2] _ y (FlagGT))
  6457  	// result: y
  6458  	for {
  6459  		if auxIntToInt32(v.AuxInt) != 2 {
  6460  			break
  6461  		}
  6462  		y := v_1
  6463  		if v_2.Op != OpPPC64FlagGT {
  6464  			break
  6465  		}
  6466  		v.copyOf(y)
  6467  		return true
  6468  	}
  6469  	// match: (ISEL [6] _ y (FlagEQ))
  6470  	// result: y
  6471  	for {
  6472  		if auxIntToInt32(v.AuxInt) != 6 {
  6473  			break
  6474  		}
  6475  		y := v_1
  6476  		if v_2.Op != OpPPC64FlagEQ {
  6477  			break
  6478  		}
  6479  		v.copyOf(y)
  6480  		return true
  6481  	}
  6482  	// match: (ISEL [6] x _ (FlagLT))
  6483  	// result: x
  6484  	for {
  6485  		if auxIntToInt32(v.AuxInt) != 6 {
  6486  			break
  6487  		}
  6488  		x := v_0
  6489  		if v_2.Op != OpPPC64FlagLT {
  6490  			break
  6491  		}
  6492  		v.copyOf(x)
  6493  		return true
  6494  	}
  6495  	// match: (ISEL [6] x _ (FlagGT))
  6496  	// result: x
  6497  	for {
  6498  		if auxIntToInt32(v.AuxInt) != 6 {
  6499  			break
  6500  		}
  6501  		x := v_0
  6502  		if v_2.Op != OpPPC64FlagGT {
  6503  			break
  6504  		}
  6505  		v.copyOf(x)
  6506  		return true
  6507  	}
  6508  	// match: (ISEL [0] _ y (FlagEQ))
  6509  	// result: y
  6510  	for {
  6511  		if auxIntToInt32(v.AuxInt) != 0 {
  6512  			break
  6513  		}
  6514  		y := v_1
  6515  		if v_2.Op != OpPPC64FlagEQ {
  6516  			break
  6517  		}
  6518  		v.copyOf(y)
  6519  		return true
  6520  	}
  6521  	// match: (ISEL [0] _ y (FlagGT))
  6522  	// result: y
  6523  	for {
  6524  		if auxIntToInt32(v.AuxInt) != 0 {
  6525  			break
  6526  		}
  6527  		y := v_1
  6528  		if v_2.Op != OpPPC64FlagGT {
  6529  			break
  6530  		}
  6531  		v.copyOf(y)
  6532  		return true
  6533  	}
  6534  	// match: (ISEL [0] x _ (FlagLT))
  6535  	// result: x
  6536  	for {
  6537  		if auxIntToInt32(v.AuxInt) != 0 {
  6538  			break
  6539  		}
  6540  		x := v_0
  6541  		if v_2.Op != OpPPC64FlagLT {
  6542  			break
  6543  		}
  6544  		v.copyOf(x)
  6545  		return true
  6546  	}
  6547  	// match: (ISEL [5] _ x (FlagEQ))
  6548  	// result: x
  6549  	for {
  6550  		if auxIntToInt32(v.AuxInt) != 5 {
  6551  			break
  6552  		}
  6553  		x := v_1
  6554  		if v_2.Op != OpPPC64FlagEQ {
  6555  			break
  6556  		}
  6557  		v.copyOf(x)
  6558  		return true
  6559  	}
  6560  	// match: (ISEL [5] _ x (FlagLT))
  6561  	// result: x
  6562  	for {
  6563  		if auxIntToInt32(v.AuxInt) != 5 {
  6564  			break
  6565  		}
  6566  		x := v_1
  6567  		if v_2.Op != OpPPC64FlagLT {
  6568  			break
  6569  		}
  6570  		v.copyOf(x)
  6571  		return true
  6572  	}
  6573  	// match: (ISEL [5] y _ (FlagGT))
  6574  	// result: y
  6575  	for {
  6576  		if auxIntToInt32(v.AuxInt) != 5 {
  6577  			break
  6578  		}
  6579  		y := v_0
  6580  		if v_2.Op != OpPPC64FlagGT {
  6581  			break
  6582  		}
  6583  		v.copyOf(y)
  6584  		return true
  6585  	}
  6586  	// match: (ISEL [1] _ y (FlagEQ))
  6587  	// result: y
  6588  	for {
  6589  		if auxIntToInt32(v.AuxInt) != 1 {
  6590  			break
  6591  		}
  6592  		y := v_1
  6593  		if v_2.Op != OpPPC64FlagEQ {
  6594  			break
  6595  		}
  6596  		v.copyOf(y)
  6597  		return true
  6598  	}
  6599  	// match: (ISEL [1] _ y (FlagLT))
  6600  	// result: y
  6601  	for {
  6602  		if auxIntToInt32(v.AuxInt) != 1 {
  6603  			break
  6604  		}
  6605  		y := v_1
  6606  		if v_2.Op != OpPPC64FlagLT {
  6607  			break
  6608  		}
  6609  		v.copyOf(y)
  6610  		return true
  6611  	}
  6612  	// match: (ISEL [1] x _ (FlagGT))
  6613  	// result: x
  6614  	for {
  6615  		if auxIntToInt32(v.AuxInt) != 1 {
  6616  			break
  6617  		}
  6618  		x := v_0
  6619  		if v_2.Op != OpPPC64FlagGT {
  6620  			break
  6621  		}
  6622  		v.copyOf(x)
  6623  		return true
  6624  	}
  6625  	// match: (ISEL [4] x _ (FlagEQ))
  6626  	// result: x
  6627  	for {
  6628  		if auxIntToInt32(v.AuxInt) != 4 {
  6629  			break
  6630  		}
  6631  		x := v_0
  6632  		if v_2.Op != OpPPC64FlagEQ {
  6633  			break
  6634  		}
  6635  		v.copyOf(x)
  6636  		return true
  6637  	}
  6638  	// match: (ISEL [4] x _ (FlagGT))
  6639  	// result: x
  6640  	for {
  6641  		if auxIntToInt32(v.AuxInt) != 4 {
  6642  			break
  6643  		}
  6644  		x := v_0
  6645  		if v_2.Op != OpPPC64FlagGT {
  6646  			break
  6647  		}
  6648  		v.copyOf(x)
  6649  		return true
  6650  	}
  6651  	// match: (ISEL [4] _ y (FlagLT))
  6652  	// result: y
  6653  	for {
  6654  		if auxIntToInt32(v.AuxInt) != 4 {
  6655  			break
  6656  		}
  6657  		y := v_1
  6658  		if v_2.Op != OpPPC64FlagLT {
  6659  			break
  6660  		}
  6661  		v.copyOf(y)
  6662  		return true
  6663  	}
  6664  	// match: (ISEL [n] x y (InvertFlags bool))
  6665  	// cond: n%4 == 0
  6666  	// result: (ISEL [n+1] x y bool)
  6667  	for {
  6668  		n := auxIntToInt32(v.AuxInt)
  6669  		x := v_0
  6670  		y := v_1
  6671  		if v_2.Op != OpPPC64InvertFlags {
  6672  			break
  6673  		}
  6674  		bool := v_2.Args[0]
  6675  		if !(n%4 == 0) {
  6676  			break
  6677  		}
  6678  		v.reset(OpPPC64ISEL)
  6679  		v.AuxInt = int32ToAuxInt(n + 1)
  6680  		v.AddArg3(x, y, bool)
  6681  		return true
  6682  	}
  6683  	// match: (ISEL [n] x y (InvertFlags bool))
  6684  	// cond: n%4 == 1
  6685  	// result: (ISEL [n-1] x y bool)
  6686  	for {
  6687  		n := auxIntToInt32(v.AuxInt)
  6688  		x := v_0
  6689  		y := v_1
  6690  		if v_2.Op != OpPPC64InvertFlags {
  6691  			break
  6692  		}
  6693  		bool := v_2.Args[0]
  6694  		if !(n%4 == 1) {
  6695  			break
  6696  		}
  6697  		v.reset(OpPPC64ISEL)
  6698  		v.AuxInt = int32ToAuxInt(n - 1)
  6699  		v.AddArg3(x, y, bool)
  6700  		return true
  6701  	}
  6702  	// match: (ISEL [n] x y (InvertFlags bool))
  6703  	// cond: n%4 == 2
  6704  	// result: (ISEL [n] x y bool)
  6705  	for {
  6706  		n := auxIntToInt32(v.AuxInt)
  6707  		x := v_0
  6708  		y := v_1
  6709  		if v_2.Op != OpPPC64InvertFlags {
  6710  			break
  6711  		}
  6712  		bool := v_2.Args[0]
  6713  		if !(n%4 == 2) {
  6714  			break
  6715  		}
  6716  		v.reset(OpPPC64ISEL)
  6717  		v.AuxInt = int32ToAuxInt(n)
  6718  		v.AddArg3(x, y, bool)
  6719  		return true
  6720  	}
  6721  	return false
  6722  }
  6723  func rewriteValuePPC64_OpPPC64LessEqual(v *Value) bool {
  6724  	v_0 := v.Args[0]
  6725  	// match: (LessEqual (FlagEQ))
  6726  	// result: (MOVDconst [1])
  6727  	for {
  6728  		if v_0.Op != OpPPC64FlagEQ {
  6729  			break
  6730  		}
  6731  		v.reset(OpPPC64MOVDconst)
  6732  		v.AuxInt = int64ToAuxInt(1)
  6733  		return true
  6734  	}
  6735  	// match: (LessEqual (FlagLT))
  6736  	// result: (MOVDconst [1])
  6737  	for {
  6738  		if v_0.Op != OpPPC64FlagLT {
  6739  			break
  6740  		}
  6741  		v.reset(OpPPC64MOVDconst)
  6742  		v.AuxInt = int64ToAuxInt(1)
  6743  		return true
  6744  	}
  6745  	// match: (LessEqual (FlagGT))
  6746  	// result: (MOVDconst [0])
  6747  	for {
  6748  		if v_0.Op != OpPPC64FlagGT {
  6749  			break
  6750  		}
  6751  		v.reset(OpPPC64MOVDconst)
  6752  		v.AuxInt = int64ToAuxInt(0)
  6753  		return true
  6754  	}
  6755  	// match: (LessEqual (InvertFlags x))
  6756  	// result: (GreaterEqual x)
  6757  	for {
  6758  		if v_0.Op != OpPPC64InvertFlags {
  6759  			break
  6760  		}
  6761  		x := v_0.Args[0]
  6762  		v.reset(OpPPC64GreaterEqual)
  6763  		v.AddArg(x)
  6764  		return true
  6765  	}
  6766  	// match: (LessEqual cmp)
  6767  	// result: (SETBCR [1] cmp)
  6768  	for {
  6769  		cmp := v_0
  6770  		v.reset(OpPPC64SETBCR)
  6771  		v.AuxInt = int32ToAuxInt(1)
  6772  		v.AddArg(cmp)
  6773  		return true
  6774  	}
  6775  }
  6776  func rewriteValuePPC64_OpPPC64LessThan(v *Value) bool {
  6777  	v_0 := v.Args[0]
  6778  	// match: (LessThan (FlagEQ))
  6779  	// result: (MOVDconst [0])
  6780  	for {
  6781  		if v_0.Op != OpPPC64FlagEQ {
  6782  			break
  6783  		}
  6784  		v.reset(OpPPC64MOVDconst)
  6785  		v.AuxInt = int64ToAuxInt(0)
  6786  		return true
  6787  	}
  6788  	// match: (LessThan (FlagLT))
  6789  	// result: (MOVDconst [1])
  6790  	for {
  6791  		if v_0.Op != OpPPC64FlagLT {
  6792  			break
  6793  		}
  6794  		v.reset(OpPPC64MOVDconst)
  6795  		v.AuxInt = int64ToAuxInt(1)
  6796  		return true
  6797  	}
  6798  	// match: (LessThan (FlagGT))
  6799  	// result: (MOVDconst [0])
  6800  	for {
  6801  		if v_0.Op != OpPPC64FlagGT {
  6802  			break
  6803  		}
  6804  		v.reset(OpPPC64MOVDconst)
  6805  		v.AuxInt = int64ToAuxInt(0)
  6806  		return true
  6807  	}
  6808  	// match: (LessThan (InvertFlags x))
  6809  	// result: (GreaterThan x)
  6810  	for {
  6811  		if v_0.Op != OpPPC64InvertFlags {
  6812  			break
  6813  		}
  6814  		x := v_0.Args[0]
  6815  		v.reset(OpPPC64GreaterThan)
  6816  		v.AddArg(x)
  6817  		return true
  6818  	}
  6819  	// match: (LessThan cmp)
  6820  	// result: (SETBC [0] cmp)
  6821  	for {
  6822  		cmp := v_0
  6823  		v.reset(OpPPC64SETBC)
  6824  		v.AuxInt = int32ToAuxInt(0)
  6825  		v.AddArg(cmp)
  6826  		return true
  6827  	}
  6828  }
  6829  func rewriteValuePPC64_OpPPC64MFVSRD(v *Value) bool {
  6830  	v_0 := v.Args[0]
  6831  	b := v.Block
  6832  	typ := &b.Func.Config.Types
  6833  	// match: (MFVSRD (FMOVDconst [c]))
  6834  	// result: (MOVDconst [int64(math.Float64bits(c))])
  6835  	for {
  6836  		if v_0.Op != OpPPC64FMOVDconst {
  6837  			break
  6838  		}
  6839  		c := auxIntToFloat64(v_0.AuxInt)
  6840  		v.reset(OpPPC64MOVDconst)
  6841  		v.AuxInt = int64ToAuxInt(int64(math.Float64bits(c)))
  6842  		return true
  6843  	}
  6844  	// match: (MFVSRD x:(FMOVDload [off] {sym} ptr mem))
  6845  	// cond: x.Uses == 1 && clobber(x)
  6846  	// result: @x.Block (MOVDload [off] {sym} ptr mem)
  6847  	for {
  6848  		x := v_0
  6849  		if x.Op != OpPPC64FMOVDload {
  6850  			break
  6851  		}
  6852  		off := auxIntToInt32(x.AuxInt)
  6853  		sym := auxToSym(x.Aux)
  6854  		mem := x.Args[1]
  6855  		ptr := x.Args[0]
  6856  		if !(x.Uses == 1 && clobber(x)) {
  6857  			break
  6858  		}
  6859  		b = x.Block
  6860  		v0 := b.NewValue0(x.Pos, OpPPC64MOVDload, typ.Int64)
  6861  		v.copyOf(v0)
  6862  		v0.AuxInt = int32ToAuxInt(off)
  6863  		v0.Aux = symToAux(sym)
  6864  		v0.AddArg2(ptr, mem)
  6865  		return true
  6866  	}
  6867  	return false
  6868  }
  6869  func rewriteValuePPC64_OpPPC64MOVBZload(v *Value) bool {
  6870  	v_1 := v.Args[1]
  6871  	v_0 := v.Args[0]
  6872  	// match: (MOVBZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  6873  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  6874  	// result: (MOVBZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  6875  	for {
  6876  		off1 := auxIntToInt32(v.AuxInt)
  6877  		sym1 := auxToSym(v.Aux)
  6878  		p := v_0
  6879  		if p.Op != OpPPC64MOVDaddr {
  6880  			break
  6881  		}
  6882  		off2 := auxIntToInt32(p.AuxInt)
  6883  		sym2 := auxToSym(p.Aux)
  6884  		ptr := p.Args[0]
  6885  		mem := v_1
  6886  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  6887  			break
  6888  		}
  6889  		v.reset(OpPPC64MOVBZload)
  6890  		v.AuxInt = int32ToAuxInt(off1 + off2)
  6891  		v.Aux = symToAux(mergeSym(sym1, sym2))
  6892  		v.AddArg2(ptr, mem)
  6893  		return true
  6894  	}
  6895  	// match: (MOVBZload [off1] {sym} (ADDconst [off2] x) mem)
  6896  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  6897  	// result: (MOVBZload [off1+int32(off2)] {sym} x mem)
  6898  	for {
  6899  		off1 := auxIntToInt32(v.AuxInt)
  6900  		sym := auxToSym(v.Aux)
  6901  		if v_0.Op != OpPPC64ADDconst {
  6902  			break
  6903  		}
  6904  		off2 := auxIntToInt64(v_0.AuxInt)
  6905  		x := v_0.Args[0]
  6906  		mem := v_1
  6907  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  6908  			break
  6909  		}
  6910  		v.reset(OpPPC64MOVBZload)
  6911  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  6912  		v.Aux = symToAux(sym)
  6913  		v.AddArg2(x, mem)
  6914  		return true
  6915  	}
  6916  	// match: (MOVBZload [0] {sym} p:(ADD ptr idx) mem)
  6917  	// cond: sym == nil && p.Uses == 1
  6918  	// result: (MOVBZloadidx ptr idx mem)
  6919  	for {
  6920  		if auxIntToInt32(v.AuxInt) != 0 {
  6921  			break
  6922  		}
  6923  		sym := auxToSym(v.Aux)
  6924  		p := v_0
  6925  		if p.Op != OpPPC64ADD {
  6926  			break
  6927  		}
  6928  		idx := p.Args[1]
  6929  		ptr := p.Args[0]
  6930  		mem := v_1
  6931  		if !(sym == nil && p.Uses == 1) {
  6932  			break
  6933  		}
  6934  		v.reset(OpPPC64MOVBZloadidx)
  6935  		v.AddArg3(ptr, idx, mem)
  6936  		return true
  6937  	}
  6938  	return false
  6939  }
  6940  func rewriteValuePPC64_OpPPC64MOVBZloadidx(v *Value) bool {
  6941  	v_2 := v.Args[2]
  6942  	v_1 := v.Args[1]
  6943  	v_0 := v.Args[0]
  6944  	// match: (MOVBZloadidx ptr (MOVDconst [c]) mem)
  6945  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  6946  	// result: (MOVBZload [int32(c)] ptr mem)
  6947  	for {
  6948  		ptr := v_0
  6949  		if v_1.Op != OpPPC64MOVDconst {
  6950  			break
  6951  		}
  6952  		c := auxIntToInt64(v_1.AuxInt)
  6953  		mem := v_2
  6954  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  6955  			break
  6956  		}
  6957  		v.reset(OpPPC64MOVBZload)
  6958  		v.AuxInt = int32ToAuxInt(int32(c))
  6959  		v.AddArg2(ptr, mem)
  6960  		return true
  6961  	}
  6962  	// match: (MOVBZloadidx (MOVDconst [c]) ptr mem)
  6963  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  6964  	// result: (MOVBZload [int32(c)] ptr mem)
  6965  	for {
  6966  		if v_0.Op != OpPPC64MOVDconst {
  6967  			break
  6968  		}
  6969  		c := auxIntToInt64(v_0.AuxInt)
  6970  		ptr := v_1
  6971  		mem := v_2
  6972  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  6973  			break
  6974  		}
  6975  		v.reset(OpPPC64MOVBZload)
  6976  		v.AuxInt = int32ToAuxInt(int32(c))
  6977  		v.AddArg2(ptr, mem)
  6978  		return true
  6979  	}
  6980  	return false
  6981  }
  6982  func rewriteValuePPC64_OpPPC64MOVBZreg(v *Value) bool {
  6983  	v_0 := v.Args[0]
  6984  	b := v.Block
  6985  	typ := &b.Func.Config.Types
  6986  	// match: (MOVBZreg y:(ANDconst [c] _))
  6987  	// cond: uint64(c) <= 0xFF
  6988  	// result: y
  6989  	for {
  6990  		y := v_0
  6991  		if y.Op != OpPPC64ANDconst {
  6992  			break
  6993  		}
  6994  		c := auxIntToInt64(y.AuxInt)
  6995  		if !(uint64(c) <= 0xFF) {
  6996  			break
  6997  		}
  6998  		v.copyOf(y)
  6999  		return true
  7000  	}
  7001  	// match: (MOVBZreg (SRWconst [c] (MOVBZreg x)))
  7002  	// result: (SRWconst [c] (MOVBZreg x))
  7003  	for {
  7004  		if v_0.Op != OpPPC64SRWconst {
  7005  			break
  7006  		}
  7007  		c := auxIntToInt64(v_0.AuxInt)
  7008  		v_0_0 := v_0.Args[0]
  7009  		if v_0_0.Op != OpPPC64MOVBZreg {
  7010  			break
  7011  		}
  7012  		x := v_0_0.Args[0]
  7013  		v.reset(OpPPC64SRWconst)
  7014  		v.AuxInt = int64ToAuxInt(c)
  7015  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  7016  		v0.AddArg(x)
  7017  		v.AddArg(v0)
  7018  		return true
  7019  	}
  7020  	// match: (MOVBZreg (SRWconst [c] x))
  7021  	// cond: x.Type.Size() == 8
  7022  	// result: (SRWconst [c] x)
  7023  	for {
  7024  		if v_0.Op != OpPPC64SRWconst {
  7025  			break
  7026  		}
  7027  		c := auxIntToInt64(v_0.AuxInt)
  7028  		x := v_0.Args[0]
  7029  		if !(x.Type.Size() == 8) {
  7030  			break
  7031  		}
  7032  		v.reset(OpPPC64SRWconst)
  7033  		v.AuxInt = int64ToAuxInt(c)
  7034  		v.AddArg(x)
  7035  		return true
  7036  	}
  7037  	// match: (MOVBZreg (SRDconst [c] x))
  7038  	// cond: c>=56
  7039  	// result: (SRDconst [c] x)
  7040  	for {
  7041  		if v_0.Op != OpPPC64SRDconst {
  7042  			break
  7043  		}
  7044  		c := auxIntToInt64(v_0.AuxInt)
  7045  		x := v_0.Args[0]
  7046  		if !(c >= 56) {
  7047  			break
  7048  		}
  7049  		v.reset(OpPPC64SRDconst)
  7050  		v.AuxInt = int64ToAuxInt(c)
  7051  		v.AddArg(x)
  7052  		return true
  7053  	}
  7054  	// match: (MOVBZreg (SRWconst [c] x))
  7055  	// cond: c>=24
  7056  	// result: (SRWconst [c] x)
  7057  	for {
  7058  		if v_0.Op != OpPPC64SRWconst {
  7059  			break
  7060  		}
  7061  		c := auxIntToInt64(v_0.AuxInt)
  7062  		x := v_0.Args[0]
  7063  		if !(c >= 24) {
  7064  			break
  7065  		}
  7066  		v.reset(OpPPC64SRWconst)
  7067  		v.AuxInt = int64ToAuxInt(c)
  7068  		v.AddArg(x)
  7069  		return true
  7070  	}
  7071  	// match: (MOVBZreg y:(MOVBZreg _))
  7072  	// result: y
  7073  	for {
  7074  		y := v_0
  7075  		if y.Op != OpPPC64MOVBZreg {
  7076  			break
  7077  		}
  7078  		v.copyOf(y)
  7079  		return true
  7080  	}
  7081  	// match: (MOVBZreg (MOVBreg x))
  7082  	// result: (MOVBZreg x)
  7083  	for {
  7084  		if v_0.Op != OpPPC64MOVBreg {
  7085  			break
  7086  		}
  7087  		x := v_0.Args[0]
  7088  		v.reset(OpPPC64MOVBZreg)
  7089  		v.AddArg(x)
  7090  		return true
  7091  	}
  7092  	// match: (MOVBZreg (SRWconst x [s]))
  7093  	// cond: mergePPC64AndSrwi(0xFF,s) != 0
  7094  	// result: (RLWINM [mergePPC64AndSrwi(0xFF,s)] x)
  7095  	for {
  7096  		if v_0.Op != OpPPC64SRWconst {
  7097  			break
  7098  		}
  7099  		s := auxIntToInt64(v_0.AuxInt)
  7100  		x := v_0.Args[0]
  7101  		if !(mergePPC64AndSrwi(0xFF, s) != 0) {
  7102  			break
  7103  		}
  7104  		v.reset(OpPPC64RLWINM)
  7105  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(0xFF, s))
  7106  		v.AddArg(x)
  7107  		return true
  7108  	}
  7109  	// match: (MOVBZreg (RLWINM [r] y))
  7110  	// cond: mergePPC64AndRlwinm(0xFF,r) != 0
  7111  	// result: (RLWINM [mergePPC64AndRlwinm(0xFF,r)] y)
  7112  	for {
  7113  		if v_0.Op != OpPPC64RLWINM {
  7114  			break
  7115  		}
  7116  		r := auxIntToInt64(v_0.AuxInt)
  7117  		y := v_0.Args[0]
  7118  		if !(mergePPC64AndRlwinm(0xFF, r) != 0) {
  7119  			break
  7120  		}
  7121  		v.reset(OpPPC64RLWINM)
  7122  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFF, r))
  7123  		v.AddArg(y)
  7124  		return true
  7125  	}
  7126  	// match: (MOVBZreg (OR <t> x (MOVWZreg y)))
  7127  	// result: (MOVBZreg (OR <t> x y))
  7128  	for {
  7129  		if v_0.Op != OpPPC64OR {
  7130  			break
  7131  		}
  7132  		t := v_0.Type
  7133  		_ = v_0.Args[1]
  7134  		v_0_0 := v_0.Args[0]
  7135  		v_0_1 := v_0.Args[1]
  7136  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7137  			x := v_0_0
  7138  			if v_0_1.Op != OpPPC64MOVWZreg {
  7139  				continue
  7140  			}
  7141  			y := v_0_1.Args[0]
  7142  			v.reset(OpPPC64MOVBZreg)
  7143  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7144  			v0.AddArg2(x, y)
  7145  			v.AddArg(v0)
  7146  			return true
  7147  		}
  7148  		break
  7149  	}
  7150  	// match: (MOVBZreg (XOR <t> x (MOVWZreg y)))
  7151  	// result: (MOVBZreg (XOR <t> x y))
  7152  	for {
  7153  		if v_0.Op != OpPPC64XOR {
  7154  			break
  7155  		}
  7156  		t := v_0.Type
  7157  		_ = v_0.Args[1]
  7158  		v_0_0 := v_0.Args[0]
  7159  		v_0_1 := v_0.Args[1]
  7160  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7161  			x := v_0_0
  7162  			if v_0_1.Op != OpPPC64MOVWZreg {
  7163  				continue
  7164  			}
  7165  			y := v_0_1.Args[0]
  7166  			v.reset(OpPPC64MOVBZreg)
  7167  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7168  			v0.AddArg2(x, y)
  7169  			v.AddArg(v0)
  7170  			return true
  7171  		}
  7172  		break
  7173  	}
  7174  	// match: (MOVBZreg (AND <t> x (MOVWZreg y)))
  7175  	// result: (MOVBZreg (AND <t> x y))
  7176  	for {
  7177  		if v_0.Op != OpPPC64AND {
  7178  			break
  7179  		}
  7180  		t := v_0.Type
  7181  		_ = v_0.Args[1]
  7182  		v_0_0 := v_0.Args[0]
  7183  		v_0_1 := v_0.Args[1]
  7184  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7185  			x := v_0_0
  7186  			if v_0_1.Op != OpPPC64MOVWZreg {
  7187  				continue
  7188  			}
  7189  			y := v_0_1.Args[0]
  7190  			v.reset(OpPPC64MOVBZreg)
  7191  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7192  			v0.AddArg2(x, y)
  7193  			v.AddArg(v0)
  7194  			return true
  7195  		}
  7196  		break
  7197  	}
  7198  	// match: (MOVBZreg (OR <t> x (MOVHZreg y)))
  7199  	// result: (MOVBZreg (OR <t> x y))
  7200  	for {
  7201  		if v_0.Op != OpPPC64OR {
  7202  			break
  7203  		}
  7204  		t := v_0.Type
  7205  		_ = v_0.Args[1]
  7206  		v_0_0 := v_0.Args[0]
  7207  		v_0_1 := v_0.Args[1]
  7208  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7209  			x := v_0_0
  7210  			if v_0_1.Op != OpPPC64MOVHZreg {
  7211  				continue
  7212  			}
  7213  			y := v_0_1.Args[0]
  7214  			v.reset(OpPPC64MOVBZreg)
  7215  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7216  			v0.AddArg2(x, y)
  7217  			v.AddArg(v0)
  7218  			return true
  7219  		}
  7220  		break
  7221  	}
  7222  	// match: (MOVBZreg (XOR <t> x (MOVHZreg y)))
  7223  	// result: (MOVBZreg (XOR <t> x y))
  7224  	for {
  7225  		if v_0.Op != OpPPC64XOR {
  7226  			break
  7227  		}
  7228  		t := v_0.Type
  7229  		_ = v_0.Args[1]
  7230  		v_0_0 := v_0.Args[0]
  7231  		v_0_1 := v_0.Args[1]
  7232  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7233  			x := v_0_0
  7234  			if v_0_1.Op != OpPPC64MOVHZreg {
  7235  				continue
  7236  			}
  7237  			y := v_0_1.Args[0]
  7238  			v.reset(OpPPC64MOVBZreg)
  7239  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7240  			v0.AddArg2(x, y)
  7241  			v.AddArg(v0)
  7242  			return true
  7243  		}
  7244  		break
  7245  	}
  7246  	// match: (MOVBZreg (AND <t> x (MOVHZreg y)))
  7247  	// result: (MOVBZreg (AND <t> x y))
  7248  	for {
  7249  		if v_0.Op != OpPPC64AND {
  7250  			break
  7251  		}
  7252  		t := v_0.Type
  7253  		_ = v_0.Args[1]
  7254  		v_0_0 := v_0.Args[0]
  7255  		v_0_1 := v_0.Args[1]
  7256  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7257  			x := v_0_0
  7258  			if v_0_1.Op != OpPPC64MOVHZreg {
  7259  				continue
  7260  			}
  7261  			y := v_0_1.Args[0]
  7262  			v.reset(OpPPC64MOVBZreg)
  7263  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7264  			v0.AddArg2(x, y)
  7265  			v.AddArg(v0)
  7266  			return true
  7267  		}
  7268  		break
  7269  	}
  7270  	// match: (MOVBZreg (OR <t> x (MOVBZreg y)))
  7271  	// result: (MOVBZreg (OR <t> x y))
  7272  	for {
  7273  		if v_0.Op != OpPPC64OR {
  7274  			break
  7275  		}
  7276  		t := v_0.Type
  7277  		_ = v_0.Args[1]
  7278  		v_0_0 := v_0.Args[0]
  7279  		v_0_1 := v_0.Args[1]
  7280  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7281  			x := v_0_0
  7282  			if v_0_1.Op != OpPPC64MOVBZreg {
  7283  				continue
  7284  			}
  7285  			y := v_0_1.Args[0]
  7286  			v.reset(OpPPC64MOVBZreg)
  7287  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  7288  			v0.AddArg2(x, y)
  7289  			v.AddArg(v0)
  7290  			return true
  7291  		}
  7292  		break
  7293  	}
  7294  	// match: (MOVBZreg (XOR <t> x (MOVBZreg y)))
  7295  	// result: (MOVBZreg (XOR <t> x y))
  7296  	for {
  7297  		if v_0.Op != OpPPC64XOR {
  7298  			break
  7299  		}
  7300  		t := v_0.Type
  7301  		_ = v_0.Args[1]
  7302  		v_0_0 := v_0.Args[0]
  7303  		v_0_1 := v_0.Args[1]
  7304  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7305  			x := v_0_0
  7306  			if v_0_1.Op != OpPPC64MOVBZreg {
  7307  				continue
  7308  			}
  7309  			y := v_0_1.Args[0]
  7310  			v.reset(OpPPC64MOVBZreg)
  7311  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  7312  			v0.AddArg2(x, y)
  7313  			v.AddArg(v0)
  7314  			return true
  7315  		}
  7316  		break
  7317  	}
  7318  	// match: (MOVBZreg (AND <t> x (MOVBZreg y)))
  7319  	// result: (MOVBZreg (AND <t> x y))
  7320  	for {
  7321  		if v_0.Op != OpPPC64AND {
  7322  			break
  7323  		}
  7324  		t := v_0.Type
  7325  		_ = v_0.Args[1]
  7326  		v_0_0 := v_0.Args[0]
  7327  		v_0_1 := v_0.Args[1]
  7328  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  7329  			x := v_0_0
  7330  			if v_0_1.Op != OpPPC64MOVBZreg {
  7331  				continue
  7332  			}
  7333  			y := v_0_1.Args[0]
  7334  			v.reset(OpPPC64MOVBZreg)
  7335  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  7336  			v0.AddArg2(x, y)
  7337  			v.AddArg(v0)
  7338  			return true
  7339  		}
  7340  		break
  7341  	}
  7342  	// match: (MOVBZreg z:(ANDconst [c] (MOVBZload ptr x)))
  7343  	// result: z
  7344  	for {
  7345  		z := v_0
  7346  		if z.Op != OpPPC64ANDconst {
  7347  			break
  7348  		}
  7349  		z_0 := z.Args[0]
  7350  		if z_0.Op != OpPPC64MOVBZload {
  7351  			break
  7352  		}
  7353  		v.copyOf(z)
  7354  		return true
  7355  	}
  7356  	// match: (MOVBZreg z:(AND y (MOVBZload ptr x)))
  7357  	// result: z
  7358  	for {
  7359  		z := v_0
  7360  		if z.Op != OpPPC64AND {
  7361  			break
  7362  		}
  7363  		_ = z.Args[1]
  7364  		z_0 := z.Args[0]
  7365  		z_1 := z.Args[1]
  7366  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  7367  			if z_1.Op != OpPPC64MOVBZload {
  7368  				continue
  7369  			}
  7370  			v.copyOf(z)
  7371  			return true
  7372  		}
  7373  		break
  7374  	}
  7375  	// match: (MOVBZreg x:(MOVBZload _ _))
  7376  	// result: x
  7377  	for {
  7378  		x := v_0
  7379  		if x.Op != OpPPC64MOVBZload {
  7380  			break
  7381  		}
  7382  		v.copyOf(x)
  7383  		return true
  7384  	}
  7385  	// match: (MOVBZreg x:(MOVBZloadidx _ _ _))
  7386  	// result: x
  7387  	for {
  7388  		x := v_0
  7389  		if x.Op != OpPPC64MOVBZloadidx {
  7390  			break
  7391  		}
  7392  		v.copyOf(x)
  7393  		return true
  7394  	}
  7395  	// match: (MOVBZreg x:(Select0 (LoweredAtomicLoad8 _ _)))
  7396  	// result: x
  7397  	for {
  7398  		x := v_0
  7399  		if x.Op != OpSelect0 {
  7400  			break
  7401  		}
  7402  		x_0 := x.Args[0]
  7403  		if x_0.Op != OpPPC64LoweredAtomicLoad8 {
  7404  			break
  7405  		}
  7406  		v.copyOf(x)
  7407  		return true
  7408  	}
  7409  	// match: (MOVBZreg x:(Arg <t>))
  7410  	// cond: is8BitInt(t) && !t.IsSigned()
  7411  	// result: x
  7412  	for {
  7413  		x := v_0
  7414  		if x.Op != OpArg {
  7415  			break
  7416  		}
  7417  		t := x.Type
  7418  		if !(is8BitInt(t) && !t.IsSigned()) {
  7419  			break
  7420  		}
  7421  		v.copyOf(x)
  7422  		return true
  7423  	}
  7424  	// match: (MOVBZreg (MOVDconst [c]))
  7425  	// result: (MOVDconst [int64(uint8(c))])
  7426  	for {
  7427  		if v_0.Op != OpPPC64MOVDconst {
  7428  			break
  7429  		}
  7430  		c := auxIntToInt64(v_0.AuxInt)
  7431  		v.reset(OpPPC64MOVDconst)
  7432  		v.AuxInt = int64ToAuxInt(int64(uint8(c)))
  7433  		return true
  7434  	}
  7435  	return false
  7436  }
  7437  func rewriteValuePPC64_OpPPC64MOVBreg(v *Value) bool {
  7438  	v_0 := v.Args[0]
  7439  	b := v.Block
  7440  	typ := &b.Func.Config.Types
  7441  	// match: (MOVBreg y:(ANDconst [c] _))
  7442  	// cond: uint64(c) <= 0x7F
  7443  	// result: y
  7444  	for {
  7445  		y := v_0
  7446  		if y.Op != OpPPC64ANDconst {
  7447  			break
  7448  		}
  7449  		c := auxIntToInt64(y.AuxInt)
  7450  		if !(uint64(c) <= 0x7F) {
  7451  			break
  7452  		}
  7453  		v.copyOf(y)
  7454  		return true
  7455  	}
  7456  	// match: (MOVBreg (SRAWconst [c] (MOVBreg x)))
  7457  	// result: (SRAWconst [c] (MOVBreg x))
  7458  	for {
  7459  		if v_0.Op != OpPPC64SRAWconst {
  7460  			break
  7461  		}
  7462  		c := auxIntToInt64(v_0.AuxInt)
  7463  		v_0_0 := v_0.Args[0]
  7464  		if v_0_0.Op != OpPPC64MOVBreg {
  7465  			break
  7466  		}
  7467  		x := v_0_0.Args[0]
  7468  		v.reset(OpPPC64SRAWconst)
  7469  		v.AuxInt = int64ToAuxInt(c)
  7470  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  7471  		v0.AddArg(x)
  7472  		v.AddArg(v0)
  7473  		return true
  7474  	}
  7475  	// match: (MOVBreg (SRAWconst [c] x))
  7476  	// cond: x.Type.Size() == 8
  7477  	// result: (SRAWconst [c] x)
  7478  	for {
  7479  		if v_0.Op != OpPPC64SRAWconst {
  7480  			break
  7481  		}
  7482  		c := auxIntToInt64(v_0.AuxInt)
  7483  		x := v_0.Args[0]
  7484  		if !(x.Type.Size() == 8) {
  7485  			break
  7486  		}
  7487  		v.reset(OpPPC64SRAWconst)
  7488  		v.AuxInt = int64ToAuxInt(c)
  7489  		v.AddArg(x)
  7490  		return true
  7491  	}
  7492  	// match: (MOVBreg (SRDconst [c] x))
  7493  	// cond: c>56
  7494  	// result: (SRDconst [c] x)
  7495  	for {
  7496  		if v_0.Op != OpPPC64SRDconst {
  7497  			break
  7498  		}
  7499  		c := auxIntToInt64(v_0.AuxInt)
  7500  		x := v_0.Args[0]
  7501  		if !(c > 56) {
  7502  			break
  7503  		}
  7504  		v.reset(OpPPC64SRDconst)
  7505  		v.AuxInt = int64ToAuxInt(c)
  7506  		v.AddArg(x)
  7507  		return true
  7508  	}
  7509  	// match: (MOVBreg (SRDconst [c] x))
  7510  	// cond: c==56
  7511  	// result: (SRADconst [c] x)
  7512  	for {
  7513  		if v_0.Op != OpPPC64SRDconst {
  7514  			break
  7515  		}
  7516  		c := auxIntToInt64(v_0.AuxInt)
  7517  		x := v_0.Args[0]
  7518  		if !(c == 56) {
  7519  			break
  7520  		}
  7521  		v.reset(OpPPC64SRADconst)
  7522  		v.AuxInt = int64ToAuxInt(c)
  7523  		v.AddArg(x)
  7524  		return true
  7525  	}
  7526  	// match: (MOVBreg (SRADconst [c] x))
  7527  	// cond: c>=56
  7528  	// result: (SRADconst [c] x)
  7529  	for {
  7530  		if v_0.Op != OpPPC64SRADconst {
  7531  			break
  7532  		}
  7533  		c := auxIntToInt64(v_0.AuxInt)
  7534  		x := v_0.Args[0]
  7535  		if !(c >= 56) {
  7536  			break
  7537  		}
  7538  		v.reset(OpPPC64SRADconst)
  7539  		v.AuxInt = int64ToAuxInt(c)
  7540  		v.AddArg(x)
  7541  		return true
  7542  	}
  7543  	// match: (MOVBreg (SRWconst [c] x))
  7544  	// cond: c>24
  7545  	// result: (SRWconst [c] x)
  7546  	for {
  7547  		if v_0.Op != OpPPC64SRWconst {
  7548  			break
  7549  		}
  7550  		c := auxIntToInt64(v_0.AuxInt)
  7551  		x := v_0.Args[0]
  7552  		if !(c > 24) {
  7553  			break
  7554  		}
  7555  		v.reset(OpPPC64SRWconst)
  7556  		v.AuxInt = int64ToAuxInt(c)
  7557  		v.AddArg(x)
  7558  		return true
  7559  	}
  7560  	// match: (MOVBreg (SRWconst [c] x))
  7561  	// cond: c==24
  7562  	// result: (SRAWconst [c] x)
  7563  	for {
  7564  		if v_0.Op != OpPPC64SRWconst {
  7565  			break
  7566  		}
  7567  		c := auxIntToInt64(v_0.AuxInt)
  7568  		x := v_0.Args[0]
  7569  		if !(c == 24) {
  7570  			break
  7571  		}
  7572  		v.reset(OpPPC64SRAWconst)
  7573  		v.AuxInt = int64ToAuxInt(c)
  7574  		v.AddArg(x)
  7575  		return true
  7576  	}
  7577  	// match: (MOVBreg (SRAWconst [c] x))
  7578  	// cond: c>=24
  7579  	// result: (SRAWconst [c] x)
  7580  	for {
  7581  		if v_0.Op != OpPPC64SRAWconst {
  7582  			break
  7583  		}
  7584  		c := auxIntToInt64(v_0.AuxInt)
  7585  		x := v_0.Args[0]
  7586  		if !(c >= 24) {
  7587  			break
  7588  		}
  7589  		v.reset(OpPPC64SRAWconst)
  7590  		v.AuxInt = int64ToAuxInt(c)
  7591  		v.AddArg(x)
  7592  		return true
  7593  	}
  7594  	// match: (MOVBreg y:(MOVBreg _))
  7595  	// result: y
  7596  	for {
  7597  		y := v_0
  7598  		if y.Op != OpPPC64MOVBreg {
  7599  			break
  7600  		}
  7601  		v.copyOf(y)
  7602  		return true
  7603  	}
  7604  	// match: (MOVBreg (MOVBZreg x))
  7605  	// result: (MOVBreg x)
  7606  	for {
  7607  		if v_0.Op != OpPPC64MOVBZreg {
  7608  			break
  7609  		}
  7610  		x := v_0.Args[0]
  7611  		v.reset(OpPPC64MOVBreg)
  7612  		v.AddArg(x)
  7613  		return true
  7614  	}
  7615  	// match: (MOVBreg x:(Arg <t>))
  7616  	// cond: is8BitInt(t) && t.IsSigned()
  7617  	// result: x
  7618  	for {
  7619  		x := v_0
  7620  		if x.Op != OpArg {
  7621  			break
  7622  		}
  7623  		t := x.Type
  7624  		if !(is8BitInt(t) && t.IsSigned()) {
  7625  			break
  7626  		}
  7627  		v.copyOf(x)
  7628  		return true
  7629  	}
  7630  	// match: (MOVBreg (MOVDconst [c]))
  7631  	// result: (MOVDconst [int64(int8(c))])
  7632  	for {
  7633  		if v_0.Op != OpPPC64MOVDconst {
  7634  			break
  7635  		}
  7636  		c := auxIntToInt64(v_0.AuxInt)
  7637  		v.reset(OpPPC64MOVDconst)
  7638  		v.AuxInt = int64ToAuxInt(int64(int8(c)))
  7639  		return true
  7640  	}
  7641  	return false
  7642  }
  7643  func rewriteValuePPC64_OpPPC64MOVBstore(v *Value) bool {
  7644  	v_2 := v.Args[2]
  7645  	v_1 := v.Args[1]
  7646  	v_0 := v.Args[0]
  7647  	b := v.Block
  7648  	typ := &b.Func.Config.Types
  7649  	// match: (MOVBstore [off1] {sym} (ADDconst [off2] x) val mem)
  7650  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  7651  	// result: (MOVBstore [off1+int32(off2)] {sym} x val mem)
  7652  	for {
  7653  		off1 := auxIntToInt32(v.AuxInt)
  7654  		sym := auxToSym(v.Aux)
  7655  		if v_0.Op != OpPPC64ADDconst {
  7656  			break
  7657  		}
  7658  		off2 := auxIntToInt64(v_0.AuxInt)
  7659  		x := v_0.Args[0]
  7660  		val := v_1
  7661  		mem := v_2
  7662  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  7663  			break
  7664  		}
  7665  		v.reset(OpPPC64MOVBstore)
  7666  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  7667  		v.Aux = symToAux(sym)
  7668  		v.AddArg3(x, val, mem)
  7669  		return true
  7670  	}
  7671  	// match: (MOVBstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  7672  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  7673  	// result: (MOVBstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  7674  	for {
  7675  		off1 := auxIntToInt32(v.AuxInt)
  7676  		sym1 := auxToSym(v.Aux)
  7677  		p := v_0
  7678  		if p.Op != OpPPC64MOVDaddr {
  7679  			break
  7680  		}
  7681  		off2 := auxIntToInt32(p.AuxInt)
  7682  		sym2 := auxToSym(p.Aux)
  7683  		ptr := p.Args[0]
  7684  		val := v_1
  7685  		mem := v_2
  7686  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  7687  			break
  7688  		}
  7689  		v.reset(OpPPC64MOVBstore)
  7690  		v.AuxInt = int32ToAuxInt(off1 + off2)
  7691  		v.Aux = symToAux(mergeSym(sym1, sym2))
  7692  		v.AddArg3(ptr, val, mem)
  7693  		return true
  7694  	}
  7695  	// match: (MOVBstore [off] {sym} ptr (MOVDconst [0]) mem)
  7696  	// result: (MOVBstorezero [off] {sym} ptr mem)
  7697  	for {
  7698  		off := auxIntToInt32(v.AuxInt)
  7699  		sym := auxToSym(v.Aux)
  7700  		ptr := v_0
  7701  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  7702  			break
  7703  		}
  7704  		mem := v_2
  7705  		v.reset(OpPPC64MOVBstorezero)
  7706  		v.AuxInt = int32ToAuxInt(off)
  7707  		v.Aux = symToAux(sym)
  7708  		v.AddArg2(ptr, mem)
  7709  		return true
  7710  	}
  7711  	// match: (MOVBstore [0] {sym} p:(ADD ptr idx) val mem)
  7712  	// cond: sym == nil && p.Uses == 1
  7713  	// result: (MOVBstoreidx ptr idx val mem)
  7714  	for {
  7715  		if auxIntToInt32(v.AuxInt) != 0 {
  7716  			break
  7717  		}
  7718  		sym := auxToSym(v.Aux)
  7719  		p := v_0
  7720  		if p.Op != OpPPC64ADD {
  7721  			break
  7722  		}
  7723  		idx := p.Args[1]
  7724  		ptr := p.Args[0]
  7725  		val := v_1
  7726  		mem := v_2
  7727  		if !(sym == nil && p.Uses == 1) {
  7728  			break
  7729  		}
  7730  		v.reset(OpPPC64MOVBstoreidx)
  7731  		v.AddArg4(ptr, idx, val, mem)
  7732  		return true
  7733  	}
  7734  	// match: (MOVBstore [off] {sym} ptr (MOVBreg x) mem)
  7735  	// result: (MOVBstore [off] {sym} ptr x mem)
  7736  	for {
  7737  		off := auxIntToInt32(v.AuxInt)
  7738  		sym := auxToSym(v.Aux)
  7739  		ptr := v_0
  7740  		if v_1.Op != OpPPC64MOVBreg {
  7741  			break
  7742  		}
  7743  		x := v_1.Args[0]
  7744  		mem := v_2
  7745  		v.reset(OpPPC64MOVBstore)
  7746  		v.AuxInt = int32ToAuxInt(off)
  7747  		v.Aux = symToAux(sym)
  7748  		v.AddArg3(ptr, x, mem)
  7749  		return true
  7750  	}
  7751  	// match: (MOVBstore [off] {sym} ptr (MOVBZreg x) mem)
  7752  	// result: (MOVBstore [off] {sym} ptr x mem)
  7753  	for {
  7754  		off := auxIntToInt32(v.AuxInt)
  7755  		sym := auxToSym(v.Aux)
  7756  		ptr := v_0
  7757  		if v_1.Op != OpPPC64MOVBZreg {
  7758  			break
  7759  		}
  7760  		x := v_1.Args[0]
  7761  		mem := v_2
  7762  		v.reset(OpPPC64MOVBstore)
  7763  		v.AuxInt = int32ToAuxInt(off)
  7764  		v.Aux = symToAux(sym)
  7765  		v.AddArg3(ptr, x, mem)
  7766  		return true
  7767  	}
  7768  	// match: (MOVBstore [off] {sym} ptr (MOVHreg x) mem)
  7769  	// result: (MOVBstore [off] {sym} ptr x mem)
  7770  	for {
  7771  		off := auxIntToInt32(v.AuxInt)
  7772  		sym := auxToSym(v.Aux)
  7773  		ptr := v_0
  7774  		if v_1.Op != OpPPC64MOVHreg {
  7775  			break
  7776  		}
  7777  		x := v_1.Args[0]
  7778  		mem := v_2
  7779  		v.reset(OpPPC64MOVBstore)
  7780  		v.AuxInt = int32ToAuxInt(off)
  7781  		v.Aux = symToAux(sym)
  7782  		v.AddArg3(ptr, x, mem)
  7783  		return true
  7784  	}
  7785  	// match: (MOVBstore [off] {sym} ptr (MOVHZreg x) mem)
  7786  	// result: (MOVBstore [off] {sym} ptr x mem)
  7787  	for {
  7788  		off := auxIntToInt32(v.AuxInt)
  7789  		sym := auxToSym(v.Aux)
  7790  		ptr := v_0
  7791  		if v_1.Op != OpPPC64MOVHZreg {
  7792  			break
  7793  		}
  7794  		x := v_1.Args[0]
  7795  		mem := v_2
  7796  		v.reset(OpPPC64MOVBstore)
  7797  		v.AuxInt = int32ToAuxInt(off)
  7798  		v.Aux = symToAux(sym)
  7799  		v.AddArg3(ptr, x, mem)
  7800  		return true
  7801  	}
  7802  	// match: (MOVBstore [off] {sym} ptr (MOVWreg x) mem)
  7803  	// result: (MOVBstore [off] {sym} ptr x mem)
  7804  	for {
  7805  		off := auxIntToInt32(v.AuxInt)
  7806  		sym := auxToSym(v.Aux)
  7807  		ptr := v_0
  7808  		if v_1.Op != OpPPC64MOVWreg {
  7809  			break
  7810  		}
  7811  		x := v_1.Args[0]
  7812  		mem := v_2
  7813  		v.reset(OpPPC64MOVBstore)
  7814  		v.AuxInt = int32ToAuxInt(off)
  7815  		v.Aux = symToAux(sym)
  7816  		v.AddArg3(ptr, x, mem)
  7817  		return true
  7818  	}
  7819  	// match: (MOVBstore [off] {sym} ptr (MOVWZreg x) mem)
  7820  	// result: (MOVBstore [off] {sym} ptr x mem)
  7821  	for {
  7822  		off := auxIntToInt32(v.AuxInt)
  7823  		sym := auxToSym(v.Aux)
  7824  		ptr := v_0
  7825  		if v_1.Op != OpPPC64MOVWZreg {
  7826  			break
  7827  		}
  7828  		x := v_1.Args[0]
  7829  		mem := v_2
  7830  		v.reset(OpPPC64MOVBstore)
  7831  		v.AuxInt = int32ToAuxInt(off)
  7832  		v.Aux = symToAux(sym)
  7833  		v.AddArg3(ptr, x, mem)
  7834  		return true
  7835  	}
  7836  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHreg x) [c]) mem)
  7837  	// cond: c <= 8
  7838  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7839  	for {
  7840  		off := auxIntToInt32(v.AuxInt)
  7841  		sym := auxToSym(v.Aux)
  7842  		ptr := v_0
  7843  		if v_1.Op != OpPPC64SRWconst {
  7844  			break
  7845  		}
  7846  		c := auxIntToInt64(v_1.AuxInt)
  7847  		v_1_0 := v_1.Args[0]
  7848  		if v_1_0.Op != OpPPC64MOVHreg {
  7849  			break
  7850  		}
  7851  		x := v_1_0.Args[0]
  7852  		mem := v_2
  7853  		if !(c <= 8) {
  7854  			break
  7855  		}
  7856  		v.reset(OpPPC64MOVBstore)
  7857  		v.AuxInt = int32ToAuxInt(off)
  7858  		v.Aux = symToAux(sym)
  7859  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7860  		v0.AuxInt = int64ToAuxInt(c)
  7861  		v0.AddArg(x)
  7862  		v.AddArg3(ptr, v0, mem)
  7863  		return true
  7864  	}
  7865  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVHZreg x) [c]) mem)
  7866  	// cond: c <= 8
  7867  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7868  	for {
  7869  		off := auxIntToInt32(v.AuxInt)
  7870  		sym := auxToSym(v.Aux)
  7871  		ptr := v_0
  7872  		if v_1.Op != OpPPC64SRWconst {
  7873  			break
  7874  		}
  7875  		c := auxIntToInt64(v_1.AuxInt)
  7876  		v_1_0 := v_1.Args[0]
  7877  		if v_1_0.Op != OpPPC64MOVHZreg {
  7878  			break
  7879  		}
  7880  		x := v_1_0.Args[0]
  7881  		mem := v_2
  7882  		if !(c <= 8) {
  7883  			break
  7884  		}
  7885  		v.reset(OpPPC64MOVBstore)
  7886  		v.AuxInt = int32ToAuxInt(off)
  7887  		v.Aux = symToAux(sym)
  7888  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7889  		v0.AuxInt = int64ToAuxInt(c)
  7890  		v0.AddArg(x)
  7891  		v.AddArg3(ptr, v0, mem)
  7892  		return true
  7893  	}
  7894  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWreg x) [c]) mem)
  7895  	// cond: c <= 24
  7896  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7897  	for {
  7898  		off := auxIntToInt32(v.AuxInt)
  7899  		sym := auxToSym(v.Aux)
  7900  		ptr := v_0
  7901  		if v_1.Op != OpPPC64SRWconst {
  7902  			break
  7903  		}
  7904  		c := auxIntToInt64(v_1.AuxInt)
  7905  		v_1_0 := v_1.Args[0]
  7906  		if v_1_0.Op != OpPPC64MOVWreg {
  7907  			break
  7908  		}
  7909  		x := v_1_0.Args[0]
  7910  		mem := v_2
  7911  		if !(c <= 24) {
  7912  			break
  7913  		}
  7914  		v.reset(OpPPC64MOVBstore)
  7915  		v.AuxInt = int32ToAuxInt(off)
  7916  		v.Aux = symToAux(sym)
  7917  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7918  		v0.AuxInt = int64ToAuxInt(c)
  7919  		v0.AddArg(x)
  7920  		v.AddArg3(ptr, v0, mem)
  7921  		return true
  7922  	}
  7923  	// match: (MOVBstore [off] {sym} ptr (SRWconst (MOVWZreg x) [c]) mem)
  7924  	// cond: c <= 24
  7925  	// result: (MOVBstore [off] {sym} ptr (SRWconst <typ.UInt32> x [c]) mem)
  7926  	for {
  7927  		off := auxIntToInt32(v.AuxInt)
  7928  		sym := auxToSym(v.Aux)
  7929  		ptr := v_0
  7930  		if v_1.Op != OpPPC64SRWconst {
  7931  			break
  7932  		}
  7933  		c := auxIntToInt64(v_1.AuxInt)
  7934  		v_1_0 := v_1.Args[0]
  7935  		if v_1_0.Op != OpPPC64MOVWZreg {
  7936  			break
  7937  		}
  7938  		x := v_1_0.Args[0]
  7939  		mem := v_2
  7940  		if !(c <= 24) {
  7941  			break
  7942  		}
  7943  		v.reset(OpPPC64MOVBstore)
  7944  		v.AuxInt = int32ToAuxInt(off)
  7945  		v.Aux = symToAux(sym)
  7946  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  7947  		v0.AuxInt = int64ToAuxInt(c)
  7948  		v0.AddArg(x)
  7949  		v.AddArg3(ptr, v0, mem)
  7950  		return true
  7951  	}
  7952  	return false
  7953  }
  7954  func rewriteValuePPC64_OpPPC64MOVBstoreidx(v *Value) bool {
  7955  	v_3 := v.Args[3]
  7956  	v_2 := v.Args[2]
  7957  	v_1 := v.Args[1]
  7958  	v_0 := v.Args[0]
  7959  	b := v.Block
  7960  	typ := &b.Func.Config.Types
  7961  	// match: (MOVBstoreidx ptr (MOVDconst [c]) val mem)
  7962  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7963  	// result: (MOVBstore [int32(c)] ptr val mem)
  7964  	for {
  7965  		ptr := v_0
  7966  		if v_1.Op != OpPPC64MOVDconst {
  7967  			break
  7968  		}
  7969  		c := auxIntToInt64(v_1.AuxInt)
  7970  		val := v_2
  7971  		mem := v_3
  7972  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7973  			break
  7974  		}
  7975  		v.reset(OpPPC64MOVBstore)
  7976  		v.AuxInt = int32ToAuxInt(int32(c))
  7977  		v.AddArg3(ptr, val, mem)
  7978  		return true
  7979  	}
  7980  	// match: (MOVBstoreidx (MOVDconst [c]) ptr val mem)
  7981  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  7982  	// result: (MOVBstore [int32(c)] ptr val mem)
  7983  	for {
  7984  		if v_0.Op != OpPPC64MOVDconst {
  7985  			break
  7986  		}
  7987  		c := auxIntToInt64(v_0.AuxInt)
  7988  		ptr := v_1
  7989  		val := v_2
  7990  		mem := v_3
  7991  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  7992  			break
  7993  		}
  7994  		v.reset(OpPPC64MOVBstore)
  7995  		v.AuxInt = int32ToAuxInt(int32(c))
  7996  		v.AddArg3(ptr, val, mem)
  7997  		return true
  7998  	}
  7999  	// match: (MOVBstoreidx ptr idx (MOVBreg x) mem)
  8000  	// result: (MOVBstoreidx ptr idx x mem)
  8001  	for {
  8002  		ptr := v_0
  8003  		idx := v_1
  8004  		if v_2.Op != OpPPC64MOVBreg {
  8005  			break
  8006  		}
  8007  		x := v_2.Args[0]
  8008  		mem := v_3
  8009  		v.reset(OpPPC64MOVBstoreidx)
  8010  		v.AddArg4(ptr, idx, x, mem)
  8011  		return true
  8012  	}
  8013  	// match: (MOVBstoreidx ptr idx (MOVBZreg x) mem)
  8014  	// result: (MOVBstoreidx ptr idx x mem)
  8015  	for {
  8016  		ptr := v_0
  8017  		idx := v_1
  8018  		if v_2.Op != OpPPC64MOVBZreg {
  8019  			break
  8020  		}
  8021  		x := v_2.Args[0]
  8022  		mem := v_3
  8023  		v.reset(OpPPC64MOVBstoreidx)
  8024  		v.AddArg4(ptr, idx, x, mem)
  8025  		return true
  8026  	}
  8027  	// match: (MOVBstoreidx ptr idx (MOVHreg x) mem)
  8028  	// result: (MOVBstoreidx ptr idx x mem)
  8029  	for {
  8030  		ptr := v_0
  8031  		idx := v_1
  8032  		if v_2.Op != OpPPC64MOVHreg {
  8033  			break
  8034  		}
  8035  		x := v_2.Args[0]
  8036  		mem := v_3
  8037  		v.reset(OpPPC64MOVBstoreidx)
  8038  		v.AddArg4(ptr, idx, x, mem)
  8039  		return true
  8040  	}
  8041  	// match: (MOVBstoreidx ptr idx (MOVHZreg x) mem)
  8042  	// result: (MOVBstoreidx ptr idx x mem)
  8043  	for {
  8044  		ptr := v_0
  8045  		idx := v_1
  8046  		if v_2.Op != OpPPC64MOVHZreg {
  8047  			break
  8048  		}
  8049  		x := v_2.Args[0]
  8050  		mem := v_3
  8051  		v.reset(OpPPC64MOVBstoreidx)
  8052  		v.AddArg4(ptr, idx, x, mem)
  8053  		return true
  8054  	}
  8055  	// match: (MOVBstoreidx ptr idx (MOVWreg x) mem)
  8056  	// result: (MOVBstoreidx ptr idx x mem)
  8057  	for {
  8058  		ptr := v_0
  8059  		idx := v_1
  8060  		if v_2.Op != OpPPC64MOVWreg {
  8061  			break
  8062  		}
  8063  		x := v_2.Args[0]
  8064  		mem := v_3
  8065  		v.reset(OpPPC64MOVBstoreidx)
  8066  		v.AddArg4(ptr, idx, x, mem)
  8067  		return true
  8068  	}
  8069  	// match: (MOVBstoreidx ptr idx (MOVWZreg x) mem)
  8070  	// result: (MOVBstoreidx ptr idx x mem)
  8071  	for {
  8072  		ptr := v_0
  8073  		idx := v_1
  8074  		if v_2.Op != OpPPC64MOVWZreg {
  8075  			break
  8076  		}
  8077  		x := v_2.Args[0]
  8078  		mem := v_3
  8079  		v.reset(OpPPC64MOVBstoreidx)
  8080  		v.AddArg4(ptr, idx, x, mem)
  8081  		return true
  8082  	}
  8083  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHreg x) [c]) mem)
  8084  	// cond: c <= 8
  8085  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8086  	for {
  8087  		ptr := v_0
  8088  		idx := v_1
  8089  		if v_2.Op != OpPPC64SRWconst {
  8090  			break
  8091  		}
  8092  		c := auxIntToInt64(v_2.AuxInt)
  8093  		v_2_0 := v_2.Args[0]
  8094  		if v_2_0.Op != OpPPC64MOVHreg {
  8095  			break
  8096  		}
  8097  		x := v_2_0.Args[0]
  8098  		mem := v_3
  8099  		if !(c <= 8) {
  8100  			break
  8101  		}
  8102  		v.reset(OpPPC64MOVBstoreidx)
  8103  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8104  		v0.AuxInt = int64ToAuxInt(c)
  8105  		v0.AddArg(x)
  8106  		v.AddArg4(ptr, idx, v0, mem)
  8107  		return true
  8108  	}
  8109  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVHZreg x) [c]) mem)
  8110  	// cond: c <= 8
  8111  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8112  	for {
  8113  		ptr := v_0
  8114  		idx := v_1
  8115  		if v_2.Op != OpPPC64SRWconst {
  8116  			break
  8117  		}
  8118  		c := auxIntToInt64(v_2.AuxInt)
  8119  		v_2_0 := v_2.Args[0]
  8120  		if v_2_0.Op != OpPPC64MOVHZreg {
  8121  			break
  8122  		}
  8123  		x := v_2_0.Args[0]
  8124  		mem := v_3
  8125  		if !(c <= 8) {
  8126  			break
  8127  		}
  8128  		v.reset(OpPPC64MOVBstoreidx)
  8129  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8130  		v0.AuxInt = int64ToAuxInt(c)
  8131  		v0.AddArg(x)
  8132  		v.AddArg4(ptr, idx, v0, mem)
  8133  		return true
  8134  	}
  8135  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWreg x) [c]) mem)
  8136  	// cond: c <= 24
  8137  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8138  	for {
  8139  		ptr := v_0
  8140  		idx := v_1
  8141  		if v_2.Op != OpPPC64SRWconst {
  8142  			break
  8143  		}
  8144  		c := auxIntToInt64(v_2.AuxInt)
  8145  		v_2_0 := v_2.Args[0]
  8146  		if v_2_0.Op != OpPPC64MOVWreg {
  8147  			break
  8148  		}
  8149  		x := v_2_0.Args[0]
  8150  		mem := v_3
  8151  		if !(c <= 24) {
  8152  			break
  8153  		}
  8154  		v.reset(OpPPC64MOVBstoreidx)
  8155  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8156  		v0.AuxInt = int64ToAuxInt(c)
  8157  		v0.AddArg(x)
  8158  		v.AddArg4(ptr, idx, v0, mem)
  8159  		return true
  8160  	}
  8161  	// match: (MOVBstoreidx ptr idx (SRWconst (MOVWZreg x) [c]) mem)
  8162  	// cond: c <= 24
  8163  	// result: (MOVBstoreidx ptr idx (SRWconst <typ.UInt32> x [c]) mem)
  8164  	for {
  8165  		ptr := v_0
  8166  		idx := v_1
  8167  		if v_2.Op != OpPPC64SRWconst {
  8168  			break
  8169  		}
  8170  		c := auxIntToInt64(v_2.AuxInt)
  8171  		v_2_0 := v_2.Args[0]
  8172  		if v_2_0.Op != OpPPC64MOVWZreg {
  8173  			break
  8174  		}
  8175  		x := v_2_0.Args[0]
  8176  		mem := v_3
  8177  		if !(c <= 24) {
  8178  			break
  8179  		}
  8180  		v.reset(OpPPC64MOVBstoreidx)
  8181  		v0 := b.NewValue0(v.Pos, OpPPC64SRWconst, typ.UInt32)
  8182  		v0.AuxInt = int64ToAuxInt(c)
  8183  		v0.AddArg(x)
  8184  		v.AddArg4(ptr, idx, v0, mem)
  8185  		return true
  8186  	}
  8187  	return false
  8188  }
  8189  func rewriteValuePPC64_OpPPC64MOVBstorezero(v *Value) bool {
  8190  	v_1 := v.Args[1]
  8191  	v_0 := v.Args[0]
  8192  	// match: (MOVBstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8193  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8194  	// result: (MOVBstorezero [off1+int32(off2)] {sym} x mem)
  8195  	for {
  8196  		off1 := auxIntToInt32(v.AuxInt)
  8197  		sym := auxToSym(v.Aux)
  8198  		if v_0.Op != OpPPC64ADDconst {
  8199  			break
  8200  		}
  8201  		off2 := auxIntToInt64(v_0.AuxInt)
  8202  		x := v_0.Args[0]
  8203  		mem := v_1
  8204  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8205  			break
  8206  		}
  8207  		v.reset(OpPPC64MOVBstorezero)
  8208  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8209  		v.Aux = symToAux(sym)
  8210  		v.AddArg2(x, mem)
  8211  		return true
  8212  	}
  8213  	// match: (MOVBstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8214  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8215  	// result: (MOVBstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8216  	for {
  8217  		off1 := auxIntToInt32(v.AuxInt)
  8218  		sym1 := auxToSym(v.Aux)
  8219  		p := v_0
  8220  		if p.Op != OpPPC64MOVDaddr {
  8221  			break
  8222  		}
  8223  		off2 := auxIntToInt32(p.AuxInt)
  8224  		sym2 := auxToSym(p.Aux)
  8225  		x := p.Args[0]
  8226  		mem := v_1
  8227  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8228  			break
  8229  		}
  8230  		v.reset(OpPPC64MOVBstorezero)
  8231  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8232  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8233  		v.AddArg2(x, mem)
  8234  		return true
  8235  	}
  8236  	return false
  8237  }
  8238  func rewriteValuePPC64_OpPPC64MOVDaddr(v *Value) bool {
  8239  	v_0 := v.Args[0]
  8240  	// match: (MOVDaddr {sym} [n] p:(ADD x y))
  8241  	// cond: sym == nil && n == 0
  8242  	// result: p
  8243  	for {
  8244  		n := auxIntToInt32(v.AuxInt)
  8245  		sym := auxToSym(v.Aux)
  8246  		p := v_0
  8247  		if p.Op != OpPPC64ADD {
  8248  			break
  8249  		}
  8250  		if !(sym == nil && n == 0) {
  8251  			break
  8252  		}
  8253  		v.copyOf(p)
  8254  		return true
  8255  	}
  8256  	// match: (MOVDaddr {sym} [n] ptr)
  8257  	// cond: sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)
  8258  	// result: ptr
  8259  	for {
  8260  		n := auxIntToInt32(v.AuxInt)
  8261  		sym := auxToSym(v.Aux)
  8262  		ptr := v_0
  8263  		if !(sym == nil && n == 0 && (ptr.Op == OpArgIntReg || ptr.Op == OpPhi)) {
  8264  			break
  8265  		}
  8266  		v.copyOf(ptr)
  8267  		return true
  8268  	}
  8269  	return false
  8270  }
  8271  func rewriteValuePPC64_OpPPC64MOVDload(v *Value) bool {
  8272  	v_1 := v.Args[1]
  8273  	v_0 := v.Args[0]
  8274  	// match: (MOVDload [off] {sym} ptr (FMOVDstore [off] {sym} ptr x _))
  8275  	// result: (MFVSRD x)
  8276  	for {
  8277  		off := auxIntToInt32(v.AuxInt)
  8278  		sym := auxToSym(v.Aux)
  8279  		ptr := v_0
  8280  		if v_1.Op != OpPPC64FMOVDstore || auxIntToInt32(v_1.AuxInt) != off || auxToSym(v_1.Aux) != sym {
  8281  			break
  8282  		}
  8283  		x := v_1.Args[1]
  8284  		if ptr != v_1.Args[0] {
  8285  			break
  8286  		}
  8287  		v.reset(OpPPC64MFVSRD)
  8288  		v.AddArg(x)
  8289  		return true
  8290  	}
  8291  	// match: (MOVDload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8292  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8293  	// result: (MOVDload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8294  	for {
  8295  		off1 := auxIntToInt32(v.AuxInt)
  8296  		sym1 := auxToSym(v.Aux)
  8297  		p := v_0
  8298  		if p.Op != OpPPC64MOVDaddr {
  8299  			break
  8300  		}
  8301  		off2 := auxIntToInt32(p.AuxInt)
  8302  		sym2 := auxToSym(p.Aux)
  8303  		ptr := p.Args[0]
  8304  		mem := v_1
  8305  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8306  			break
  8307  		}
  8308  		v.reset(OpPPC64MOVDload)
  8309  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8310  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8311  		v.AddArg2(ptr, mem)
  8312  		return true
  8313  	}
  8314  	// match: (MOVDload [off1] {sym} (ADDconst [off2] x) mem)
  8315  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8316  	// result: (MOVDload [off1+int32(off2)] {sym} x mem)
  8317  	for {
  8318  		off1 := auxIntToInt32(v.AuxInt)
  8319  		sym := auxToSym(v.Aux)
  8320  		if v_0.Op != OpPPC64ADDconst {
  8321  			break
  8322  		}
  8323  		off2 := auxIntToInt64(v_0.AuxInt)
  8324  		x := v_0.Args[0]
  8325  		mem := v_1
  8326  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8327  			break
  8328  		}
  8329  		v.reset(OpPPC64MOVDload)
  8330  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8331  		v.Aux = symToAux(sym)
  8332  		v.AddArg2(x, mem)
  8333  		return true
  8334  	}
  8335  	// match: (MOVDload [0] {sym} p:(ADD ptr idx) mem)
  8336  	// cond: sym == nil && p.Uses == 1
  8337  	// result: (MOVDloadidx ptr idx mem)
  8338  	for {
  8339  		if auxIntToInt32(v.AuxInt) != 0 {
  8340  			break
  8341  		}
  8342  		sym := auxToSym(v.Aux)
  8343  		p := v_0
  8344  		if p.Op != OpPPC64ADD {
  8345  			break
  8346  		}
  8347  		idx := p.Args[1]
  8348  		ptr := p.Args[0]
  8349  		mem := v_1
  8350  		if !(sym == nil && p.Uses == 1) {
  8351  			break
  8352  		}
  8353  		v.reset(OpPPC64MOVDloadidx)
  8354  		v.AddArg3(ptr, idx, mem)
  8355  		return true
  8356  	}
  8357  	return false
  8358  }
  8359  func rewriteValuePPC64_OpPPC64MOVDloadidx(v *Value) bool {
  8360  	v_2 := v.Args[2]
  8361  	v_1 := v.Args[1]
  8362  	v_0 := v.Args[0]
  8363  	// match: (MOVDloadidx ptr (MOVDconst [c]) mem)
  8364  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8365  	// result: (MOVDload [int32(c)] ptr mem)
  8366  	for {
  8367  		ptr := v_0
  8368  		if v_1.Op != OpPPC64MOVDconst {
  8369  			break
  8370  		}
  8371  		c := auxIntToInt64(v_1.AuxInt)
  8372  		mem := v_2
  8373  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8374  			break
  8375  		}
  8376  		v.reset(OpPPC64MOVDload)
  8377  		v.AuxInt = int32ToAuxInt(int32(c))
  8378  		v.AddArg2(ptr, mem)
  8379  		return true
  8380  	}
  8381  	// match: (MOVDloadidx (MOVDconst [c]) ptr mem)
  8382  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8383  	// result: (MOVDload [int32(c)] ptr mem)
  8384  	for {
  8385  		if v_0.Op != OpPPC64MOVDconst {
  8386  			break
  8387  		}
  8388  		c := auxIntToInt64(v_0.AuxInt)
  8389  		ptr := v_1
  8390  		mem := v_2
  8391  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8392  			break
  8393  		}
  8394  		v.reset(OpPPC64MOVDload)
  8395  		v.AuxInt = int32ToAuxInt(int32(c))
  8396  		v.AddArg2(ptr, mem)
  8397  		return true
  8398  	}
  8399  	return false
  8400  }
  8401  func rewriteValuePPC64_OpPPC64MOVDstore(v *Value) bool {
  8402  	v_2 := v.Args[2]
  8403  	v_1 := v.Args[1]
  8404  	v_0 := v.Args[0]
  8405  	b := v.Block
  8406  	// match: (MOVDstore [off] {sym} ptr (MFVSRD x) mem)
  8407  	// result: (FMOVDstore [off] {sym} ptr x mem)
  8408  	for {
  8409  		off := auxIntToInt32(v.AuxInt)
  8410  		sym := auxToSym(v.Aux)
  8411  		ptr := v_0
  8412  		if v_1.Op != OpPPC64MFVSRD {
  8413  			break
  8414  		}
  8415  		x := v_1.Args[0]
  8416  		mem := v_2
  8417  		v.reset(OpPPC64FMOVDstore)
  8418  		v.AuxInt = int32ToAuxInt(off)
  8419  		v.Aux = symToAux(sym)
  8420  		v.AddArg3(ptr, x, mem)
  8421  		return true
  8422  	}
  8423  	// match: (MOVDstore [off1] {sym} (ADDconst [off2] x) val mem)
  8424  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8425  	// result: (MOVDstore [off1+int32(off2)] {sym} x val mem)
  8426  	for {
  8427  		off1 := auxIntToInt32(v.AuxInt)
  8428  		sym := auxToSym(v.Aux)
  8429  		if v_0.Op != OpPPC64ADDconst {
  8430  			break
  8431  		}
  8432  		off2 := auxIntToInt64(v_0.AuxInt)
  8433  		x := v_0.Args[0]
  8434  		val := v_1
  8435  		mem := v_2
  8436  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8437  			break
  8438  		}
  8439  		v.reset(OpPPC64MOVDstore)
  8440  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8441  		v.Aux = symToAux(sym)
  8442  		v.AddArg3(x, val, mem)
  8443  		return true
  8444  	}
  8445  	// match: (MOVDstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  8446  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8447  	// result: (MOVDstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  8448  	for {
  8449  		off1 := auxIntToInt32(v.AuxInt)
  8450  		sym1 := auxToSym(v.Aux)
  8451  		p := v_0
  8452  		if p.Op != OpPPC64MOVDaddr {
  8453  			break
  8454  		}
  8455  		off2 := auxIntToInt32(p.AuxInt)
  8456  		sym2 := auxToSym(p.Aux)
  8457  		ptr := p.Args[0]
  8458  		val := v_1
  8459  		mem := v_2
  8460  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8461  			break
  8462  		}
  8463  		v.reset(OpPPC64MOVDstore)
  8464  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8465  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8466  		v.AddArg3(ptr, val, mem)
  8467  		return true
  8468  	}
  8469  	// match: (MOVDstore [off] {sym} ptr (MOVDconst [0]) mem)
  8470  	// result: (MOVDstorezero [off] {sym} ptr mem)
  8471  	for {
  8472  		off := auxIntToInt32(v.AuxInt)
  8473  		sym := auxToSym(v.Aux)
  8474  		ptr := v_0
  8475  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  8476  			break
  8477  		}
  8478  		mem := v_2
  8479  		v.reset(OpPPC64MOVDstorezero)
  8480  		v.AuxInt = int32ToAuxInt(off)
  8481  		v.Aux = symToAux(sym)
  8482  		v.AddArg2(ptr, mem)
  8483  		return true
  8484  	}
  8485  	// match: (MOVDstore [0] {sym} p:(ADD ptr idx) val mem)
  8486  	// cond: sym == nil && p.Uses == 1
  8487  	// result: (MOVDstoreidx ptr idx val mem)
  8488  	for {
  8489  		if auxIntToInt32(v.AuxInt) != 0 {
  8490  			break
  8491  		}
  8492  		sym := auxToSym(v.Aux)
  8493  		p := v_0
  8494  		if p.Op != OpPPC64ADD {
  8495  			break
  8496  		}
  8497  		idx := p.Args[1]
  8498  		ptr := p.Args[0]
  8499  		val := v_1
  8500  		mem := v_2
  8501  		if !(sym == nil && p.Uses == 1) {
  8502  			break
  8503  		}
  8504  		v.reset(OpPPC64MOVDstoreidx)
  8505  		v.AddArg4(ptr, idx, val, mem)
  8506  		return true
  8507  	}
  8508  	// match: (MOVDstore [off] {sym} ptr r:(BRD val) mem)
  8509  	// cond: r.Uses == 1
  8510  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8511  	for {
  8512  		off := auxIntToInt32(v.AuxInt)
  8513  		sym := auxToSym(v.Aux)
  8514  		ptr := v_0
  8515  		r := v_1
  8516  		if r.Op != OpPPC64BRD {
  8517  			break
  8518  		}
  8519  		val := r.Args[0]
  8520  		mem := v_2
  8521  		if !(r.Uses == 1) {
  8522  			break
  8523  		}
  8524  		v.reset(OpPPC64MOVDBRstore)
  8525  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8526  		v0.AuxInt = int32ToAuxInt(off)
  8527  		v0.Aux = symToAux(sym)
  8528  		v0.AddArg(ptr)
  8529  		v.AddArg3(v0, val, mem)
  8530  		return true
  8531  	}
  8532  	// match: (MOVDstore [off] {sym} ptr (Bswap64 val) mem)
  8533  	// result: (MOVDBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  8534  	for {
  8535  		off := auxIntToInt32(v.AuxInt)
  8536  		sym := auxToSym(v.Aux)
  8537  		ptr := v_0
  8538  		if v_1.Op != OpBswap64 {
  8539  			break
  8540  		}
  8541  		val := v_1.Args[0]
  8542  		mem := v_2
  8543  		v.reset(OpPPC64MOVDBRstore)
  8544  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  8545  		v0.AuxInt = int32ToAuxInt(off)
  8546  		v0.Aux = symToAux(sym)
  8547  		v0.AddArg(ptr)
  8548  		v.AddArg3(v0, val, mem)
  8549  		return true
  8550  	}
  8551  	return false
  8552  }
  8553  func rewriteValuePPC64_OpPPC64MOVDstoreidx(v *Value) bool {
  8554  	v_3 := v.Args[3]
  8555  	v_2 := v.Args[2]
  8556  	v_1 := v.Args[1]
  8557  	v_0 := v.Args[0]
  8558  	// match: (MOVDstoreidx ptr (MOVDconst [c]) val mem)
  8559  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8560  	// result: (MOVDstore [int32(c)] ptr val mem)
  8561  	for {
  8562  		ptr := v_0
  8563  		if v_1.Op != OpPPC64MOVDconst {
  8564  			break
  8565  		}
  8566  		c := auxIntToInt64(v_1.AuxInt)
  8567  		val := v_2
  8568  		mem := v_3
  8569  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8570  			break
  8571  		}
  8572  		v.reset(OpPPC64MOVDstore)
  8573  		v.AuxInt = int32ToAuxInt(int32(c))
  8574  		v.AddArg3(ptr, val, mem)
  8575  		return true
  8576  	}
  8577  	// match: (MOVDstoreidx (MOVDconst [c]) ptr val mem)
  8578  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8579  	// result: (MOVDstore [int32(c)] ptr val mem)
  8580  	for {
  8581  		if v_0.Op != OpPPC64MOVDconst {
  8582  			break
  8583  		}
  8584  		c := auxIntToInt64(v_0.AuxInt)
  8585  		ptr := v_1
  8586  		val := v_2
  8587  		mem := v_3
  8588  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8589  			break
  8590  		}
  8591  		v.reset(OpPPC64MOVDstore)
  8592  		v.AuxInt = int32ToAuxInt(int32(c))
  8593  		v.AddArg3(ptr, val, mem)
  8594  		return true
  8595  	}
  8596  	// match: (MOVDstoreidx ptr idx r:(BRD val) mem)
  8597  	// cond: r.Uses == 1
  8598  	// result: (MOVDBRstoreidx ptr idx val mem)
  8599  	for {
  8600  		ptr := v_0
  8601  		idx := v_1
  8602  		r := v_2
  8603  		if r.Op != OpPPC64BRD {
  8604  			break
  8605  		}
  8606  		val := r.Args[0]
  8607  		mem := v_3
  8608  		if !(r.Uses == 1) {
  8609  			break
  8610  		}
  8611  		v.reset(OpPPC64MOVDBRstoreidx)
  8612  		v.AddArg4(ptr, idx, val, mem)
  8613  		return true
  8614  	}
  8615  	// match: (MOVDstoreidx ptr idx (Bswap64 val) mem)
  8616  	// result: (MOVDBRstoreidx ptr idx val mem)
  8617  	for {
  8618  		ptr := v_0
  8619  		idx := v_1
  8620  		if v_2.Op != OpBswap64 {
  8621  			break
  8622  		}
  8623  		val := v_2.Args[0]
  8624  		mem := v_3
  8625  		v.reset(OpPPC64MOVDBRstoreidx)
  8626  		v.AddArg4(ptr, idx, val, mem)
  8627  		return true
  8628  	}
  8629  	return false
  8630  }
  8631  func rewriteValuePPC64_OpPPC64MOVDstorezero(v *Value) bool {
  8632  	v_1 := v.Args[1]
  8633  	v_0 := v.Args[0]
  8634  	// match: (MOVDstorezero [off1] {sym} (ADDconst [off2] x) mem)
  8635  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  8636  	// result: (MOVDstorezero [off1+int32(off2)] {sym} x mem)
  8637  	for {
  8638  		off1 := auxIntToInt32(v.AuxInt)
  8639  		sym := auxToSym(v.Aux)
  8640  		if v_0.Op != OpPPC64ADDconst {
  8641  			break
  8642  		}
  8643  		off2 := auxIntToInt64(v_0.AuxInt)
  8644  		x := v_0.Args[0]
  8645  		mem := v_1
  8646  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  8647  			break
  8648  		}
  8649  		v.reset(OpPPC64MOVDstorezero)
  8650  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8651  		v.Aux = symToAux(sym)
  8652  		v.AddArg2(x, mem)
  8653  		return true
  8654  	}
  8655  	// match: (MOVDstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
  8656  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8657  	// result: (MOVDstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
  8658  	for {
  8659  		off1 := auxIntToInt32(v.AuxInt)
  8660  		sym1 := auxToSym(v.Aux)
  8661  		p := v_0
  8662  		if p.Op != OpPPC64MOVDaddr {
  8663  			break
  8664  		}
  8665  		off2 := auxIntToInt32(p.AuxInt)
  8666  		sym2 := auxToSym(p.Aux)
  8667  		x := p.Args[0]
  8668  		mem := v_1
  8669  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8670  			break
  8671  		}
  8672  		v.reset(OpPPC64MOVDstorezero)
  8673  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8674  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8675  		v.AddArg2(x, mem)
  8676  		return true
  8677  	}
  8678  	return false
  8679  }
  8680  func rewriteValuePPC64_OpPPC64MOVHBRstore(v *Value) bool {
  8681  	v_2 := v.Args[2]
  8682  	v_1 := v.Args[1]
  8683  	v_0 := v.Args[0]
  8684  	// match: (MOVHBRstore ptr (MOVHreg x) mem)
  8685  	// result: (MOVHBRstore ptr x mem)
  8686  	for {
  8687  		ptr := v_0
  8688  		if v_1.Op != OpPPC64MOVHreg {
  8689  			break
  8690  		}
  8691  		x := v_1.Args[0]
  8692  		mem := v_2
  8693  		v.reset(OpPPC64MOVHBRstore)
  8694  		v.AddArg3(ptr, x, mem)
  8695  		return true
  8696  	}
  8697  	// match: (MOVHBRstore ptr (MOVHZreg x) mem)
  8698  	// result: (MOVHBRstore ptr x mem)
  8699  	for {
  8700  		ptr := v_0
  8701  		if v_1.Op != OpPPC64MOVHZreg {
  8702  			break
  8703  		}
  8704  		x := v_1.Args[0]
  8705  		mem := v_2
  8706  		v.reset(OpPPC64MOVHBRstore)
  8707  		v.AddArg3(ptr, x, mem)
  8708  		return true
  8709  	}
  8710  	// match: (MOVHBRstore ptr (MOVWreg x) mem)
  8711  	// result: (MOVHBRstore ptr x mem)
  8712  	for {
  8713  		ptr := v_0
  8714  		if v_1.Op != OpPPC64MOVWreg {
  8715  			break
  8716  		}
  8717  		x := v_1.Args[0]
  8718  		mem := v_2
  8719  		v.reset(OpPPC64MOVHBRstore)
  8720  		v.AddArg3(ptr, x, mem)
  8721  		return true
  8722  	}
  8723  	// match: (MOVHBRstore ptr (MOVWZreg x) mem)
  8724  	// result: (MOVHBRstore ptr x mem)
  8725  	for {
  8726  		ptr := v_0
  8727  		if v_1.Op != OpPPC64MOVWZreg {
  8728  			break
  8729  		}
  8730  		x := v_1.Args[0]
  8731  		mem := v_2
  8732  		v.reset(OpPPC64MOVHBRstore)
  8733  		v.AddArg3(ptr, x, mem)
  8734  		return true
  8735  	}
  8736  	return false
  8737  }
  8738  func rewriteValuePPC64_OpPPC64MOVHZload(v *Value) bool {
  8739  	v_1 := v.Args[1]
  8740  	v_0 := v.Args[0]
  8741  	// match: (MOVHZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  8742  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  8743  	// result: (MOVHZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  8744  	for {
  8745  		off1 := auxIntToInt32(v.AuxInt)
  8746  		sym1 := auxToSym(v.Aux)
  8747  		p := v_0
  8748  		if p.Op != OpPPC64MOVDaddr {
  8749  			break
  8750  		}
  8751  		off2 := auxIntToInt32(p.AuxInt)
  8752  		sym2 := auxToSym(p.Aux)
  8753  		ptr := p.Args[0]
  8754  		mem := v_1
  8755  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  8756  			break
  8757  		}
  8758  		v.reset(OpPPC64MOVHZload)
  8759  		v.AuxInt = int32ToAuxInt(off1 + off2)
  8760  		v.Aux = symToAux(mergeSym(sym1, sym2))
  8761  		v.AddArg2(ptr, mem)
  8762  		return true
  8763  	}
  8764  	// match: (MOVHZload [off1] {sym} (ADDconst [off2] x) mem)
  8765  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  8766  	// result: (MOVHZload [off1+int32(off2)] {sym} x mem)
  8767  	for {
  8768  		off1 := auxIntToInt32(v.AuxInt)
  8769  		sym := auxToSym(v.Aux)
  8770  		if v_0.Op != OpPPC64ADDconst {
  8771  			break
  8772  		}
  8773  		off2 := auxIntToInt64(v_0.AuxInt)
  8774  		x := v_0.Args[0]
  8775  		mem := v_1
  8776  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  8777  			break
  8778  		}
  8779  		v.reset(OpPPC64MOVHZload)
  8780  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  8781  		v.Aux = symToAux(sym)
  8782  		v.AddArg2(x, mem)
  8783  		return true
  8784  	}
  8785  	// match: (MOVHZload [0] {sym} p:(ADD ptr idx) mem)
  8786  	// cond: sym == nil && p.Uses == 1
  8787  	// result: (MOVHZloadidx ptr idx mem)
  8788  	for {
  8789  		if auxIntToInt32(v.AuxInt) != 0 {
  8790  			break
  8791  		}
  8792  		sym := auxToSym(v.Aux)
  8793  		p := v_0
  8794  		if p.Op != OpPPC64ADD {
  8795  			break
  8796  		}
  8797  		idx := p.Args[1]
  8798  		ptr := p.Args[0]
  8799  		mem := v_1
  8800  		if !(sym == nil && p.Uses == 1) {
  8801  			break
  8802  		}
  8803  		v.reset(OpPPC64MOVHZloadidx)
  8804  		v.AddArg3(ptr, idx, mem)
  8805  		return true
  8806  	}
  8807  	return false
  8808  }
  8809  func rewriteValuePPC64_OpPPC64MOVHZloadidx(v *Value) bool {
  8810  	v_2 := v.Args[2]
  8811  	v_1 := v.Args[1]
  8812  	v_0 := v.Args[0]
  8813  	// match: (MOVHZloadidx ptr (MOVDconst [c]) mem)
  8814  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8815  	// result: (MOVHZload [int32(c)] ptr mem)
  8816  	for {
  8817  		ptr := v_0
  8818  		if v_1.Op != OpPPC64MOVDconst {
  8819  			break
  8820  		}
  8821  		c := auxIntToInt64(v_1.AuxInt)
  8822  		mem := v_2
  8823  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8824  			break
  8825  		}
  8826  		v.reset(OpPPC64MOVHZload)
  8827  		v.AuxInt = int32ToAuxInt(int32(c))
  8828  		v.AddArg2(ptr, mem)
  8829  		return true
  8830  	}
  8831  	// match: (MOVHZloadidx (MOVDconst [c]) ptr mem)
  8832  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  8833  	// result: (MOVHZload [int32(c)] ptr mem)
  8834  	for {
  8835  		if v_0.Op != OpPPC64MOVDconst {
  8836  			break
  8837  		}
  8838  		c := auxIntToInt64(v_0.AuxInt)
  8839  		ptr := v_1
  8840  		mem := v_2
  8841  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  8842  			break
  8843  		}
  8844  		v.reset(OpPPC64MOVHZload)
  8845  		v.AuxInt = int32ToAuxInt(int32(c))
  8846  		v.AddArg2(ptr, mem)
  8847  		return true
  8848  	}
  8849  	return false
  8850  }
  8851  func rewriteValuePPC64_OpPPC64MOVHZreg(v *Value) bool {
  8852  	v_0 := v.Args[0]
  8853  	b := v.Block
  8854  	typ := &b.Func.Config.Types
  8855  	// match: (MOVHZreg y:(ANDconst [c] _))
  8856  	// cond: uint64(c) <= 0xFFFF
  8857  	// result: y
  8858  	for {
  8859  		y := v_0
  8860  		if y.Op != OpPPC64ANDconst {
  8861  			break
  8862  		}
  8863  		c := auxIntToInt64(y.AuxInt)
  8864  		if !(uint64(c) <= 0xFFFF) {
  8865  			break
  8866  		}
  8867  		v.copyOf(y)
  8868  		return true
  8869  	}
  8870  	// match: (MOVHZreg (SRWconst [c] (MOVBZreg x)))
  8871  	// result: (SRWconst [c] (MOVBZreg x))
  8872  	for {
  8873  		if v_0.Op != OpPPC64SRWconst {
  8874  			break
  8875  		}
  8876  		c := auxIntToInt64(v_0.AuxInt)
  8877  		v_0_0 := v_0.Args[0]
  8878  		if v_0_0.Op != OpPPC64MOVBZreg {
  8879  			break
  8880  		}
  8881  		x := v_0_0.Args[0]
  8882  		v.reset(OpPPC64SRWconst)
  8883  		v.AuxInt = int64ToAuxInt(c)
  8884  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
  8885  		v0.AddArg(x)
  8886  		v.AddArg(v0)
  8887  		return true
  8888  	}
  8889  	// match: (MOVHZreg (SRWconst [c] (MOVHZreg x)))
  8890  	// result: (SRWconst [c] (MOVHZreg x))
  8891  	for {
  8892  		if v_0.Op != OpPPC64SRWconst {
  8893  			break
  8894  		}
  8895  		c := auxIntToInt64(v_0.AuxInt)
  8896  		v_0_0 := v_0.Args[0]
  8897  		if v_0_0.Op != OpPPC64MOVHZreg {
  8898  			break
  8899  		}
  8900  		x := v_0_0.Args[0]
  8901  		v.reset(OpPPC64SRWconst)
  8902  		v.AuxInt = int64ToAuxInt(c)
  8903  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
  8904  		v0.AddArg(x)
  8905  		v.AddArg(v0)
  8906  		return true
  8907  	}
  8908  	// match: (MOVHZreg (SRWconst [c] x))
  8909  	// cond: x.Type.Size() <= 16
  8910  	// result: (SRWconst [c] x)
  8911  	for {
  8912  		if v_0.Op != OpPPC64SRWconst {
  8913  			break
  8914  		}
  8915  		c := auxIntToInt64(v_0.AuxInt)
  8916  		x := v_0.Args[0]
  8917  		if !(x.Type.Size() <= 16) {
  8918  			break
  8919  		}
  8920  		v.reset(OpPPC64SRWconst)
  8921  		v.AuxInt = int64ToAuxInt(c)
  8922  		v.AddArg(x)
  8923  		return true
  8924  	}
  8925  	// match: (MOVHZreg (SRDconst [c] x))
  8926  	// cond: c>=48
  8927  	// result: (SRDconst [c] x)
  8928  	for {
  8929  		if v_0.Op != OpPPC64SRDconst {
  8930  			break
  8931  		}
  8932  		c := auxIntToInt64(v_0.AuxInt)
  8933  		x := v_0.Args[0]
  8934  		if !(c >= 48) {
  8935  			break
  8936  		}
  8937  		v.reset(OpPPC64SRDconst)
  8938  		v.AuxInt = int64ToAuxInt(c)
  8939  		v.AddArg(x)
  8940  		return true
  8941  	}
  8942  	// match: (MOVHZreg (SRWconst [c] x))
  8943  	// cond: c>=16
  8944  	// result: (SRWconst [c] x)
  8945  	for {
  8946  		if v_0.Op != OpPPC64SRWconst {
  8947  			break
  8948  		}
  8949  		c := auxIntToInt64(v_0.AuxInt)
  8950  		x := v_0.Args[0]
  8951  		if !(c >= 16) {
  8952  			break
  8953  		}
  8954  		v.reset(OpPPC64SRWconst)
  8955  		v.AuxInt = int64ToAuxInt(c)
  8956  		v.AddArg(x)
  8957  		return true
  8958  	}
  8959  	// match: (MOVHZreg (RLWINM [r] y))
  8960  	// cond: mergePPC64AndRlwinm(0xFFFF,r) != 0
  8961  	// result: (RLWINM [mergePPC64AndRlwinm(0xFFFF,r)] y)
  8962  	for {
  8963  		if v_0.Op != OpPPC64RLWINM {
  8964  			break
  8965  		}
  8966  		r := auxIntToInt64(v_0.AuxInt)
  8967  		y := v_0.Args[0]
  8968  		if !(mergePPC64AndRlwinm(0xFFFF, r) != 0) {
  8969  			break
  8970  		}
  8971  		v.reset(OpPPC64RLWINM)
  8972  		v.AuxInt = int64ToAuxInt(mergePPC64AndRlwinm(0xFFFF, r))
  8973  		v.AddArg(y)
  8974  		return true
  8975  	}
  8976  	// match: (MOVHZreg y:(MOVHZreg _))
  8977  	// result: y
  8978  	for {
  8979  		y := v_0
  8980  		if y.Op != OpPPC64MOVHZreg {
  8981  			break
  8982  		}
  8983  		v.copyOf(y)
  8984  		return true
  8985  	}
  8986  	// match: (MOVHZreg y:(MOVBZreg _))
  8987  	// result: y
  8988  	for {
  8989  		y := v_0
  8990  		if y.Op != OpPPC64MOVBZreg {
  8991  			break
  8992  		}
  8993  		v.copyOf(y)
  8994  		return true
  8995  	}
  8996  	// match: (MOVHZreg y:(MOVHBRload _ _))
  8997  	// result: y
  8998  	for {
  8999  		y := v_0
  9000  		if y.Op != OpPPC64MOVHBRload {
  9001  			break
  9002  		}
  9003  		v.copyOf(y)
  9004  		return true
  9005  	}
  9006  	// match: (MOVHZreg y:(MOVHreg x))
  9007  	// result: (MOVHZreg x)
  9008  	for {
  9009  		y := v_0
  9010  		if y.Op != OpPPC64MOVHreg {
  9011  			break
  9012  		}
  9013  		x := y.Args[0]
  9014  		v.reset(OpPPC64MOVHZreg)
  9015  		v.AddArg(x)
  9016  		return true
  9017  	}
  9018  	// match: (MOVHZreg (OR <t> x (MOVWZreg y)))
  9019  	// result: (MOVHZreg (OR <t> x y))
  9020  	for {
  9021  		if v_0.Op != OpPPC64OR {
  9022  			break
  9023  		}
  9024  		t := v_0.Type
  9025  		_ = v_0.Args[1]
  9026  		v_0_0 := v_0.Args[0]
  9027  		v_0_1 := v_0.Args[1]
  9028  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9029  			x := v_0_0
  9030  			if v_0_1.Op != OpPPC64MOVWZreg {
  9031  				continue
  9032  			}
  9033  			y := v_0_1.Args[0]
  9034  			v.reset(OpPPC64MOVHZreg)
  9035  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9036  			v0.AddArg2(x, y)
  9037  			v.AddArg(v0)
  9038  			return true
  9039  		}
  9040  		break
  9041  	}
  9042  	// match: (MOVHZreg (XOR <t> x (MOVWZreg y)))
  9043  	// result: (MOVHZreg (XOR <t> x y))
  9044  	for {
  9045  		if v_0.Op != OpPPC64XOR {
  9046  			break
  9047  		}
  9048  		t := v_0.Type
  9049  		_ = v_0.Args[1]
  9050  		v_0_0 := v_0.Args[0]
  9051  		v_0_1 := v_0.Args[1]
  9052  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9053  			x := v_0_0
  9054  			if v_0_1.Op != OpPPC64MOVWZreg {
  9055  				continue
  9056  			}
  9057  			y := v_0_1.Args[0]
  9058  			v.reset(OpPPC64MOVHZreg)
  9059  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9060  			v0.AddArg2(x, y)
  9061  			v.AddArg(v0)
  9062  			return true
  9063  		}
  9064  		break
  9065  	}
  9066  	// match: (MOVHZreg (AND <t> x (MOVWZreg y)))
  9067  	// result: (MOVHZreg (AND <t> x y))
  9068  	for {
  9069  		if v_0.Op != OpPPC64AND {
  9070  			break
  9071  		}
  9072  		t := v_0.Type
  9073  		_ = v_0.Args[1]
  9074  		v_0_0 := v_0.Args[0]
  9075  		v_0_1 := v_0.Args[1]
  9076  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9077  			x := v_0_0
  9078  			if v_0_1.Op != OpPPC64MOVWZreg {
  9079  				continue
  9080  			}
  9081  			y := v_0_1.Args[0]
  9082  			v.reset(OpPPC64MOVHZreg)
  9083  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9084  			v0.AddArg2(x, y)
  9085  			v.AddArg(v0)
  9086  			return true
  9087  		}
  9088  		break
  9089  	}
  9090  	// match: (MOVHZreg (OR <t> x (MOVHZreg y)))
  9091  	// result: (MOVHZreg (OR <t> x y))
  9092  	for {
  9093  		if v_0.Op != OpPPC64OR {
  9094  			break
  9095  		}
  9096  		t := v_0.Type
  9097  		_ = v_0.Args[1]
  9098  		v_0_0 := v_0.Args[0]
  9099  		v_0_1 := v_0.Args[1]
  9100  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9101  			x := v_0_0
  9102  			if v_0_1.Op != OpPPC64MOVHZreg {
  9103  				continue
  9104  			}
  9105  			y := v_0_1.Args[0]
  9106  			v.reset(OpPPC64MOVHZreg)
  9107  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
  9108  			v0.AddArg2(x, y)
  9109  			v.AddArg(v0)
  9110  			return true
  9111  		}
  9112  		break
  9113  	}
  9114  	// match: (MOVHZreg (XOR <t> x (MOVHZreg y)))
  9115  	// result: (MOVHZreg (XOR <t> x y))
  9116  	for {
  9117  		if v_0.Op != OpPPC64XOR {
  9118  			break
  9119  		}
  9120  		t := v_0.Type
  9121  		_ = v_0.Args[1]
  9122  		v_0_0 := v_0.Args[0]
  9123  		v_0_1 := v_0.Args[1]
  9124  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9125  			x := v_0_0
  9126  			if v_0_1.Op != OpPPC64MOVHZreg {
  9127  				continue
  9128  			}
  9129  			y := v_0_1.Args[0]
  9130  			v.reset(OpPPC64MOVHZreg)
  9131  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
  9132  			v0.AddArg2(x, y)
  9133  			v.AddArg(v0)
  9134  			return true
  9135  		}
  9136  		break
  9137  	}
  9138  	// match: (MOVHZreg (AND <t> x (MOVHZreg y)))
  9139  	// result: (MOVHZreg (AND <t> x y))
  9140  	for {
  9141  		if v_0.Op != OpPPC64AND {
  9142  			break
  9143  		}
  9144  		t := v_0.Type
  9145  		_ = v_0.Args[1]
  9146  		v_0_0 := v_0.Args[0]
  9147  		v_0_1 := v_0.Args[1]
  9148  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
  9149  			x := v_0_0
  9150  			if v_0_1.Op != OpPPC64MOVHZreg {
  9151  				continue
  9152  			}
  9153  			y := v_0_1.Args[0]
  9154  			v.reset(OpPPC64MOVHZreg)
  9155  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
  9156  			v0.AddArg2(x, y)
  9157  			v.AddArg(v0)
  9158  			return true
  9159  		}
  9160  		break
  9161  	}
  9162  	// match: (MOVHZreg z:(ANDconst [c] (MOVBZload ptr x)))
  9163  	// result: z
  9164  	for {
  9165  		z := v_0
  9166  		if z.Op != OpPPC64ANDconst {
  9167  			break
  9168  		}
  9169  		z_0 := z.Args[0]
  9170  		if z_0.Op != OpPPC64MOVBZload {
  9171  			break
  9172  		}
  9173  		v.copyOf(z)
  9174  		return true
  9175  	}
  9176  	// match: (MOVHZreg z:(AND y (MOVHZload ptr x)))
  9177  	// result: z
  9178  	for {
  9179  		z := v_0
  9180  		if z.Op != OpPPC64AND {
  9181  			break
  9182  		}
  9183  		_ = z.Args[1]
  9184  		z_0 := z.Args[0]
  9185  		z_1 := z.Args[1]
  9186  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
  9187  			if z_1.Op != OpPPC64MOVHZload {
  9188  				continue
  9189  			}
  9190  			v.copyOf(z)
  9191  			return true
  9192  		}
  9193  		break
  9194  	}
  9195  	// match: (MOVHZreg z:(ANDconst [c] (MOVHZload ptr x)))
  9196  	// result: z
  9197  	for {
  9198  		z := v_0
  9199  		if z.Op != OpPPC64ANDconst {
  9200  			break
  9201  		}
  9202  		z_0 := z.Args[0]
  9203  		if z_0.Op != OpPPC64MOVHZload {
  9204  			break
  9205  		}
  9206  		v.copyOf(z)
  9207  		return true
  9208  	}
  9209  	// match: (MOVHZreg x:(MOVBZload _ _))
  9210  	// result: x
  9211  	for {
  9212  		x := v_0
  9213  		if x.Op != OpPPC64MOVBZload {
  9214  			break
  9215  		}
  9216  		v.copyOf(x)
  9217  		return true
  9218  	}
  9219  	// match: (MOVHZreg x:(MOVBZloadidx _ _ _))
  9220  	// result: x
  9221  	for {
  9222  		x := v_0
  9223  		if x.Op != OpPPC64MOVBZloadidx {
  9224  			break
  9225  		}
  9226  		v.copyOf(x)
  9227  		return true
  9228  	}
  9229  	// match: (MOVHZreg x:(MOVHZload _ _))
  9230  	// result: x
  9231  	for {
  9232  		x := v_0
  9233  		if x.Op != OpPPC64MOVHZload {
  9234  			break
  9235  		}
  9236  		v.copyOf(x)
  9237  		return true
  9238  	}
  9239  	// match: (MOVHZreg x:(MOVHZloadidx _ _ _))
  9240  	// result: x
  9241  	for {
  9242  		x := v_0
  9243  		if x.Op != OpPPC64MOVHZloadidx {
  9244  			break
  9245  		}
  9246  		v.copyOf(x)
  9247  		return true
  9248  	}
  9249  	// match: (MOVHZreg x:(Arg <t>))
  9250  	// cond: (is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()
  9251  	// result: x
  9252  	for {
  9253  		x := v_0
  9254  		if x.Op != OpArg {
  9255  			break
  9256  		}
  9257  		t := x.Type
  9258  		if !((is8BitInt(t) || is16BitInt(t)) && !t.IsSigned()) {
  9259  			break
  9260  		}
  9261  		v.copyOf(x)
  9262  		return true
  9263  	}
  9264  	// match: (MOVHZreg (MOVDconst [c]))
  9265  	// result: (MOVDconst [int64(uint16(c))])
  9266  	for {
  9267  		if v_0.Op != OpPPC64MOVDconst {
  9268  			break
  9269  		}
  9270  		c := auxIntToInt64(v_0.AuxInt)
  9271  		v.reset(OpPPC64MOVDconst)
  9272  		v.AuxInt = int64ToAuxInt(int64(uint16(c)))
  9273  		return true
  9274  	}
  9275  	return false
  9276  }
  9277  func rewriteValuePPC64_OpPPC64MOVHload(v *Value) bool {
  9278  	v_1 := v.Args[1]
  9279  	v_0 := v.Args[0]
  9280  	// match: (MOVHload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
  9281  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9282  	// result: (MOVHload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
  9283  	for {
  9284  		off1 := auxIntToInt32(v.AuxInt)
  9285  		sym1 := auxToSym(v.Aux)
  9286  		p := v_0
  9287  		if p.Op != OpPPC64MOVDaddr {
  9288  			break
  9289  		}
  9290  		off2 := auxIntToInt32(p.AuxInt)
  9291  		sym2 := auxToSym(p.Aux)
  9292  		ptr := p.Args[0]
  9293  		mem := v_1
  9294  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9295  			break
  9296  		}
  9297  		v.reset(OpPPC64MOVHload)
  9298  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9299  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9300  		v.AddArg2(ptr, mem)
  9301  		return true
  9302  	}
  9303  	// match: (MOVHload [off1] {sym} (ADDconst [off2] x) mem)
  9304  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9305  	// result: (MOVHload [off1+int32(off2)] {sym} x mem)
  9306  	for {
  9307  		off1 := auxIntToInt32(v.AuxInt)
  9308  		sym := auxToSym(v.Aux)
  9309  		if v_0.Op != OpPPC64ADDconst {
  9310  			break
  9311  		}
  9312  		off2 := auxIntToInt64(v_0.AuxInt)
  9313  		x := v_0.Args[0]
  9314  		mem := v_1
  9315  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9316  			break
  9317  		}
  9318  		v.reset(OpPPC64MOVHload)
  9319  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9320  		v.Aux = symToAux(sym)
  9321  		v.AddArg2(x, mem)
  9322  		return true
  9323  	}
  9324  	// match: (MOVHload [0] {sym} p:(ADD ptr idx) mem)
  9325  	// cond: sym == nil && p.Uses == 1
  9326  	// result: (MOVHloadidx ptr idx mem)
  9327  	for {
  9328  		if auxIntToInt32(v.AuxInt) != 0 {
  9329  			break
  9330  		}
  9331  		sym := auxToSym(v.Aux)
  9332  		p := v_0
  9333  		if p.Op != OpPPC64ADD {
  9334  			break
  9335  		}
  9336  		idx := p.Args[1]
  9337  		ptr := p.Args[0]
  9338  		mem := v_1
  9339  		if !(sym == nil && p.Uses == 1) {
  9340  			break
  9341  		}
  9342  		v.reset(OpPPC64MOVHloadidx)
  9343  		v.AddArg3(ptr, idx, mem)
  9344  		return true
  9345  	}
  9346  	return false
  9347  }
  9348  func rewriteValuePPC64_OpPPC64MOVHloadidx(v *Value) bool {
  9349  	v_2 := v.Args[2]
  9350  	v_1 := v.Args[1]
  9351  	v_0 := v.Args[0]
  9352  	// match: (MOVHloadidx ptr (MOVDconst [c]) mem)
  9353  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9354  	// result: (MOVHload [int32(c)] ptr mem)
  9355  	for {
  9356  		ptr := v_0
  9357  		if v_1.Op != OpPPC64MOVDconst {
  9358  			break
  9359  		}
  9360  		c := auxIntToInt64(v_1.AuxInt)
  9361  		mem := v_2
  9362  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9363  			break
  9364  		}
  9365  		v.reset(OpPPC64MOVHload)
  9366  		v.AuxInt = int32ToAuxInt(int32(c))
  9367  		v.AddArg2(ptr, mem)
  9368  		return true
  9369  	}
  9370  	// match: (MOVHloadidx (MOVDconst [c]) ptr mem)
  9371  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9372  	// result: (MOVHload [int32(c)] ptr mem)
  9373  	for {
  9374  		if v_0.Op != OpPPC64MOVDconst {
  9375  			break
  9376  		}
  9377  		c := auxIntToInt64(v_0.AuxInt)
  9378  		ptr := v_1
  9379  		mem := v_2
  9380  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9381  			break
  9382  		}
  9383  		v.reset(OpPPC64MOVHload)
  9384  		v.AuxInt = int32ToAuxInt(int32(c))
  9385  		v.AddArg2(ptr, mem)
  9386  		return true
  9387  	}
  9388  	return false
  9389  }
  9390  func rewriteValuePPC64_OpPPC64MOVHreg(v *Value) bool {
  9391  	v_0 := v.Args[0]
  9392  	b := v.Block
  9393  	typ := &b.Func.Config.Types
  9394  	// match: (MOVHreg y:(ANDconst [c] _))
  9395  	// cond: uint64(c) <= 0x7FFF
  9396  	// result: y
  9397  	for {
  9398  		y := v_0
  9399  		if y.Op != OpPPC64ANDconst {
  9400  			break
  9401  		}
  9402  		c := auxIntToInt64(y.AuxInt)
  9403  		if !(uint64(c) <= 0x7FFF) {
  9404  			break
  9405  		}
  9406  		v.copyOf(y)
  9407  		return true
  9408  	}
  9409  	// match: (MOVHreg (SRAWconst [c] (MOVBreg x)))
  9410  	// result: (SRAWconst [c] (MOVBreg x))
  9411  	for {
  9412  		if v_0.Op != OpPPC64SRAWconst {
  9413  			break
  9414  		}
  9415  		c := auxIntToInt64(v_0.AuxInt)
  9416  		v_0_0 := v_0.Args[0]
  9417  		if v_0_0.Op != OpPPC64MOVBreg {
  9418  			break
  9419  		}
  9420  		x := v_0_0.Args[0]
  9421  		v.reset(OpPPC64SRAWconst)
  9422  		v.AuxInt = int64ToAuxInt(c)
  9423  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
  9424  		v0.AddArg(x)
  9425  		v.AddArg(v0)
  9426  		return true
  9427  	}
  9428  	// match: (MOVHreg (SRAWconst [c] (MOVHreg x)))
  9429  	// result: (SRAWconst [c] (MOVHreg x))
  9430  	for {
  9431  		if v_0.Op != OpPPC64SRAWconst {
  9432  			break
  9433  		}
  9434  		c := auxIntToInt64(v_0.AuxInt)
  9435  		v_0_0 := v_0.Args[0]
  9436  		if v_0_0.Op != OpPPC64MOVHreg {
  9437  			break
  9438  		}
  9439  		x := v_0_0.Args[0]
  9440  		v.reset(OpPPC64SRAWconst)
  9441  		v.AuxInt = int64ToAuxInt(c)
  9442  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
  9443  		v0.AddArg(x)
  9444  		v.AddArg(v0)
  9445  		return true
  9446  	}
  9447  	// match: (MOVHreg (SRAWconst [c] x))
  9448  	// cond: x.Type.Size() <= 16
  9449  	// result: (SRAWconst [c] x)
  9450  	for {
  9451  		if v_0.Op != OpPPC64SRAWconst {
  9452  			break
  9453  		}
  9454  		c := auxIntToInt64(v_0.AuxInt)
  9455  		x := v_0.Args[0]
  9456  		if !(x.Type.Size() <= 16) {
  9457  			break
  9458  		}
  9459  		v.reset(OpPPC64SRAWconst)
  9460  		v.AuxInt = int64ToAuxInt(c)
  9461  		v.AddArg(x)
  9462  		return true
  9463  	}
  9464  	// match: (MOVHreg (SRDconst [c] x))
  9465  	// cond: c>48
  9466  	// result: (SRDconst [c] x)
  9467  	for {
  9468  		if v_0.Op != OpPPC64SRDconst {
  9469  			break
  9470  		}
  9471  		c := auxIntToInt64(v_0.AuxInt)
  9472  		x := v_0.Args[0]
  9473  		if !(c > 48) {
  9474  			break
  9475  		}
  9476  		v.reset(OpPPC64SRDconst)
  9477  		v.AuxInt = int64ToAuxInt(c)
  9478  		v.AddArg(x)
  9479  		return true
  9480  	}
  9481  	// match: (MOVHreg (SRDconst [c] x))
  9482  	// cond: c==48
  9483  	// result: (SRADconst [c] x)
  9484  	for {
  9485  		if v_0.Op != OpPPC64SRDconst {
  9486  			break
  9487  		}
  9488  		c := auxIntToInt64(v_0.AuxInt)
  9489  		x := v_0.Args[0]
  9490  		if !(c == 48) {
  9491  			break
  9492  		}
  9493  		v.reset(OpPPC64SRADconst)
  9494  		v.AuxInt = int64ToAuxInt(c)
  9495  		v.AddArg(x)
  9496  		return true
  9497  	}
  9498  	// match: (MOVHreg (SRADconst [c] x))
  9499  	// cond: c>=48
  9500  	// result: (SRADconst [c] x)
  9501  	for {
  9502  		if v_0.Op != OpPPC64SRADconst {
  9503  			break
  9504  		}
  9505  		c := auxIntToInt64(v_0.AuxInt)
  9506  		x := v_0.Args[0]
  9507  		if !(c >= 48) {
  9508  			break
  9509  		}
  9510  		v.reset(OpPPC64SRADconst)
  9511  		v.AuxInt = int64ToAuxInt(c)
  9512  		v.AddArg(x)
  9513  		return true
  9514  	}
  9515  	// match: (MOVHreg (SRWconst [c] x))
  9516  	// cond: c>16
  9517  	// result: (SRWconst [c] x)
  9518  	for {
  9519  		if v_0.Op != OpPPC64SRWconst {
  9520  			break
  9521  		}
  9522  		c := auxIntToInt64(v_0.AuxInt)
  9523  		x := v_0.Args[0]
  9524  		if !(c > 16) {
  9525  			break
  9526  		}
  9527  		v.reset(OpPPC64SRWconst)
  9528  		v.AuxInt = int64ToAuxInt(c)
  9529  		v.AddArg(x)
  9530  		return true
  9531  	}
  9532  	// match: (MOVHreg (SRAWconst [c] x))
  9533  	// cond: c>=16
  9534  	// result: (SRAWconst [c] x)
  9535  	for {
  9536  		if v_0.Op != OpPPC64SRAWconst {
  9537  			break
  9538  		}
  9539  		c := auxIntToInt64(v_0.AuxInt)
  9540  		x := v_0.Args[0]
  9541  		if !(c >= 16) {
  9542  			break
  9543  		}
  9544  		v.reset(OpPPC64SRAWconst)
  9545  		v.AuxInt = int64ToAuxInt(c)
  9546  		v.AddArg(x)
  9547  		return true
  9548  	}
  9549  	// match: (MOVHreg (SRWconst [c] x))
  9550  	// cond: c==16
  9551  	// result: (SRAWconst [c] x)
  9552  	for {
  9553  		if v_0.Op != OpPPC64SRWconst {
  9554  			break
  9555  		}
  9556  		c := auxIntToInt64(v_0.AuxInt)
  9557  		x := v_0.Args[0]
  9558  		if !(c == 16) {
  9559  			break
  9560  		}
  9561  		v.reset(OpPPC64SRAWconst)
  9562  		v.AuxInt = int64ToAuxInt(c)
  9563  		v.AddArg(x)
  9564  		return true
  9565  	}
  9566  	// match: (MOVHreg y:(MOVHreg _))
  9567  	// result: y
  9568  	for {
  9569  		y := v_0
  9570  		if y.Op != OpPPC64MOVHreg {
  9571  			break
  9572  		}
  9573  		v.copyOf(y)
  9574  		return true
  9575  	}
  9576  	// match: (MOVHreg y:(MOVBreg _))
  9577  	// result: y
  9578  	for {
  9579  		y := v_0
  9580  		if y.Op != OpPPC64MOVBreg {
  9581  			break
  9582  		}
  9583  		v.copyOf(y)
  9584  		return true
  9585  	}
  9586  	// match: (MOVHreg y:(MOVHZreg x))
  9587  	// result: (MOVHreg x)
  9588  	for {
  9589  		y := v_0
  9590  		if y.Op != OpPPC64MOVHZreg {
  9591  			break
  9592  		}
  9593  		x := y.Args[0]
  9594  		v.reset(OpPPC64MOVHreg)
  9595  		v.AddArg(x)
  9596  		return true
  9597  	}
  9598  	// match: (MOVHreg x:(MOVHload _ _))
  9599  	// result: x
  9600  	for {
  9601  		x := v_0
  9602  		if x.Op != OpPPC64MOVHload {
  9603  			break
  9604  		}
  9605  		v.copyOf(x)
  9606  		return true
  9607  	}
  9608  	// match: (MOVHreg x:(MOVHloadidx _ _ _))
  9609  	// result: x
  9610  	for {
  9611  		x := v_0
  9612  		if x.Op != OpPPC64MOVHloadidx {
  9613  			break
  9614  		}
  9615  		v.copyOf(x)
  9616  		return true
  9617  	}
  9618  	// match: (MOVHreg x:(Arg <t>))
  9619  	// cond: (is8BitInt(t) || is16BitInt(t)) && t.IsSigned()
  9620  	// result: x
  9621  	for {
  9622  		x := v_0
  9623  		if x.Op != OpArg {
  9624  			break
  9625  		}
  9626  		t := x.Type
  9627  		if !((is8BitInt(t) || is16BitInt(t)) && t.IsSigned()) {
  9628  			break
  9629  		}
  9630  		v.copyOf(x)
  9631  		return true
  9632  	}
  9633  	// match: (MOVHreg (MOVDconst [c]))
  9634  	// result: (MOVDconst [int64(int16(c))])
  9635  	for {
  9636  		if v_0.Op != OpPPC64MOVDconst {
  9637  			break
  9638  		}
  9639  		c := auxIntToInt64(v_0.AuxInt)
  9640  		v.reset(OpPPC64MOVDconst)
  9641  		v.AuxInt = int64ToAuxInt(int64(int16(c)))
  9642  		return true
  9643  	}
  9644  	return false
  9645  }
  9646  func rewriteValuePPC64_OpPPC64MOVHstore(v *Value) bool {
  9647  	v_2 := v.Args[2]
  9648  	v_1 := v.Args[1]
  9649  	v_0 := v.Args[0]
  9650  	b := v.Block
  9651  	// match: (MOVHstore [off1] {sym} (ADDconst [off2] x) val mem)
  9652  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
  9653  	// result: (MOVHstore [off1+int32(off2)] {sym} x val mem)
  9654  	for {
  9655  		off1 := auxIntToInt32(v.AuxInt)
  9656  		sym := auxToSym(v.Aux)
  9657  		if v_0.Op != OpPPC64ADDconst {
  9658  			break
  9659  		}
  9660  		off2 := auxIntToInt64(v_0.AuxInt)
  9661  		x := v_0.Args[0]
  9662  		val := v_1
  9663  		mem := v_2
  9664  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
  9665  			break
  9666  		}
  9667  		v.reset(OpPPC64MOVHstore)
  9668  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
  9669  		v.Aux = symToAux(sym)
  9670  		v.AddArg3(x, val, mem)
  9671  		return true
  9672  	}
  9673  	// match: (MOVHstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
  9674  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
  9675  	// result: (MOVHstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
  9676  	for {
  9677  		off1 := auxIntToInt32(v.AuxInt)
  9678  		sym1 := auxToSym(v.Aux)
  9679  		p := v_0
  9680  		if p.Op != OpPPC64MOVDaddr {
  9681  			break
  9682  		}
  9683  		off2 := auxIntToInt32(p.AuxInt)
  9684  		sym2 := auxToSym(p.Aux)
  9685  		ptr := p.Args[0]
  9686  		val := v_1
  9687  		mem := v_2
  9688  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
  9689  			break
  9690  		}
  9691  		v.reset(OpPPC64MOVHstore)
  9692  		v.AuxInt = int32ToAuxInt(off1 + off2)
  9693  		v.Aux = symToAux(mergeSym(sym1, sym2))
  9694  		v.AddArg3(ptr, val, mem)
  9695  		return true
  9696  	}
  9697  	// match: (MOVHstore [off] {sym} ptr (MOVDconst [0]) mem)
  9698  	// result: (MOVHstorezero [off] {sym} ptr mem)
  9699  	for {
  9700  		off := auxIntToInt32(v.AuxInt)
  9701  		sym := auxToSym(v.Aux)
  9702  		ptr := v_0
  9703  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
  9704  			break
  9705  		}
  9706  		mem := v_2
  9707  		v.reset(OpPPC64MOVHstorezero)
  9708  		v.AuxInt = int32ToAuxInt(off)
  9709  		v.Aux = symToAux(sym)
  9710  		v.AddArg2(ptr, mem)
  9711  		return true
  9712  	}
  9713  	// match: (MOVHstore [0] {sym} p:(ADD ptr idx) val mem)
  9714  	// cond: sym == nil && p.Uses == 1
  9715  	// result: (MOVHstoreidx ptr idx val mem)
  9716  	for {
  9717  		if auxIntToInt32(v.AuxInt) != 0 {
  9718  			break
  9719  		}
  9720  		sym := auxToSym(v.Aux)
  9721  		p := v_0
  9722  		if p.Op != OpPPC64ADD {
  9723  			break
  9724  		}
  9725  		idx := p.Args[1]
  9726  		ptr := p.Args[0]
  9727  		val := v_1
  9728  		mem := v_2
  9729  		if !(sym == nil && p.Uses == 1) {
  9730  			break
  9731  		}
  9732  		v.reset(OpPPC64MOVHstoreidx)
  9733  		v.AddArg4(ptr, idx, val, mem)
  9734  		return true
  9735  	}
  9736  	// match: (MOVHstore [off] {sym} ptr (MOVHreg x) mem)
  9737  	// result: (MOVHstore [off] {sym} ptr x mem)
  9738  	for {
  9739  		off := auxIntToInt32(v.AuxInt)
  9740  		sym := auxToSym(v.Aux)
  9741  		ptr := v_0
  9742  		if v_1.Op != OpPPC64MOVHreg {
  9743  			break
  9744  		}
  9745  		x := v_1.Args[0]
  9746  		mem := v_2
  9747  		v.reset(OpPPC64MOVHstore)
  9748  		v.AuxInt = int32ToAuxInt(off)
  9749  		v.Aux = symToAux(sym)
  9750  		v.AddArg3(ptr, x, mem)
  9751  		return true
  9752  	}
  9753  	// match: (MOVHstore [off] {sym} ptr (MOVHZreg x) mem)
  9754  	// result: (MOVHstore [off] {sym} ptr x mem)
  9755  	for {
  9756  		off := auxIntToInt32(v.AuxInt)
  9757  		sym := auxToSym(v.Aux)
  9758  		ptr := v_0
  9759  		if v_1.Op != OpPPC64MOVHZreg {
  9760  			break
  9761  		}
  9762  		x := v_1.Args[0]
  9763  		mem := v_2
  9764  		v.reset(OpPPC64MOVHstore)
  9765  		v.AuxInt = int32ToAuxInt(off)
  9766  		v.Aux = symToAux(sym)
  9767  		v.AddArg3(ptr, x, mem)
  9768  		return true
  9769  	}
  9770  	// match: (MOVHstore [off] {sym} ptr (MOVWreg x) mem)
  9771  	// result: (MOVHstore [off] {sym} ptr x mem)
  9772  	for {
  9773  		off := auxIntToInt32(v.AuxInt)
  9774  		sym := auxToSym(v.Aux)
  9775  		ptr := v_0
  9776  		if v_1.Op != OpPPC64MOVWreg {
  9777  			break
  9778  		}
  9779  		x := v_1.Args[0]
  9780  		mem := v_2
  9781  		v.reset(OpPPC64MOVHstore)
  9782  		v.AuxInt = int32ToAuxInt(off)
  9783  		v.Aux = symToAux(sym)
  9784  		v.AddArg3(ptr, x, mem)
  9785  		return true
  9786  	}
  9787  	// match: (MOVHstore [off] {sym} ptr (MOVWZreg x) mem)
  9788  	// result: (MOVHstore [off] {sym} ptr x mem)
  9789  	for {
  9790  		off := auxIntToInt32(v.AuxInt)
  9791  		sym := auxToSym(v.Aux)
  9792  		ptr := v_0
  9793  		if v_1.Op != OpPPC64MOVWZreg {
  9794  			break
  9795  		}
  9796  		x := v_1.Args[0]
  9797  		mem := v_2
  9798  		v.reset(OpPPC64MOVHstore)
  9799  		v.AuxInt = int32ToAuxInt(off)
  9800  		v.Aux = symToAux(sym)
  9801  		v.AddArg3(ptr, x, mem)
  9802  		return true
  9803  	}
  9804  	// match: (MOVHstore [off] {sym} ptr r:(BRH val) mem)
  9805  	// cond: r.Uses == 1
  9806  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  9807  	for {
  9808  		off := auxIntToInt32(v.AuxInt)
  9809  		sym := auxToSym(v.Aux)
  9810  		ptr := v_0
  9811  		r := v_1
  9812  		if r.Op != OpPPC64BRH {
  9813  			break
  9814  		}
  9815  		val := r.Args[0]
  9816  		mem := v_2
  9817  		if !(r.Uses == 1) {
  9818  			break
  9819  		}
  9820  		v.reset(OpPPC64MOVHBRstore)
  9821  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  9822  		v0.AuxInt = int32ToAuxInt(off)
  9823  		v0.Aux = symToAux(sym)
  9824  		v0.AddArg(ptr)
  9825  		v.AddArg3(v0, val, mem)
  9826  		return true
  9827  	}
  9828  	// match: (MOVHstore [off] {sym} ptr (Bswap16 val) mem)
  9829  	// result: (MOVHBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
  9830  	for {
  9831  		off := auxIntToInt32(v.AuxInt)
  9832  		sym := auxToSym(v.Aux)
  9833  		ptr := v_0
  9834  		if v_1.Op != OpBswap16 {
  9835  			break
  9836  		}
  9837  		val := v_1.Args[0]
  9838  		mem := v_2
  9839  		v.reset(OpPPC64MOVHBRstore)
  9840  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
  9841  		v0.AuxInt = int32ToAuxInt(off)
  9842  		v0.Aux = symToAux(sym)
  9843  		v0.AddArg(ptr)
  9844  		v.AddArg3(v0, val, mem)
  9845  		return true
  9846  	}
  9847  	return false
  9848  }
  9849  func rewriteValuePPC64_OpPPC64MOVHstoreidx(v *Value) bool {
  9850  	v_3 := v.Args[3]
  9851  	v_2 := v.Args[2]
  9852  	v_1 := v.Args[1]
  9853  	v_0 := v.Args[0]
  9854  	// match: (MOVHstoreidx ptr (MOVDconst [c]) val mem)
  9855  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9856  	// result: (MOVHstore [int32(c)] ptr val mem)
  9857  	for {
  9858  		ptr := v_0
  9859  		if v_1.Op != OpPPC64MOVDconst {
  9860  			break
  9861  		}
  9862  		c := auxIntToInt64(v_1.AuxInt)
  9863  		val := v_2
  9864  		mem := v_3
  9865  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9866  			break
  9867  		}
  9868  		v.reset(OpPPC64MOVHstore)
  9869  		v.AuxInt = int32ToAuxInt(int32(c))
  9870  		v.AddArg3(ptr, val, mem)
  9871  		return true
  9872  	}
  9873  	// match: (MOVHstoreidx (MOVDconst [c]) ptr val mem)
  9874  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
  9875  	// result: (MOVHstore [int32(c)] ptr val mem)
  9876  	for {
  9877  		if v_0.Op != OpPPC64MOVDconst {
  9878  			break
  9879  		}
  9880  		c := auxIntToInt64(v_0.AuxInt)
  9881  		ptr := v_1
  9882  		val := v_2
  9883  		mem := v_3
  9884  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
  9885  			break
  9886  		}
  9887  		v.reset(OpPPC64MOVHstore)
  9888  		v.AuxInt = int32ToAuxInt(int32(c))
  9889  		v.AddArg3(ptr, val, mem)
  9890  		return true
  9891  	}
  9892  	// match: (MOVHstoreidx ptr idx (MOVHreg x) mem)
  9893  	// result: (MOVHstoreidx ptr idx x mem)
  9894  	for {
  9895  		ptr := v_0
  9896  		idx := v_1
  9897  		if v_2.Op != OpPPC64MOVHreg {
  9898  			break
  9899  		}
  9900  		x := v_2.Args[0]
  9901  		mem := v_3
  9902  		v.reset(OpPPC64MOVHstoreidx)
  9903  		v.AddArg4(ptr, idx, x, mem)
  9904  		return true
  9905  	}
  9906  	// match: (MOVHstoreidx ptr idx (MOVHZreg x) mem)
  9907  	// result: (MOVHstoreidx ptr idx x mem)
  9908  	for {
  9909  		ptr := v_0
  9910  		idx := v_1
  9911  		if v_2.Op != OpPPC64MOVHZreg {
  9912  			break
  9913  		}
  9914  		x := v_2.Args[0]
  9915  		mem := v_3
  9916  		v.reset(OpPPC64MOVHstoreidx)
  9917  		v.AddArg4(ptr, idx, x, mem)
  9918  		return true
  9919  	}
  9920  	// match: (MOVHstoreidx ptr idx (MOVWreg x) mem)
  9921  	// result: (MOVHstoreidx ptr idx x mem)
  9922  	for {
  9923  		ptr := v_0
  9924  		idx := v_1
  9925  		if v_2.Op != OpPPC64MOVWreg {
  9926  			break
  9927  		}
  9928  		x := v_2.Args[0]
  9929  		mem := v_3
  9930  		v.reset(OpPPC64MOVHstoreidx)
  9931  		v.AddArg4(ptr, idx, x, mem)
  9932  		return true
  9933  	}
  9934  	// match: (MOVHstoreidx ptr idx (MOVWZreg x) mem)
  9935  	// result: (MOVHstoreidx ptr idx x mem)
  9936  	for {
  9937  		ptr := v_0
  9938  		idx := v_1
  9939  		if v_2.Op != OpPPC64MOVWZreg {
  9940  			break
  9941  		}
  9942  		x := v_2.Args[0]
  9943  		mem := v_3
  9944  		v.reset(OpPPC64MOVHstoreidx)
  9945  		v.AddArg4(ptr, idx, x, mem)
  9946  		return true
  9947  	}
  9948  	// match: (MOVHstoreidx ptr idx r:(BRH val) mem)
  9949  	// cond: r.Uses == 1
  9950  	// result: (MOVHBRstoreidx ptr idx val mem)
  9951  	for {
  9952  		ptr := v_0
  9953  		idx := v_1
  9954  		r := v_2
  9955  		if r.Op != OpPPC64BRH {
  9956  			break
  9957  		}
  9958  		val := r.Args[0]
  9959  		mem := v_3
  9960  		if !(r.Uses == 1) {
  9961  			break
  9962  		}
  9963  		v.reset(OpPPC64MOVHBRstoreidx)
  9964  		v.AddArg4(ptr, idx, val, mem)
  9965  		return true
  9966  	}
  9967  	// match: (MOVHstoreidx ptr idx (Bswap16 val) mem)
  9968  	// result: (MOVHBRstoreidx ptr idx val mem)
  9969  	for {
  9970  		ptr := v_0
  9971  		idx := v_1
  9972  		if v_2.Op != OpBswap16 {
  9973  			break
  9974  		}
  9975  		val := v_2.Args[0]
  9976  		mem := v_3
  9977  		v.reset(OpPPC64MOVHBRstoreidx)
  9978  		v.AddArg4(ptr, idx, val, mem)
  9979  		return true
  9980  	}
  9981  	return false
  9982  }
  9983  func rewriteValuePPC64_OpPPC64MOVHstorezero(v *Value) bool {
  9984  	v_1 := v.Args[1]
  9985  	v_0 := v.Args[0]
  9986  	// match: (MOVHstorezero [off1] {sym} (ADDconst [off2] x) mem)
  9987  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
  9988  	// result: (MOVHstorezero [off1+int32(off2)] {sym} x mem)
  9989  	for {
  9990  		off1 := auxIntToInt32(v.AuxInt)
  9991  		sym := auxToSym(v.Aux)
  9992  		if v_0.Op != OpPPC64ADDconst {
  9993  			break
  9994  		}
  9995  		off2 := auxIntToInt64(v_0.AuxInt)
  9996  		x := v_0.Args[0]
  9997  		mem := v_1
  9998  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
  9999  			break
 10000  		}
 10001  		v.reset(OpPPC64MOVHstorezero)
 10002  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10003  		v.Aux = symToAux(sym)
 10004  		v.AddArg2(x, mem)
 10005  		return true
 10006  	}
 10007  	// match: (MOVHstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 10008  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10009  	// result: (MOVHstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 10010  	for {
 10011  		off1 := auxIntToInt32(v.AuxInt)
 10012  		sym1 := auxToSym(v.Aux)
 10013  		p := v_0
 10014  		if p.Op != OpPPC64MOVDaddr {
 10015  			break
 10016  		}
 10017  		off2 := auxIntToInt32(p.AuxInt)
 10018  		sym2 := auxToSym(p.Aux)
 10019  		x := p.Args[0]
 10020  		mem := v_1
 10021  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10022  			break
 10023  		}
 10024  		v.reset(OpPPC64MOVHstorezero)
 10025  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10026  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10027  		v.AddArg2(x, mem)
 10028  		return true
 10029  	}
 10030  	return false
 10031  }
 10032  func rewriteValuePPC64_OpPPC64MOVWBRstore(v *Value) bool {
 10033  	v_2 := v.Args[2]
 10034  	v_1 := v.Args[1]
 10035  	v_0 := v.Args[0]
 10036  	// match: (MOVWBRstore ptr (MOVWreg x) mem)
 10037  	// result: (MOVWBRstore ptr x mem)
 10038  	for {
 10039  		ptr := v_0
 10040  		if v_1.Op != OpPPC64MOVWreg {
 10041  			break
 10042  		}
 10043  		x := v_1.Args[0]
 10044  		mem := v_2
 10045  		v.reset(OpPPC64MOVWBRstore)
 10046  		v.AddArg3(ptr, x, mem)
 10047  		return true
 10048  	}
 10049  	// match: (MOVWBRstore ptr (MOVWZreg x) mem)
 10050  	// result: (MOVWBRstore ptr x mem)
 10051  	for {
 10052  		ptr := v_0
 10053  		if v_1.Op != OpPPC64MOVWZreg {
 10054  			break
 10055  		}
 10056  		x := v_1.Args[0]
 10057  		mem := v_2
 10058  		v.reset(OpPPC64MOVWBRstore)
 10059  		v.AddArg3(ptr, x, mem)
 10060  		return true
 10061  	}
 10062  	return false
 10063  }
 10064  func rewriteValuePPC64_OpPPC64MOVWZload(v *Value) bool {
 10065  	v_1 := v.Args[1]
 10066  	v_0 := v.Args[0]
 10067  	// match: (MOVWZload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10068  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10069  	// result: (MOVWZload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10070  	for {
 10071  		off1 := auxIntToInt32(v.AuxInt)
 10072  		sym1 := auxToSym(v.Aux)
 10073  		p := v_0
 10074  		if p.Op != OpPPC64MOVDaddr {
 10075  			break
 10076  		}
 10077  		off2 := auxIntToInt32(p.AuxInt)
 10078  		sym2 := auxToSym(p.Aux)
 10079  		ptr := p.Args[0]
 10080  		mem := v_1
 10081  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10082  			break
 10083  		}
 10084  		v.reset(OpPPC64MOVWZload)
 10085  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10086  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10087  		v.AddArg2(ptr, mem)
 10088  		return true
 10089  	}
 10090  	// match: (MOVWZload [off1] {sym} (ADDconst [off2] x) mem)
 10091  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10092  	// result: (MOVWZload [off1+int32(off2)] {sym} x mem)
 10093  	for {
 10094  		off1 := auxIntToInt32(v.AuxInt)
 10095  		sym := auxToSym(v.Aux)
 10096  		if v_0.Op != OpPPC64ADDconst {
 10097  			break
 10098  		}
 10099  		off2 := auxIntToInt64(v_0.AuxInt)
 10100  		x := v_0.Args[0]
 10101  		mem := v_1
 10102  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10103  			break
 10104  		}
 10105  		v.reset(OpPPC64MOVWZload)
 10106  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10107  		v.Aux = symToAux(sym)
 10108  		v.AddArg2(x, mem)
 10109  		return true
 10110  	}
 10111  	// match: (MOVWZload [0] {sym} p:(ADD ptr idx) mem)
 10112  	// cond: sym == nil && p.Uses == 1
 10113  	// result: (MOVWZloadidx ptr idx mem)
 10114  	for {
 10115  		if auxIntToInt32(v.AuxInt) != 0 {
 10116  			break
 10117  		}
 10118  		sym := auxToSym(v.Aux)
 10119  		p := v_0
 10120  		if p.Op != OpPPC64ADD {
 10121  			break
 10122  		}
 10123  		idx := p.Args[1]
 10124  		ptr := p.Args[0]
 10125  		mem := v_1
 10126  		if !(sym == nil && p.Uses == 1) {
 10127  			break
 10128  		}
 10129  		v.reset(OpPPC64MOVWZloadidx)
 10130  		v.AddArg3(ptr, idx, mem)
 10131  		return true
 10132  	}
 10133  	return false
 10134  }
 10135  func rewriteValuePPC64_OpPPC64MOVWZloadidx(v *Value) bool {
 10136  	v_2 := v.Args[2]
 10137  	v_1 := v.Args[1]
 10138  	v_0 := v.Args[0]
 10139  	// match: (MOVWZloadidx ptr (MOVDconst [c]) mem)
 10140  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10141  	// result: (MOVWZload [int32(c)] ptr mem)
 10142  	for {
 10143  		ptr := v_0
 10144  		if v_1.Op != OpPPC64MOVDconst {
 10145  			break
 10146  		}
 10147  		c := auxIntToInt64(v_1.AuxInt)
 10148  		mem := v_2
 10149  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10150  			break
 10151  		}
 10152  		v.reset(OpPPC64MOVWZload)
 10153  		v.AuxInt = int32ToAuxInt(int32(c))
 10154  		v.AddArg2(ptr, mem)
 10155  		return true
 10156  	}
 10157  	// match: (MOVWZloadidx (MOVDconst [c]) ptr mem)
 10158  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10159  	// result: (MOVWZload [int32(c)] ptr mem)
 10160  	for {
 10161  		if v_0.Op != OpPPC64MOVDconst {
 10162  			break
 10163  		}
 10164  		c := auxIntToInt64(v_0.AuxInt)
 10165  		ptr := v_1
 10166  		mem := v_2
 10167  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10168  			break
 10169  		}
 10170  		v.reset(OpPPC64MOVWZload)
 10171  		v.AuxInt = int32ToAuxInt(int32(c))
 10172  		v.AddArg2(ptr, mem)
 10173  		return true
 10174  	}
 10175  	return false
 10176  }
 10177  func rewriteValuePPC64_OpPPC64MOVWZreg(v *Value) bool {
 10178  	v_0 := v.Args[0]
 10179  	b := v.Block
 10180  	typ := &b.Func.Config.Types
 10181  	// match: (MOVWZreg y:(ANDconst [c] _))
 10182  	// cond: uint64(c) <= 0xFFFFFFFF
 10183  	// result: y
 10184  	for {
 10185  		y := v_0
 10186  		if y.Op != OpPPC64ANDconst {
 10187  			break
 10188  		}
 10189  		c := auxIntToInt64(y.AuxInt)
 10190  		if !(uint64(c) <= 0xFFFFFFFF) {
 10191  			break
 10192  		}
 10193  		v.copyOf(y)
 10194  		return true
 10195  	}
 10196  	// match: (MOVWZreg y:(AND (MOVDconst [c]) _))
 10197  	// cond: uint64(c) <= 0xFFFFFFFF
 10198  	// result: y
 10199  	for {
 10200  		y := v_0
 10201  		if y.Op != OpPPC64AND {
 10202  			break
 10203  		}
 10204  		y_0 := y.Args[0]
 10205  		y_1 := y.Args[1]
 10206  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10207  			if y_0.Op != OpPPC64MOVDconst {
 10208  				continue
 10209  			}
 10210  			c := auxIntToInt64(y_0.AuxInt)
 10211  			if !(uint64(c) <= 0xFFFFFFFF) {
 10212  				continue
 10213  			}
 10214  			v.copyOf(y)
 10215  			return true
 10216  		}
 10217  		break
 10218  	}
 10219  	// match: (MOVWZreg (SRWconst [c] (MOVBZreg x)))
 10220  	// result: (SRWconst [c] (MOVBZreg x))
 10221  	for {
 10222  		if v_0.Op != OpPPC64SRWconst {
 10223  			break
 10224  		}
 10225  		c := auxIntToInt64(v_0.AuxInt)
 10226  		v_0_0 := v_0.Args[0]
 10227  		if v_0_0.Op != OpPPC64MOVBZreg {
 10228  			break
 10229  		}
 10230  		x := v_0_0.Args[0]
 10231  		v.reset(OpPPC64SRWconst)
 10232  		v.AuxInt = int64ToAuxInt(c)
 10233  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 10234  		v0.AddArg(x)
 10235  		v.AddArg(v0)
 10236  		return true
 10237  	}
 10238  	// match: (MOVWZreg (SRWconst [c] (MOVHZreg x)))
 10239  	// result: (SRWconst [c] (MOVHZreg x))
 10240  	for {
 10241  		if v_0.Op != OpPPC64SRWconst {
 10242  			break
 10243  		}
 10244  		c := auxIntToInt64(v_0.AuxInt)
 10245  		v_0_0 := v_0.Args[0]
 10246  		if v_0_0.Op != OpPPC64MOVHZreg {
 10247  			break
 10248  		}
 10249  		x := v_0_0.Args[0]
 10250  		v.reset(OpPPC64SRWconst)
 10251  		v.AuxInt = int64ToAuxInt(c)
 10252  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 10253  		v0.AddArg(x)
 10254  		v.AddArg(v0)
 10255  		return true
 10256  	}
 10257  	// match: (MOVWZreg (SRWconst [c] (MOVWZreg x)))
 10258  	// result: (SRWconst [c] (MOVWZreg x))
 10259  	for {
 10260  		if v_0.Op != OpPPC64SRWconst {
 10261  			break
 10262  		}
 10263  		c := auxIntToInt64(v_0.AuxInt)
 10264  		v_0_0 := v_0.Args[0]
 10265  		if v_0_0.Op != OpPPC64MOVWZreg {
 10266  			break
 10267  		}
 10268  		x := v_0_0.Args[0]
 10269  		v.reset(OpPPC64SRWconst)
 10270  		v.AuxInt = int64ToAuxInt(c)
 10271  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 10272  		v0.AddArg(x)
 10273  		v.AddArg(v0)
 10274  		return true
 10275  	}
 10276  	// match: (MOVWZreg (SRWconst [c] x))
 10277  	// cond: x.Type.Size() <= 32
 10278  	// result: (SRWconst [c] x)
 10279  	for {
 10280  		if v_0.Op != OpPPC64SRWconst {
 10281  			break
 10282  		}
 10283  		c := auxIntToInt64(v_0.AuxInt)
 10284  		x := v_0.Args[0]
 10285  		if !(x.Type.Size() <= 32) {
 10286  			break
 10287  		}
 10288  		v.reset(OpPPC64SRWconst)
 10289  		v.AuxInt = int64ToAuxInt(c)
 10290  		v.AddArg(x)
 10291  		return true
 10292  	}
 10293  	// match: (MOVWZreg (SRDconst [c] x))
 10294  	// cond: c>=32
 10295  	// result: (SRDconst [c] x)
 10296  	for {
 10297  		if v_0.Op != OpPPC64SRDconst {
 10298  			break
 10299  		}
 10300  		c := auxIntToInt64(v_0.AuxInt)
 10301  		x := v_0.Args[0]
 10302  		if !(c >= 32) {
 10303  			break
 10304  		}
 10305  		v.reset(OpPPC64SRDconst)
 10306  		v.AuxInt = int64ToAuxInt(c)
 10307  		v.AddArg(x)
 10308  		return true
 10309  	}
 10310  	// match: (MOVWZreg (RLWINM [r] y))
 10311  	// cond: mergePPC64MovwzregRlwinm(r) != 0
 10312  	// result: (RLWINM [mergePPC64MovwzregRlwinm(r)] y)
 10313  	for {
 10314  		if v_0.Op != OpPPC64RLWINM {
 10315  			break
 10316  		}
 10317  		r := auxIntToInt64(v_0.AuxInt)
 10318  		y := v_0.Args[0]
 10319  		if !(mergePPC64MovwzregRlwinm(r) != 0) {
 10320  			break
 10321  		}
 10322  		v.reset(OpPPC64RLWINM)
 10323  		v.AuxInt = int64ToAuxInt(mergePPC64MovwzregRlwinm(r))
 10324  		v.AddArg(y)
 10325  		return true
 10326  	}
 10327  	// match: (MOVWZreg w:(SLWconst u))
 10328  	// result: w
 10329  	for {
 10330  		w := v_0
 10331  		if w.Op != OpPPC64SLWconst {
 10332  			break
 10333  		}
 10334  		v.copyOf(w)
 10335  		return true
 10336  	}
 10337  	// match: (MOVWZreg y:(MOVWZreg _))
 10338  	// result: y
 10339  	for {
 10340  		y := v_0
 10341  		if y.Op != OpPPC64MOVWZreg {
 10342  			break
 10343  		}
 10344  		v.copyOf(y)
 10345  		return true
 10346  	}
 10347  	// match: (MOVWZreg y:(MOVHZreg _))
 10348  	// result: y
 10349  	for {
 10350  		y := v_0
 10351  		if y.Op != OpPPC64MOVHZreg {
 10352  			break
 10353  		}
 10354  		v.copyOf(y)
 10355  		return true
 10356  	}
 10357  	// match: (MOVWZreg y:(MOVBZreg _))
 10358  	// result: y
 10359  	for {
 10360  		y := v_0
 10361  		if y.Op != OpPPC64MOVBZreg {
 10362  			break
 10363  		}
 10364  		v.copyOf(y)
 10365  		return true
 10366  	}
 10367  	// match: (MOVWZreg y:(MOVHBRload _ _))
 10368  	// result: y
 10369  	for {
 10370  		y := v_0
 10371  		if y.Op != OpPPC64MOVHBRload {
 10372  			break
 10373  		}
 10374  		v.copyOf(y)
 10375  		return true
 10376  	}
 10377  	// match: (MOVWZreg y:(MOVWBRload _ _))
 10378  	// result: y
 10379  	for {
 10380  		y := v_0
 10381  		if y.Op != OpPPC64MOVWBRload {
 10382  			break
 10383  		}
 10384  		v.copyOf(y)
 10385  		return true
 10386  	}
 10387  	// match: (MOVWZreg y:(MOVWreg x))
 10388  	// result: (MOVWZreg x)
 10389  	for {
 10390  		y := v_0
 10391  		if y.Op != OpPPC64MOVWreg {
 10392  			break
 10393  		}
 10394  		x := y.Args[0]
 10395  		v.reset(OpPPC64MOVWZreg)
 10396  		v.AddArg(x)
 10397  		return true
 10398  	}
 10399  	// match: (MOVWZreg (OR <t> x (MOVWZreg y)))
 10400  	// result: (MOVWZreg (OR <t> x y))
 10401  	for {
 10402  		if v_0.Op != OpPPC64OR {
 10403  			break
 10404  		}
 10405  		t := v_0.Type
 10406  		_ = v_0.Args[1]
 10407  		v_0_0 := v_0.Args[0]
 10408  		v_0_1 := v_0.Args[1]
 10409  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10410  			x := v_0_0
 10411  			if v_0_1.Op != OpPPC64MOVWZreg {
 10412  				continue
 10413  			}
 10414  			y := v_0_1.Args[0]
 10415  			v.reset(OpPPC64MOVWZreg)
 10416  			v0 := b.NewValue0(v.Pos, OpPPC64OR, t)
 10417  			v0.AddArg2(x, y)
 10418  			v.AddArg(v0)
 10419  			return true
 10420  		}
 10421  		break
 10422  	}
 10423  	// match: (MOVWZreg (XOR <t> x (MOVWZreg y)))
 10424  	// result: (MOVWZreg (XOR <t> x y))
 10425  	for {
 10426  		if v_0.Op != OpPPC64XOR {
 10427  			break
 10428  		}
 10429  		t := v_0.Type
 10430  		_ = v_0.Args[1]
 10431  		v_0_0 := v_0.Args[0]
 10432  		v_0_1 := v_0.Args[1]
 10433  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10434  			x := v_0_0
 10435  			if v_0_1.Op != OpPPC64MOVWZreg {
 10436  				continue
 10437  			}
 10438  			y := v_0_1.Args[0]
 10439  			v.reset(OpPPC64MOVWZreg)
 10440  			v0 := b.NewValue0(v.Pos, OpPPC64XOR, t)
 10441  			v0.AddArg2(x, y)
 10442  			v.AddArg(v0)
 10443  			return true
 10444  		}
 10445  		break
 10446  	}
 10447  	// match: (MOVWZreg (AND <t> x (MOVWZreg y)))
 10448  	// result: (MOVWZreg (AND <t> x y))
 10449  	for {
 10450  		if v_0.Op != OpPPC64AND {
 10451  			break
 10452  		}
 10453  		t := v_0.Type
 10454  		_ = v_0.Args[1]
 10455  		v_0_0 := v_0.Args[0]
 10456  		v_0_1 := v_0.Args[1]
 10457  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 10458  			x := v_0_0
 10459  			if v_0_1.Op != OpPPC64MOVWZreg {
 10460  				continue
 10461  			}
 10462  			y := v_0_1.Args[0]
 10463  			v.reset(OpPPC64MOVWZreg)
 10464  			v0 := b.NewValue0(v.Pos, OpPPC64AND, t)
 10465  			v0.AddArg2(x, y)
 10466  			v.AddArg(v0)
 10467  			return true
 10468  		}
 10469  		break
 10470  	}
 10471  	// match: (MOVWZreg z:(ANDconst [c] (MOVBZload ptr x)))
 10472  	// result: z
 10473  	for {
 10474  		z := v_0
 10475  		if z.Op != OpPPC64ANDconst {
 10476  			break
 10477  		}
 10478  		z_0 := z.Args[0]
 10479  		if z_0.Op != OpPPC64MOVBZload {
 10480  			break
 10481  		}
 10482  		v.copyOf(z)
 10483  		return true
 10484  	}
 10485  	// match: (MOVWZreg z:(AND y (MOVWZload ptr x)))
 10486  	// result: z
 10487  	for {
 10488  		z := v_0
 10489  		if z.Op != OpPPC64AND {
 10490  			break
 10491  		}
 10492  		_ = z.Args[1]
 10493  		z_0 := z.Args[0]
 10494  		z_1 := z.Args[1]
 10495  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 10496  			if z_1.Op != OpPPC64MOVWZload {
 10497  				continue
 10498  			}
 10499  			v.copyOf(z)
 10500  			return true
 10501  		}
 10502  		break
 10503  	}
 10504  	// match: (MOVWZreg z:(ANDconst [c] (MOVHZload ptr x)))
 10505  	// result: z
 10506  	for {
 10507  		z := v_0
 10508  		if z.Op != OpPPC64ANDconst {
 10509  			break
 10510  		}
 10511  		z_0 := z.Args[0]
 10512  		if z_0.Op != OpPPC64MOVHZload {
 10513  			break
 10514  		}
 10515  		v.copyOf(z)
 10516  		return true
 10517  	}
 10518  	// match: (MOVWZreg z:(ANDconst [c] (MOVWZload ptr x)))
 10519  	// result: z
 10520  	for {
 10521  		z := v_0
 10522  		if z.Op != OpPPC64ANDconst {
 10523  			break
 10524  		}
 10525  		z_0 := z.Args[0]
 10526  		if z_0.Op != OpPPC64MOVWZload {
 10527  			break
 10528  		}
 10529  		v.copyOf(z)
 10530  		return true
 10531  	}
 10532  	// match: (MOVWZreg x:(MOVBZload _ _))
 10533  	// result: x
 10534  	for {
 10535  		x := v_0
 10536  		if x.Op != OpPPC64MOVBZload {
 10537  			break
 10538  		}
 10539  		v.copyOf(x)
 10540  		return true
 10541  	}
 10542  	// match: (MOVWZreg x:(MOVBZloadidx _ _ _))
 10543  	// result: x
 10544  	for {
 10545  		x := v_0
 10546  		if x.Op != OpPPC64MOVBZloadidx {
 10547  			break
 10548  		}
 10549  		v.copyOf(x)
 10550  		return true
 10551  	}
 10552  	// match: (MOVWZreg x:(MOVHZload _ _))
 10553  	// result: x
 10554  	for {
 10555  		x := v_0
 10556  		if x.Op != OpPPC64MOVHZload {
 10557  			break
 10558  		}
 10559  		v.copyOf(x)
 10560  		return true
 10561  	}
 10562  	// match: (MOVWZreg x:(MOVHZloadidx _ _ _))
 10563  	// result: x
 10564  	for {
 10565  		x := v_0
 10566  		if x.Op != OpPPC64MOVHZloadidx {
 10567  			break
 10568  		}
 10569  		v.copyOf(x)
 10570  		return true
 10571  	}
 10572  	// match: (MOVWZreg x:(MOVWZload _ _))
 10573  	// result: x
 10574  	for {
 10575  		x := v_0
 10576  		if x.Op != OpPPC64MOVWZload {
 10577  			break
 10578  		}
 10579  		v.copyOf(x)
 10580  		return true
 10581  	}
 10582  	// match: (MOVWZreg x:(MOVWZloadidx _ _ _))
 10583  	// result: x
 10584  	for {
 10585  		x := v_0
 10586  		if x.Op != OpPPC64MOVWZloadidx {
 10587  			break
 10588  		}
 10589  		v.copyOf(x)
 10590  		return true
 10591  	}
 10592  	// match: (MOVWZreg x:(Select0 (LoweredAtomicLoad32 _ _)))
 10593  	// result: x
 10594  	for {
 10595  		x := v_0
 10596  		if x.Op != OpSelect0 {
 10597  			break
 10598  		}
 10599  		x_0 := x.Args[0]
 10600  		if x_0.Op != OpPPC64LoweredAtomicLoad32 {
 10601  			break
 10602  		}
 10603  		v.copyOf(x)
 10604  		return true
 10605  	}
 10606  	// match: (MOVWZreg x:(Arg <t>))
 10607  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()
 10608  	// result: x
 10609  	for {
 10610  		x := v_0
 10611  		if x.Op != OpArg {
 10612  			break
 10613  		}
 10614  		t := x.Type
 10615  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && !t.IsSigned()) {
 10616  			break
 10617  		}
 10618  		v.copyOf(x)
 10619  		return true
 10620  	}
 10621  	// match: (MOVWZreg (MOVDconst [c]))
 10622  	// result: (MOVDconst [int64(uint32(c))])
 10623  	for {
 10624  		if v_0.Op != OpPPC64MOVDconst {
 10625  			break
 10626  		}
 10627  		c := auxIntToInt64(v_0.AuxInt)
 10628  		v.reset(OpPPC64MOVDconst)
 10629  		v.AuxInt = int64ToAuxInt(int64(uint32(c)))
 10630  		return true
 10631  	}
 10632  	return false
 10633  }
 10634  func rewriteValuePPC64_OpPPC64MOVWload(v *Value) bool {
 10635  	v_1 := v.Args[1]
 10636  	v_0 := v.Args[0]
 10637  	// match: (MOVWload [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) mem)
 10638  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 10639  	// result: (MOVWload [off1+off2] {mergeSym(sym1,sym2)} ptr mem)
 10640  	for {
 10641  		off1 := auxIntToInt32(v.AuxInt)
 10642  		sym1 := auxToSym(v.Aux)
 10643  		p := v_0
 10644  		if p.Op != OpPPC64MOVDaddr {
 10645  			break
 10646  		}
 10647  		off2 := auxIntToInt32(p.AuxInt)
 10648  		sym2 := auxToSym(p.Aux)
 10649  		ptr := p.Args[0]
 10650  		mem := v_1
 10651  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 10652  			break
 10653  		}
 10654  		v.reset(OpPPC64MOVWload)
 10655  		v.AuxInt = int32ToAuxInt(off1 + off2)
 10656  		v.Aux = symToAux(mergeSym(sym1, sym2))
 10657  		v.AddArg2(ptr, mem)
 10658  		return true
 10659  	}
 10660  	// match: (MOVWload [off1] {sym} (ADDconst [off2] x) mem)
 10661  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 10662  	// result: (MOVWload [off1+int32(off2)] {sym} x mem)
 10663  	for {
 10664  		off1 := auxIntToInt32(v.AuxInt)
 10665  		sym := auxToSym(v.Aux)
 10666  		if v_0.Op != OpPPC64ADDconst {
 10667  			break
 10668  		}
 10669  		off2 := auxIntToInt64(v_0.AuxInt)
 10670  		x := v_0.Args[0]
 10671  		mem := v_1
 10672  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 10673  			break
 10674  		}
 10675  		v.reset(OpPPC64MOVWload)
 10676  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 10677  		v.Aux = symToAux(sym)
 10678  		v.AddArg2(x, mem)
 10679  		return true
 10680  	}
 10681  	// match: (MOVWload [0] {sym} p:(ADD ptr idx) mem)
 10682  	// cond: sym == nil && p.Uses == 1
 10683  	// result: (MOVWloadidx ptr idx mem)
 10684  	for {
 10685  		if auxIntToInt32(v.AuxInt) != 0 {
 10686  			break
 10687  		}
 10688  		sym := auxToSym(v.Aux)
 10689  		p := v_0
 10690  		if p.Op != OpPPC64ADD {
 10691  			break
 10692  		}
 10693  		idx := p.Args[1]
 10694  		ptr := p.Args[0]
 10695  		mem := v_1
 10696  		if !(sym == nil && p.Uses == 1) {
 10697  			break
 10698  		}
 10699  		v.reset(OpPPC64MOVWloadidx)
 10700  		v.AddArg3(ptr, idx, mem)
 10701  		return true
 10702  	}
 10703  	return false
 10704  }
 10705  func rewriteValuePPC64_OpPPC64MOVWloadidx(v *Value) bool {
 10706  	v_2 := v.Args[2]
 10707  	v_1 := v.Args[1]
 10708  	v_0 := v.Args[0]
 10709  	// match: (MOVWloadidx ptr (MOVDconst [c]) mem)
 10710  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10711  	// result: (MOVWload [int32(c)] ptr mem)
 10712  	for {
 10713  		ptr := v_0
 10714  		if v_1.Op != OpPPC64MOVDconst {
 10715  			break
 10716  		}
 10717  		c := auxIntToInt64(v_1.AuxInt)
 10718  		mem := v_2
 10719  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10720  			break
 10721  		}
 10722  		v.reset(OpPPC64MOVWload)
 10723  		v.AuxInt = int32ToAuxInt(int32(c))
 10724  		v.AddArg2(ptr, mem)
 10725  		return true
 10726  	}
 10727  	// match: (MOVWloadidx (MOVDconst [c]) ptr mem)
 10728  	// cond: ((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 10729  	// result: (MOVWload [int32(c)] ptr mem)
 10730  	for {
 10731  		if v_0.Op != OpPPC64MOVDconst {
 10732  			break
 10733  		}
 10734  		c := auxIntToInt64(v_0.AuxInt)
 10735  		ptr := v_1
 10736  		mem := v_2
 10737  		if !((is16Bit(c) && c%4 == 0) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 10738  			break
 10739  		}
 10740  		v.reset(OpPPC64MOVWload)
 10741  		v.AuxInt = int32ToAuxInt(int32(c))
 10742  		v.AddArg2(ptr, mem)
 10743  		return true
 10744  	}
 10745  	return false
 10746  }
 10747  func rewriteValuePPC64_OpPPC64MOVWreg(v *Value) bool {
 10748  	v_0 := v.Args[0]
 10749  	b := v.Block
 10750  	typ := &b.Func.Config.Types
 10751  	// match: (MOVWreg y:(ANDconst [c] _))
 10752  	// cond: uint64(c) <= 0xFFFF
 10753  	// result: y
 10754  	for {
 10755  		y := v_0
 10756  		if y.Op != OpPPC64ANDconst {
 10757  			break
 10758  		}
 10759  		c := auxIntToInt64(y.AuxInt)
 10760  		if !(uint64(c) <= 0xFFFF) {
 10761  			break
 10762  		}
 10763  		v.copyOf(y)
 10764  		return true
 10765  	}
 10766  	// match: (MOVWreg y:(AND (MOVDconst [c]) _))
 10767  	// cond: uint64(c) <= 0x7FFFFFFF
 10768  	// result: y
 10769  	for {
 10770  		y := v_0
 10771  		if y.Op != OpPPC64AND {
 10772  			break
 10773  		}
 10774  		y_0 := y.Args[0]
 10775  		y_1 := y.Args[1]
 10776  		for _i0 := 0; _i0 <= 1; _i0, y_0, y_1 = _i0+1, y_1, y_0 {
 10777  			if y_0.Op != OpPPC64MOVDconst {
 10778  				continue
 10779  			}
 10780  			c := auxIntToInt64(y_0.AuxInt)
 10781  			if !(uint64(c) <= 0x7FFFFFFF) {
 10782  				continue
 10783  			}
 10784  			v.copyOf(y)
 10785  			return true
 10786  		}
 10787  		break
 10788  	}
 10789  	// match: (MOVWreg (SRAWconst [c] (MOVBreg x)))
 10790  	// result: (SRAWconst [c] (MOVBreg x))
 10791  	for {
 10792  		if v_0.Op != OpPPC64SRAWconst {
 10793  			break
 10794  		}
 10795  		c := auxIntToInt64(v_0.AuxInt)
 10796  		v_0_0 := v_0.Args[0]
 10797  		if v_0_0.Op != OpPPC64MOVBreg {
 10798  			break
 10799  		}
 10800  		x := v_0_0.Args[0]
 10801  		v.reset(OpPPC64SRAWconst)
 10802  		v.AuxInt = int64ToAuxInt(c)
 10803  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 10804  		v0.AddArg(x)
 10805  		v.AddArg(v0)
 10806  		return true
 10807  	}
 10808  	// match: (MOVWreg (SRAWconst [c] (MOVHreg x)))
 10809  	// result: (SRAWconst [c] (MOVHreg x))
 10810  	for {
 10811  		if v_0.Op != OpPPC64SRAWconst {
 10812  			break
 10813  		}
 10814  		c := auxIntToInt64(v_0.AuxInt)
 10815  		v_0_0 := v_0.Args[0]
 10816  		if v_0_0.Op != OpPPC64MOVHreg {
 10817  			break
 10818  		}
 10819  		x := v_0_0.Args[0]
 10820  		v.reset(OpPPC64SRAWconst)
 10821  		v.AuxInt = int64ToAuxInt(c)
 10822  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 10823  		v0.AddArg(x)
 10824  		v.AddArg(v0)
 10825  		return true
 10826  	}
 10827  	// match: (MOVWreg (SRAWconst [c] (MOVWreg x)))
 10828  	// result: (SRAWconst [c] (MOVWreg x))
 10829  	for {
 10830  		if v_0.Op != OpPPC64SRAWconst {
 10831  			break
 10832  		}
 10833  		c := auxIntToInt64(v_0.AuxInt)
 10834  		v_0_0 := v_0.Args[0]
 10835  		if v_0_0.Op != OpPPC64MOVWreg {
 10836  			break
 10837  		}
 10838  		x := v_0_0.Args[0]
 10839  		v.reset(OpPPC64SRAWconst)
 10840  		v.AuxInt = int64ToAuxInt(c)
 10841  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWreg, typ.Int64)
 10842  		v0.AddArg(x)
 10843  		v.AddArg(v0)
 10844  		return true
 10845  	}
 10846  	// match: (MOVWreg (SRAWconst [c] x))
 10847  	// cond: x.Type.Size() <= 32
 10848  	// result: (SRAWconst [c] x)
 10849  	for {
 10850  		if v_0.Op != OpPPC64SRAWconst {
 10851  			break
 10852  		}
 10853  		c := auxIntToInt64(v_0.AuxInt)
 10854  		x := v_0.Args[0]
 10855  		if !(x.Type.Size() <= 32) {
 10856  			break
 10857  		}
 10858  		v.reset(OpPPC64SRAWconst)
 10859  		v.AuxInt = int64ToAuxInt(c)
 10860  		v.AddArg(x)
 10861  		return true
 10862  	}
 10863  	// match: (MOVWreg (SRDconst [c] x))
 10864  	// cond: c>32
 10865  	// result: (SRDconst [c] x)
 10866  	for {
 10867  		if v_0.Op != OpPPC64SRDconst {
 10868  			break
 10869  		}
 10870  		c := auxIntToInt64(v_0.AuxInt)
 10871  		x := v_0.Args[0]
 10872  		if !(c > 32) {
 10873  			break
 10874  		}
 10875  		v.reset(OpPPC64SRDconst)
 10876  		v.AuxInt = int64ToAuxInt(c)
 10877  		v.AddArg(x)
 10878  		return true
 10879  	}
 10880  	// match: (MOVWreg (SRADconst [c] x))
 10881  	// cond: c>=32
 10882  	// result: (SRADconst [c] x)
 10883  	for {
 10884  		if v_0.Op != OpPPC64SRADconst {
 10885  			break
 10886  		}
 10887  		c := auxIntToInt64(v_0.AuxInt)
 10888  		x := v_0.Args[0]
 10889  		if !(c >= 32) {
 10890  			break
 10891  		}
 10892  		v.reset(OpPPC64SRADconst)
 10893  		v.AuxInt = int64ToAuxInt(c)
 10894  		v.AddArg(x)
 10895  		return true
 10896  	}
 10897  	// match: (MOVWreg (SRDconst [c] x))
 10898  	// cond: c==32
 10899  	// result: (SRADconst [c] x)
 10900  	for {
 10901  		if v_0.Op != OpPPC64SRDconst {
 10902  			break
 10903  		}
 10904  		c := auxIntToInt64(v_0.AuxInt)
 10905  		x := v_0.Args[0]
 10906  		if !(c == 32) {
 10907  			break
 10908  		}
 10909  		v.reset(OpPPC64SRADconst)
 10910  		v.AuxInt = int64ToAuxInt(c)
 10911  		v.AddArg(x)
 10912  		return true
 10913  	}
 10914  	// match: (MOVWreg y:(MOVWreg _))
 10915  	// result: y
 10916  	for {
 10917  		y := v_0
 10918  		if y.Op != OpPPC64MOVWreg {
 10919  			break
 10920  		}
 10921  		v.copyOf(y)
 10922  		return true
 10923  	}
 10924  	// match: (MOVWreg y:(MOVHreg _))
 10925  	// result: y
 10926  	for {
 10927  		y := v_0
 10928  		if y.Op != OpPPC64MOVHreg {
 10929  			break
 10930  		}
 10931  		v.copyOf(y)
 10932  		return true
 10933  	}
 10934  	// match: (MOVWreg y:(MOVBreg _))
 10935  	// result: y
 10936  	for {
 10937  		y := v_0
 10938  		if y.Op != OpPPC64MOVBreg {
 10939  			break
 10940  		}
 10941  		v.copyOf(y)
 10942  		return true
 10943  	}
 10944  	// match: (MOVWreg y:(MOVWZreg x))
 10945  	// result: (MOVWreg x)
 10946  	for {
 10947  		y := v_0
 10948  		if y.Op != OpPPC64MOVWZreg {
 10949  			break
 10950  		}
 10951  		x := y.Args[0]
 10952  		v.reset(OpPPC64MOVWreg)
 10953  		v.AddArg(x)
 10954  		return true
 10955  	}
 10956  	// match: (MOVWreg x:(MOVHload _ _))
 10957  	// result: x
 10958  	for {
 10959  		x := v_0
 10960  		if x.Op != OpPPC64MOVHload {
 10961  			break
 10962  		}
 10963  		v.copyOf(x)
 10964  		return true
 10965  	}
 10966  	// match: (MOVWreg x:(MOVHloadidx _ _ _))
 10967  	// result: x
 10968  	for {
 10969  		x := v_0
 10970  		if x.Op != OpPPC64MOVHloadidx {
 10971  			break
 10972  		}
 10973  		v.copyOf(x)
 10974  		return true
 10975  	}
 10976  	// match: (MOVWreg x:(MOVWload _ _))
 10977  	// result: x
 10978  	for {
 10979  		x := v_0
 10980  		if x.Op != OpPPC64MOVWload {
 10981  			break
 10982  		}
 10983  		v.copyOf(x)
 10984  		return true
 10985  	}
 10986  	// match: (MOVWreg x:(MOVWloadidx _ _ _))
 10987  	// result: x
 10988  	for {
 10989  		x := v_0
 10990  		if x.Op != OpPPC64MOVWloadidx {
 10991  			break
 10992  		}
 10993  		v.copyOf(x)
 10994  		return true
 10995  	}
 10996  	// match: (MOVWreg x:(Arg <t>))
 10997  	// cond: (is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()
 10998  	// result: x
 10999  	for {
 11000  		x := v_0
 11001  		if x.Op != OpArg {
 11002  			break
 11003  		}
 11004  		t := x.Type
 11005  		if !((is8BitInt(t) || is16BitInt(t) || is32BitInt(t)) && t.IsSigned()) {
 11006  			break
 11007  		}
 11008  		v.copyOf(x)
 11009  		return true
 11010  	}
 11011  	// match: (MOVWreg (MOVDconst [c]))
 11012  	// result: (MOVDconst [int64(int32(c))])
 11013  	for {
 11014  		if v_0.Op != OpPPC64MOVDconst {
 11015  			break
 11016  		}
 11017  		c := auxIntToInt64(v_0.AuxInt)
 11018  		v.reset(OpPPC64MOVDconst)
 11019  		v.AuxInt = int64ToAuxInt(int64(int32(c)))
 11020  		return true
 11021  	}
 11022  	return false
 11023  }
 11024  func rewriteValuePPC64_OpPPC64MOVWstore(v *Value) bool {
 11025  	v_2 := v.Args[2]
 11026  	v_1 := v.Args[1]
 11027  	v_0 := v.Args[0]
 11028  	b := v.Block
 11029  	// match: (MOVWstore [off1] {sym} (ADDconst [off2] x) val mem)
 11030  	// cond: (is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2)))
 11031  	// result: (MOVWstore [off1+int32(off2)] {sym} x val mem)
 11032  	for {
 11033  		off1 := auxIntToInt32(v.AuxInt)
 11034  		sym := auxToSym(v.Aux)
 11035  		if v_0.Op != OpPPC64ADDconst {
 11036  			break
 11037  		}
 11038  		off2 := auxIntToInt64(v_0.AuxInt)
 11039  		x := v_0.Args[0]
 11040  		val := v_1
 11041  		mem := v_2
 11042  		if !(is16Bit(int64(off1)+off2) || (supportsPPC64PCRel() && is32Bit(int64(off1)+off2))) {
 11043  			break
 11044  		}
 11045  		v.reset(OpPPC64MOVWstore)
 11046  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11047  		v.Aux = symToAux(sym)
 11048  		v.AddArg3(x, val, mem)
 11049  		return true
 11050  	}
 11051  	// match: (MOVWstore [off1] {sym1} p:(MOVDaddr [off2] {sym2} ptr) val mem)
 11052  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 11053  	// result: (MOVWstore [off1+off2] {mergeSym(sym1,sym2)} ptr val mem)
 11054  	for {
 11055  		off1 := auxIntToInt32(v.AuxInt)
 11056  		sym1 := auxToSym(v.Aux)
 11057  		p := v_0
 11058  		if p.Op != OpPPC64MOVDaddr {
 11059  			break
 11060  		}
 11061  		off2 := auxIntToInt32(p.AuxInt)
 11062  		sym2 := auxToSym(p.Aux)
 11063  		ptr := p.Args[0]
 11064  		val := v_1
 11065  		mem := v_2
 11066  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (ptr.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 11067  			break
 11068  		}
 11069  		v.reset(OpPPC64MOVWstore)
 11070  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11071  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11072  		v.AddArg3(ptr, val, mem)
 11073  		return true
 11074  	}
 11075  	// match: (MOVWstore [off] {sym} ptr (MOVDconst [0]) mem)
 11076  	// result: (MOVWstorezero [off] {sym} ptr mem)
 11077  	for {
 11078  		off := auxIntToInt32(v.AuxInt)
 11079  		sym := auxToSym(v.Aux)
 11080  		ptr := v_0
 11081  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != 0 {
 11082  			break
 11083  		}
 11084  		mem := v_2
 11085  		v.reset(OpPPC64MOVWstorezero)
 11086  		v.AuxInt = int32ToAuxInt(off)
 11087  		v.Aux = symToAux(sym)
 11088  		v.AddArg2(ptr, mem)
 11089  		return true
 11090  	}
 11091  	// match: (MOVWstore [0] {sym} p:(ADD ptr idx) val mem)
 11092  	// cond: sym == nil && p.Uses == 1
 11093  	// result: (MOVWstoreidx ptr idx val mem)
 11094  	for {
 11095  		if auxIntToInt32(v.AuxInt) != 0 {
 11096  			break
 11097  		}
 11098  		sym := auxToSym(v.Aux)
 11099  		p := v_0
 11100  		if p.Op != OpPPC64ADD {
 11101  			break
 11102  		}
 11103  		idx := p.Args[1]
 11104  		ptr := p.Args[0]
 11105  		val := v_1
 11106  		mem := v_2
 11107  		if !(sym == nil && p.Uses == 1) {
 11108  			break
 11109  		}
 11110  		v.reset(OpPPC64MOVWstoreidx)
 11111  		v.AddArg4(ptr, idx, val, mem)
 11112  		return true
 11113  	}
 11114  	// match: (MOVWstore [off] {sym} ptr (MOVWreg x) mem)
 11115  	// result: (MOVWstore [off] {sym} ptr x mem)
 11116  	for {
 11117  		off := auxIntToInt32(v.AuxInt)
 11118  		sym := auxToSym(v.Aux)
 11119  		ptr := v_0
 11120  		if v_1.Op != OpPPC64MOVWreg {
 11121  			break
 11122  		}
 11123  		x := v_1.Args[0]
 11124  		mem := v_2
 11125  		v.reset(OpPPC64MOVWstore)
 11126  		v.AuxInt = int32ToAuxInt(off)
 11127  		v.Aux = symToAux(sym)
 11128  		v.AddArg3(ptr, x, mem)
 11129  		return true
 11130  	}
 11131  	// match: (MOVWstore [off] {sym} ptr (MOVWZreg x) mem)
 11132  	// result: (MOVWstore [off] {sym} ptr x mem)
 11133  	for {
 11134  		off := auxIntToInt32(v.AuxInt)
 11135  		sym := auxToSym(v.Aux)
 11136  		ptr := v_0
 11137  		if v_1.Op != OpPPC64MOVWZreg {
 11138  			break
 11139  		}
 11140  		x := v_1.Args[0]
 11141  		mem := v_2
 11142  		v.reset(OpPPC64MOVWstore)
 11143  		v.AuxInt = int32ToAuxInt(off)
 11144  		v.Aux = symToAux(sym)
 11145  		v.AddArg3(ptr, x, mem)
 11146  		return true
 11147  	}
 11148  	// match: (MOVWstore [off] {sym} ptr r:(BRW val) mem)
 11149  	// cond: r.Uses == 1
 11150  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 11151  	for {
 11152  		off := auxIntToInt32(v.AuxInt)
 11153  		sym := auxToSym(v.Aux)
 11154  		ptr := v_0
 11155  		r := v_1
 11156  		if r.Op != OpPPC64BRW {
 11157  			break
 11158  		}
 11159  		val := r.Args[0]
 11160  		mem := v_2
 11161  		if !(r.Uses == 1) {
 11162  			break
 11163  		}
 11164  		v.reset(OpPPC64MOVWBRstore)
 11165  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 11166  		v0.AuxInt = int32ToAuxInt(off)
 11167  		v0.Aux = symToAux(sym)
 11168  		v0.AddArg(ptr)
 11169  		v.AddArg3(v0, val, mem)
 11170  		return true
 11171  	}
 11172  	// match: (MOVWstore [off] {sym} ptr (Bswap32 val) mem)
 11173  	// result: (MOVWBRstore (MOVDaddr <ptr.Type> [off] {sym} ptr) val mem)
 11174  	for {
 11175  		off := auxIntToInt32(v.AuxInt)
 11176  		sym := auxToSym(v.Aux)
 11177  		ptr := v_0
 11178  		if v_1.Op != OpBswap32 {
 11179  			break
 11180  		}
 11181  		val := v_1.Args[0]
 11182  		mem := v_2
 11183  		v.reset(OpPPC64MOVWBRstore)
 11184  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDaddr, ptr.Type)
 11185  		v0.AuxInt = int32ToAuxInt(off)
 11186  		v0.Aux = symToAux(sym)
 11187  		v0.AddArg(ptr)
 11188  		v.AddArg3(v0, val, mem)
 11189  		return true
 11190  	}
 11191  	return false
 11192  }
 11193  func rewriteValuePPC64_OpPPC64MOVWstoreidx(v *Value) bool {
 11194  	v_3 := v.Args[3]
 11195  	v_2 := v.Args[2]
 11196  	v_1 := v.Args[1]
 11197  	v_0 := v.Args[0]
 11198  	// match: (MOVWstoreidx ptr (MOVDconst [c]) val mem)
 11199  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 11200  	// result: (MOVWstore [int32(c)] ptr val mem)
 11201  	for {
 11202  		ptr := v_0
 11203  		if v_1.Op != OpPPC64MOVDconst {
 11204  			break
 11205  		}
 11206  		c := auxIntToInt64(v_1.AuxInt)
 11207  		val := v_2
 11208  		mem := v_3
 11209  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 11210  			break
 11211  		}
 11212  		v.reset(OpPPC64MOVWstore)
 11213  		v.AuxInt = int32ToAuxInt(int32(c))
 11214  		v.AddArg3(ptr, val, mem)
 11215  		return true
 11216  	}
 11217  	// match: (MOVWstoreidx (MOVDconst [c]) ptr val mem)
 11218  	// cond: (is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c)))
 11219  	// result: (MOVWstore [int32(c)] ptr val mem)
 11220  	for {
 11221  		if v_0.Op != OpPPC64MOVDconst {
 11222  			break
 11223  		}
 11224  		c := auxIntToInt64(v_0.AuxInt)
 11225  		ptr := v_1
 11226  		val := v_2
 11227  		mem := v_3
 11228  		if !(is16Bit(c) || (buildcfg.GOPPC64 >= 10 && is32Bit(c))) {
 11229  			break
 11230  		}
 11231  		v.reset(OpPPC64MOVWstore)
 11232  		v.AuxInt = int32ToAuxInt(int32(c))
 11233  		v.AddArg3(ptr, val, mem)
 11234  		return true
 11235  	}
 11236  	// match: (MOVWstoreidx ptr idx (MOVWreg x) mem)
 11237  	// result: (MOVWstoreidx ptr idx x mem)
 11238  	for {
 11239  		ptr := v_0
 11240  		idx := v_1
 11241  		if v_2.Op != OpPPC64MOVWreg {
 11242  			break
 11243  		}
 11244  		x := v_2.Args[0]
 11245  		mem := v_3
 11246  		v.reset(OpPPC64MOVWstoreidx)
 11247  		v.AddArg4(ptr, idx, x, mem)
 11248  		return true
 11249  	}
 11250  	// match: (MOVWstoreidx ptr idx (MOVWZreg x) mem)
 11251  	// result: (MOVWstoreidx ptr idx x mem)
 11252  	for {
 11253  		ptr := v_0
 11254  		idx := v_1
 11255  		if v_2.Op != OpPPC64MOVWZreg {
 11256  			break
 11257  		}
 11258  		x := v_2.Args[0]
 11259  		mem := v_3
 11260  		v.reset(OpPPC64MOVWstoreidx)
 11261  		v.AddArg4(ptr, idx, x, mem)
 11262  		return true
 11263  	}
 11264  	// match: (MOVWstoreidx ptr idx r:(BRW val) mem)
 11265  	// cond: r.Uses == 1
 11266  	// result: (MOVWBRstoreidx ptr idx val mem)
 11267  	for {
 11268  		ptr := v_0
 11269  		idx := v_1
 11270  		r := v_2
 11271  		if r.Op != OpPPC64BRW {
 11272  			break
 11273  		}
 11274  		val := r.Args[0]
 11275  		mem := v_3
 11276  		if !(r.Uses == 1) {
 11277  			break
 11278  		}
 11279  		v.reset(OpPPC64MOVWBRstoreidx)
 11280  		v.AddArg4(ptr, idx, val, mem)
 11281  		return true
 11282  	}
 11283  	// match: (MOVWstoreidx ptr idx (Bswap32 val) mem)
 11284  	// result: (MOVWBRstoreidx ptr idx val mem)
 11285  	for {
 11286  		ptr := v_0
 11287  		idx := v_1
 11288  		if v_2.Op != OpBswap32 {
 11289  			break
 11290  		}
 11291  		val := v_2.Args[0]
 11292  		mem := v_3
 11293  		v.reset(OpPPC64MOVWBRstoreidx)
 11294  		v.AddArg4(ptr, idx, val, mem)
 11295  		return true
 11296  	}
 11297  	return false
 11298  }
 11299  func rewriteValuePPC64_OpPPC64MOVWstorezero(v *Value) bool {
 11300  	v_1 := v.Args[1]
 11301  	v_0 := v.Args[0]
 11302  	// match: (MOVWstorezero [off1] {sym} (ADDconst [off2] x) mem)
 11303  	// cond: ((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1)+off2)))
 11304  	// result: (MOVWstorezero [off1+int32(off2)] {sym} x mem)
 11305  	for {
 11306  		off1 := auxIntToInt32(v.AuxInt)
 11307  		sym := auxToSym(v.Aux)
 11308  		if v_0.Op != OpPPC64ADDconst {
 11309  			break
 11310  		}
 11311  		off2 := auxIntToInt64(v_0.AuxInt)
 11312  		x := v_0.Args[0]
 11313  		mem := v_1
 11314  		if !((supportsPPC64PCRel() && is32Bit(int64(off1)+off2)) || (is16Bit(int64(off1) + off2))) {
 11315  			break
 11316  		}
 11317  		v.reset(OpPPC64MOVWstorezero)
 11318  		v.AuxInt = int32ToAuxInt(off1 + int32(off2))
 11319  		v.Aux = symToAux(sym)
 11320  		v.AddArg2(x, mem)
 11321  		return true
 11322  	}
 11323  	// match: (MOVWstorezero [off1] {sym1} p:(MOVDaddr [off2] {sym2} x) mem)
 11324  	// cond: canMergeSym(sym1,sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))
 11325  	// result: (MOVWstorezero [off1+off2] {mergeSym(sym1,sym2)} x mem)
 11326  	for {
 11327  		off1 := auxIntToInt32(v.AuxInt)
 11328  		sym1 := auxToSym(v.Aux)
 11329  		p := v_0
 11330  		if p.Op != OpPPC64MOVDaddr {
 11331  			break
 11332  		}
 11333  		off2 := auxIntToInt32(p.AuxInt)
 11334  		sym2 := auxToSym(p.Aux)
 11335  		x := p.Args[0]
 11336  		mem := v_1
 11337  		if !(canMergeSym(sym1, sym2) && ((is16Bit(int64(off1+off2)) && (x.Op != OpSB || p.Uses == 1)) || (supportsPPC64PCRel() && is32Bit(int64(off1+off2))))) {
 11338  			break
 11339  		}
 11340  		v.reset(OpPPC64MOVWstorezero)
 11341  		v.AuxInt = int32ToAuxInt(off1 + off2)
 11342  		v.Aux = symToAux(mergeSym(sym1, sym2))
 11343  		v.AddArg2(x, mem)
 11344  		return true
 11345  	}
 11346  	return false
 11347  }
 11348  func rewriteValuePPC64_OpPPC64MTVSRD(v *Value) bool {
 11349  	v_0 := v.Args[0]
 11350  	b := v.Block
 11351  	typ := &b.Func.Config.Types
 11352  	// match: (MTVSRD (MOVDconst [c]))
 11353  	// cond: !math.IsNaN(math.Float64frombits(uint64(c)))
 11354  	// result: (FMOVDconst [math.Float64frombits(uint64(c))])
 11355  	for {
 11356  		if v_0.Op != OpPPC64MOVDconst {
 11357  			break
 11358  		}
 11359  		c := auxIntToInt64(v_0.AuxInt)
 11360  		if !(!math.IsNaN(math.Float64frombits(uint64(c)))) {
 11361  			break
 11362  		}
 11363  		v.reset(OpPPC64FMOVDconst)
 11364  		v.AuxInt = float64ToAuxInt(math.Float64frombits(uint64(c)))
 11365  		return true
 11366  	}
 11367  	// match: (MTVSRD x:(MOVDload [off] {sym} ptr mem))
 11368  	// cond: x.Uses == 1 && clobber(x)
 11369  	// result: @x.Block (FMOVDload [off] {sym} ptr mem)
 11370  	for {
 11371  		x := v_0
 11372  		if x.Op != OpPPC64MOVDload {
 11373  			break
 11374  		}
 11375  		off := auxIntToInt32(x.AuxInt)
 11376  		sym := auxToSym(x.Aux)
 11377  		mem := x.Args[1]
 11378  		ptr := x.Args[0]
 11379  		if !(x.Uses == 1 && clobber(x)) {
 11380  			break
 11381  		}
 11382  		b = x.Block
 11383  		v0 := b.NewValue0(x.Pos, OpPPC64FMOVDload, typ.Float64)
 11384  		v.copyOf(v0)
 11385  		v0.AuxInt = int32ToAuxInt(off)
 11386  		v0.Aux = symToAux(sym)
 11387  		v0.AddArg2(ptr, mem)
 11388  		return true
 11389  	}
 11390  	return false
 11391  }
 11392  func rewriteValuePPC64_OpPPC64MULLD(v *Value) bool {
 11393  	v_1 := v.Args[1]
 11394  	v_0 := v.Args[0]
 11395  	// match: (MULLD x (MOVDconst [c]))
 11396  	// cond: is16Bit(c)
 11397  	// result: (MULLDconst [int32(c)] x)
 11398  	for {
 11399  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11400  			x := v_0
 11401  			if v_1.Op != OpPPC64MOVDconst {
 11402  				continue
 11403  			}
 11404  			c := auxIntToInt64(v_1.AuxInt)
 11405  			if !(is16Bit(c)) {
 11406  				continue
 11407  			}
 11408  			v.reset(OpPPC64MULLDconst)
 11409  			v.AuxInt = int32ToAuxInt(int32(c))
 11410  			v.AddArg(x)
 11411  			return true
 11412  		}
 11413  		break
 11414  	}
 11415  	return false
 11416  }
 11417  func rewriteValuePPC64_OpPPC64MULLW(v *Value) bool {
 11418  	v_1 := v.Args[1]
 11419  	v_0 := v.Args[0]
 11420  	// match: (MULLW x (MOVDconst [c]))
 11421  	// cond: is16Bit(c)
 11422  	// result: (MULLWconst [int32(c)] x)
 11423  	for {
 11424  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11425  			x := v_0
 11426  			if v_1.Op != OpPPC64MOVDconst {
 11427  				continue
 11428  			}
 11429  			c := auxIntToInt64(v_1.AuxInt)
 11430  			if !(is16Bit(c)) {
 11431  				continue
 11432  			}
 11433  			v.reset(OpPPC64MULLWconst)
 11434  			v.AuxInt = int32ToAuxInt(int32(c))
 11435  			v.AddArg(x)
 11436  			return true
 11437  		}
 11438  		break
 11439  	}
 11440  	return false
 11441  }
 11442  func rewriteValuePPC64_OpPPC64NEG(v *Value) bool {
 11443  	v_0 := v.Args[0]
 11444  	// match: (NEG (ADDconst [c] x))
 11445  	// cond: is32Bit(-c)
 11446  	// result: (SUBFCconst [-c] x)
 11447  	for {
 11448  		if v_0.Op != OpPPC64ADDconst {
 11449  			break
 11450  		}
 11451  		c := auxIntToInt64(v_0.AuxInt)
 11452  		x := v_0.Args[0]
 11453  		if !(is32Bit(-c)) {
 11454  			break
 11455  		}
 11456  		v.reset(OpPPC64SUBFCconst)
 11457  		v.AuxInt = int64ToAuxInt(-c)
 11458  		v.AddArg(x)
 11459  		return true
 11460  	}
 11461  	// match: (NEG (SUBFCconst [c] x))
 11462  	// cond: is32Bit(-c)
 11463  	// result: (ADDconst [-c] x)
 11464  	for {
 11465  		if v_0.Op != OpPPC64SUBFCconst {
 11466  			break
 11467  		}
 11468  		c := auxIntToInt64(v_0.AuxInt)
 11469  		x := v_0.Args[0]
 11470  		if !(is32Bit(-c)) {
 11471  			break
 11472  		}
 11473  		v.reset(OpPPC64ADDconst)
 11474  		v.AuxInt = int64ToAuxInt(-c)
 11475  		v.AddArg(x)
 11476  		return true
 11477  	}
 11478  	// match: (NEG (SUB x y))
 11479  	// result: (SUB y x)
 11480  	for {
 11481  		if v_0.Op != OpPPC64SUB {
 11482  			break
 11483  		}
 11484  		y := v_0.Args[1]
 11485  		x := v_0.Args[0]
 11486  		v.reset(OpPPC64SUB)
 11487  		v.AddArg2(y, x)
 11488  		return true
 11489  	}
 11490  	// match: (NEG (NEG x))
 11491  	// result: x
 11492  	for {
 11493  		if v_0.Op != OpPPC64NEG {
 11494  			break
 11495  		}
 11496  		x := v_0.Args[0]
 11497  		v.copyOf(x)
 11498  		return true
 11499  	}
 11500  	return false
 11501  }
 11502  func rewriteValuePPC64_OpPPC64NOR(v *Value) bool {
 11503  	v_1 := v.Args[1]
 11504  	v_0 := v.Args[0]
 11505  	// match: (NOR (MOVDconst [c]) (MOVDconst [d]))
 11506  	// result: (MOVDconst [^(c|d)])
 11507  	for {
 11508  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11509  			if v_0.Op != OpPPC64MOVDconst {
 11510  				continue
 11511  			}
 11512  			c := auxIntToInt64(v_0.AuxInt)
 11513  			if v_1.Op != OpPPC64MOVDconst {
 11514  				continue
 11515  			}
 11516  			d := auxIntToInt64(v_1.AuxInt)
 11517  			v.reset(OpPPC64MOVDconst)
 11518  			v.AuxInt = int64ToAuxInt(^(c | d))
 11519  			return true
 11520  		}
 11521  		break
 11522  	}
 11523  	return false
 11524  }
 11525  func rewriteValuePPC64_OpPPC64NotEqual(v *Value) bool {
 11526  	v_0 := v.Args[0]
 11527  	// match: (NotEqual (FlagEQ))
 11528  	// result: (MOVDconst [0])
 11529  	for {
 11530  		if v_0.Op != OpPPC64FlagEQ {
 11531  			break
 11532  		}
 11533  		v.reset(OpPPC64MOVDconst)
 11534  		v.AuxInt = int64ToAuxInt(0)
 11535  		return true
 11536  	}
 11537  	// match: (NotEqual (FlagLT))
 11538  	// result: (MOVDconst [1])
 11539  	for {
 11540  		if v_0.Op != OpPPC64FlagLT {
 11541  			break
 11542  		}
 11543  		v.reset(OpPPC64MOVDconst)
 11544  		v.AuxInt = int64ToAuxInt(1)
 11545  		return true
 11546  	}
 11547  	// match: (NotEqual (FlagGT))
 11548  	// result: (MOVDconst [1])
 11549  	for {
 11550  		if v_0.Op != OpPPC64FlagGT {
 11551  			break
 11552  		}
 11553  		v.reset(OpPPC64MOVDconst)
 11554  		v.AuxInt = int64ToAuxInt(1)
 11555  		return true
 11556  	}
 11557  	// match: (NotEqual (InvertFlags x))
 11558  	// result: (NotEqual x)
 11559  	for {
 11560  		if v_0.Op != OpPPC64InvertFlags {
 11561  			break
 11562  		}
 11563  		x := v_0.Args[0]
 11564  		v.reset(OpPPC64NotEqual)
 11565  		v.AddArg(x)
 11566  		return true
 11567  	}
 11568  	// match: (NotEqual cmp)
 11569  	// result: (SETBCR [2] cmp)
 11570  	for {
 11571  		cmp := v_0
 11572  		v.reset(OpPPC64SETBCR)
 11573  		v.AuxInt = int32ToAuxInt(2)
 11574  		v.AddArg(cmp)
 11575  		return true
 11576  	}
 11577  }
 11578  func rewriteValuePPC64_OpPPC64OR(v *Value) bool {
 11579  	v_1 := v.Args[1]
 11580  	v_0 := v.Args[0]
 11581  	// match: (OR x (NOR y y))
 11582  	// result: (ORN x y)
 11583  	for {
 11584  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11585  			x := v_0
 11586  			if v_1.Op != OpPPC64NOR {
 11587  				continue
 11588  			}
 11589  			y := v_1.Args[1]
 11590  			if y != v_1.Args[0] {
 11591  				continue
 11592  			}
 11593  			v.reset(OpPPC64ORN)
 11594  			v.AddArg2(x, y)
 11595  			return true
 11596  		}
 11597  		break
 11598  	}
 11599  	// match: (OR (MOVDconst [c]) (MOVDconst [d]))
 11600  	// result: (MOVDconst [c|d])
 11601  	for {
 11602  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11603  			if v_0.Op != OpPPC64MOVDconst {
 11604  				continue
 11605  			}
 11606  			c := auxIntToInt64(v_0.AuxInt)
 11607  			if v_1.Op != OpPPC64MOVDconst {
 11608  				continue
 11609  			}
 11610  			d := auxIntToInt64(v_1.AuxInt)
 11611  			v.reset(OpPPC64MOVDconst)
 11612  			v.AuxInt = int64ToAuxInt(c | d)
 11613  			return true
 11614  		}
 11615  		break
 11616  	}
 11617  	// match: (OR x (MOVDconst [c]))
 11618  	// cond: isU32Bit(c)
 11619  	// result: (ORconst [c] x)
 11620  	for {
 11621  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 11622  			x := v_0
 11623  			if v_1.Op != OpPPC64MOVDconst {
 11624  				continue
 11625  			}
 11626  			c := auxIntToInt64(v_1.AuxInt)
 11627  			if !(isU32Bit(c)) {
 11628  				continue
 11629  			}
 11630  			v.reset(OpPPC64ORconst)
 11631  			v.AuxInt = int64ToAuxInt(c)
 11632  			v.AddArg(x)
 11633  			return true
 11634  		}
 11635  		break
 11636  	}
 11637  	return false
 11638  }
 11639  func rewriteValuePPC64_OpPPC64ORN(v *Value) bool {
 11640  	v_1 := v.Args[1]
 11641  	v_0 := v.Args[0]
 11642  	// match: (ORN x (MOVDconst [-1]))
 11643  	// result: x
 11644  	for {
 11645  		x := v_0
 11646  		if v_1.Op != OpPPC64MOVDconst || auxIntToInt64(v_1.AuxInt) != -1 {
 11647  			break
 11648  		}
 11649  		v.copyOf(x)
 11650  		return true
 11651  	}
 11652  	// match: (ORN (MOVDconst [c]) (MOVDconst [d]))
 11653  	// result: (MOVDconst [c|^d])
 11654  	for {
 11655  		if v_0.Op != OpPPC64MOVDconst {
 11656  			break
 11657  		}
 11658  		c := auxIntToInt64(v_0.AuxInt)
 11659  		if v_1.Op != OpPPC64MOVDconst {
 11660  			break
 11661  		}
 11662  		d := auxIntToInt64(v_1.AuxInt)
 11663  		v.reset(OpPPC64MOVDconst)
 11664  		v.AuxInt = int64ToAuxInt(c | ^d)
 11665  		return true
 11666  	}
 11667  	return false
 11668  }
 11669  func rewriteValuePPC64_OpPPC64ORconst(v *Value) bool {
 11670  	v_0 := v.Args[0]
 11671  	// match: (ORconst [c] (ORconst [d] x))
 11672  	// result: (ORconst [c|d] x)
 11673  	for {
 11674  		c := auxIntToInt64(v.AuxInt)
 11675  		if v_0.Op != OpPPC64ORconst {
 11676  			break
 11677  		}
 11678  		d := auxIntToInt64(v_0.AuxInt)
 11679  		x := v_0.Args[0]
 11680  		v.reset(OpPPC64ORconst)
 11681  		v.AuxInt = int64ToAuxInt(c | d)
 11682  		v.AddArg(x)
 11683  		return true
 11684  	}
 11685  	// match: (ORconst [-1] _)
 11686  	// result: (MOVDconst [-1])
 11687  	for {
 11688  		if auxIntToInt64(v.AuxInt) != -1 {
 11689  			break
 11690  		}
 11691  		v.reset(OpPPC64MOVDconst)
 11692  		v.AuxInt = int64ToAuxInt(-1)
 11693  		return true
 11694  	}
 11695  	// match: (ORconst [0] x)
 11696  	// result: x
 11697  	for {
 11698  		if auxIntToInt64(v.AuxInt) != 0 {
 11699  			break
 11700  		}
 11701  		x := v_0
 11702  		v.copyOf(x)
 11703  		return true
 11704  	}
 11705  	return false
 11706  }
 11707  func rewriteValuePPC64_OpPPC64RLWINM(v *Value) bool {
 11708  	v_0 := v.Args[0]
 11709  	// match: (RLWINM [r] (MOVHZreg u))
 11710  	// cond: mergePPC64RlwinmAnd(r,0xFFFF) != 0
 11711  	// result: (RLWINM [mergePPC64RlwinmAnd(r,0xFFFF)] u)
 11712  	for {
 11713  		r := auxIntToInt64(v.AuxInt)
 11714  		if v_0.Op != OpPPC64MOVHZreg {
 11715  			break
 11716  		}
 11717  		u := v_0.Args[0]
 11718  		if !(mergePPC64RlwinmAnd(r, 0xFFFF) != 0) {
 11719  			break
 11720  		}
 11721  		v.reset(OpPPC64RLWINM)
 11722  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, 0xFFFF))
 11723  		v.AddArg(u)
 11724  		return true
 11725  	}
 11726  	// match: (RLWINM [r] (ANDconst [a] u))
 11727  	// cond: mergePPC64RlwinmAnd(r,uint32(a)) != 0
 11728  	// result: (RLWINM [mergePPC64RlwinmAnd(r,uint32(a))] u)
 11729  	for {
 11730  		r := auxIntToInt64(v.AuxInt)
 11731  		if v_0.Op != OpPPC64ANDconst {
 11732  			break
 11733  		}
 11734  		a := auxIntToInt64(v_0.AuxInt)
 11735  		u := v_0.Args[0]
 11736  		if !(mergePPC64RlwinmAnd(r, uint32(a)) != 0) {
 11737  			break
 11738  		}
 11739  		v.reset(OpPPC64RLWINM)
 11740  		v.AuxInt = int64ToAuxInt(mergePPC64RlwinmAnd(r, uint32(a)))
 11741  		v.AddArg(u)
 11742  		return true
 11743  	}
 11744  	return false
 11745  }
 11746  func rewriteValuePPC64_OpPPC64ROTL(v *Value) bool {
 11747  	v_1 := v.Args[1]
 11748  	v_0 := v.Args[0]
 11749  	// match: (ROTL x (MOVDconst [c]))
 11750  	// result: (ROTLconst x [c&63])
 11751  	for {
 11752  		x := v_0
 11753  		if v_1.Op != OpPPC64MOVDconst {
 11754  			break
 11755  		}
 11756  		c := auxIntToInt64(v_1.AuxInt)
 11757  		v.reset(OpPPC64ROTLconst)
 11758  		v.AuxInt = int64ToAuxInt(c & 63)
 11759  		v.AddArg(x)
 11760  		return true
 11761  	}
 11762  	return false
 11763  }
 11764  func rewriteValuePPC64_OpPPC64ROTLW(v *Value) bool {
 11765  	v_1 := v.Args[1]
 11766  	v_0 := v.Args[0]
 11767  	// match: (ROTLW x (MOVDconst [c]))
 11768  	// result: (ROTLWconst x [c&31])
 11769  	for {
 11770  		x := v_0
 11771  		if v_1.Op != OpPPC64MOVDconst {
 11772  			break
 11773  		}
 11774  		c := auxIntToInt64(v_1.AuxInt)
 11775  		v.reset(OpPPC64ROTLWconst)
 11776  		v.AuxInt = int64ToAuxInt(c & 31)
 11777  		v.AddArg(x)
 11778  		return true
 11779  	}
 11780  	return false
 11781  }
 11782  func rewriteValuePPC64_OpPPC64ROTLWconst(v *Value) bool {
 11783  	v_0 := v.Args[0]
 11784  	// match: (ROTLWconst [r] (AND (MOVDconst [m]) x))
 11785  	// cond: isPPC64WordRotateMask(m)
 11786  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 11787  	for {
 11788  		r := auxIntToInt64(v.AuxInt)
 11789  		if v_0.Op != OpPPC64AND {
 11790  			break
 11791  		}
 11792  		_ = v_0.Args[1]
 11793  		v_0_0 := v_0.Args[0]
 11794  		v_0_1 := v_0.Args[1]
 11795  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 11796  			if v_0_0.Op != OpPPC64MOVDconst {
 11797  				continue
 11798  			}
 11799  			m := auxIntToInt64(v_0_0.AuxInt)
 11800  			x := v_0_1
 11801  			if !(isPPC64WordRotateMask(m)) {
 11802  				continue
 11803  			}
 11804  			v.reset(OpPPC64RLWINM)
 11805  			v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 11806  			v.AddArg(x)
 11807  			return true
 11808  		}
 11809  		break
 11810  	}
 11811  	// match: (ROTLWconst [r] (ANDconst [m] x))
 11812  	// cond: isPPC64WordRotateMask(m)
 11813  	// result: (RLWINM [encodePPC64RotateMask(r,rotateLeft32(m,r),32)] x)
 11814  	for {
 11815  		r := auxIntToInt64(v.AuxInt)
 11816  		if v_0.Op != OpPPC64ANDconst {
 11817  			break
 11818  		}
 11819  		m := auxIntToInt64(v_0.AuxInt)
 11820  		x := v_0.Args[0]
 11821  		if !(isPPC64WordRotateMask(m)) {
 11822  			break
 11823  		}
 11824  		v.reset(OpPPC64RLWINM)
 11825  		v.AuxInt = int64ToAuxInt(encodePPC64RotateMask(r, rotateLeft32(m, r), 32))
 11826  		v.AddArg(x)
 11827  		return true
 11828  	}
 11829  	return false
 11830  }
 11831  func rewriteValuePPC64_OpPPC64SETBC(v *Value) bool {
 11832  	v_0 := v.Args[0]
 11833  	b := v.Block
 11834  	typ := &b.Func.Config.Types
 11835  	// match: (SETBC [0] (FlagLT))
 11836  	// result: (MOVDconst [1])
 11837  	for {
 11838  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 11839  			break
 11840  		}
 11841  		v.reset(OpPPC64MOVDconst)
 11842  		v.AuxInt = int64ToAuxInt(1)
 11843  		return true
 11844  	}
 11845  	// match: (SETBC [0] (FlagGT))
 11846  	// result: (MOVDconst [0])
 11847  	for {
 11848  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 11849  			break
 11850  		}
 11851  		v.reset(OpPPC64MOVDconst)
 11852  		v.AuxInt = int64ToAuxInt(0)
 11853  		return true
 11854  	}
 11855  	// match: (SETBC [0] (FlagEQ))
 11856  	// result: (MOVDconst [0])
 11857  	for {
 11858  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 11859  			break
 11860  		}
 11861  		v.reset(OpPPC64MOVDconst)
 11862  		v.AuxInt = int64ToAuxInt(0)
 11863  		return true
 11864  	}
 11865  	// match: (SETBC [1] (FlagGT))
 11866  	// result: (MOVDconst [1])
 11867  	for {
 11868  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 11869  			break
 11870  		}
 11871  		v.reset(OpPPC64MOVDconst)
 11872  		v.AuxInt = int64ToAuxInt(1)
 11873  		return true
 11874  	}
 11875  	// match: (SETBC [1] (FlagLT))
 11876  	// result: (MOVDconst [0])
 11877  	for {
 11878  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 11879  			break
 11880  		}
 11881  		v.reset(OpPPC64MOVDconst)
 11882  		v.AuxInt = int64ToAuxInt(0)
 11883  		return true
 11884  	}
 11885  	// match: (SETBC [1] (FlagEQ))
 11886  	// result: (MOVDconst [0])
 11887  	for {
 11888  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 11889  			break
 11890  		}
 11891  		v.reset(OpPPC64MOVDconst)
 11892  		v.AuxInt = int64ToAuxInt(0)
 11893  		return true
 11894  	}
 11895  	// match: (SETBC [2] (FlagEQ))
 11896  	// result: (MOVDconst [1])
 11897  	for {
 11898  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 11899  			break
 11900  		}
 11901  		v.reset(OpPPC64MOVDconst)
 11902  		v.AuxInt = int64ToAuxInt(1)
 11903  		return true
 11904  	}
 11905  	// match: (SETBC [2] (FlagLT))
 11906  	// result: (MOVDconst [0])
 11907  	for {
 11908  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 11909  			break
 11910  		}
 11911  		v.reset(OpPPC64MOVDconst)
 11912  		v.AuxInt = int64ToAuxInt(0)
 11913  		return true
 11914  	}
 11915  	// match: (SETBC [2] (FlagGT))
 11916  	// result: (MOVDconst [0])
 11917  	for {
 11918  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 11919  			break
 11920  		}
 11921  		v.reset(OpPPC64MOVDconst)
 11922  		v.AuxInt = int64ToAuxInt(0)
 11923  		return true
 11924  	}
 11925  	// match: (SETBC [0] (InvertFlags bool))
 11926  	// result: (SETBC [1] bool)
 11927  	for {
 11928  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 11929  			break
 11930  		}
 11931  		bool := v_0.Args[0]
 11932  		v.reset(OpPPC64SETBC)
 11933  		v.AuxInt = int32ToAuxInt(1)
 11934  		v.AddArg(bool)
 11935  		return true
 11936  	}
 11937  	// match: (SETBC [1] (InvertFlags bool))
 11938  	// result: (SETBC [0] bool)
 11939  	for {
 11940  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 11941  			break
 11942  		}
 11943  		bool := v_0.Args[0]
 11944  		v.reset(OpPPC64SETBC)
 11945  		v.AuxInt = int32ToAuxInt(0)
 11946  		v.AddArg(bool)
 11947  		return true
 11948  	}
 11949  	// match: (SETBC [2] (InvertFlags bool))
 11950  	// result: (SETBC [2] bool)
 11951  	for {
 11952  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 11953  			break
 11954  		}
 11955  		bool := v_0.Args[0]
 11956  		v.reset(OpPPC64SETBC)
 11957  		v.AuxInt = int32ToAuxInt(2)
 11958  		v.AddArg(bool)
 11959  		return true
 11960  	}
 11961  	// match: (SETBC [n] (InvertFlags bool))
 11962  	// result: (SETBCR [n] bool)
 11963  	for {
 11964  		n := auxIntToInt32(v.AuxInt)
 11965  		if v_0.Op != OpPPC64InvertFlags {
 11966  			break
 11967  		}
 11968  		bool := v_0.Args[0]
 11969  		v.reset(OpPPC64SETBCR)
 11970  		v.AuxInt = int32ToAuxInt(n)
 11971  		v.AddArg(bool)
 11972  		return true
 11973  	}
 11974  	// match: (SETBC [2] (CMPconst [0] a:(ANDconst [1] _)))
 11975  	// result: (XORconst [1] a)
 11976  	for {
 11977  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11978  			break
 11979  		}
 11980  		a := v_0.Args[0]
 11981  		if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
 11982  			break
 11983  		}
 11984  		v.reset(OpPPC64XORconst)
 11985  		v.AuxInt = int64ToAuxInt(1)
 11986  		v.AddArg(a)
 11987  		return true
 11988  	}
 11989  	// match: (SETBC [2] (CMPconst [0] a:(AND y z)))
 11990  	// cond: a.Uses == 1
 11991  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 11992  	for {
 11993  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 11994  			break
 11995  		}
 11996  		a := v_0.Args[0]
 11997  		if a.Op != OpPPC64AND {
 11998  			break
 11999  		}
 12000  		z := a.Args[1]
 12001  		y := a.Args[0]
 12002  		if !(a.Uses == 1) {
 12003  			break
 12004  		}
 12005  		v.reset(OpPPC64SETBC)
 12006  		v.AuxInt = int32ToAuxInt(2)
 12007  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12008  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 12009  		v1.AddArg2(y, z)
 12010  		v0.AddArg(v1)
 12011  		v.AddArg(v0)
 12012  		return true
 12013  	}
 12014  	// match: (SETBC [2] (CMPconst [0] o:(OR y z)))
 12015  	// cond: o.Uses == 1
 12016  	// result: (SETBC [2] (Select1 <types.TypeFlags> (ORCC y z )))
 12017  	for {
 12018  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12019  			break
 12020  		}
 12021  		o := v_0.Args[0]
 12022  		if o.Op != OpPPC64OR {
 12023  			break
 12024  		}
 12025  		z := o.Args[1]
 12026  		y := o.Args[0]
 12027  		if !(o.Uses == 1) {
 12028  			break
 12029  		}
 12030  		v.reset(OpPPC64SETBC)
 12031  		v.AuxInt = int32ToAuxInt(2)
 12032  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12033  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12034  		v1.AddArg2(y, z)
 12035  		v0.AddArg(v1)
 12036  		v.AddArg(v0)
 12037  		return true
 12038  	}
 12039  	// match: (SETBC [2] (CMPconst [0] a:(XOR y z)))
 12040  	// cond: a.Uses == 1
 12041  	// result: (SETBC [2] (Select1 <types.TypeFlags> (XORCC y z )))
 12042  	for {
 12043  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12044  			break
 12045  		}
 12046  		a := v_0.Args[0]
 12047  		if a.Op != OpPPC64XOR {
 12048  			break
 12049  		}
 12050  		z := a.Args[1]
 12051  		y := a.Args[0]
 12052  		if !(a.Uses == 1) {
 12053  			break
 12054  		}
 12055  		v.reset(OpPPC64SETBC)
 12056  		v.AuxInt = int32ToAuxInt(2)
 12057  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12058  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12059  		v1.AddArg2(y, z)
 12060  		v0.AddArg(v1)
 12061  		v.AddArg(v0)
 12062  		return true
 12063  	}
 12064  	return false
 12065  }
 12066  func rewriteValuePPC64_OpPPC64SETBCR(v *Value) bool {
 12067  	v_0 := v.Args[0]
 12068  	b := v.Block
 12069  	typ := &b.Func.Config.Types
 12070  	// match: (SETBCR [0] (FlagLT))
 12071  	// result: (MOVDconst [0])
 12072  	for {
 12073  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagLT {
 12074  			break
 12075  		}
 12076  		v.reset(OpPPC64MOVDconst)
 12077  		v.AuxInt = int64ToAuxInt(0)
 12078  		return true
 12079  	}
 12080  	// match: (SETBCR [0] (FlagGT))
 12081  	// result: (MOVDconst [1])
 12082  	for {
 12083  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagGT {
 12084  			break
 12085  		}
 12086  		v.reset(OpPPC64MOVDconst)
 12087  		v.AuxInt = int64ToAuxInt(1)
 12088  		return true
 12089  	}
 12090  	// match: (SETBCR [0] (FlagEQ))
 12091  	// result: (MOVDconst [1])
 12092  	for {
 12093  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64FlagEQ {
 12094  			break
 12095  		}
 12096  		v.reset(OpPPC64MOVDconst)
 12097  		v.AuxInt = int64ToAuxInt(1)
 12098  		return true
 12099  	}
 12100  	// match: (SETBCR [1] (FlagGT))
 12101  	// result: (MOVDconst [0])
 12102  	for {
 12103  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagGT {
 12104  			break
 12105  		}
 12106  		v.reset(OpPPC64MOVDconst)
 12107  		v.AuxInt = int64ToAuxInt(0)
 12108  		return true
 12109  	}
 12110  	// match: (SETBCR [1] (FlagLT))
 12111  	// result: (MOVDconst [1])
 12112  	for {
 12113  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagLT {
 12114  			break
 12115  		}
 12116  		v.reset(OpPPC64MOVDconst)
 12117  		v.AuxInt = int64ToAuxInt(1)
 12118  		return true
 12119  	}
 12120  	// match: (SETBCR [1] (FlagEQ))
 12121  	// result: (MOVDconst [1])
 12122  	for {
 12123  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64FlagEQ {
 12124  			break
 12125  		}
 12126  		v.reset(OpPPC64MOVDconst)
 12127  		v.AuxInt = int64ToAuxInt(1)
 12128  		return true
 12129  	}
 12130  	// match: (SETBCR [2] (FlagEQ))
 12131  	// result: (MOVDconst [0])
 12132  	for {
 12133  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagEQ {
 12134  			break
 12135  		}
 12136  		v.reset(OpPPC64MOVDconst)
 12137  		v.AuxInt = int64ToAuxInt(0)
 12138  		return true
 12139  	}
 12140  	// match: (SETBCR [2] (FlagLT))
 12141  	// result: (MOVDconst [1])
 12142  	for {
 12143  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagLT {
 12144  			break
 12145  		}
 12146  		v.reset(OpPPC64MOVDconst)
 12147  		v.AuxInt = int64ToAuxInt(1)
 12148  		return true
 12149  	}
 12150  	// match: (SETBCR [2] (FlagGT))
 12151  	// result: (MOVDconst [1])
 12152  	for {
 12153  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64FlagGT {
 12154  			break
 12155  		}
 12156  		v.reset(OpPPC64MOVDconst)
 12157  		v.AuxInt = int64ToAuxInt(1)
 12158  		return true
 12159  	}
 12160  	// match: (SETBCR [0] (InvertFlags bool))
 12161  	// result: (SETBCR [1] bool)
 12162  	for {
 12163  		if auxIntToInt32(v.AuxInt) != 0 || v_0.Op != OpPPC64InvertFlags {
 12164  			break
 12165  		}
 12166  		bool := v_0.Args[0]
 12167  		v.reset(OpPPC64SETBCR)
 12168  		v.AuxInt = int32ToAuxInt(1)
 12169  		v.AddArg(bool)
 12170  		return true
 12171  	}
 12172  	// match: (SETBCR [1] (InvertFlags bool))
 12173  	// result: (SETBCR [0] bool)
 12174  	for {
 12175  		if auxIntToInt32(v.AuxInt) != 1 || v_0.Op != OpPPC64InvertFlags {
 12176  			break
 12177  		}
 12178  		bool := v_0.Args[0]
 12179  		v.reset(OpPPC64SETBCR)
 12180  		v.AuxInt = int32ToAuxInt(0)
 12181  		v.AddArg(bool)
 12182  		return true
 12183  	}
 12184  	// match: (SETBCR [2] (InvertFlags bool))
 12185  	// result: (SETBCR [2] bool)
 12186  	for {
 12187  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64InvertFlags {
 12188  			break
 12189  		}
 12190  		bool := v_0.Args[0]
 12191  		v.reset(OpPPC64SETBCR)
 12192  		v.AuxInt = int32ToAuxInt(2)
 12193  		v.AddArg(bool)
 12194  		return true
 12195  	}
 12196  	// match: (SETBCR [n] (InvertFlags bool))
 12197  	// result: (SETBC [n] bool)
 12198  	for {
 12199  		n := auxIntToInt32(v.AuxInt)
 12200  		if v_0.Op != OpPPC64InvertFlags {
 12201  			break
 12202  		}
 12203  		bool := v_0.Args[0]
 12204  		v.reset(OpPPC64SETBC)
 12205  		v.AuxInt = int32ToAuxInt(n)
 12206  		v.AddArg(bool)
 12207  		return true
 12208  	}
 12209  	// match: (SETBCR [2] (CMPconst [0] a:(ANDconst [1] _)))
 12210  	// result: a
 12211  	for {
 12212  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12213  			break
 12214  		}
 12215  		a := v_0.Args[0]
 12216  		if a.Op != OpPPC64ANDconst || auxIntToInt64(a.AuxInt) != 1 {
 12217  			break
 12218  		}
 12219  		v.copyOf(a)
 12220  		return true
 12221  	}
 12222  	// match: (SETBCR [2] (CMPconst [0] a:(AND y z)))
 12223  	// cond: a.Uses == 1
 12224  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ANDCC y z )))
 12225  	for {
 12226  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12227  			break
 12228  		}
 12229  		a := v_0.Args[0]
 12230  		if a.Op != OpPPC64AND {
 12231  			break
 12232  		}
 12233  		z := a.Args[1]
 12234  		y := a.Args[0]
 12235  		if !(a.Uses == 1) {
 12236  			break
 12237  		}
 12238  		v.reset(OpPPC64SETBCR)
 12239  		v.AuxInt = int32ToAuxInt(2)
 12240  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12241  		v1 := b.NewValue0(v.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 12242  		v1.AddArg2(y, z)
 12243  		v0.AddArg(v1)
 12244  		v.AddArg(v0)
 12245  		return true
 12246  	}
 12247  	// match: (SETBCR [2] (CMPconst [0] o:(OR y z)))
 12248  	// cond: o.Uses == 1
 12249  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (ORCC y z )))
 12250  	for {
 12251  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12252  			break
 12253  		}
 12254  		o := v_0.Args[0]
 12255  		if o.Op != OpPPC64OR {
 12256  			break
 12257  		}
 12258  		z := o.Args[1]
 12259  		y := o.Args[0]
 12260  		if !(o.Uses == 1) {
 12261  			break
 12262  		}
 12263  		v.reset(OpPPC64SETBCR)
 12264  		v.AuxInt = int32ToAuxInt(2)
 12265  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12266  		v1 := b.NewValue0(v.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12267  		v1.AddArg2(y, z)
 12268  		v0.AddArg(v1)
 12269  		v.AddArg(v0)
 12270  		return true
 12271  	}
 12272  	// match: (SETBCR [2] (CMPconst [0] a:(XOR y z)))
 12273  	// cond: a.Uses == 1
 12274  	// result: (SETBCR [2] (Select1 <types.TypeFlags> (XORCC y z )))
 12275  	for {
 12276  		if auxIntToInt32(v.AuxInt) != 2 || v_0.Op != OpPPC64CMPconst || auxIntToInt64(v_0.AuxInt) != 0 {
 12277  			break
 12278  		}
 12279  		a := v_0.Args[0]
 12280  		if a.Op != OpPPC64XOR {
 12281  			break
 12282  		}
 12283  		z := a.Args[1]
 12284  		y := a.Args[0]
 12285  		if !(a.Uses == 1) {
 12286  			break
 12287  		}
 12288  		v.reset(OpPPC64SETBCR)
 12289  		v.AuxInt = int32ToAuxInt(2)
 12290  		v0 := b.NewValue0(v.Pos, OpSelect1, types.TypeFlags)
 12291  		v1 := b.NewValue0(v.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 12292  		v1.AddArg2(y, z)
 12293  		v0.AddArg(v1)
 12294  		v.AddArg(v0)
 12295  		return true
 12296  	}
 12297  	return false
 12298  }
 12299  func rewriteValuePPC64_OpPPC64SLD(v *Value) bool {
 12300  	v_1 := v.Args[1]
 12301  	v_0 := v.Args[0]
 12302  	// match: (SLD x (MOVDconst [c]))
 12303  	// result: (SLDconst [c&63 | (c>>6&1*63)] x)
 12304  	for {
 12305  		x := v_0
 12306  		if v_1.Op != OpPPC64MOVDconst {
 12307  			break
 12308  		}
 12309  		c := auxIntToInt64(v_1.AuxInt)
 12310  		v.reset(OpPPC64SLDconst)
 12311  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12312  		v.AddArg(x)
 12313  		return true
 12314  	}
 12315  	return false
 12316  }
 12317  func rewriteValuePPC64_OpPPC64SLDconst(v *Value) bool {
 12318  	v_0 := v.Args[0]
 12319  	// match: (SLDconst [l] (SRWconst [r] x))
 12320  	// cond: mergePPC64SldiSrw(l,r) != 0
 12321  	// result: (RLWINM [mergePPC64SldiSrw(l,r)] x)
 12322  	for {
 12323  		l := auxIntToInt64(v.AuxInt)
 12324  		if v_0.Op != OpPPC64SRWconst {
 12325  			break
 12326  		}
 12327  		r := auxIntToInt64(v_0.AuxInt)
 12328  		x := v_0.Args[0]
 12329  		if !(mergePPC64SldiSrw(l, r) != 0) {
 12330  			break
 12331  		}
 12332  		v.reset(OpPPC64RLWINM)
 12333  		v.AuxInt = int64ToAuxInt(mergePPC64SldiSrw(l, r))
 12334  		v.AddArg(x)
 12335  		return true
 12336  	}
 12337  	// match: (SLDconst [s] (RLWINM [r] y))
 12338  	// cond: mergePPC64SldiRlwinm(s,r) != 0
 12339  	// result: (RLWINM [mergePPC64SldiRlwinm(s,r)] y)
 12340  	for {
 12341  		s := auxIntToInt64(v.AuxInt)
 12342  		if v_0.Op != OpPPC64RLWINM {
 12343  			break
 12344  		}
 12345  		r := auxIntToInt64(v_0.AuxInt)
 12346  		y := v_0.Args[0]
 12347  		if !(mergePPC64SldiRlwinm(s, r) != 0) {
 12348  			break
 12349  		}
 12350  		v.reset(OpPPC64RLWINM)
 12351  		v.AuxInt = int64ToAuxInt(mergePPC64SldiRlwinm(s, r))
 12352  		v.AddArg(y)
 12353  		return true
 12354  	}
 12355  	// match: (SLDconst [c] z:(MOVBZreg x))
 12356  	// cond: c < 8 && z.Uses == 1
 12357  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,56,63,64)] x)
 12358  	for {
 12359  		c := auxIntToInt64(v.AuxInt)
 12360  		z := v_0
 12361  		if z.Op != OpPPC64MOVBZreg {
 12362  			break
 12363  		}
 12364  		x := z.Args[0]
 12365  		if !(c < 8 && z.Uses == 1) {
 12366  			break
 12367  		}
 12368  		v.reset(OpPPC64CLRLSLDI)
 12369  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 56, 63, 64))
 12370  		v.AddArg(x)
 12371  		return true
 12372  	}
 12373  	// match: (SLDconst [c] z:(MOVHZreg x))
 12374  	// cond: c < 16 && z.Uses == 1
 12375  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,48,63,64)] x)
 12376  	for {
 12377  		c := auxIntToInt64(v.AuxInt)
 12378  		z := v_0
 12379  		if z.Op != OpPPC64MOVHZreg {
 12380  			break
 12381  		}
 12382  		x := z.Args[0]
 12383  		if !(c < 16 && z.Uses == 1) {
 12384  			break
 12385  		}
 12386  		v.reset(OpPPC64CLRLSLDI)
 12387  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 48, 63, 64))
 12388  		v.AddArg(x)
 12389  		return true
 12390  	}
 12391  	// match: (SLDconst [c] z:(MOVWZreg x))
 12392  	// cond: c < 32 && z.Uses == 1
 12393  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,32,63,64)] x)
 12394  	for {
 12395  		c := auxIntToInt64(v.AuxInt)
 12396  		z := v_0
 12397  		if z.Op != OpPPC64MOVWZreg {
 12398  			break
 12399  		}
 12400  		x := z.Args[0]
 12401  		if !(c < 32 && z.Uses == 1) {
 12402  			break
 12403  		}
 12404  		v.reset(OpPPC64CLRLSLDI)
 12405  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32, 63, 64))
 12406  		v.AddArg(x)
 12407  		return true
 12408  	}
 12409  	// match: (SLDconst [c] z:(ANDconst [d] x))
 12410  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))
 12411  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12412  	for {
 12413  		c := auxIntToInt64(v.AuxInt)
 12414  		z := v_0
 12415  		if z.Op != OpPPC64ANDconst {
 12416  			break
 12417  		}
 12418  		d := auxIntToInt64(z.AuxInt)
 12419  		x := z.Args[0]
 12420  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12421  			break
 12422  		}
 12423  		v.reset(OpPPC64CLRLSLDI)
 12424  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12425  		v.AddArg(x)
 12426  		return true
 12427  	}
 12428  	// match: (SLDconst [c] z:(AND (MOVDconst [d]) x))
 12429  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(64-getPPC64ShiftMaskLength(d))
 12430  	// result: (CLRLSLDI [newPPC64ShiftAuxInt(c,64-getPPC64ShiftMaskLength(d),63,64)] x)
 12431  	for {
 12432  		c := auxIntToInt64(v.AuxInt)
 12433  		z := v_0
 12434  		if z.Op != OpPPC64AND {
 12435  			break
 12436  		}
 12437  		_ = z.Args[1]
 12438  		z_0 := z.Args[0]
 12439  		z_1 := z.Args[1]
 12440  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12441  			if z_0.Op != OpPPC64MOVDconst {
 12442  				continue
 12443  			}
 12444  			d := auxIntToInt64(z_0.AuxInt)
 12445  			x := z_1
 12446  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (64-getPPC64ShiftMaskLength(d))) {
 12447  				continue
 12448  			}
 12449  			v.reset(OpPPC64CLRLSLDI)
 12450  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 64-getPPC64ShiftMaskLength(d), 63, 64))
 12451  			v.AddArg(x)
 12452  			return true
 12453  		}
 12454  		break
 12455  	}
 12456  	// match: (SLDconst [c] z:(MOVWreg x))
 12457  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12458  	// result: (EXTSWSLconst [c] x)
 12459  	for {
 12460  		c := auxIntToInt64(v.AuxInt)
 12461  		z := v_0
 12462  		if z.Op != OpPPC64MOVWreg {
 12463  			break
 12464  		}
 12465  		x := z.Args[0]
 12466  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12467  			break
 12468  		}
 12469  		v.reset(OpPPC64EXTSWSLconst)
 12470  		v.AuxInt = int64ToAuxInt(c)
 12471  		v.AddArg(x)
 12472  		return true
 12473  	}
 12474  	return false
 12475  }
 12476  func rewriteValuePPC64_OpPPC64SLW(v *Value) bool {
 12477  	v_1 := v.Args[1]
 12478  	v_0 := v.Args[0]
 12479  	// match: (SLW x (MOVDconst [c]))
 12480  	// result: (SLWconst [c&31 | (c>>5&1*31)] x)
 12481  	for {
 12482  		x := v_0
 12483  		if v_1.Op != OpPPC64MOVDconst {
 12484  			break
 12485  		}
 12486  		c := auxIntToInt64(v_1.AuxInt)
 12487  		v.reset(OpPPC64SLWconst)
 12488  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12489  		v.AddArg(x)
 12490  		return true
 12491  	}
 12492  	return false
 12493  }
 12494  func rewriteValuePPC64_OpPPC64SLWconst(v *Value) bool {
 12495  	v_0 := v.Args[0]
 12496  	// match: (SLWconst [s] (MOVWZreg w))
 12497  	// result: (SLWconst [s] w)
 12498  	for {
 12499  		s := auxIntToInt64(v.AuxInt)
 12500  		if v_0.Op != OpPPC64MOVWZreg {
 12501  			break
 12502  		}
 12503  		w := v_0.Args[0]
 12504  		v.reset(OpPPC64SLWconst)
 12505  		v.AuxInt = int64ToAuxInt(s)
 12506  		v.AddArg(w)
 12507  		return true
 12508  	}
 12509  	// match: (SLWconst [c] z:(MOVBZreg x))
 12510  	// cond: z.Uses == 1 && c < 8
 12511  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,24,31,32)] x)
 12512  	for {
 12513  		c := auxIntToInt64(v.AuxInt)
 12514  		z := v_0
 12515  		if z.Op != OpPPC64MOVBZreg {
 12516  			break
 12517  		}
 12518  		x := z.Args[0]
 12519  		if !(z.Uses == 1 && c < 8) {
 12520  			break
 12521  		}
 12522  		v.reset(OpPPC64CLRLSLWI)
 12523  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 24, 31, 32))
 12524  		v.AddArg(x)
 12525  		return true
 12526  	}
 12527  	// match: (SLWconst [c] z:(MOVHZreg x))
 12528  	// cond: z.Uses == 1 && c < 16
 12529  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,16,31,32)] x)
 12530  	for {
 12531  		c := auxIntToInt64(v.AuxInt)
 12532  		z := v_0
 12533  		if z.Op != OpPPC64MOVHZreg {
 12534  			break
 12535  		}
 12536  		x := z.Args[0]
 12537  		if !(z.Uses == 1 && c < 16) {
 12538  			break
 12539  		}
 12540  		v.reset(OpPPC64CLRLSLWI)
 12541  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 16, 31, 32))
 12542  		v.AddArg(x)
 12543  		return true
 12544  	}
 12545  	// match: (SLWconst [c] z:(ANDconst [d] x))
 12546  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12547  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12548  	for {
 12549  		c := auxIntToInt64(v.AuxInt)
 12550  		z := v_0
 12551  		if z.Op != OpPPC64ANDconst {
 12552  			break
 12553  		}
 12554  		d := auxIntToInt64(z.AuxInt)
 12555  		x := z.Args[0]
 12556  		if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12557  			break
 12558  		}
 12559  		v.reset(OpPPC64CLRLSLWI)
 12560  		v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12561  		v.AddArg(x)
 12562  		return true
 12563  	}
 12564  	// match: (SLWconst [c] z:(AND (MOVDconst [d]) x))
 12565  	// cond: z.Uses == 1 && isPPC64ValidShiftMask(d) && c<=(32-getPPC64ShiftMaskLength(d))
 12566  	// result: (CLRLSLWI [newPPC64ShiftAuxInt(c,32-getPPC64ShiftMaskLength(d),31,32)] x)
 12567  	for {
 12568  		c := auxIntToInt64(v.AuxInt)
 12569  		z := v_0
 12570  		if z.Op != OpPPC64AND {
 12571  			break
 12572  		}
 12573  		_ = z.Args[1]
 12574  		z_0 := z.Args[0]
 12575  		z_1 := z.Args[1]
 12576  		for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 12577  			if z_0.Op != OpPPC64MOVDconst {
 12578  				continue
 12579  			}
 12580  			d := auxIntToInt64(z_0.AuxInt)
 12581  			x := z_1
 12582  			if !(z.Uses == 1 && isPPC64ValidShiftMask(d) && c <= (32-getPPC64ShiftMaskLength(d))) {
 12583  				continue
 12584  			}
 12585  			v.reset(OpPPC64CLRLSLWI)
 12586  			v.AuxInt = int32ToAuxInt(newPPC64ShiftAuxInt(c, 32-getPPC64ShiftMaskLength(d), 31, 32))
 12587  			v.AddArg(x)
 12588  			return true
 12589  		}
 12590  		break
 12591  	}
 12592  	// match: (SLWconst [c] z:(MOVWreg x))
 12593  	// cond: c < 32 && buildcfg.GOPPC64 >= 9
 12594  	// result: (EXTSWSLconst [c] x)
 12595  	for {
 12596  		c := auxIntToInt64(v.AuxInt)
 12597  		z := v_0
 12598  		if z.Op != OpPPC64MOVWreg {
 12599  			break
 12600  		}
 12601  		x := z.Args[0]
 12602  		if !(c < 32 && buildcfg.GOPPC64 >= 9) {
 12603  			break
 12604  		}
 12605  		v.reset(OpPPC64EXTSWSLconst)
 12606  		v.AuxInt = int64ToAuxInt(c)
 12607  		v.AddArg(x)
 12608  		return true
 12609  	}
 12610  	return false
 12611  }
 12612  func rewriteValuePPC64_OpPPC64SRAD(v *Value) bool {
 12613  	v_1 := v.Args[1]
 12614  	v_0 := v.Args[0]
 12615  	// match: (SRAD x (MOVDconst [c]))
 12616  	// result: (SRADconst [c&63 | (c>>6&1*63)] x)
 12617  	for {
 12618  		x := v_0
 12619  		if v_1.Op != OpPPC64MOVDconst {
 12620  			break
 12621  		}
 12622  		c := auxIntToInt64(v_1.AuxInt)
 12623  		v.reset(OpPPC64SRADconst)
 12624  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12625  		v.AddArg(x)
 12626  		return true
 12627  	}
 12628  	return false
 12629  }
 12630  func rewriteValuePPC64_OpPPC64SRAW(v *Value) bool {
 12631  	v_1 := v.Args[1]
 12632  	v_0 := v.Args[0]
 12633  	// match: (SRAW x (MOVDconst [c]))
 12634  	// result: (SRAWconst [c&31 | (c>>5&1*31)] x)
 12635  	for {
 12636  		x := v_0
 12637  		if v_1.Op != OpPPC64MOVDconst {
 12638  			break
 12639  		}
 12640  		c := auxIntToInt64(v_1.AuxInt)
 12641  		v.reset(OpPPC64SRAWconst)
 12642  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12643  		v.AddArg(x)
 12644  		return true
 12645  	}
 12646  	return false
 12647  }
 12648  func rewriteValuePPC64_OpPPC64SRD(v *Value) bool {
 12649  	v_1 := v.Args[1]
 12650  	v_0 := v.Args[0]
 12651  	// match: (SRD x (MOVDconst [c]))
 12652  	// result: (SRDconst [c&63 | (c>>6&1*63)] x)
 12653  	for {
 12654  		x := v_0
 12655  		if v_1.Op != OpPPC64MOVDconst {
 12656  			break
 12657  		}
 12658  		c := auxIntToInt64(v_1.AuxInt)
 12659  		v.reset(OpPPC64SRDconst)
 12660  		v.AuxInt = int64ToAuxInt(c&63 | (c >> 6 & 1 * 63))
 12661  		v.AddArg(x)
 12662  		return true
 12663  	}
 12664  	return false
 12665  }
 12666  func rewriteValuePPC64_OpPPC64SRW(v *Value) bool {
 12667  	v_1 := v.Args[1]
 12668  	v_0 := v.Args[0]
 12669  	// match: (SRW x (MOVDconst [c]))
 12670  	// result: (SRWconst [c&31 | (c>>5&1*31)] x)
 12671  	for {
 12672  		x := v_0
 12673  		if v_1.Op != OpPPC64MOVDconst {
 12674  			break
 12675  		}
 12676  		c := auxIntToInt64(v_1.AuxInt)
 12677  		v.reset(OpPPC64SRWconst)
 12678  		v.AuxInt = int64ToAuxInt(c&31 | (c >> 5 & 1 * 31))
 12679  		v.AddArg(x)
 12680  		return true
 12681  	}
 12682  	return false
 12683  }
 12684  func rewriteValuePPC64_OpPPC64SRWconst(v *Value) bool {
 12685  	v_0 := v.Args[0]
 12686  	// match: (SRWconst (ANDconst [m] x) [s])
 12687  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 12688  	// result: (MOVDconst [0])
 12689  	for {
 12690  		s := auxIntToInt64(v.AuxInt)
 12691  		if v_0.Op != OpPPC64ANDconst {
 12692  			break
 12693  		}
 12694  		m := auxIntToInt64(v_0.AuxInt)
 12695  		if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 12696  			break
 12697  		}
 12698  		v.reset(OpPPC64MOVDconst)
 12699  		v.AuxInt = int64ToAuxInt(0)
 12700  		return true
 12701  	}
 12702  	// match: (SRWconst (ANDconst [m] x) [s])
 12703  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 12704  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 12705  	for {
 12706  		s := auxIntToInt64(v.AuxInt)
 12707  		if v_0.Op != OpPPC64ANDconst {
 12708  			break
 12709  		}
 12710  		m := auxIntToInt64(v_0.AuxInt)
 12711  		x := v_0.Args[0]
 12712  		if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 12713  			break
 12714  		}
 12715  		v.reset(OpPPC64RLWINM)
 12716  		v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 12717  		v.AddArg(x)
 12718  		return true
 12719  	}
 12720  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 12721  	// cond: mergePPC64RShiftMask(m>>uint(s),s,32) == 0
 12722  	// result: (MOVDconst [0])
 12723  	for {
 12724  		s := auxIntToInt64(v.AuxInt)
 12725  		if v_0.Op != OpPPC64AND {
 12726  			break
 12727  		}
 12728  		_ = v_0.Args[1]
 12729  		v_0_0 := v_0.Args[0]
 12730  		v_0_1 := v_0.Args[1]
 12731  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 12732  			if v_0_0.Op != OpPPC64MOVDconst {
 12733  				continue
 12734  			}
 12735  			m := auxIntToInt64(v_0_0.AuxInt)
 12736  			if !(mergePPC64RShiftMask(m>>uint(s), s, 32) == 0) {
 12737  				continue
 12738  			}
 12739  			v.reset(OpPPC64MOVDconst)
 12740  			v.AuxInt = int64ToAuxInt(0)
 12741  			return true
 12742  		}
 12743  		break
 12744  	}
 12745  	// match: (SRWconst (AND (MOVDconst [m]) x) [s])
 12746  	// cond: mergePPC64AndSrwi(m>>uint(s),s) != 0
 12747  	// result: (RLWINM [mergePPC64AndSrwi(m>>uint(s),s)] x)
 12748  	for {
 12749  		s := auxIntToInt64(v.AuxInt)
 12750  		if v_0.Op != OpPPC64AND {
 12751  			break
 12752  		}
 12753  		_ = v_0.Args[1]
 12754  		v_0_0 := v_0.Args[0]
 12755  		v_0_1 := v_0.Args[1]
 12756  		for _i0 := 0; _i0 <= 1; _i0, v_0_0, v_0_1 = _i0+1, v_0_1, v_0_0 {
 12757  			if v_0_0.Op != OpPPC64MOVDconst {
 12758  				continue
 12759  			}
 12760  			m := auxIntToInt64(v_0_0.AuxInt)
 12761  			x := v_0_1
 12762  			if !(mergePPC64AndSrwi(m>>uint(s), s) != 0) {
 12763  				continue
 12764  			}
 12765  			v.reset(OpPPC64RLWINM)
 12766  			v.AuxInt = int64ToAuxInt(mergePPC64AndSrwi(m>>uint(s), s))
 12767  			v.AddArg(x)
 12768  			return true
 12769  		}
 12770  		break
 12771  	}
 12772  	return false
 12773  }
 12774  func rewriteValuePPC64_OpPPC64SUB(v *Value) bool {
 12775  	v_1 := v.Args[1]
 12776  	v_0 := v.Args[0]
 12777  	// match: (SUB x (MOVDconst [c]))
 12778  	// cond: is32Bit(-c)
 12779  	// result: (ADDconst [-c] x)
 12780  	for {
 12781  		x := v_0
 12782  		if v_1.Op != OpPPC64MOVDconst {
 12783  			break
 12784  		}
 12785  		c := auxIntToInt64(v_1.AuxInt)
 12786  		if !(is32Bit(-c)) {
 12787  			break
 12788  		}
 12789  		v.reset(OpPPC64ADDconst)
 12790  		v.AuxInt = int64ToAuxInt(-c)
 12791  		v.AddArg(x)
 12792  		return true
 12793  	}
 12794  	// match: (SUB (MOVDconst [c]) x)
 12795  	// cond: is32Bit(c)
 12796  	// result: (SUBFCconst [c] x)
 12797  	for {
 12798  		if v_0.Op != OpPPC64MOVDconst {
 12799  			break
 12800  		}
 12801  		c := auxIntToInt64(v_0.AuxInt)
 12802  		x := v_1
 12803  		if !(is32Bit(c)) {
 12804  			break
 12805  		}
 12806  		v.reset(OpPPC64SUBFCconst)
 12807  		v.AuxInt = int64ToAuxInt(c)
 12808  		v.AddArg(x)
 12809  		return true
 12810  	}
 12811  	return false
 12812  }
 12813  func rewriteValuePPC64_OpPPC64SUBE(v *Value) bool {
 12814  	v_2 := v.Args[2]
 12815  	v_1 := v.Args[1]
 12816  	v_0 := v.Args[0]
 12817  	b := v.Block
 12818  	typ := &b.Func.Config.Types
 12819  	// match: (SUBE x y (Select1 <typ.UInt64> (SUBCconst (MOVDconst [0]) [0])))
 12820  	// result: (SUBC x y)
 12821  	for {
 12822  		x := v_0
 12823  		y := v_1
 12824  		if v_2.Op != OpSelect1 || v_2.Type != typ.UInt64 {
 12825  			break
 12826  		}
 12827  		v_2_0 := v_2.Args[0]
 12828  		if v_2_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_2_0.AuxInt) != 0 {
 12829  			break
 12830  		}
 12831  		v_2_0_0 := v_2_0.Args[0]
 12832  		if v_2_0_0.Op != OpPPC64MOVDconst || auxIntToInt64(v_2_0_0.AuxInt) != 0 {
 12833  			break
 12834  		}
 12835  		v.reset(OpPPC64SUBC)
 12836  		v.AddArg2(x, y)
 12837  		return true
 12838  	}
 12839  	return false
 12840  }
 12841  func rewriteValuePPC64_OpPPC64SUBFCconst(v *Value) bool {
 12842  	v_0 := v.Args[0]
 12843  	// match: (SUBFCconst [c] (NEG x))
 12844  	// result: (ADDconst [c] x)
 12845  	for {
 12846  		c := auxIntToInt64(v.AuxInt)
 12847  		if v_0.Op != OpPPC64NEG {
 12848  			break
 12849  		}
 12850  		x := v_0.Args[0]
 12851  		v.reset(OpPPC64ADDconst)
 12852  		v.AuxInt = int64ToAuxInt(c)
 12853  		v.AddArg(x)
 12854  		return true
 12855  	}
 12856  	// match: (SUBFCconst [c] (SUBFCconst [d] x))
 12857  	// cond: is32Bit(c-d)
 12858  	// result: (ADDconst [c-d] x)
 12859  	for {
 12860  		c := auxIntToInt64(v.AuxInt)
 12861  		if v_0.Op != OpPPC64SUBFCconst {
 12862  			break
 12863  		}
 12864  		d := auxIntToInt64(v_0.AuxInt)
 12865  		x := v_0.Args[0]
 12866  		if !(is32Bit(c - d)) {
 12867  			break
 12868  		}
 12869  		v.reset(OpPPC64ADDconst)
 12870  		v.AuxInt = int64ToAuxInt(c - d)
 12871  		v.AddArg(x)
 12872  		return true
 12873  	}
 12874  	// match: (SUBFCconst [0] x)
 12875  	// result: (NEG x)
 12876  	for {
 12877  		if auxIntToInt64(v.AuxInt) != 0 {
 12878  			break
 12879  		}
 12880  		x := v_0
 12881  		v.reset(OpPPC64NEG)
 12882  		v.AddArg(x)
 12883  		return true
 12884  	}
 12885  	return false
 12886  }
 12887  func rewriteValuePPC64_OpPPC64XOR(v *Value) bool {
 12888  	v_1 := v.Args[1]
 12889  	v_0 := v.Args[0]
 12890  	// match: (XOR (MOVDconst [c]) (MOVDconst [d]))
 12891  	// result: (MOVDconst [c^d])
 12892  	for {
 12893  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12894  			if v_0.Op != OpPPC64MOVDconst {
 12895  				continue
 12896  			}
 12897  			c := auxIntToInt64(v_0.AuxInt)
 12898  			if v_1.Op != OpPPC64MOVDconst {
 12899  				continue
 12900  			}
 12901  			d := auxIntToInt64(v_1.AuxInt)
 12902  			v.reset(OpPPC64MOVDconst)
 12903  			v.AuxInt = int64ToAuxInt(c ^ d)
 12904  			return true
 12905  		}
 12906  		break
 12907  	}
 12908  	// match: (XOR x (MOVDconst [c]))
 12909  	// cond: isU32Bit(c)
 12910  	// result: (XORconst [c] x)
 12911  	for {
 12912  		for _i0 := 0; _i0 <= 1; _i0, v_0, v_1 = _i0+1, v_1, v_0 {
 12913  			x := v_0
 12914  			if v_1.Op != OpPPC64MOVDconst {
 12915  				continue
 12916  			}
 12917  			c := auxIntToInt64(v_1.AuxInt)
 12918  			if !(isU32Bit(c)) {
 12919  				continue
 12920  			}
 12921  			v.reset(OpPPC64XORconst)
 12922  			v.AuxInt = int64ToAuxInt(c)
 12923  			v.AddArg(x)
 12924  			return true
 12925  		}
 12926  		break
 12927  	}
 12928  	return false
 12929  }
 12930  func rewriteValuePPC64_OpPPC64XORconst(v *Value) bool {
 12931  	v_0 := v.Args[0]
 12932  	// match: (XORconst [c] (XORconst [d] x))
 12933  	// result: (XORconst [c^d] x)
 12934  	for {
 12935  		c := auxIntToInt64(v.AuxInt)
 12936  		if v_0.Op != OpPPC64XORconst {
 12937  			break
 12938  		}
 12939  		d := auxIntToInt64(v_0.AuxInt)
 12940  		x := v_0.Args[0]
 12941  		v.reset(OpPPC64XORconst)
 12942  		v.AuxInt = int64ToAuxInt(c ^ d)
 12943  		v.AddArg(x)
 12944  		return true
 12945  	}
 12946  	// match: (XORconst [0] x)
 12947  	// result: x
 12948  	for {
 12949  		if auxIntToInt64(v.AuxInt) != 0 {
 12950  			break
 12951  		}
 12952  		x := v_0
 12953  		v.copyOf(x)
 12954  		return true
 12955  	}
 12956  	// match: (XORconst [1] (SETBCR [n] cmp))
 12957  	// result: (SETBC [n] cmp)
 12958  	for {
 12959  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBCR {
 12960  			break
 12961  		}
 12962  		n := auxIntToInt32(v_0.AuxInt)
 12963  		cmp := v_0.Args[0]
 12964  		v.reset(OpPPC64SETBC)
 12965  		v.AuxInt = int32ToAuxInt(n)
 12966  		v.AddArg(cmp)
 12967  		return true
 12968  	}
 12969  	// match: (XORconst [1] (SETBC [n] cmp))
 12970  	// result: (SETBCR [n] cmp)
 12971  	for {
 12972  		if auxIntToInt64(v.AuxInt) != 1 || v_0.Op != OpPPC64SETBC {
 12973  			break
 12974  		}
 12975  		n := auxIntToInt32(v_0.AuxInt)
 12976  		cmp := v_0.Args[0]
 12977  		v.reset(OpPPC64SETBCR)
 12978  		v.AuxInt = int32ToAuxInt(n)
 12979  		v.AddArg(cmp)
 12980  		return true
 12981  	}
 12982  	return false
 12983  }
 12984  func rewriteValuePPC64_OpPanicBounds(v *Value) bool {
 12985  	v_2 := v.Args[2]
 12986  	v_1 := v.Args[1]
 12987  	v_0 := v.Args[0]
 12988  	// match: (PanicBounds [kind] x y mem)
 12989  	// cond: boundsABI(kind) == 0
 12990  	// result: (LoweredPanicBoundsA [kind] x y mem)
 12991  	for {
 12992  		kind := auxIntToInt64(v.AuxInt)
 12993  		x := v_0
 12994  		y := v_1
 12995  		mem := v_2
 12996  		if !(boundsABI(kind) == 0) {
 12997  			break
 12998  		}
 12999  		v.reset(OpPPC64LoweredPanicBoundsA)
 13000  		v.AuxInt = int64ToAuxInt(kind)
 13001  		v.AddArg3(x, y, mem)
 13002  		return true
 13003  	}
 13004  	// match: (PanicBounds [kind] x y mem)
 13005  	// cond: boundsABI(kind) == 1
 13006  	// result: (LoweredPanicBoundsB [kind] x y mem)
 13007  	for {
 13008  		kind := auxIntToInt64(v.AuxInt)
 13009  		x := v_0
 13010  		y := v_1
 13011  		mem := v_2
 13012  		if !(boundsABI(kind) == 1) {
 13013  			break
 13014  		}
 13015  		v.reset(OpPPC64LoweredPanicBoundsB)
 13016  		v.AuxInt = int64ToAuxInt(kind)
 13017  		v.AddArg3(x, y, mem)
 13018  		return true
 13019  	}
 13020  	// match: (PanicBounds [kind] x y mem)
 13021  	// cond: boundsABI(kind) == 2
 13022  	// result: (LoweredPanicBoundsC [kind] x y mem)
 13023  	for {
 13024  		kind := auxIntToInt64(v.AuxInt)
 13025  		x := v_0
 13026  		y := v_1
 13027  		mem := v_2
 13028  		if !(boundsABI(kind) == 2) {
 13029  			break
 13030  		}
 13031  		v.reset(OpPPC64LoweredPanicBoundsC)
 13032  		v.AuxInt = int64ToAuxInt(kind)
 13033  		v.AddArg3(x, y, mem)
 13034  		return true
 13035  	}
 13036  	return false
 13037  }
 13038  func rewriteValuePPC64_OpPopCount16(v *Value) bool {
 13039  	v_0 := v.Args[0]
 13040  	b := v.Block
 13041  	typ := &b.Func.Config.Types
 13042  	// match: (PopCount16 x)
 13043  	// result: (POPCNTW (MOVHZreg x))
 13044  	for {
 13045  		x := v_0
 13046  		v.reset(OpPPC64POPCNTW)
 13047  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13048  		v0.AddArg(x)
 13049  		v.AddArg(v0)
 13050  		return true
 13051  	}
 13052  }
 13053  func rewriteValuePPC64_OpPopCount32(v *Value) bool {
 13054  	v_0 := v.Args[0]
 13055  	b := v.Block
 13056  	typ := &b.Func.Config.Types
 13057  	// match: (PopCount32 x)
 13058  	// result: (POPCNTW (MOVWZreg x))
 13059  	for {
 13060  		x := v_0
 13061  		v.reset(OpPPC64POPCNTW)
 13062  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWZreg, typ.Int64)
 13063  		v0.AddArg(x)
 13064  		v.AddArg(v0)
 13065  		return true
 13066  	}
 13067  }
 13068  func rewriteValuePPC64_OpPopCount8(v *Value) bool {
 13069  	v_0 := v.Args[0]
 13070  	b := v.Block
 13071  	typ := &b.Func.Config.Types
 13072  	// match: (PopCount8 x)
 13073  	// result: (POPCNTB (MOVBZreg x))
 13074  	for {
 13075  		x := v_0
 13076  		v.reset(OpPPC64POPCNTB)
 13077  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 13078  		v0.AddArg(x)
 13079  		v.AddArg(v0)
 13080  		return true
 13081  	}
 13082  }
 13083  func rewriteValuePPC64_OpPrefetchCache(v *Value) bool {
 13084  	v_1 := v.Args[1]
 13085  	v_0 := v.Args[0]
 13086  	// match: (PrefetchCache ptr mem)
 13087  	// result: (DCBT ptr mem [0])
 13088  	for {
 13089  		ptr := v_0
 13090  		mem := v_1
 13091  		v.reset(OpPPC64DCBT)
 13092  		v.AuxInt = int64ToAuxInt(0)
 13093  		v.AddArg2(ptr, mem)
 13094  		return true
 13095  	}
 13096  }
 13097  func rewriteValuePPC64_OpPrefetchCacheStreamed(v *Value) bool {
 13098  	v_1 := v.Args[1]
 13099  	v_0 := v.Args[0]
 13100  	// match: (PrefetchCacheStreamed ptr mem)
 13101  	// result: (DCBT ptr mem [16])
 13102  	for {
 13103  		ptr := v_0
 13104  		mem := v_1
 13105  		v.reset(OpPPC64DCBT)
 13106  		v.AuxInt = int64ToAuxInt(16)
 13107  		v.AddArg2(ptr, mem)
 13108  		return true
 13109  	}
 13110  }
 13111  func rewriteValuePPC64_OpRotateLeft16(v *Value) bool {
 13112  	v_1 := v.Args[1]
 13113  	v_0 := v.Args[0]
 13114  	b := v.Block
 13115  	typ := &b.Func.Config.Types
 13116  	// match: (RotateLeft16 <t> x (MOVDconst [c]))
 13117  	// result: (Or16 (Lsh16x64 <t> x (MOVDconst [c&15])) (Rsh16Ux64 <t> x (MOVDconst [-c&15])))
 13118  	for {
 13119  		t := v.Type
 13120  		x := v_0
 13121  		if v_1.Op != OpPPC64MOVDconst {
 13122  			break
 13123  		}
 13124  		c := auxIntToInt64(v_1.AuxInt)
 13125  		v.reset(OpOr16)
 13126  		v0 := b.NewValue0(v.Pos, OpLsh16x64, t)
 13127  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13128  		v1.AuxInt = int64ToAuxInt(c & 15)
 13129  		v0.AddArg2(x, v1)
 13130  		v2 := b.NewValue0(v.Pos, OpRsh16Ux64, t)
 13131  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13132  		v3.AuxInt = int64ToAuxInt(-c & 15)
 13133  		v2.AddArg2(x, v3)
 13134  		v.AddArg2(v0, v2)
 13135  		return true
 13136  	}
 13137  	return false
 13138  }
 13139  func rewriteValuePPC64_OpRotateLeft8(v *Value) bool {
 13140  	v_1 := v.Args[1]
 13141  	v_0 := v.Args[0]
 13142  	b := v.Block
 13143  	typ := &b.Func.Config.Types
 13144  	// match: (RotateLeft8 <t> x (MOVDconst [c]))
 13145  	// result: (Or8 (Lsh8x64 <t> x (MOVDconst [c&7])) (Rsh8Ux64 <t> x (MOVDconst [-c&7])))
 13146  	for {
 13147  		t := v.Type
 13148  		x := v_0
 13149  		if v_1.Op != OpPPC64MOVDconst {
 13150  			break
 13151  		}
 13152  		c := auxIntToInt64(v_1.AuxInt)
 13153  		v.reset(OpOr8)
 13154  		v0 := b.NewValue0(v.Pos, OpLsh8x64, t)
 13155  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13156  		v1.AuxInt = int64ToAuxInt(c & 7)
 13157  		v0.AddArg2(x, v1)
 13158  		v2 := b.NewValue0(v.Pos, OpRsh8Ux64, t)
 13159  		v3 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13160  		v3.AuxInt = int64ToAuxInt(-c & 7)
 13161  		v2.AddArg2(x, v3)
 13162  		v.AddArg2(v0, v2)
 13163  		return true
 13164  	}
 13165  	return false
 13166  }
 13167  func rewriteValuePPC64_OpRsh16Ux16(v *Value) bool {
 13168  	v_1 := v.Args[1]
 13169  	v_0 := v.Args[0]
 13170  	b := v.Block
 13171  	typ := &b.Func.Config.Types
 13172  	// match: (Rsh16Ux16 x y)
 13173  	// cond: shiftIsBounded(v)
 13174  	// result: (SRD (MOVHZreg x) y)
 13175  	for {
 13176  		x := v_0
 13177  		y := v_1
 13178  		if !(shiftIsBounded(v)) {
 13179  			break
 13180  		}
 13181  		v.reset(OpPPC64SRD)
 13182  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13183  		v0.AddArg(x)
 13184  		v.AddArg2(v0, y)
 13185  		return true
 13186  	}
 13187  	// match: (Rsh16Ux16 <t> x y)
 13188  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF0] y)))
 13189  	for {
 13190  		t := v.Type
 13191  		x := v_0
 13192  		y := v_1
 13193  		v.reset(OpPPC64ISEL)
 13194  		v.AuxInt = int32ToAuxInt(2)
 13195  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13196  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13197  		v1.AddArg(x)
 13198  		v0.AddArg2(v1, y)
 13199  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13200  		v2.AuxInt = int64ToAuxInt(0)
 13201  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13202  		v3.AuxInt = int64ToAuxInt(0)
 13203  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13204  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13205  		v4.AddArg(y)
 13206  		v3.AddArg(v4)
 13207  		v.AddArg3(v0, v2, v3)
 13208  		return true
 13209  	}
 13210  }
 13211  func rewriteValuePPC64_OpRsh16Ux32(v *Value) bool {
 13212  	v_1 := v.Args[1]
 13213  	v_0 := v.Args[0]
 13214  	b := v.Block
 13215  	typ := &b.Func.Config.Types
 13216  	// match: (Rsh16Ux32 x y)
 13217  	// cond: shiftIsBounded(v)
 13218  	// result: (SRD (MOVHZreg x) y)
 13219  	for {
 13220  		x := v_0
 13221  		y := v_1
 13222  		if !(shiftIsBounded(v)) {
 13223  			break
 13224  		}
 13225  		v.reset(OpPPC64SRD)
 13226  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13227  		v0.AddArg(x)
 13228  		v.AddArg2(v0, y)
 13229  		return true
 13230  	}
 13231  	// match: (Rsh16Ux32 <t> x y)
 13232  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPWUconst y [16]))
 13233  	for {
 13234  		t := v.Type
 13235  		x := v_0
 13236  		y := v_1
 13237  		v.reset(OpPPC64ISEL)
 13238  		v.AuxInt = int32ToAuxInt(0)
 13239  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13240  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13241  		v1.AddArg(x)
 13242  		v0.AddArg2(v1, y)
 13243  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13244  		v2.AuxInt = int64ToAuxInt(0)
 13245  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13246  		v3.AuxInt = int32ToAuxInt(16)
 13247  		v3.AddArg(y)
 13248  		v.AddArg3(v0, v2, v3)
 13249  		return true
 13250  	}
 13251  }
 13252  func rewriteValuePPC64_OpRsh16Ux64(v *Value) bool {
 13253  	v_1 := v.Args[1]
 13254  	v_0 := v.Args[0]
 13255  	b := v.Block
 13256  	typ := &b.Func.Config.Types
 13257  	// match: (Rsh16Ux64 x (MOVDconst [c]))
 13258  	// cond: uint64(c) < 16
 13259  	// result: (SRWconst (ZeroExt16to32 x) [c])
 13260  	for {
 13261  		x := v_0
 13262  		if v_1.Op != OpPPC64MOVDconst {
 13263  			break
 13264  		}
 13265  		c := auxIntToInt64(v_1.AuxInt)
 13266  		if !(uint64(c) < 16) {
 13267  			break
 13268  		}
 13269  		v.reset(OpPPC64SRWconst)
 13270  		v.AuxInt = int64ToAuxInt(c)
 13271  		v0 := b.NewValue0(v.Pos, OpZeroExt16to32, typ.UInt32)
 13272  		v0.AddArg(x)
 13273  		v.AddArg(v0)
 13274  		return true
 13275  	}
 13276  	// match: (Rsh16Ux64 x y)
 13277  	// cond: shiftIsBounded(v)
 13278  	// result: (SRD (MOVHZreg x) y)
 13279  	for {
 13280  		x := v_0
 13281  		y := v_1
 13282  		if !(shiftIsBounded(v)) {
 13283  			break
 13284  		}
 13285  		v.reset(OpPPC64SRD)
 13286  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13287  		v0.AddArg(x)
 13288  		v.AddArg2(v0, y)
 13289  		return true
 13290  	}
 13291  	// match: (Rsh16Ux64 <t> x y)
 13292  	// result: (ISEL [0] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPUconst y [16]))
 13293  	for {
 13294  		t := v.Type
 13295  		x := v_0
 13296  		y := v_1
 13297  		v.reset(OpPPC64ISEL)
 13298  		v.AuxInt = int32ToAuxInt(0)
 13299  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13300  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13301  		v1.AddArg(x)
 13302  		v0.AddArg2(v1, y)
 13303  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13304  		v2.AuxInt = int64ToAuxInt(0)
 13305  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13306  		v3.AuxInt = int64ToAuxInt(16)
 13307  		v3.AddArg(y)
 13308  		v.AddArg3(v0, v2, v3)
 13309  		return true
 13310  	}
 13311  }
 13312  func rewriteValuePPC64_OpRsh16Ux8(v *Value) bool {
 13313  	v_1 := v.Args[1]
 13314  	v_0 := v.Args[0]
 13315  	b := v.Block
 13316  	typ := &b.Func.Config.Types
 13317  	// match: (Rsh16Ux8 x y)
 13318  	// cond: shiftIsBounded(v)
 13319  	// result: (SRD (MOVHZreg x) y)
 13320  	for {
 13321  		x := v_0
 13322  		y := v_1
 13323  		if !(shiftIsBounded(v)) {
 13324  			break
 13325  		}
 13326  		v.reset(OpPPC64SRD)
 13327  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13328  		v0.AddArg(x)
 13329  		v.AddArg2(v0, y)
 13330  		return true
 13331  	}
 13332  	// match: (Rsh16Ux8 <t> x y)
 13333  	// result: (ISEL [2] (SRD <t> (MOVHZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F0] y)))
 13334  	for {
 13335  		t := v.Type
 13336  		x := v_0
 13337  		y := v_1
 13338  		v.reset(OpPPC64ISEL)
 13339  		v.AuxInt = int32ToAuxInt(2)
 13340  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13341  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHZreg, typ.Int64)
 13342  		v1.AddArg(x)
 13343  		v0.AddArg2(v1, y)
 13344  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13345  		v2.AuxInt = int64ToAuxInt(0)
 13346  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13347  		v3.AuxInt = int64ToAuxInt(0)
 13348  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13349  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13350  		v4.AddArg(y)
 13351  		v3.AddArg(v4)
 13352  		v.AddArg3(v0, v2, v3)
 13353  		return true
 13354  	}
 13355  }
 13356  func rewriteValuePPC64_OpRsh16x16(v *Value) bool {
 13357  	v_1 := v.Args[1]
 13358  	v_0 := v.Args[0]
 13359  	b := v.Block
 13360  	typ := &b.Func.Config.Types
 13361  	// match: (Rsh16x16 x y)
 13362  	// cond: shiftIsBounded(v)
 13363  	// result: (SRAD (MOVHreg x) y)
 13364  	for {
 13365  		x := v_0
 13366  		y := v_1
 13367  		if !(shiftIsBounded(v)) {
 13368  			break
 13369  		}
 13370  		v.reset(OpPPC64SRAD)
 13371  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13372  		v0.AddArg(x)
 13373  		v.AddArg2(v0, y)
 13374  		return true
 13375  	}
 13376  	// match: (Rsh16x16 <t> x y)
 13377  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPconst [0] (ANDconst [0xFFF0] y)))
 13378  	for {
 13379  		t := v.Type
 13380  		x := v_0
 13381  		y := v_1
 13382  		v.reset(OpPPC64ISEL)
 13383  		v.AuxInt = int32ToAuxInt(2)
 13384  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13385  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13386  		v1.AddArg(x)
 13387  		v0.AddArg2(v1, y)
 13388  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13389  		v2.AuxInt = int64ToAuxInt(15)
 13390  		v2.AddArg(v1)
 13391  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13392  		v3.AuxInt = int64ToAuxInt(0)
 13393  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13394  		v4.AuxInt = int64ToAuxInt(0xFFF0)
 13395  		v4.AddArg(y)
 13396  		v3.AddArg(v4)
 13397  		v.AddArg3(v0, v2, v3)
 13398  		return true
 13399  	}
 13400  }
 13401  func rewriteValuePPC64_OpRsh16x32(v *Value) bool {
 13402  	v_1 := v.Args[1]
 13403  	v_0 := v.Args[0]
 13404  	b := v.Block
 13405  	typ := &b.Func.Config.Types
 13406  	// match: (Rsh16x32 x y)
 13407  	// cond: shiftIsBounded(v)
 13408  	// result: (SRAD (MOVHreg x) y)
 13409  	for {
 13410  		x := v_0
 13411  		y := v_1
 13412  		if !(shiftIsBounded(v)) {
 13413  			break
 13414  		}
 13415  		v.reset(OpPPC64SRAD)
 13416  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13417  		v0.AddArg(x)
 13418  		v.AddArg2(v0, y)
 13419  		return true
 13420  	}
 13421  	// match: (Rsh16x32 <t> x y)
 13422  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPWUconst y [16]))
 13423  	for {
 13424  		t := v.Type
 13425  		x := v_0
 13426  		y := v_1
 13427  		v.reset(OpPPC64ISEL)
 13428  		v.AuxInt = int32ToAuxInt(0)
 13429  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13430  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13431  		v1.AddArg(x)
 13432  		v0.AddArg2(v1, y)
 13433  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13434  		v2.AuxInt = int64ToAuxInt(15)
 13435  		v2.AddArg(v1)
 13436  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13437  		v3.AuxInt = int32ToAuxInt(16)
 13438  		v3.AddArg(y)
 13439  		v.AddArg3(v0, v2, v3)
 13440  		return true
 13441  	}
 13442  }
 13443  func rewriteValuePPC64_OpRsh16x64(v *Value) bool {
 13444  	v_1 := v.Args[1]
 13445  	v_0 := v.Args[0]
 13446  	b := v.Block
 13447  	typ := &b.Func.Config.Types
 13448  	// match: (Rsh16x64 x (MOVDconst [c]))
 13449  	// cond: uint64(c) >= 16
 13450  	// result: (SRAWconst (SignExt16to32 x) [63])
 13451  	for {
 13452  		x := v_0
 13453  		if v_1.Op != OpPPC64MOVDconst {
 13454  			break
 13455  		}
 13456  		c := auxIntToInt64(v_1.AuxInt)
 13457  		if !(uint64(c) >= 16) {
 13458  			break
 13459  		}
 13460  		v.reset(OpPPC64SRAWconst)
 13461  		v.AuxInt = int64ToAuxInt(63)
 13462  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13463  		v0.AddArg(x)
 13464  		v.AddArg(v0)
 13465  		return true
 13466  	}
 13467  	// match: (Rsh16x64 x (MOVDconst [c]))
 13468  	// cond: uint64(c) < 16
 13469  	// result: (SRAWconst (SignExt16to32 x) [c])
 13470  	for {
 13471  		x := v_0
 13472  		if v_1.Op != OpPPC64MOVDconst {
 13473  			break
 13474  		}
 13475  		c := auxIntToInt64(v_1.AuxInt)
 13476  		if !(uint64(c) < 16) {
 13477  			break
 13478  		}
 13479  		v.reset(OpPPC64SRAWconst)
 13480  		v.AuxInt = int64ToAuxInt(c)
 13481  		v0 := b.NewValue0(v.Pos, OpSignExt16to32, typ.Int32)
 13482  		v0.AddArg(x)
 13483  		v.AddArg(v0)
 13484  		return true
 13485  	}
 13486  	// match: (Rsh16x64 x y)
 13487  	// cond: shiftIsBounded(v)
 13488  	// result: (SRAD (MOVHreg x) y)
 13489  	for {
 13490  		x := v_0
 13491  		y := v_1
 13492  		if !(shiftIsBounded(v)) {
 13493  			break
 13494  		}
 13495  		v.reset(OpPPC64SRAD)
 13496  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13497  		v0.AddArg(x)
 13498  		v.AddArg2(v0, y)
 13499  		return true
 13500  	}
 13501  	// match: (Rsh16x64 <t> x y)
 13502  	// result: (ISEL [0] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPUconst y [16]))
 13503  	for {
 13504  		t := v.Type
 13505  		x := v_0
 13506  		y := v_1
 13507  		v.reset(OpPPC64ISEL)
 13508  		v.AuxInt = int32ToAuxInt(0)
 13509  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13510  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13511  		v1.AddArg(x)
 13512  		v0.AddArg2(v1, y)
 13513  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13514  		v2.AuxInt = int64ToAuxInt(15)
 13515  		v2.AddArg(v1)
 13516  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13517  		v3.AuxInt = int64ToAuxInt(16)
 13518  		v3.AddArg(y)
 13519  		v.AddArg3(v0, v2, v3)
 13520  		return true
 13521  	}
 13522  }
 13523  func rewriteValuePPC64_OpRsh16x8(v *Value) bool {
 13524  	v_1 := v.Args[1]
 13525  	v_0 := v.Args[0]
 13526  	b := v.Block
 13527  	typ := &b.Func.Config.Types
 13528  	// match: (Rsh16x8 x y)
 13529  	// cond: shiftIsBounded(v)
 13530  	// result: (SRAD (MOVHreg x) y)
 13531  	for {
 13532  		x := v_0
 13533  		y := v_1
 13534  		if !(shiftIsBounded(v)) {
 13535  			break
 13536  		}
 13537  		v.reset(OpPPC64SRAD)
 13538  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13539  		v0.AddArg(x)
 13540  		v.AddArg2(v0, y)
 13541  		return true
 13542  	}
 13543  	// match: (Rsh16x8 <t> x y)
 13544  	// result: (ISEL [2] (SRAD <t> (MOVHreg x) y) (SRADconst <t> (MOVHreg x) [15]) (CMPconst [0] (ANDconst [0x00F0] y)))
 13545  	for {
 13546  		t := v.Type
 13547  		x := v_0
 13548  		y := v_1
 13549  		v.reset(OpPPC64ISEL)
 13550  		v.AuxInt = int32ToAuxInt(2)
 13551  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 13552  		v1 := b.NewValue0(v.Pos, OpPPC64MOVHreg, typ.Int64)
 13553  		v1.AddArg(x)
 13554  		v0.AddArg2(v1, y)
 13555  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 13556  		v2.AuxInt = int64ToAuxInt(15)
 13557  		v2.AddArg(v1)
 13558  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13559  		v3.AuxInt = int64ToAuxInt(0)
 13560  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13561  		v4.AuxInt = int64ToAuxInt(0x00F0)
 13562  		v4.AddArg(y)
 13563  		v3.AddArg(v4)
 13564  		v.AddArg3(v0, v2, v3)
 13565  		return true
 13566  	}
 13567  }
 13568  func rewriteValuePPC64_OpRsh32Ux16(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: (Rsh32Ux16 x y)
 13574  	// cond: shiftIsBounded(v)
 13575  	// result: (SRW x y)
 13576  	for {
 13577  		x := v_0
 13578  		y := v_1
 13579  		if !(shiftIsBounded(v)) {
 13580  			break
 13581  		}
 13582  		v.reset(OpPPC64SRW)
 13583  		v.AddArg2(x, y)
 13584  		return true
 13585  	}
 13586  	// match: (Rsh32Ux16 <t> x y)
 13587  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFE0] 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, OpPPC64SRW, t)
 13595  		v0.AddArg2(x, y)
 13596  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13597  		v1.AuxInt = int64ToAuxInt(0)
 13598  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13599  		v2.AuxInt = int64ToAuxInt(0)
 13600  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13601  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 13602  		v3.AddArg(y)
 13603  		v2.AddArg(v3)
 13604  		v.AddArg3(v0, v1, v2)
 13605  		return true
 13606  	}
 13607  }
 13608  func rewriteValuePPC64_OpRsh32Ux32(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: (Rsh32Ux32 x y)
 13614  	// cond: shiftIsBounded(v)
 13615  	// result: (SRW x y)
 13616  	for {
 13617  		x := v_0
 13618  		y := v_1
 13619  		if !(shiftIsBounded(v)) {
 13620  			break
 13621  		}
 13622  		v.reset(OpPPC64SRW)
 13623  		v.AddArg2(x, y)
 13624  		return true
 13625  	}
 13626  	// match: (Rsh32Ux32 <t> x y)
 13627  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPWUconst y [32]))
 13628  	for {
 13629  		t := v.Type
 13630  		x := v_0
 13631  		y := v_1
 13632  		v.reset(OpPPC64ISEL)
 13633  		v.AuxInt = int32ToAuxInt(0)
 13634  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, 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, OpPPC64CMPWUconst, types.TypeFlags)
 13639  		v2.AuxInt = int32ToAuxInt(32)
 13640  		v2.AddArg(y)
 13641  		v.AddArg3(v0, v1, v2)
 13642  		return true
 13643  	}
 13644  }
 13645  func rewriteValuePPC64_OpRsh32Ux64(v *Value) bool {
 13646  	v_1 := v.Args[1]
 13647  	v_0 := v.Args[0]
 13648  	b := v.Block
 13649  	typ := &b.Func.Config.Types
 13650  	// match: (Rsh32Ux64 x (MOVDconst [c]))
 13651  	// cond: uint64(c) < 32
 13652  	// result: (SRWconst x [c])
 13653  	for {
 13654  		x := v_0
 13655  		if v_1.Op != OpPPC64MOVDconst {
 13656  			break
 13657  		}
 13658  		c := auxIntToInt64(v_1.AuxInt)
 13659  		if !(uint64(c) < 32) {
 13660  			break
 13661  		}
 13662  		v.reset(OpPPC64SRWconst)
 13663  		v.AuxInt = int64ToAuxInt(c)
 13664  		v.AddArg(x)
 13665  		return true
 13666  	}
 13667  	// match: (Rsh32Ux64 x y)
 13668  	// cond: shiftIsBounded(v)
 13669  	// result: (SRW x y)
 13670  	for {
 13671  		x := v_0
 13672  		y := v_1
 13673  		if !(shiftIsBounded(v)) {
 13674  			break
 13675  		}
 13676  		v.reset(OpPPC64SRW)
 13677  		v.AddArg2(x, y)
 13678  		return true
 13679  	}
 13680  	// match: (Rsh32Ux64 <t> x y)
 13681  	// result: (ISEL [0] (SRW <t> x y) (MOVDconst [0]) (CMPUconst y [32]))
 13682  	for {
 13683  		t := v.Type
 13684  		x := v_0
 13685  		y := v_1
 13686  		v.reset(OpPPC64ISEL)
 13687  		v.AuxInt = int32ToAuxInt(0)
 13688  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13689  		v0.AddArg2(x, y)
 13690  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13691  		v1.AuxInt = int64ToAuxInt(0)
 13692  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13693  		v2.AuxInt = int64ToAuxInt(32)
 13694  		v2.AddArg(y)
 13695  		v.AddArg3(v0, v1, v2)
 13696  		return true
 13697  	}
 13698  }
 13699  func rewriteValuePPC64_OpRsh32Ux8(v *Value) bool {
 13700  	v_1 := v.Args[1]
 13701  	v_0 := v.Args[0]
 13702  	b := v.Block
 13703  	typ := &b.Func.Config.Types
 13704  	// match: (Rsh32Ux8 x y)
 13705  	// cond: shiftIsBounded(v)
 13706  	// result: (SRW x y)
 13707  	for {
 13708  		x := v_0
 13709  		y := v_1
 13710  		if !(shiftIsBounded(v)) {
 13711  			break
 13712  		}
 13713  		v.reset(OpPPC64SRW)
 13714  		v.AddArg2(x, y)
 13715  		return true
 13716  	}
 13717  	// match: (Rsh32Ux8 <t> x y)
 13718  	// result: (ISEL [2] (SRW <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00E0] y)))
 13719  	for {
 13720  		t := v.Type
 13721  		x := v_0
 13722  		y := v_1
 13723  		v.reset(OpPPC64ISEL)
 13724  		v.AuxInt = int32ToAuxInt(2)
 13725  		v0 := b.NewValue0(v.Pos, OpPPC64SRW, t)
 13726  		v0.AddArg2(x, y)
 13727  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13728  		v1.AuxInt = int64ToAuxInt(0)
 13729  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13730  		v2.AuxInt = int64ToAuxInt(0)
 13731  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13732  		v3.AuxInt = int64ToAuxInt(0x00E0)
 13733  		v3.AddArg(y)
 13734  		v2.AddArg(v3)
 13735  		v.AddArg3(v0, v1, v2)
 13736  		return true
 13737  	}
 13738  }
 13739  func rewriteValuePPC64_OpRsh32x16(v *Value) bool {
 13740  	v_1 := v.Args[1]
 13741  	v_0 := v.Args[0]
 13742  	b := v.Block
 13743  	typ := &b.Func.Config.Types
 13744  	// match: (Rsh32x16 x y)
 13745  	// cond: shiftIsBounded(v)
 13746  	// result: (SRAW x y)
 13747  	for {
 13748  		x := v_0
 13749  		y := v_1
 13750  		if !(shiftIsBounded(v)) {
 13751  			break
 13752  		}
 13753  		v.reset(OpPPC64SRAW)
 13754  		v.AddArg2(x, y)
 13755  		return true
 13756  	}
 13757  	// match: (Rsh32x16 <t> x y)
 13758  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPconst [0] (ANDconst [0xFFE0] y)))
 13759  	for {
 13760  		t := v.Type
 13761  		x := v_0
 13762  		y := v_1
 13763  		v.reset(OpPPC64ISEL)
 13764  		v.AuxInt = int32ToAuxInt(2)
 13765  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13766  		v0.AddArg2(x, y)
 13767  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13768  		v1.AuxInt = int64ToAuxInt(31)
 13769  		v1.AddArg(x)
 13770  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13771  		v2.AuxInt = int64ToAuxInt(0)
 13772  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13773  		v3.AuxInt = int64ToAuxInt(0xFFE0)
 13774  		v3.AddArg(y)
 13775  		v2.AddArg(v3)
 13776  		v.AddArg3(v0, v1, v2)
 13777  		return true
 13778  	}
 13779  }
 13780  func rewriteValuePPC64_OpRsh32x32(v *Value) bool {
 13781  	v_1 := v.Args[1]
 13782  	v_0 := v.Args[0]
 13783  	b := v.Block
 13784  	// match: (Rsh32x32 x y)
 13785  	// cond: shiftIsBounded(v)
 13786  	// result: (SRAW x y)
 13787  	for {
 13788  		x := v_0
 13789  		y := v_1
 13790  		if !(shiftIsBounded(v)) {
 13791  			break
 13792  		}
 13793  		v.reset(OpPPC64SRAW)
 13794  		v.AddArg2(x, y)
 13795  		return true
 13796  	}
 13797  	// match: (Rsh32x32 <t> x y)
 13798  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPWUconst y [32]))
 13799  	for {
 13800  		t := v.Type
 13801  		x := v_0
 13802  		y := v_1
 13803  		v.reset(OpPPC64ISEL)
 13804  		v.AuxInt = int32ToAuxInt(0)
 13805  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13806  		v0.AddArg2(x, y)
 13807  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13808  		v1.AuxInt = int64ToAuxInt(31)
 13809  		v1.AddArg(x)
 13810  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 13811  		v2.AuxInt = int32ToAuxInt(32)
 13812  		v2.AddArg(y)
 13813  		v.AddArg3(v0, v1, v2)
 13814  		return true
 13815  	}
 13816  }
 13817  func rewriteValuePPC64_OpRsh32x64(v *Value) bool {
 13818  	v_1 := v.Args[1]
 13819  	v_0 := v.Args[0]
 13820  	b := v.Block
 13821  	// match: (Rsh32x64 x (MOVDconst [c]))
 13822  	// cond: uint64(c) >= 32
 13823  	// result: (SRAWconst x [63])
 13824  	for {
 13825  		x := v_0
 13826  		if v_1.Op != OpPPC64MOVDconst {
 13827  			break
 13828  		}
 13829  		c := auxIntToInt64(v_1.AuxInt)
 13830  		if !(uint64(c) >= 32) {
 13831  			break
 13832  		}
 13833  		v.reset(OpPPC64SRAWconst)
 13834  		v.AuxInt = int64ToAuxInt(63)
 13835  		v.AddArg(x)
 13836  		return true
 13837  	}
 13838  	// match: (Rsh32x64 x (MOVDconst [c]))
 13839  	// cond: uint64(c) < 32
 13840  	// result: (SRAWconst x [c])
 13841  	for {
 13842  		x := v_0
 13843  		if v_1.Op != OpPPC64MOVDconst {
 13844  			break
 13845  		}
 13846  		c := auxIntToInt64(v_1.AuxInt)
 13847  		if !(uint64(c) < 32) {
 13848  			break
 13849  		}
 13850  		v.reset(OpPPC64SRAWconst)
 13851  		v.AuxInt = int64ToAuxInt(c)
 13852  		v.AddArg(x)
 13853  		return true
 13854  	}
 13855  	// match: (Rsh32x64 x y)
 13856  	// cond: shiftIsBounded(v)
 13857  	// result: (SRAW x y)
 13858  	for {
 13859  		x := v_0
 13860  		y := v_1
 13861  		if !(shiftIsBounded(v)) {
 13862  			break
 13863  		}
 13864  		v.reset(OpPPC64SRAW)
 13865  		v.AddArg2(x, y)
 13866  		return true
 13867  	}
 13868  	// match: (Rsh32x64 <t> x y)
 13869  	// result: (ISEL [0] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPUconst y [32]))
 13870  	for {
 13871  		t := v.Type
 13872  		x := v_0
 13873  		y := v_1
 13874  		v.reset(OpPPC64ISEL)
 13875  		v.AuxInt = int32ToAuxInt(0)
 13876  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13877  		v0.AddArg2(x, y)
 13878  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13879  		v1.AuxInt = int64ToAuxInt(31)
 13880  		v1.AddArg(x)
 13881  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 13882  		v2.AuxInt = int64ToAuxInt(32)
 13883  		v2.AddArg(y)
 13884  		v.AddArg3(v0, v1, v2)
 13885  		return true
 13886  	}
 13887  }
 13888  func rewriteValuePPC64_OpRsh32x8(v *Value) bool {
 13889  	v_1 := v.Args[1]
 13890  	v_0 := v.Args[0]
 13891  	b := v.Block
 13892  	typ := &b.Func.Config.Types
 13893  	// match: (Rsh32x8 x y)
 13894  	// cond: shiftIsBounded(v)
 13895  	// result: (SRAW x y)
 13896  	for {
 13897  		x := v_0
 13898  		y := v_1
 13899  		if !(shiftIsBounded(v)) {
 13900  			break
 13901  		}
 13902  		v.reset(OpPPC64SRAW)
 13903  		v.AddArg2(x, y)
 13904  		return true
 13905  	}
 13906  	// match: (Rsh32x8 <t> x y)
 13907  	// result: (ISEL [2] (SRAW <t> x y) (SRAWconst <t> x [31]) (CMPconst [0] (ANDconst [0x00E0] y)))
 13908  	for {
 13909  		t := v.Type
 13910  		x := v_0
 13911  		y := v_1
 13912  		v.reset(OpPPC64ISEL)
 13913  		v.AuxInt = int32ToAuxInt(2)
 13914  		v0 := b.NewValue0(v.Pos, OpPPC64SRAW, t)
 13915  		v0.AddArg2(x, y)
 13916  		v1 := b.NewValue0(v.Pos, OpPPC64SRAWconst, t)
 13917  		v1.AuxInt = int64ToAuxInt(31)
 13918  		v1.AddArg(x)
 13919  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13920  		v2.AuxInt = int64ToAuxInt(0)
 13921  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13922  		v3.AuxInt = int64ToAuxInt(0x00E0)
 13923  		v3.AddArg(y)
 13924  		v2.AddArg(v3)
 13925  		v.AddArg3(v0, v1, v2)
 13926  		return true
 13927  	}
 13928  }
 13929  func rewriteValuePPC64_OpRsh64Ux16(v *Value) bool {
 13930  	v_1 := v.Args[1]
 13931  	v_0 := v.Args[0]
 13932  	b := v.Block
 13933  	typ := &b.Func.Config.Types
 13934  	// match: (Rsh64Ux16 x y)
 13935  	// cond: shiftIsBounded(v)
 13936  	// result: (SRD x y)
 13937  	for {
 13938  		x := v_0
 13939  		y := v_1
 13940  		if !(shiftIsBounded(v)) {
 13941  			break
 13942  		}
 13943  		v.reset(OpPPC64SRD)
 13944  		v.AddArg2(x, y)
 13945  		return true
 13946  	}
 13947  	// match: (Rsh64Ux16 <t> x y)
 13948  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFC0] y)))
 13949  	for {
 13950  		t := v.Type
 13951  		x := v_0
 13952  		y := v_1
 13953  		v.reset(OpPPC64ISEL)
 13954  		v.AuxInt = int32ToAuxInt(2)
 13955  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13956  		v0.AddArg2(x, y)
 13957  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13958  		v1.AuxInt = int64ToAuxInt(0)
 13959  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 13960  		v2.AuxInt = int64ToAuxInt(0)
 13961  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 13962  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 13963  		v3.AddArg(y)
 13964  		v2.AddArg(v3)
 13965  		v.AddArg3(v0, v1, v2)
 13966  		return true
 13967  	}
 13968  }
 13969  func rewriteValuePPC64_OpRsh64Ux32(v *Value) bool {
 13970  	v_1 := v.Args[1]
 13971  	v_0 := v.Args[0]
 13972  	b := v.Block
 13973  	typ := &b.Func.Config.Types
 13974  	// match: (Rsh64Ux32 x y)
 13975  	// cond: shiftIsBounded(v)
 13976  	// result: (SRD x y)
 13977  	for {
 13978  		x := v_0
 13979  		y := v_1
 13980  		if !(shiftIsBounded(v)) {
 13981  			break
 13982  		}
 13983  		v.reset(OpPPC64SRD)
 13984  		v.AddArg2(x, y)
 13985  		return true
 13986  	}
 13987  	// match: (Rsh64Ux32 <t> x y)
 13988  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPWUconst y [64]))
 13989  	for {
 13990  		t := v.Type
 13991  		x := v_0
 13992  		y := v_1
 13993  		v.reset(OpPPC64ISEL)
 13994  		v.AuxInt = int32ToAuxInt(0)
 13995  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 13996  		v0.AddArg2(x, y)
 13997  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 13998  		v1.AuxInt = int64ToAuxInt(0)
 13999  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14000  		v2.AuxInt = int32ToAuxInt(64)
 14001  		v2.AddArg(y)
 14002  		v.AddArg3(v0, v1, v2)
 14003  		return true
 14004  	}
 14005  }
 14006  func rewriteValuePPC64_OpRsh64Ux64(v *Value) bool {
 14007  	v_1 := v.Args[1]
 14008  	v_0 := v.Args[0]
 14009  	b := v.Block
 14010  	typ := &b.Func.Config.Types
 14011  	// match: (Rsh64Ux64 x (MOVDconst [c]))
 14012  	// cond: uint64(c) < 64
 14013  	// result: (SRDconst x [c])
 14014  	for {
 14015  		x := v_0
 14016  		if v_1.Op != OpPPC64MOVDconst {
 14017  			break
 14018  		}
 14019  		c := auxIntToInt64(v_1.AuxInt)
 14020  		if !(uint64(c) < 64) {
 14021  			break
 14022  		}
 14023  		v.reset(OpPPC64SRDconst)
 14024  		v.AuxInt = int64ToAuxInt(c)
 14025  		v.AddArg(x)
 14026  		return true
 14027  	}
 14028  	// match: (Rsh64Ux64 x y)
 14029  	// cond: shiftIsBounded(v)
 14030  	// result: (SRD x y)
 14031  	for {
 14032  		x := v_0
 14033  		y := v_1
 14034  		if !(shiftIsBounded(v)) {
 14035  			break
 14036  		}
 14037  		v.reset(OpPPC64SRD)
 14038  		v.AddArg2(x, y)
 14039  		return true
 14040  	}
 14041  	// match: (Rsh64Ux64 <t> x y)
 14042  	// result: (ISEL [0] (SRD <t> x y) (MOVDconst [0]) (CMPUconst y [64]))
 14043  	for {
 14044  		t := v.Type
 14045  		x := v_0
 14046  		y := v_1
 14047  		v.reset(OpPPC64ISEL)
 14048  		v.AuxInt = int32ToAuxInt(0)
 14049  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14050  		v0.AddArg2(x, y)
 14051  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14052  		v1.AuxInt = int64ToAuxInt(0)
 14053  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14054  		v2.AuxInt = int64ToAuxInt(64)
 14055  		v2.AddArg(y)
 14056  		v.AddArg3(v0, v1, v2)
 14057  		return true
 14058  	}
 14059  }
 14060  func rewriteValuePPC64_OpRsh64Ux8(v *Value) bool {
 14061  	v_1 := v.Args[1]
 14062  	v_0 := v.Args[0]
 14063  	b := v.Block
 14064  	typ := &b.Func.Config.Types
 14065  	// match: (Rsh64Ux8 x y)
 14066  	// cond: shiftIsBounded(v)
 14067  	// result: (SRD x y)
 14068  	for {
 14069  		x := v_0
 14070  		y := v_1
 14071  		if !(shiftIsBounded(v)) {
 14072  			break
 14073  		}
 14074  		v.reset(OpPPC64SRD)
 14075  		v.AddArg2(x, y)
 14076  		return true
 14077  	}
 14078  	// match: (Rsh64Ux8 <t> x y)
 14079  	// result: (ISEL [2] (SRD <t> x y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00C0] y)))
 14080  	for {
 14081  		t := v.Type
 14082  		x := v_0
 14083  		y := v_1
 14084  		v.reset(OpPPC64ISEL)
 14085  		v.AuxInt = int32ToAuxInt(2)
 14086  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14087  		v0.AddArg2(x, y)
 14088  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14089  		v1.AuxInt = int64ToAuxInt(0)
 14090  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14091  		v2.AuxInt = int64ToAuxInt(0)
 14092  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14093  		v3.AuxInt = int64ToAuxInt(0x00C0)
 14094  		v3.AddArg(y)
 14095  		v2.AddArg(v3)
 14096  		v.AddArg3(v0, v1, v2)
 14097  		return true
 14098  	}
 14099  }
 14100  func rewriteValuePPC64_OpRsh64x16(v *Value) bool {
 14101  	v_1 := v.Args[1]
 14102  	v_0 := v.Args[0]
 14103  	b := v.Block
 14104  	typ := &b.Func.Config.Types
 14105  	// match: (Rsh64x16 x y)
 14106  	// cond: shiftIsBounded(v)
 14107  	// result: (SRAD x y)
 14108  	for {
 14109  		x := v_0
 14110  		y := v_1
 14111  		if !(shiftIsBounded(v)) {
 14112  			break
 14113  		}
 14114  		v.reset(OpPPC64SRAD)
 14115  		v.AddArg2(x, y)
 14116  		return true
 14117  	}
 14118  	// match: (Rsh64x16 <t> x y)
 14119  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPconst [0] (ANDconst [0xFFC0] y)))
 14120  	for {
 14121  		t := v.Type
 14122  		x := v_0
 14123  		y := v_1
 14124  		v.reset(OpPPC64ISEL)
 14125  		v.AuxInt = int32ToAuxInt(2)
 14126  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14127  		v0.AddArg2(x, y)
 14128  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14129  		v1.AuxInt = int64ToAuxInt(63)
 14130  		v1.AddArg(x)
 14131  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14132  		v2.AuxInt = int64ToAuxInt(0)
 14133  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14134  		v3.AuxInt = int64ToAuxInt(0xFFC0)
 14135  		v3.AddArg(y)
 14136  		v2.AddArg(v3)
 14137  		v.AddArg3(v0, v1, v2)
 14138  		return true
 14139  	}
 14140  }
 14141  func rewriteValuePPC64_OpRsh64x32(v *Value) bool {
 14142  	v_1 := v.Args[1]
 14143  	v_0 := v.Args[0]
 14144  	b := v.Block
 14145  	// match: (Rsh64x32 x y)
 14146  	// cond: shiftIsBounded(v)
 14147  	// result: (SRAD x y)
 14148  	for {
 14149  		x := v_0
 14150  		y := v_1
 14151  		if !(shiftIsBounded(v)) {
 14152  			break
 14153  		}
 14154  		v.reset(OpPPC64SRAD)
 14155  		v.AddArg2(x, y)
 14156  		return true
 14157  	}
 14158  	// match: (Rsh64x32 <t> x y)
 14159  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPWUconst y [64]))
 14160  	for {
 14161  		t := v.Type
 14162  		x := v_0
 14163  		y := v_1
 14164  		v.reset(OpPPC64ISEL)
 14165  		v.AuxInt = int32ToAuxInt(0)
 14166  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14167  		v0.AddArg2(x, y)
 14168  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14169  		v1.AuxInt = int64ToAuxInt(63)
 14170  		v1.AddArg(x)
 14171  		v2 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14172  		v2.AuxInt = int32ToAuxInt(64)
 14173  		v2.AddArg(y)
 14174  		v.AddArg3(v0, v1, v2)
 14175  		return true
 14176  	}
 14177  }
 14178  func rewriteValuePPC64_OpRsh64x64(v *Value) bool {
 14179  	v_1 := v.Args[1]
 14180  	v_0 := v.Args[0]
 14181  	b := v.Block
 14182  	// match: (Rsh64x64 x (MOVDconst [c]))
 14183  	// cond: uint64(c) >= 64
 14184  	// result: (SRADconst x [63])
 14185  	for {
 14186  		x := v_0
 14187  		if v_1.Op != OpPPC64MOVDconst {
 14188  			break
 14189  		}
 14190  		c := auxIntToInt64(v_1.AuxInt)
 14191  		if !(uint64(c) >= 64) {
 14192  			break
 14193  		}
 14194  		v.reset(OpPPC64SRADconst)
 14195  		v.AuxInt = int64ToAuxInt(63)
 14196  		v.AddArg(x)
 14197  		return true
 14198  	}
 14199  	// match: (Rsh64x64 x (MOVDconst [c]))
 14200  	// cond: uint64(c) < 64
 14201  	// result: (SRADconst x [c])
 14202  	for {
 14203  		x := v_0
 14204  		if v_1.Op != OpPPC64MOVDconst {
 14205  			break
 14206  		}
 14207  		c := auxIntToInt64(v_1.AuxInt)
 14208  		if !(uint64(c) < 64) {
 14209  			break
 14210  		}
 14211  		v.reset(OpPPC64SRADconst)
 14212  		v.AuxInt = int64ToAuxInt(c)
 14213  		v.AddArg(x)
 14214  		return true
 14215  	}
 14216  	// match: (Rsh64x64 x y)
 14217  	// cond: shiftIsBounded(v)
 14218  	// result: (SRAD x y)
 14219  	for {
 14220  		x := v_0
 14221  		y := v_1
 14222  		if !(shiftIsBounded(v)) {
 14223  			break
 14224  		}
 14225  		v.reset(OpPPC64SRAD)
 14226  		v.AddArg2(x, y)
 14227  		return true
 14228  	}
 14229  	// match: (Rsh64x64 <t> x y)
 14230  	// result: (ISEL [0] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPUconst y [64]))
 14231  	for {
 14232  		t := v.Type
 14233  		x := v_0
 14234  		y := v_1
 14235  		v.reset(OpPPC64ISEL)
 14236  		v.AuxInt = int32ToAuxInt(0)
 14237  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14238  		v0.AddArg2(x, y)
 14239  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14240  		v1.AuxInt = int64ToAuxInt(63)
 14241  		v1.AddArg(x)
 14242  		v2 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14243  		v2.AuxInt = int64ToAuxInt(64)
 14244  		v2.AddArg(y)
 14245  		v.AddArg3(v0, v1, v2)
 14246  		return true
 14247  	}
 14248  }
 14249  func rewriteValuePPC64_OpRsh64x8(v *Value) bool {
 14250  	v_1 := v.Args[1]
 14251  	v_0 := v.Args[0]
 14252  	b := v.Block
 14253  	typ := &b.Func.Config.Types
 14254  	// match: (Rsh64x8 x y)
 14255  	// cond: shiftIsBounded(v)
 14256  	// result: (SRAD x y)
 14257  	for {
 14258  		x := v_0
 14259  		y := v_1
 14260  		if !(shiftIsBounded(v)) {
 14261  			break
 14262  		}
 14263  		v.reset(OpPPC64SRAD)
 14264  		v.AddArg2(x, y)
 14265  		return true
 14266  	}
 14267  	// match: (Rsh64x8 <t> x y)
 14268  	// result: (ISEL [2] (SRAD <t> x y) (SRADconst <t> x [63]) (CMPconst [0] (ANDconst [0x00C0] y)))
 14269  	for {
 14270  		t := v.Type
 14271  		x := v_0
 14272  		y := v_1
 14273  		v.reset(OpPPC64ISEL)
 14274  		v.AuxInt = int32ToAuxInt(2)
 14275  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14276  		v0.AddArg2(x, y)
 14277  		v1 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14278  		v1.AuxInt = int64ToAuxInt(63)
 14279  		v1.AddArg(x)
 14280  		v2 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14281  		v2.AuxInt = int64ToAuxInt(0)
 14282  		v3 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14283  		v3.AuxInt = int64ToAuxInt(0x00C0)
 14284  		v3.AddArg(y)
 14285  		v2.AddArg(v3)
 14286  		v.AddArg3(v0, v1, v2)
 14287  		return true
 14288  	}
 14289  }
 14290  func rewriteValuePPC64_OpRsh8Ux16(v *Value) bool {
 14291  	v_1 := v.Args[1]
 14292  	v_0 := v.Args[0]
 14293  	b := v.Block
 14294  	typ := &b.Func.Config.Types
 14295  	// match: (Rsh8Ux16 x y)
 14296  	// cond: shiftIsBounded(v)
 14297  	// result: (SRD (MOVBZreg x) y)
 14298  	for {
 14299  		x := v_0
 14300  		y := v_1
 14301  		if !(shiftIsBounded(v)) {
 14302  			break
 14303  		}
 14304  		v.reset(OpPPC64SRD)
 14305  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14306  		v0.AddArg(x)
 14307  		v.AddArg2(v0, y)
 14308  		return true
 14309  	}
 14310  	// match: (Rsh8Ux16 <t> x y)
 14311  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0xFFF8] y)))
 14312  	for {
 14313  		t := v.Type
 14314  		x := v_0
 14315  		y := v_1
 14316  		v.reset(OpPPC64ISEL)
 14317  		v.AuxInt = int32ToAuxInt(2)
 14318  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14319  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14320  		v1.AddArg(x)
 14321  		v0.AddArg2(v1, y)
 14322  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14323  		v2.AuxInt = int64ToAuxInt(0)
 14324  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14325  		v3.AuxInt = int64ToAuxInt(0)
 14326  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14327  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14328  		v4.AddArg(y)
 14329  		v3.AddArg(v4)
 14330  		v.AddArg3(v0, v2, v3)
 14331  		return true
 14332  	}
 14333  }
 14334  func rewriteValuePPC64_OpRsh8Ux32(v *Value) bool {
 14335  	v_1 := v.Args[1]
 14336  	v_0 := v.Args[0]
 14337  	b := v.Block
 14338  	typ := &b.Func.Config.Types
 14339  	// match: (Rsh8Ux32 x y)
 14340  	// cond: shiftIsBounded(v)
 14341  	// result: (SRD (MOVBZreg x) y)
 14342  	for {
 14343  		x := v_0
 14344  		y := v_1
 14345  		if !(shiftIsBounded(v)) {
 14346  			break
 14347  		}
 14348  		v.reset(OpPPC64SRD)
 14349  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14350  		v0.AddArg(x)
 14351  		v.AddArg2(v0, y)
 14352  		return true
 14353  	}
 14354  	// match: (Rsh8Ux32 <t> x y)
 14355  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPWUconst y [8]))
 14356  	for {
 14357  		t := v.Type
 14358  		x := v_0
 14359  		y := v_1
 14360  		v.reset(OpPPC64ISEL)
 14361  		v.AuxInt = int32ToAuxInt(0)
 14362  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14363  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14364  		v1.AddArg(x)
 14365  		v0.AddArg2(v1, y)
 14366  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14367  		v2.AuxInt = int64ToAuxInt(0)
 14368  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14369  		v3.AuxInt = int32ToAuxInt(8)
 14370  		v3.AddArg(y)
 14371  		v.AddArg3(v0, v2, v3)
 14372  		return true
 14373  	}
 14374  }
 14375  func rewriteValuePPC64_OpRsh8Ux64(v *Value) bool {
 14376  	v_1 := v.Args[1]
 14377  	v_0 := v.Args[0]
 14378  	b := v.Block
 14379  	typ := &b.Func.Config.Types
 14380  	// match: (Rsh8Ux64 x (MOVDconst [c]))
 14381  	// cond: uint64(c) < 8
 14382  	// result: (SRWconst (ZeroExt8to32 x) [c])
 14383  	for {
 14384  		x := v_0
 14385  		if v_1.Op != OpPPC64MOVDconst {
 14386  			break
 14387  		}
 14388  		c := auxIntToInt64(v_1.AuxInt)
 14389  		if !(uint64(c) < 8) {
 14390  			break
 14391  		}
 14392  		v.reset(OpPPC64SRWconst)
 14393  		v.AuxInt = int64ToAuxInt(c)
 14394  		v0 := b.NewValue0(v.Pos, OpZeroExt8to32, typ.UInt32)
 14395  		v0.AddArg(x)
 14396  		v.AddArg(v0)
 14397  		return true
 14398  	}
 14399  	// match: (Rsh8Ux64 x y)
 14400  	// cond: shiftIsBounded(v)
 14401  	// result: (SRD (MOVBZreg x) y)
 14402  	for {
 14403  		x := v_0
 14404  		y := v_1
 14405  		if !(shiftIsBounded(v)) {
 14406  			break
 14407  		}
 14408  		v.reset(OpPPC64SRD)
 14409  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14410  		v0.AddArg(x)
 14411  		v.AddArg2(v0, y)
 14412  		return true
 14413  	}
 14414  	// match: (Rsh8Ux64 <t> x y)
 14415  	// result: (ISEL [0] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPUconst y [8]))
 14416  	for {
 14417  		t := v.Type
 14418  		x := v_0
 14419  		y := v_1
 14420  		v.reset(OpPPC64ISEL)
 14421  		v.AuxInt = int32ToAuxInt(0)
 14422  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14423  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14424  		v1.AddArg(x)
 14425  		v0.AddArg2(v1, y)
 14426  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14427  		v2.AuxInt = int64ToAuxInt(0)
 14428  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14429  		v3.AuxInt = int64ToAuxInt(8)
 14430  		v3.AddArg(y)
 14431  		v.AddArg3(v0, v2, v3)
 14432  		return true
 14433  	}
 14434  }
 14435  func rewriteValuePPC64_OpRsh8Ux8(v *Value) bool {
 14436  	v_1 := v.Args[1]
 14437  	v_0 := v.Args[0]
 14438  	b := v.Block
 14439  	typ := &b.Func.Config.Types
 14440  	// match: (Rsh8Ux8 x y)
 14441  	// cond: shiftIsBounded(v)
 14442  	// result: (SRD (MOVBZreg x) y)
 14443  	for {
 14444  		x := v_0
 14445  		y := v_1
 14446  		if !(shiftIsBounded(v)) {
 14447  			break
 14448  		}
 14449  		v.reset(OpPPC64SRD)
 14450  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14451  		v0.AddArg(x)
 14452  		v.AddArg2(v0, y)
 14453  		return true
 14454  	}
 14455  	// match: (Rsh8Ux8 <t> x y)
 14456  	// result: (ISEL [2] (SRD <t> (MOVBZreg x) y) (MOVDconst [0]) (CMPconst [0] (ANDconst [0x00F8] y)))
 14457  	for {
 14458  		t := v.Type
 14459  		x := v_0
 14460  		y := v_1
 14461  		v.reset(OpPPC64ISEL)
 14462  		v.AuxInt = int32ToAuxInt(2)
 14463  		v0 := b.NewValue0(v.Pos, OpPPC64SRD, t)
 14464  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBZreg, typ.Int64)
 14465  		v1.AddArg(x)
 14466  		v0.AddArg2(v1, y)
 14467  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDconst, typ.Int64)
 14468  		v2.AuxInt = int64ToAuxInt(0)
 14469  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14470  		v3.AuxInt = int64ToAuxInt(0)
 14471  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14472  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14473  		v4.AddArg(y)
 14474  		v3.AddArg(v4)
 14475  		v.AddArg3(v0, v2, v3)
 14476  		return true
 14477  	}
 14478  }
 14479  func rewriteValuePPC64_OpRsh8x16(v *Value) bool {
 14480  	v_1 := v.Args[1]
 14481  	v_0 := v.Args[0]
 14482  	b := v.Block
 14483  	typ := &b.Func.Config.Types
 14484  	// match: (Rsh8x16 x y)
 14485  	// cond: shiftIsBounded(v)
 14486  	// result: (SRAD (MOVBreg x) y)
 14487  	for {
 14488  		x := v_0
 14489  		y := v_1
 14490  		if !(shiftIsBounded(v)) {
 14491  			break
 14492  		}
 14493  		v.reset(OpPPC64SRAD)
 14494  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14495  		v0.AddArg(x)
 14496  		v.AddArg2(v0, y)
 14497  		return true
 14498  	}
 14499  	// match: (Rsh8x16 <t> x y)
 14500  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPconst [0] (ANDconst [0xFFF8] y)))
 14501  	for {
 14502  		t := v.Type
 14503  		x := v_0
 14504  		y := v_1
 14505  		v.reset(OpPPC64ISEL)
 14506  		v.AuxInt = int32ToAuxInt(2)
 14507  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14508  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14509  		v1.AddArg(x)
 14510  		v0.AddArg2(v1, y)
 14511  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14512  		v2.AuxInt = int64ToAuxInt(7)
 14513  		v2.AddArg(v1)
 14514  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14515  		v3.AuxInt = int64ToAuxInt(0)
 14516  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14517  		v4.AuxInt = int64ToAuxInt(0xFFF8)
 14518  		v4.AddArg(y)
 14519  		v3.AddArg(v4)
 14520  		v.AddArg3(v0, v2, v3)
 14521  		return true
 14522  	}
 14523  }
 14524  func rewriteValuePPC64_OpRsh8x32(v *Value) bool {
 14525  	v_1 := v.Args[1]
 14526  	v_0 := v.Args[0]
 14527  	b := v.Block
 14528  	typ := &b.Func.Config.Types
 14529  	// match: (Rsh8x32 x y)
 14530  	// cond: shiftIsBounded(v)
 14531  	// result: (SRAD (MOVBreg x) y)
 14532  	for {
 14533  		x := v_0
 14534  		y := v_1
 14535  		if !(shiftIsBounded(v)) {
 14536  			break
 14537  		}
 14538  		v.reset(OpPPC64SRAD)
 14539  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14540  		v0.AddArg(x)
 14541  		v.AddArg2(v0, y)
 14542  		return true
 14543  	}
 14544  	// match: (Rsh8x32 <t> x y)
 14545  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPWUconst y [8]))
 14546  	for {
 14547  		t := v.Type
 14548  		x := v_0
 14549  		y := v_1
 14550  		v.reset(OpPPC64ISEL)
 14551  		v.AuxInt = int32ToAuxInt(0)
 14552  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14553  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14554  		v1.AddArg(x)
 14555  		v0.AddArg2(v1, y)
 14556  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14557  		v2.AuxInt = int64ToAuxInt(7)
 14558  		v2.AddArg(v1)
 14559  		v3 := b.NewValue0(v.Pos, OpPPC64CMPWUconst, types.TypeFlags)
 14560  		v3.AuxInt = int32ToAuxInt(8)
 14561  		v3.AddArg(y)
 14562  		v.AddArg3(v0, v2, v3)
 14563  		return true
 14564  	}
 14565  }
 14566  func rewriteValuePPC64_OpRsh8x64(v *Value) bool {
 14567  	v_1 := v.Args[1]
 14568  	v_0 := v.Args[0]
 14569  	b := v.Block
 14570  	typ := &b.Func.Config.Types
 14571  	// match: (Rsh8x64 x (MOVDconst [c]))
 14572  	// cond: uint64(c) >= 8
 14573  	// result: (SRAWconst (SignExt8to32 x) [63])
 14574  	for {
 14575  		x := v_0
 14576  		if v_1.Op != OpPPC64MOVDconst {
 14577  			break
 14578  		}
 14579  		c := auxIntToInt64(v_1.AuxInt)
 14580  		if !(uint64(c) >= 8) {
 14581  			break
 14582  		}
 14583  		v.reset(OpPPC64SRAWconst)
 14584  		v.AuxInt = int64ToAuxInt(63)
 14585  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14586  		v0.AddArg(x)
 14587  		v.AddArg(v0)
 14588  		return true
 14589  	}
 14590  	// match: (Rsh8x64 x (MOVDconst [c]))
 14591  	// cond: uint64(c) < 8
 14592  	// result: (SRAWconst (SignExt8to32 x) [c])
 14593  	for {
 14594  		x := v_0
 14595  		if v_1.Op != OpPPC64MOVDconst {
 14596  			break
 14597  		}
 14598  		c := auxIntToInt64(v_1.AuxInt)
 14599  		if !(uint64(c) < 8) {
 14600  			break
 14601  		}
 14602  		v.reset(OpPPC64SRAWconst)
 14603  		v.AuxInt = int64ToAuxInt(c)
 14604  		v0 := b.NewValue0(v.Pos, OpSignExt8to32, typ.Int32)
 14605  		v0.AddArg(x)
 14606  		v.AddArg(v0)
 14607  		return true
 14608  	}
 14609  	// match: (Rsh8x64 x y)
 14610  	// cond: shiftIsBounded(v)
 14611  	// result: (SRAD (MOVBreg x) y)
 14612  	for {
 14613  		x := v_0
 14614  		y := v_1
 14615  		if !(shiftIsBounded(v)) {
 14616  			break
 14617  		}
 14618  		v.reset(OpPPC64SRAD)
 14619  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14620  		v0.AddArg(x)
 14621  		v.AddArg2(v0, y)
 14622  		return true
 14623  	}
 14624  	// match: (Rsh8x64 <t> x y)
 14625  	// result: (ISEL [0] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPUconst y [8]))
 14626  	for {
 14627  		t := v.Type
 14628  		x := v_0
 14629  		y := v_1
 14630  		v.reset(OpPPC64ISEL)
 14631  		v.AuxInt = int32ToAuxInt(0)
 14632  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14633  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14634  		v1.AddArg(x)
 14635  		v0.AddArg2(v1, y)
 14636  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14637  		v2.AuxInt = int64ToAuxInt(7)
 14638  		v2.AddArg(v1)
 14639  		v3 := b.NewValue0(v.Pos, OpPPC64CMPUconst, types.TypeFlags)
 14640  		v3.AuxInt = int64ToAuxInt(8)
 14641  		v3.AddArg(y)
 14642  		v.AddArg3(v0, v2, v3)
 14643  		return true
 14644  	}
 14645  }
 14646  func rewriteValuePPC64_OpRsh8x8(v *Value) bool {
 14647  	v_1 := v.Args[1]
 14648  	v_0 := v.Args[0]
 14649  	b := v.Block
 14650  	typ := &b.Func.Config.Types
 14651  	// match: (Rsh8x8 x y)
 14652  	// cond: shiftIsBounded(v)
 14653  	// result: (SRAD (MOVBreg x) y)
 14654  	for {
 14655  		x := v_0
 14656  		y := v_1
 14657  		if !(shiftIsBounded(v)) {
 14658  			break
 14659  		}
 14660  		v.reset(OpPPC64SRAD)
 14661  		v0 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14662  		v0.AddArg(x)
 14663  		v.AddArg2(v0, y)
 14664  		return true
 14665  	}
 14666  	// match: (Rsh8x8 <t> x y)
 14667  	// result: (ISEL [2] (SRAD <t> (MOVBreg x) y) (SRADconst <t> (MOVBreg x) [7]) (CMPconst [0] (ANDconst [0x00F8] y)))
 14668  	for {
 14669  		t := v.Type
 14670  		x := v_0
 14671  		y := v_1
 14672  		v.reset(OpPPC64ISEL)
 14673  		v.AuxInt = int32ToAuxInt(2)
 14674  		v0 := b.NewValue0(v.Pos, OpPPC64SRAD, t)
 14675  		v1 := b.NewValue0(v.Pos, OpPPC64MOVBreg, typ.Int64)
 14676  		v1.AddArg(x)
 14677  		v0.AddArg2(v1, y)
 14678  		v2 := b.NewValue0(v.Pos, OpPPC64SRADconst, t)
 14679  		v2.AuxInt = int64ToAuxInt(7)
 14680  		v2.AddArg(v1)
 14681  		v3 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14682  		v3.AuxInt = int64ToAuxInt(0)
 14683  		v4 := b.NewValue0(v.Pos, OpPPC64ANDconst, typ.Int)
 14684  		v4.AuxInt = int64ToAuxInt(0x00F8)
 14685  		v4.AddArg(y)
 14686  		v3.AddArg(v4)
 14687  		v.AddArg3(v0, v2, v3)
 14688  		return true
 14689  	}
 14690  }
 14691  func rewriteValuePPC64_OpSelect0(v *Value) bool {
 14692  	v_0 := v.Args[0]
 14693  	b := v.Block
 14694  	typ := &b.Func.Config.Types
 14695  	// match: (Select0 (Mul64uhilo x y))
 14696  	// result: (MULHDU x y)
 14697  	for {
 14698  		if v_0.Op != OpMul64uhilo {
 14699  			break
 14700  		}
 14701  		y := v_0.Args[1]
 14702  		x := v_0.Args[0]
 14703  		v.reset(OpPPC64MULHDU)
 14704  		v.AddArg2(x, y)
 14705  		return true
 14706  	}
 14707  	// match: (Select0 (Mul64uover x y))
 14708  	// result: (MULLD x y)
 14709  	for {
 14710  		if v_0.Op != OpMul64uover {
 14711  			break
 14712  		}
 14713  		y := v_0.Args[1]
 14714  		x := v_0.Args[0]
 14715  		v.reset(OpPPC64MULLD)
 14716  		v.AddArg2(x, y)
 14717  		return true
 14718  	}
 14719  	// match: (Select0 (Add64carry x y c))
 14720  	// result: (Select0 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1]))))
 14721  	for {
 14722  		if v_0.Op != OpAdd64carry {
 14723  			break
 14724  		}
 14725  		c := v_0.Args[2]
 14726  		x := v_0.Args[0]
 14727  		y := v_0.Args[1]
 14728  		v.reset(OpSelect0)
 14729  		v.Type = typ.UInt64
 14730  		v0 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 14731  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14732  		v2 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14733  		v2.AuxInt = int64ToAuxInt(-1)
 14734  		v2.AddArg(c)
 14735  		v1.AddArg(v2)
 14736  		v0.AddArg3(x, y, v1)
 14737  		v.AddArg(v0)
 14738  		return true
 14739  	}
 14740  	// match: (Select0 (Sub64borrow x y c))
 14741  	// result: (Select0 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))
 14742  	for {
 14743  		if v_0.Op != OpSub64borrow {
 14744  			break
 14745  		}
 14746  		c := v_0.Args[2]
 14747  		x := v_0.Args[0]
 14748  		y := v_0.Args[1]
 14749  		v.reset(OpSelect0)
 14750  		v.Type = typ.UInt64
 14751  		v0 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 14752  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14753  		v2 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14754  		v2.AuxInt = int64ToAuxInt(0)
 14755  		v2.AddArg(c)
 14756  		v1.AddArg(v2)
 14757  		v0.AddArg3(x, y, v1)
 14758  		v.AddArg(v0)
 14759  		return true
 14760  	}
 14761  	return false
 14762  }
 14763  func rewriteValuePPC64_OpSelect1(v *Value) bool {
 14764  	v_0 := v.Args[0]
 14765  	b := v.Block
 14766  	typ := &b.Func.Config.Types
 14767  	// match: (Select1 (Mul64uhilo x y))
 14768  	// result: (MULLD x y)
 14769  	for {
 14770  		if v_0.Op != OpMul64uhilo {
 14771  			break
 14772  		}
 14773  		y := v_0.Args[1]
 14774  		x := v_0.Args[0]
 14775  		v.reset(OpPPC64MULLD)
 14776  		v.AddArg2(x, y)
 14777  		return true
 14778  	}
 14779  	// match: (Select1 (Mul64uover x y))
 14780  	// result: (SETBCR [2] (CMPconst [0] (MULHDU <x.Type> x y)))
 14781  	for {
 14782  		if v_0.Op != OpMul64uover {
 14783  			break
 14784  		}
 14785  		y := v_0.Args[1]
 14786  		x := v_0.Args[0]
 14787  		v.reset(OpPPC64SETBCR)
 14788  		v.AuxInt = int32ToAuxInt(2)
 14789  		v0 := b.NewValue0(v.Pos, OpPPC64CMPconst, types.TypeFlags)
 14790  		v0.AuxInt = int64ToAuxInt(0)
 14791  		v1 := b.NewValue0(v.Pos, OpPPC64MULHDU, x.Type)
 14792  		v1.AddArg2(x, y)
 14793  		v0.AddArg(v1)
 14794  		v.AddArg(v0)
 14795  		return true
 14796  	}
 14797  	// match: (Select1 (Add64carry x y c))
 14798  	// result: (ADDZEzero (Select1 <typ.UInt64> (ADDE x y (Select1 <typ.UInt64> (ADDCconst c [-1])))))
 14799  	for {
 14800  		if v_0.Op != OpAdd64carry {
 14801  			break
 14802  		}
 14803  		c := v_0.Args[2]
 14804  		x := v_0.Args[0]
 14805  		y := v_0.Args[1]
 14806  		v.reset(OpPPC64ADDZEzero)
 14807  		v0 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14808  		v1 := b.NewValue0(v.Pos, OpPPC64ADDE, types.NewTuple(typ.UInt64, typ.UInt64))
 14809  		v2 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14810  		v3 := b.NewValue0(v.Pos, OpPPC64ADDCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14811  		v3.AuxInt = int64ToAuxInt(-1)
 14812  		v3.AddArg(c)
 14813  		v2.AddArg(v3)
 14814  		v1.AddArg3(x, y, v2)
 14815  		v0.AddArg(v1)
 14816  		v.AddArg(v0)
 14817  		return true
 14818  	}
 14819  	// match: (Select1 (ADDCconst n:(ADDZEzero x) [-1]))
 14820  	// cond: n.Uses <= 2
 14821  	// result: x
 14822  	for {
 14823  		if v_0.Op != OpPPC64ADDCconst || auxIntToInt64(v_0.AuxInt) != -1 {
 14824  			break
 14825  		}
 14826  		n := v_0.Args[0]
 14827  		if n.Op != OpPPC64ADDZEzero {
 14828  			break
 14829  		}
 14830  		x := n.Args[0]
 14831  		if !(n.Uses <= 2) {
 14832  			break
 14833  		}
 14834  		v.copyOf(x)
 14835  		return true
 14836  	}
 14837  	// match: (Select1 (Sub64borrow x y c))
 14838  	// result: (NEG (SUBZEzero (Select1 <typ.UInt64> (SUBE x y (Select1 <typ.UInt64> (SUBCconst c [0]))))))
 14839  	for {
 14840  		if v_0.Op != OpSub64borrow {
 14841  			break
 14842  		}
 14843  		c := v_0.Args[2]
 14844  		x := v_0.Args[0]
 14845  		y := v_0.Args[1]
 14846  		v.reset(OpPPC64NEG)
 14847  		v0 := b.NewValue0(v.Pos, OpPPC64SUBZEzero, typ.UInt64)
 14848  		v1 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14849  		v2 := b.NewValue0(v.Pos, OpPPC64SUBE, types.NewTuple(typ.UInt64, typ.UInt64))
 14850  		v3 := b.NewValue0(v.Pos, OpSelect1, typ.UInt64)
 14851  		v4 := b.NewValue0(v.Pos, OpPPC64SUBCconst, types.NewTuple(typ.UInt64, typ.UInt64))
 14852  		v4.AuxInt = int64ToAuxInt(0)
 14853  		v4.AddArg(c)
 14854  		v3.AddArg(v4)
 14855  		v2.AddArg3(x, y, v3)
 14856  		v1.AddArg(v2)
 14857  		v0.AddArg(v1)
 14858  		v.AddArg(v0)
 14859  		return true
 14860  	}
 14861  	// match: (Select1 (SUBCconst n:(NEG (SUBZEzero x)) [0]))
 14862  	// cond: n.Uses <= 2
 14863  	// result: x
 14864  	for {
 14865  		if v_0.Op != OpPPC64SUBCconst || auxIntToInt64(v_0.AuxInt) != 0 {
 14866  			break
 14867  		}
 14868  		n := v_0.Args[0]
 14869  		if n.Op != OpPPC64NEG {
 14870  			break
 14871  		}
 14872  		n_0 := n.Args[0]
 14873  		if n_0.Op != OpPPC64SUBZEzero {
 14874  			break
 14875  		}
 14876  		x := n_0.Args[0]
 14877  		if !(n.Uses <= 2) {
 14878  			break
 14879  		}
 14880  		v.copyOf(x)
 14881  		return true
 14882  	}
 14883  	return false
 14884  }
 14885  func rewriteValuePPC64_OpSelectN(v *Value) bool {
 14886  	v_0 := v.Args[0]
 14887  	b := v.Block
 14888  	config := b.Func.Config
 14889  	// match: (SelectN [0] call:(CALLstatic {sym} s1:(MOVDstore _ (MOVDconst [sz]) s2:(MOVDstore _ src s3:(MOVDstore {t} _ dst mem)))))
 14890  	// 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)
 14891  	// result: (Move [sz] dst src mem)
 14892  	for {
 14893  		if auxIntToInt64(v.AuxInt) != 0 {
 14894  			break
 14895  		}
 14896  		call := v_0
 14897  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 1 {
 14898  			break
 14899  		}
 14900  		sym := auxToCall(call.Aux)
 14901  		s1 := call.Args[0]
 14902  		if s1.Op != OpPPC64MOVDstore {
 14903  			break
 14904  		}
 14905  		_ = s1.Args[2]
 14906  		s1_1 := s1.Args[1]
 14907  		if s1_1.Op != OpPPC64MOVDconst {
 14908  			break
 14909  		}
 14910  		sz := auxIntToInt64(s1_1.AuxInt)
 14911  		s2 := s1.Args[2]
 14912  		if s2.Op != OpPPC64MOVDstore {
 14913  			break
 14914  		}
 14915  		_ = s2.Args[2]
 14916  		src := s2.Args[1]
 14917  		s3 := s2.Args[2]
 14918  		if s3.Op != OpPPC64MOVDstore {
 14919  			break
 14920  		}
 14921  		mem := s3.Args[2]
 14922  		dst := s3.Args[1]
 14923  		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)) {
 14924  			break
 14925  		}
 14926  		v.reset(OpMove)
 14927  		v.AuxInt = int64ToAuxInt(sz)
 14928  		v.AddArg3(dst, src, mem)
 14929  		return true
 14930  	}
 14931  	// match: (SelectN [0] call:(CALLstatic {sym} dst src (MOVDconst [sz]) mem))
 14932  	// cond: sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)
 14933  	// result: (Move [sz] dst src mem)
 14934  	for {
 14935  		if auxIntToInt64(v.AuxInt) != 0 {
 14936  			break
 14937  		}
 14938  		call := v_0
 14939  		if call.Op != OpPPC64CALLstatic || len(call.Args) != 4 {
 14940  			break
 14941  		}
 14942  		sym := auxToCall(call.Aux)
 14943  		mem := call.Args[3]
 14944  		dst := call.Args[0]
 14945  		src := call.Args[1]
 14946  		call_2 := call.Args[2]
 14947  		if call_2.Op != OpPPC64MOVDconst {
 14948  			break
 14949  		}
 14950  		sz := auxIntToInt64(call_2.AuxInt)
 14951  		if !(sz >= 0 && isSameCall(sym, "runtime.memmove") && call.Uses == 1 && isInlinableMemmove(dst, src, sz, config) && clobber(call)) {
 14952  			break
 14953  		}
 14954  		v.reset(OpMove)
 14955  		v.AuxInt = int64ToAuxInt(sz)
 14956  		v.AddArg3(dst, src, mem)
 14957  		return true
 14958  	}
 14959  	return false
 14960  }
 14961  func rewriteValuePPC64_OpSlicemask(v *Value) bool {
 14962  	v_0 := v.Args[0]
 14963  	b := v.Block
 14964  	// match: (Slicemask <t> x)
 14965  	// result: (SRADconst (NEG <t> x) [63])
 14966  	for {
 14967  		t := v.Type
 14968  		x := v_0
 14969  		v.reset(OpPPC64SRADconst)
 14970  		v.AuxInt = int64ToAuxInt(63)
 14971  		v0 := b.NewValue0(v.Pos, OpPPC64NEG, t)
 14972  		v0.AddArg(x)
 14973  		v.AddArg(v0)
 14974  		return true
 14975  	}
 14976  }
 14977  func rewriteValuePPC64_OpStore(v *Value) bool {
 14978  	v_2 := v.Args[2]
 14979  	v_1 := v.Args[1]
 14980  	v_0 := v.Args[0]
 14981  	// match: (Store {t} ptr val mem)
 14982  	// cond: t.Size() == 8 && t.IsFloat()
 14983  	// result: (FMOVDstore ptr val mem)
 14984  	for {
 14985  		t := auxToType(v.Aux)
 14986  		ptr := v_0
 14987  		val := v_1
 14988  		mem := v_2
 14989  		if !(t.Size() == 8 && t.IsFloat()) {
 14990  			break
 14991  		}
 14992  		v.reset(OpPPC64FMOVDstore)
 14993  		v.AddArg3(ptr, val, mem)
 14994  		return true
 14995  	}
 14996  	// match: (Store {t} ptr val mem)
 14997  	// cond: t.Size() == 4 && t.IsFloat()
 14998  	// result: (FMOVSstore ptr val mem)
 14999  	for {
 15000  		t := auxToType(v.Aux)
 15001  		ptr := v_0
 15002  		val := v_1
 15003  		mem := v_2
 15004  		if !(t.Size() == 4 && t.IsFloat()) {
 15005  			break
 15006  		}
 15007  		v.reset(OpPPC64FMOVSstore)
 15008  		v.AddArg3(ptr, val, mem)
 15009  		return true
 15010  	}
 15011  	// match: (Store {t} ptr val mem)
 15012  	// cond: t.Size() == 8 && !t.IsFloat()
 15013  	// result: (MOVDstore ptr val mem)
 15014  	for {
 15015  		t := auxToType(v.Aux)
 15016  		ptr := v_0
 15017  		val := v_1
 15018  		mem := v_2
 15019  		if !(t.Size() == 8 && !t.IsFloat()) {
 15020  			break
 15021  		}
 15022  		v.reset(OpPPC64MOVDstore)
 15023  		v.AddArg3(ptr, val, mem)
 15024  		return true
 15025  	}
 15026  	// match: (Store {t} ptr val mem)
 15027  	// cond: t.Size() == 4 && !t.IsFloat()
 15028  	// result: (MOVWstore ptr val mem)
 15029  	for {
 15030  		t := auxToType(v.Aux)
 15031  		ptr := v_0
 15032  		val := v_1
 15033  		mem := v_2
 15034  		if !(t.Size() == 4 && !t.IsFloat()) {
 15035  			break
 15036  		}
 15037  		v.reset(OpPPC64MOVWstore)
 15038  		v.AddArg3(ptr, val, mem)
 15039  		return true
 15040  	}
 15041  	// match: (Store {t} ptr val mem)
 15042  	// cond: t.Size() == 2
 15043  	// result: (MOVHstore ptr val mem)
 15044  	for {
 15045  		t := auxToType(v.Aux)
 15046  		ptr := v_0
 15047  		val := v_1
 15048  		mem := v_2
 15049  		if !(t.Size() == 2) {
 15050  			break
 15051  		}
 15052  		v.reset(OpPPC64MOVHstore)
 15053  		v.AddArg3(ptr, val, mem)
 15054  		return true
 15055  	}
 15056  	// match: (Store {t} ptr val mem)
 15057  	// cond: t.Size() == 1
 15058  	// result: (MOVBstore ptr val mem)
 15059  	for {
 15060  		t := auxToType(v.Aux)
 15061  		ptr := v_0
 15062  		val := v_1
 15063  		mem := v_2
 15064  		if !(t.Size() == 1) {
 15065  			break
 15066  		}
 15067  		v.reset(OpPPC64MOVBstore)
 15068  		v.AddArg3(ptr, val, mem)
 15069  		return true
 15070  	}
 15071  	return false
 15072  }
 15073  func rewriteValuePPC64_OpTrunc16to8(v *Value) bool {
 15074  	v_0 := v.Args[0]
 15075  	// match: (Trunc16to8 <t> x)
 15076  	// cond: t.IsSigned()
 15077  	// result: (MOVBreg x)
 15078  	for {
 15079  		t := v.Type
 15080  		x := v_0
 15081  		if !(t.IsSigned()) {
 15082  			break
 15083  		}
 15084  		v.reset(OpPPC64MOVBreg)
 15085  		v.AddArg(x)
 15086  		return true
 15087  	}
 15088  	// match: (Trunc16to8 x)
 15089  	// result: (MOVBZreg x)
 15090  	for {
 15091  		x := v_0
 15092  		v.reset(OpPPC64MOVBZreg)
 15093  		v.AddArg(x)
 15094  		return true
 15095  	}
 15096  }
 15097  func rewriteValuePPC64_OpTrunc32to16(v *Value) bool {
 15098  	v_0 := v.Args[0]
 15099  	// match: (Trunc32to16 <t> x)
 15100  	// cond: t.IsSigned()
 15101  	// result: (MOVHreg x)
 15102  	for {
 15103  		t := v.Type
 15104  		x := v_0
 15105  		if !(t.IsSigned()) {
 15106  			break
 15107  		}
 15108  		v.reset(OpPPC64MOVHreg)
 15109  		v.AddArg(x)
 15110  		return true
 15111  	}
 15112  	// match: (Trunc32to16 x)
 15113  	// result: (MOVHZreg x)
 15114  	for {
 15115  		x := v_0
 15116  		v.reset(OpPPC64MOVHZreg)
 15117  		v.AddArg(x)
 15118  		return true
 15119  	}
 15120  }
 15121  func rewriteValuePPC64_OpTrunc32to8(v *Value) bool {
 15122  	v_0 := v.Args[0]
 15123  	// match: (Trunc32to8 <t> x)
 15124  	// cond: t.IsSigned()
 15125  	// result: (MOVBreg x)
 15126  	for {
 15127  		t := v.Type
 15128  		x := v_0
 15129  		if !(t.IsSigned()) {
 15130  			break
 15131  		}
 15132  		v.reset(OpPPC64MOVBreg)
 15133  		v.AddArg(x)
 15134  		return true
 15135  	}
 15136  	// match: (Trunc32to8 x)
 15137  	// result: (MOVBZreg x)
 15138  	for {
 15139  		x := v_0
 15140  		v.reset(OpPPC64MOVBZreg)
 15141  		v.AddArg(x)
 15142  		return true
 15143  	}
 15144  }
 15145  func rewriteValuePPC64_OpTrunc64to16(v *Value) bool {
 15146  	v_0 := v.Args[0]
 15147  	// match: (Trunc64to16 <t> x)
 15148  	// cond: t.IsSigned()
 15149  	// result: (MOVHreg x)
 15150  	for {
 15151  		t := v.Type
 15152  		x := v_0
 15153  		if !(t.IsSigned()) {
 15154  			break
 15155  		}
 15156  		v.reset(OpPPC64MOVHreg)
 15157  		v.AddArg(x)
 15158  		return true
 15159  	}
 15160  	// match: (Trunc64to16 x)
 15161  	// result: (MOVHZreg x)
 15162  	for {
 15163  		x := v_0
 15164  		v.reset(OpPPC64MOVHZreg)
 15165  		v.AddArg(x)
 15166  		return true
 15167  	}
 15168  }
 15169  func rewriteValuePPC64_OpTrunc64to32(v *Value) bool {
 15170  	v_0 := v.Args[0]
 15171  	// match: (Trunc64to32 <t> x)
 15172  	// cond: t.IsSigned()
 15173  	// result: (MOVWreg x)
 15174  	for {
 15175  		t := v.Type
 15176  		x := v_0
 15177  		if !(t.IsSigned()) {
 15178  			break
 15179  		}
 15180  		v.reset(OpPPC64MOVWreg)
 15181  		v.AddArg(x)
 15182  		return true
 15183  	}
 15184  	// match: (Trunc64to32 x)
 15185  	// result: (MOVWZreg x)
 15186  	for {
 15187  		x := v_0
 15188  		v.reset(OpPPC64MOVWZreg)
 15189  		v.AddArg(x)
 15190  		return true
 15191  	}
 15192  }
 15193  func rewriteValuePPC64_OpTrunc64to8(v *Value) bool {
 15194  	v_0 := v.Args[0]
 15195  	// match: (Trunc64to8 <t> x)
 15196  	// cond: t.IsSigned()
 15197  	// result: (MOVBreg x)
 15198  	for {
 15199  		t := v.Type
 15200  		x := v_0
 15201  		if !(t.IsSigned()) {
 15202  			break
 15203  		}
 15204  		v.reset(OpPPC64MOVBreg)
 15205  		v.AddArg(x)
 15206  		return true
 15207  	}
 15208  	// match: (Trunc64to8 x)
 15209  	// result: (MOVBZreg x)
 15210  	for {
 15211  		x := v_0
 15212  		v.reset(OpPPC64MOVBZreg)
 15213  		v.AddArg(x)
 15214  		return true
 15215  	}
 15216  }
 15217  func rewriteValuePPC64_OpZero(v *Value) bool {
 15218  	v_1 := v.Args[1]
 15219  	v_0 := v.Args[0]
 15220  	b := v.Block
 15221  	// match: (Zero [0] _ mem)
 15222  	// result: mem
 15223  	for {
 15224  		if auxIntToInt64(v.AuxInt) != 0 {
 15225  			break
 15226  		}
 15227  		mem := v_1
 15228  		v.copyOf(mem)
 15229  		return true
 15230  	}
 15231  	// match: (Zero [1] destptr mem)
 15232  	// result: (MOVBstorezero destptr mem)
 15233  	for {
 15234  		if auxIntToInt64(v.AuxInt) != 1 {
 15235  			break
 15236  		}
 15237  		destptr := v_0
 15238  		mem := v_1
 15239  		v.reset(OpPPC64MOVBstorezero)
 15240  		v.AddArg2(destptr, mem)
 15241  		return true
 15242  	}
 15243  	// match: (Zero [2] destptr mem)
 15244  	// result: (MOVHstorezero destptr mem)
 15245  	for {
 15246  		if auxIntToInt64(v.AuxInt) != 2 {
 15247  			break
 15248  		}
 15249  		destptr := v_0
 15250  		mem := v_1
 15251  		v.reset(OpPPC64MOVHstorezero)
 15252  		v.AddArg2(destptr, mem)
 15253  		return true
 15254  	}
 15255  	// match: (Zero [3] destptr mem)
 15256  	// result: (MOVBstorezero [2] destptr (MOVHstorezero destptr mem))
 15257  	for {
 15258  		if auxIntToInt64(v.AuxInt) != 3 {
 15259  			break
 15260  		}
 15261  		destptr := v_0
 15262  		mem := v_1
 15263  		v.reset(OpPPC64MOVBstorezero)
 15264  		v.AuxInt = int32ToAuxInt(2)
 15265  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15266  		v0.AddArg2(destptr, mem)
 15267  		v.AddArg2(destptr, v0)
 15268  		return true
 15269  	}
 15270  	// match: (Zero [4] destptr mem)
 15271  	// result: (MOVWstorezero destptr mem)
 15272  	for {
 15273  		if auxIntToInt64(v.AuxInt) != 4 {
 15274  			break
 15275  		}
 15276  		destptr := v_0
 15277  		mem := v_1
 15278  		v.reset(OpPPC64MOVWstorezero)
 15279  		v.AddArg2(destptr, mem)
 15280  		return true
 15281  	}
 15282  	// match: (Zero [5] destptr mem)
 15283  	// result: (MOVBstorezero [4] destptr (MOVWstorezero destptr mem))
 15284  	for {
 15285  		if auxIntToInt64(v.AuxInt) != 5 {
 15286  			break
 15287  		}
 15288  		destptr := v_0
 15289  		mem := v_1
 15290  		v.reset(OpPPC64MOVBstorezero)
 15291  		v.AuxInt = int32ToAuxInt(4)
 15292  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15293  		v0.AddArg2(destptr, mem)
 15294  		v.AddArg2(destptr, v0)
 15295  		return true
 15296  	}
 15297  	// match: (Zero [6] destptr mem)
 15298  	// result: (MOVHstorezero [4] destptr (MOVWstorezero destptr mem))
 15299  	for {
 15300  		if auxIntToInt64(v.AuxInt) != 6 {
 15301  			break
 15302  		}
 15303  		destptr := v_0
 15304  		mem := v_1
 15305  		v.reset(OpPPC64MOVHstorezero)
 15306  		v.AuxInt = int32ToAuxInt(4)
 15307  		v0 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15308  		v0.AddArg2(destptr, mem)
 15309  		v.AddArg2(destptr, v0)
 15310  		return true
 15311  	}
 15312  	// match: (Zero [7] destptr mem)
 15313  	// result: (MOVBstorezero [6] destptr (MOVHstorezero [4] destptr (MOVWstorezero destptr mem)))
 15314  	for {
 15315  		if auxIntToInt64(v.AuxInt) != 7 {
 15316  			break
 15317  		}
 15318  		destptr := v_0
 15319  		mem := v_1
 15320  		v.reset(OpPPC64MOVBstorezero)
 15321  		v.AuxInt = int32ToAuxInt(6)
 15322  		v0 := b.NewValue0(v.Pos, OpPPC64MOVHstorezero, types.TypeMem)
 15323  		v0.AuxInt = int32ToAuxInt(4)
 15324  		v1 := b.NewValue0(v.Pos, OpPPC64MOVWstorezero, types.TypeMem)
 15325  		v1.AddArg2(destptr, mem)
 15326  		v0.AddArg2(destptr, v1)
 15327  		v.AddArg2(destptr, v0)
 15328  		return true
 15329  	}
 15330  	// match: (Zero [8] {t} destptr mem)
 15331  	// result: (MOVDstorezero destptr mem)
 15332  	for {
 15333  		if auxIntToInt64(v.AuxInt) != 8 {
 15334  			break
 15335  		}
 15336  		destptr := v_0
 15337  		mem := v_1
 15338  		v.reset(OpPPC64MOVDstorezero)
 15339  		v.AddArg2(destptr, mem)
 15340  		return true
 15341  	}
 15342  	// match: (Zero [12] {t} destptr mem)
 15343  	// result: (MOVWstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15344  	for {
 15345  		if auxIntToInt64(v.AuxInt) != 12 {
 15346  			break
 15347  		}
 15348  		destptr := v_0
 15349  		mem := v_1
 15350  		v.reset(OpPPC64MOVWstorezero)
 15351  		v.AuxInt = int32ToAuxInt(8)
 15352  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15353  		v0.AuxInt = int32ToAuxInt(0)
 15354  		v0.AddArg2(destptr, mem)
 15355  		v.AddArg2(destptr, v0)
 15356  		return true
 15357  	}
 15358  	// match: (Zero [16] {t} destptr mem)
 15359  	// result: (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))
 15360  	for {
 15361  		if auxIntToInt64(v.AuxInt) != 16 {
 15362  			break
 15363  		}
 15364  		destptr := v_0
 15365  		mem := v_1
 15366  		v.reset(OpPPC64MOVDstorezero)
 15367  		v.AuxInt = int32ToAuxInt(8)
 15368  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15369  		v0.AuxInt = int32ToAuxInt(0)
 15370  		v0.AddArg2(destptr, mem)
 15371  		v.AddArg2(destptr, v0)
 15372  		return true
 15373  	}
 15374  	// match: (Zero [24] {t} destptr mem)
 15375  	// result: (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem)))
 15376  	for {
 15377  		if auxIntToInt64(v.AuxInt) != 24 {
 15378  			break
 15379  		}
 15380  		destptr := v_0
 15381  		mem := v_1
 15382  		v.reset(OpPPC64MOVDstorezero)
 15383  		v.AuxInt = int32ToAuxInt(16)
 15384  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15385  		v0.AuxInt = int32ToAuxInt(8)
 15386  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15387  		v1.AuxInt = int32ToAuxInt(0)
 15388  		v1.AddArg2(destptr, mem)
 15389  		v0.AddArg2(destptr, v1)
 15390  		v.AddArg2(destptr, v0)
 15391  		return true
 15392  	}
 15393  	// match: (Zero [32] {t} destptr mem)
 15394  	// result: (MOVDstorezero [24] destptr (MOVDstorezero [16] destptr (MOVDstorezero [8] destptr (MOVDstorezero [0] destptr mem))))
 15395  	for {
 15396  		if auxIntToInt64(v.AuxInt) != 32 {
 15397  			break
 15398  		}
 15399  		destptr := v_0
 15400  		mem := v_1
 15401  		v.reset(OpPPC64MOVDstorezero)
 15402  		v.AuxInt = int32ToAuxInt(24)
 15403  		v0 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15404  		v0.AuxInt = int32ToAuxInt(16)
 15405  		v1 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15406  		v1.AuxInt = int32ToAuxInt(8)
 15407  		v2 := b.NewValue0(v.Pos, OpPPC64MOVDstorezero, types.TypeMem)
 15408  		v2.AuxInt = int32ToAuxInt(0)
 15409  		v2.AddArg2(destptr, mem)
 15410  		v1.AddArg2(destptr, v2)
 15411  		v0.AddArg2(destptr, v1)
 15412  		v.AddArg2(destptr, v0)
 15413  		return true
 15414  	}
 15415  	// match: (Zero [s] ptr mem)
 15416  	// cond: buildcfg.GOPPC64 <= 8 && s < 64
 15417  	// result: (LoweredZeroShort [s] ptr mem)
 15418  	for {
 15419  		s := auxIntToInt64(v.AuxInt)
 15420  		ptr := v_0
 15421  		mem := v_1
 15422  		if !(buildcfg.GOPPC64 <= 8 && s < 64) {
 15423  			break
 15424  		}
 15425  		v.reset(OpPPC64LoweredZeroShort)
 15426  		v.AuxInt = int64ToAuxInt(s)
 15427  		v.AddArg2(ptr, mem)
 15428  		return true
 15429  	}
 15430  	// match: (Zero [s] ptr mem)
 15431  	// cond: buildcfg.GOPPC64 <= 8
 15432  	// result: (LoweredZero [s] ptr mem)
 15433  	for {
 15434  		s := auxIntToInt64(v.AuxInt)
 15435  		ptr := v_0
 15436  		mem := v_1
 15437  		if !(buildcfg.GOPPC64 <= 8) {
 15438  			break
 15439  		}
 15440  		v.reset(OpPPC64LoweredZero)
 15441  		v.AuxInt = int64ToAuxInt(s)
 15442  		v.AddArg2(ptr, mem)
 15443  		return true
 15444  	}
 15445  	// match: (Zero [s] ptr mem)
 15446  	// cond: s < 128 && buildcfg.GOPPC64 >= 9
 15447  	// result: (LoweredQuadZeroShort [s] ptr mem)
 15448  	for {
 15449  		s := auxIntToInt64(v.AuxInt)
 15450  		ptr := v_0
 15451  		mem := v_1
 15452  		if !(s < 128 && buildcfg.GOPPC64 >= 9) {
 15453  			break
 15454  		}
 15455  		v.reset(OpPPC64LoweredQuadZeroShort)
 15456  		v.AuxInt = int64ToAuxInt(s)
 15457  		v.AddArg2(ptr, mem)
 15458  		return true
 15459  	}
 15460  	// match: (Zero [s] ptr mem)
 15461  	// cond: buildcfg.GOPPC64 >= 9
 15462  	// result: (LoweredQuadZero [s] ptr mem)
 15463  	for {
 15464  		s := auxIntToInt64(v.AuxInt)
 15465  		ptr := v_0
 15466  		mem := v_1
 15467  		if !(buildcfg.GOPPC64 >= 9) {
 15468  			break
 15469  		}
 15470  		v.reset(OpPPC64LoweredQuadZero)
 15471  		v.AuxInt = int64ToAuxInt(s)
 15472  		v.AddArg2(ptr, mem)
 15473  		return true
 15474  	}
 15475  	return false
 15476  }
 15477  func rewriteBlockPPC64(b *Block) bool {
 15478  	typ := &b.Func.Config.Types
 15479  	switch b.Kind {
 15480  	case BlockPPC64EQ:
 15481  		// match: (EQ (FlagEQ) yes no)
 15482  		// result: (First yes no)
 15483  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15484  			b.Reset(BlockFirst)
 15485  			return true
 15486  		}
 15487  		// match: (EQ (FlagLT) yes no)
 15488  		// result: (First no yes)
 15489  		for b.Controls[0].Op == OpPPC64FlagLT {
 15490  			b.Reset(BlockFirst)
 15491  			b.swapSuccessors()
 15492  			return true
 15493  		}
 15494  		// match: (EQ (FlagGT) yes no)
 15495  		// result: (First no yes)
 15496  		for b.Controls[0].Op == OpPPC64FlagGT {
 15497  			b.Reset(BlockFirst)
 15498  			b.swapSuccessors()
 15499  			return true
 15500  		}
 15501  		// match: (EQ (InvertFlags cmp) yes no)
 15502  		// result: (EQ cmp yes no)
 15503  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15504  			v_0 := b.Controls[0]
 15505  			cmp := v_0.Args[0]
 15506  			b.resetWithControl(BlockPPC64EQ, cmp)
 15507  			return true
 15508  		}
 15509  		// match: (EQ (CMPconst [0] z:(AND x y)) yes no)
 15510  		// cond: z.Uses == 1
 15511  		// result: (EQ (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15512  		for b.Controls[0].Op == OpPPC64CMPconst {
 15513  			v_0 := b.Controls[0]
 15514  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15515  				break
 15516  			}
 15517  			z := v_0.Args[0]
 15518  			if z.Op != OpPPC64AND {
 15519  				break
 15520  			}
 15521  			_ = z.Args[1]
 15522  			z_0 := z.Args[0]
 15523  			z_1 := z.Args[1]
 15524  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15525  				x := z_0
 15526  				y := z_1
 15527  				if !(z.Uses == 1) {
 15528  					continue
 15529  				}
 15530  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15531  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15532  				v1.AddArg2(x, y)
 15533  				v0.AddArg(v1)
 15534  				b.resetWithControl(BlockPPC64EQ, v0)
 15535  				return true
 15536  			}
 15537  			break
 15538  		}
 15539  		// match: (EQ (CMPconst [0] z:(OR x y)) yes no)
 15540  		// cond: z.Uses == 1
 15541  		// result: (EQ (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15542  		for b.Controls[0].Op == OpPPC64CMPconst {
 15543  			v_0 := b.Controls[0]
 15544  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15545  				break
 15546  			}
 15547  			z := v_0.Args[0]
 15548  			if z.Op != OpPPC64OR {
 15549  				break
 15550  			}
 15551  			_ = z.Args[1]
 15552  			z_0 := z.Args[0]
 15553  			z_1 := z.Args[1]
 15554  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15555  				x := z_0
 15556  				y := z_1
 15557  				if !(z.Uses == 1) {
 15558  					continue
 15559  				}
 15560  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15561  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15562  				v1.AddArg2(x, y)
 15563  				v0.AddArg(v1)
 15564  				b.resetWithControl(BlockPPC64EQ, v0)
 15565  				return true
 15566  			}
 15567  			break
 15568  		}
 15569  		// match: (EQ (CMPconst [0] z:(XOR x y)) yes no)
 15570  		// cond: z.Uses == 1
 15571  		// result: (EQ (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15572  		for b.Controls[0].Op == OpPPC64CMPconst {
 15573  			v_0 := b.Controls[0]
 15574  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15575  				break
 15576  			}
 15577  			z := v_0.Args[0]
 15578  			if z.Op != OpPPC64XOR {
 15579  				break
 15580  			}
 15581  			_ = z.Args[1]
 15582  			z_0 := z.Args[0]
 15583  			z_1 := z.Args[1]
 15584  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15585  				x := z_0
 15586  				y := z_1
 15587  				if !(z.Uses == 1) {
 15588  					continue
 15589  				}
 15590  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15591  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15592  				v1.AddArg2(x, y)
 15593  				v0.AddArg(v1)
 15594  				b.resetWithControl(BlockPPC64EQ, v0)
 15595  				return true
 15596  			}
 15597  			break
 15598  		}
 15599  	case BlockPPC64GE:
 15600  		// match: (GE (FlagEQ) yes no)
 15601  		// result: (First yes no)
 15602  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15603  			b.Reset(BlockFirst)
 15604  			return true
 15605  		}
 15606  		// match: (GE (FlagLT) yes no)
 15607  		// result: (First no yes)
 15608  		for b.Controls[0].Op == OpPPC64FlagLT {
 15609  			b.Reset(BlockFirst)
 15610  			b.swapSuccessors()
 15611  			return true
 15612  		}
 15613  		// match: (GE (FlagGT) yes no)
 15614  		// result: (First yes no)
 15615  		for b.Controls[0].Op == OpPPC64FlagGT {
 15616  			b.Reset(BlockFirst)
 15617  			return true
 15618  		}
 15619  		// match: (GE (InvertFlags cmp) yes no)
 15620  		// result: (LE cmp yes no)
 15621  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15622  			v_0 := b.Controls[0]
 15623  			cmp := v_0.Args[0]
 15624  			b.resetWithControl(BlockPPC64LE, cmp)
 15625  			return true
 15626  		}
 15627  		// match: (GE (CMPconst [0] z:(AND x y)) yes no)
 15628  		// cond: z.Uses == 1
 15629  		// result: (GE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15630  		for b.Controls[0].Op == OpPPC64CMPconst {
 15631  			v_0 := b.Controls[0]
 15632  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15633  				break
 15634  			}
 15635  			z := v_0.Args[0]
 15636  			if z.Op != OpPPC64AND {
 15637  				break
 15638  			}
 15639  			_ = z.Args[1]
 15640  			z_0 := z.Args[0]
 15641  			z_1 := z.Args[1]
 15642  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15643  				x := z_0
 15644  				y := z_1
 15645  				if !(z.Uses == 1) {
 15646  					continue
 15647  				}
 15648  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15649  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15650  				v1.AddArg2(x, y)
 15651  				v0.AddArg(v1)
 15652  				b.resetWithControl(BlockPPC64GE, v0)
 15653  				return true
 15654  			}
 15655  			break
 15656  		}
 15657  		// match: (GE (CMPconst [0] z:(OR x y)) yes no)
 15658  		// cond: z.Uses == 1
 15659  		// result: (GE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15660  		for b.Controls[0].Op == OpPPC64CMPconst {
 15661  			v_0 := b.Controls[0]
 15662  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15663  				break
 15664  			}
 15665  			z := v_0.Args[0]
 15666  			if z.Op != OpPPC64OR {
 15667  				break
 15668  			}
 15669  			_ = z.Args[1]
 15670  			z_0 := z.Args[0]
 15671  			z_1 := z.Args[1]
 15672  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15673  				x := z_0
 15674  				y := z_1
 15675  				if !(z.Uses == 1) {
 15676  					continue
 15677  				}
 15678  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15679  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15680  				v1.AddArg2(x, y)
 15681  				v0.AddArg(v1)
 15682  				b.resetWithControl(BlockPPC64GE, v0)
 15683  				return true
 15684  			}
 15685  			break
 15686  		}
 15687  		// match: (GE (CMPconst [0] z:(XOR x y)) yes no)
 15688  		// cond: z.Uses == 1
 15689  		// result: (GE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15690  		for b.Controls[0].Op == OpPPC64CMPconst {
 15691  			v_0 := b.Controls[0]
 15692  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15693  				break
 15694  			}
 15695  			z := v_0.Args[0]
 15696  			if z.Op != OpPPC64XOR {
 15697  				break
 15698  			}
 15699  			_ = z.Args[1]
 15700  			z_0 := z.Args[0]
 15701  			z_1 := z.Args[1]
 15702  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15703  				x := z_0
 15704  				y := z_1
 15705  				if !(z.Uses == 1) {
 15706  					continue
 15707  				}
 15708  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15709  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15710  				v1.AddArg2(x, y)
 15711  				v0.AddArg(v1)
 15712  				b.resetWithControl(BlockPPC64GE, v0)
 15713  				return true
 15714  			}
 15715  			break
 15716  		}
 15717  	case BlockPPC64GT:
 15718  		// match: (GT (FlagEQ) yes no)
 15719  		// result: (First no yes)
 15720  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15721  			b.Reset(BlockFirst)
 15722  			b.swapSuccessors()
 15723  			return true
 15724  		}
 15725  		// match: (GT (FlagLT) yes no)
 15726  		// result: (First no yes)
 15727  		for b.Controls[0].Op == OpPPC64FlagLT {
 15728  			b.Reset(BlockFirst)
 15729  			b.swapSuccessors()
 15730  			return true
 15731  		}
 15732  		// match: (GT (FlagGT) yes no)
 15733  		// result: (First yes no)
 15734  		for b.Controls[0].Op == OpPPC64FlagGT {
 15735  			b.Reset(BlockFirst)
 15736  			return true
 15737  		}
 15738  		// match: (GT (InvertFlags cmp) yes no)
 15739  		// result: (LT cmp yes no)
 15740  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15741  			v_0 := b.Controls[0]
 15742  			cmp := v_0.Args[0]
 15743  			b.resetWithControl(BlockPPC64LT, cmp)
 15744  			return true
 15745  		}
 15746  		// match: (GT (CMPconst [0] z:(AND x y)) yes no)
 15747  		// cond: z.Uses == 1
 15748  		// result: (GT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15749  		for b.Controls[0].Op == OpPPC64CMPconst {
 15750  			v_0 := b.Controls[0]
 15751  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15752  				break
 15753  			}
 15754  			z := v_0.Args[0]
 15755  			if z.Op != OpPPC64AND {
 15756  				break
 15757  			}
 15758  			_ = z.Args[1]
 15759  			z_0 := z.Args[0]
 15760  			z_1 := z.Args[1]
 15761  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15762  				x := z_0
 15763  				y := z_1
 15764  				if !(z.Uses == 1) {
 15765  					continue
 15766  				}
 15767  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15768  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15769  				v1.AddArg2(x, y)
 15770  				v0.AddArg(v1)
 15771  				b.resetWithControl(BlockPPC64GT, v0)
 15772  				return true
 15773  			}
 15774  			break
 15775  		}
 15776  		// match: (GT (CMPconst [0] z:(OR x y)) yes no)
 15777  		// cond: z.Uses == 1
 15778  		// result: (GT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15779  		for b.Controls[0].Op == OpPPC64CMPconst {
 15780  			v_0 := b.Controls[0]
 15781  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15782  				break
 15783  			}
 15784  			z := v_0.Args[0]
 15785  			if z.Op != OpPPC64OR {
 15786  				break
 15787  			}
 15788  			_ = z.Args[1]
 15789  			z_0 := z.Args[0]
 15790  			z_1 := z.Args[1]
 15791  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15792  				x := z_0
 15793  				y := z_1
 15794  				if !(z.Uses == 1) {
 15795  					continue
 15796  				}
 15797  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15798  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15799  				v1.AddArg2(x, y)
 15800  				v0.AddArg(v1)
 15801  				b.resetWithControl(BlockPPC64GT, v0)
 15802  				return true
 15803  			}
 15804  			break
 15805  		}
 15806  		// match: (GT (CMPconst [0] z:(XOR x y)) yes no)
 15807  		// cond: z.Uses == 1
 15808  		// result: (GT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 15809  		for b.Controls[0].Op == OpPPC64CMPconst {
 15810  			v_0 := b.Controls[0]
 15811  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15812  				break
 15813  			}
 15814  			z := v_0.Args[0]
 15815  			if z.Op != OpPPC64XOR {
 15816  				break
 15817  			}
 15818  			_ = z.Args[1]
 15819  			z_0 := z.Args[0]
 15820  			z_1 := z.Args[1]
 15821  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15822  				x := z_0
 15823  				y := z_1
 15824  				if !(z.Uses == 1) {
 15825  					continue
 15826  				}
 15827  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15828  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 15829  				v1.AddArg2(x, y)
 15830  				v0.AddArg(v1)
 15831  				b.resetWithControl(BlockPPC64GT, v0)
 15832  				return true
 15833  			}
 15834  			break
 15835  		}
 15836  	case BlockIf:
 15837  		// match: (If (Equal cc) yes no)
 15838  		// result: (EQ cc yes no)
 15839  		for b.Controls[0].Op == OpPPC64Equal {
 15840  			v_0 := b.Controls[0]
 15841  			cc := v_0.Args[0]
 15842  			b.resetWithControl(BlockPPC64EQ, cc)
 15843  			return true
 15844  		}
 15845  		// match: (If (NotEqual cc) yes no)
 15846  		// result: (NE cc yes no)
 15847  		for b.Controls[0].Op == OpPPC64NotEqual {
 15848  			v_0 := b.Controls[0]
 15849  			cc := v_0.Args[0]
 15850  			b.resetWithControl(BlockPPC64NE, cc)
 15851  			return true
 15852  		}
 15853  		// match: (If (LessThan cc) yes no)
 15854  		// result: (LT cc yes no)
 15855  		for b.Controls[0].Op == OpPPC64LessThan {
 15856  			v_0 := b.Controls[0]
 15857  			cc := v_0.Args[0]
 15858  			b.resetWithControl(BlockPPC64LT, cc)
 15859  			return true
 15860  		}
 15861  		// match: (If (LessEqual cc) yes no)
 15862  		// result: (LE cc yes no)
 15863  		for b.Controls[0].Op == OpPPC64LessEqual {
 15864  			v_0 := b.Controls[0]
 15865  			cc := v_0.Args[0]
 15866  			b.resetWithControl(BlockPPC64LE, cc)
 15867  			return true
 15868  		}
 15869  		// match: (If (GreaterThan cc) yes no)
 15870  		// result: (GT cc yes no)
 15871  		for b.Controls[0].Op == OpPPC64GreaterThan {
 15872  			v_0 := b.Controls[0]
 15873  			cc := v_0.Args[0]
 15874  			b.resetWithControl(BlockPPC64GT, cc)
 15875  			return true
 15876  		}
 15877  		// match: (If (GreaterEqual cc) yes no)
 15878  		// result: (GE cc yes no)
 15879  		for b.Controls[0].Op == OpPPC64GreaterEqual {
 15880  			v_0 := b.Controls[0]
 15881  			cc := v_0.Args[0]
 15882  			b.resetWithControl(BlockPPC64GE, cc)
 15883  			return true
 15884  		}
 15885  		// match: (If (FLessThan cc) yes no)
 15886  		// result: (FLT cc yes no)
 15887  		for b.Controls[0].Op == OpPPC64FLessThan {
 15888  			v_0 := b.Controls[0]
 15889  			cc := v_0.Args[0]
 15890  			b.resetWithControl(BlockPPC64FLT, cc)
 15891  			return true
 15892  		}
 15893  		// match: (If (FLessEqual cc) yes no)
 15894  		// result: (FLE cc yes no)
 15895  		for b.Controls[0].Op == OpPPC64FLessEqual {
 15896  			v_0 := b.Controls[0]
 15897  			cc := v_0.Args[0]
 15898  			b.resetWithControl(BlockPPC64FLE, cc)
 15899  			return true
 15900  		}
 15901  		// match: (If (FGreaterThan cc) yes no)
 15902  		// result: (FGT cc yes no)
 15903  		for b.Controls[0].Op == OpPPC64FGreaterThan {
 15904  			v_0 := b.Controls[0]
 15905  			cc := v_0.Args[0]
 15906  			b.resetWithControl(BlockPPC64FGT, cc)
 15907  			return true
 15908  		}
 15909  		// match: (If (FGreaterEqual cc) yes no)
 15910  		// result: (FGE cc yes no)
 15911  		for b.Controls[0].Op == OpPPC64FGreaterEqual {
 15912  			v_0 := b.Controls[0]
 15913  			cc := v_0.Args[0]
 15914  			b.resetWithControl(BlockPPC64FGE, cc)
 15915  			return true
 15916  		}
 15917  		// match: (If cond yes no)
 15918  		// result: (NE (CMPconst [0] (ANDconst [1] cond)) yes no)
 15919  		for {
 15920  			cond := b.Controls[0]
 15921  			v0 := b.NewValue0(cond.Pos, OpPPC64CMPconst, types.TypeFlags)
 15922  			v0.AuxInt = int64ToAuxInt(0)
 15923  			v1 := b.NewValue0(cond.Pos, OpPPC64ANDconst, typ.Int)
 15924  			v1.AuxInt = int64ToAuxInt(1)
 15925  			v1.AddArg(cond)
 15926  			v0.AddArg(v1)
 15927  			b.resetWithControl(BlockPPC64NE, v0)
 15928  			return true
 15929  		}
 15930  	case BlockPPC64LE:
 15931  		// match: (LE (FlagEQ) yes no)
 15932  		// result: (First yes no)
 15933  		for b.Controls[0].Op == OpPPC64FlagEQ {
 15934  			b.Reset(BlockFirst)
 15935  			return true
 15936  		}
 15937  		// match: (LE (FlagLT) yes no)
 15938  		// result: (First yes no)
 15939  		for b.Controls[0].Op == OpPPC64FlagLT {
 15940  			b.Reset(BlockFirst)
 15941  			return true
 15942  		}
 15943  		// match: (LE (FlagGT) yes no)
 15944  		// result: (First no yes)
 15945  		for b.Controls[0].Op == OpPPC64FlagGT {
 15946  			b.Reset(BlockFirst)
 15947  			b.swapSuccessors()
 15948  			return true
 15949  		}
 15950  		// match: (LE (InvertFlags cmp) yes no)
 15951  		// result: (GE cmp yes no)
 15952  		for b.Controls[0].Op == OpPPC64InvertFlags {
 15953  			v_0 := b.Controls[0]
 15954  			cmp := v_0.Args[0]
 15955  			b.resetWithControl(BlockPPC64GE, cmp)
 15956  			return true
 15957  		}
 15958  		// match: (LE (CMPconst [0] z:(AND x y)) yes no)
 15959  		// cond: z.Uses == 1
 15960  		// result: (LE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 15961  		for b.Controls[0].Op == OpPPC64CMPconst {
 15962  			v_0 := b.Controls[0]
 15963  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15964  				break
 15965  			}
 15966  			z := v_0.Args[0]
 15967  			if z.Op != OpPPC64AND {
 15968  				break
 15969  			}
 15970  			_ = z.Args[1]
 15971  			z_0 := z.Args[0]
 15972  			z_1 := z.Args[1]
 15973  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 15974  				x := z_0
 15975  				y := z_1
 15976  				if !(z.Uses == 1) {
 15977  					continue
 15978  				}
 15979  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 15980  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 15981  				v1.AddArg2(x, y)
 15982  				v0.AddArg(v1)
 15983  				b.resetWithControl(BlockPPC64LE, v0)
 15984  				return true
 15985  			}
 15986  			break
 15987  		}
 15988  		// match: (LE (CMPconst [0] z:(OR x y)) yes no)
 15989  		// cond: z.Uses == 1
 15990  		// result: (LE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 15991  		for b.Controls[0].Op == OpPPC64CMPconst {
 15992  			v_0 := b.Controls[0]
 15993  			if auxIntToInt64(v_0.AuxInt) != 0 {
 15994  				break
 15995  			}
 15996  			z := v_0.Args[0]
 15997  			if z.Op != OpPPC64OR {
 15998  				break
 15999  			}
 16000  			_ = z.Args[1]
 16001  			z_0 := z.Args[0]
 16002  			z_1 := z.Args[1]
 16003  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16004  				x := z_0
 16005  				y := z_1
 16006  				if !(z.Uses == 1) {
 16007  					continue
 16008  				}
 16009  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16010  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16011  				v1.AddArg2(x, y)
 16012  				v0.AddArg(v1)
 16013  				b.resetWithControl(BlockPPC64LE, v0)
 16014  				return true
 16015  			}
 16016  			break
 16017  		}
 16018  		// match: (LE (CMPconst [0] z:(XOR x y)) yes no)
 16019  		// cond: z.Uses == 1
 16020  		// result: (LE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16021  		for b.Controls[0].Op == OpPPC64CMPconst {
 16022  			v_0 := b.Controls[0]
 16023  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16024  				break
 16025  			}
 16026  			z := v_0.Args[0]
 16027  			if z.Op != OpPPC64XOR {
 16028  				break
 16029  			}
 16030  			_ = z.Args[1]
 16031  			z_0 := z.Args[0]
 16032  			z_1 := z.Args[1]
 16033  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16034  				x := z_0
 16035  				y := z_1
 16036  				if !(z.Uses == 1) {
 16037  					continue
 16038  				}
 16039  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16040  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16041  				v1.AddArg2(x, y)
 16042  				v0.AddArg(v1)
 16043  				b.resetWithControl(BlockPPC64LE, v0)
 16044  				return true
 16045  			}
 16046  			break
 16047  		}
 16048  	case BlockPPC64LT:
 16049  		// match: (LT (FlagEQ) yes no)
 16050  		// result: (First no yes)
 16051  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16052  			b.Reset(BlockFirst)
 16053  			b.swapSuccessors()
 16054  			return true
 16055  		}
 16056  		// match: (LT (FlagLT) yes no)
 16057  		// result: (First yes no)
 16058  		for b.Controls[0].Op == OpPPC64FlagLT {
 16059  			b.Reset(BlockFirst)
 16060  			return true
 16061  		}
 16062  		// match: (LT (FlagGT) yes no)
 16063  		// result: (First no yes)
 16064  		for b.Controls[0].Op == OpPPC64FlagGT {
 16065  			b.Reset(BlockFirst)
 16066  			b.swapSuccessors()
 16067  			return true
 16068  		}
 16069  		// match: (LT (InvertFlags cmp) yes no)
 16070  		// result: (GT cmp yes no)
 16071  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16072  			v_0 := b.Controls[0]
 16073  			cmp := v_0.Args[0]
 16074  			b.resetWithControl(BlockPPC64GT, cmp)
 16075  			return true
 16076  		}
 16077  		// match: (LT (CMPconst [0] z:(AND x y)) yes no)
 16078  		// cond: z.Uses == 1
 16079  		// result: (LT (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16080  		for b.Controls[0].Op == OpPPC64CMPconst {
 16081  			v_0 := b.Controls[0]
 16082  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16083  				break
 16084  			}
 16085  			z := v_0.Args[0]
 16086  			if z.Op != OpPPC64AND {
 16087  				break
 16088  			}
 16089  			_ = z.Args[1]
 16090  			z_0 := z.Args[0]
 16091  			z_1 := z.Args[1]
 16092  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16093  				x := z_0
 16094  				y := z_1
 16095  				if !(z.Uses == 1) {
 16096  					continue
 16097  				}
 16098  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16099  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16100  				v1.AddArg2(x, y)
 16101  				v0.AddArg(v1)
 16102  				b.resetWithControl(BlockPPC64LT, v0)
 16103  				return true
 16104  			}
 16105  			break
 16106  		}
 16107  		// match: (LT (CMPconst [0] z:(OR x y)) yes no)
 16108  		// cond: z.Uses == 1
 16109  		// result: (LT (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16110  		for b.Controls[0].Op == OpPPC64CMPconst {
 16111  			v_0 := b.Controls[0]
 16112  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16113  				break
 16114  			}
 16115  			z := v_0.Args[0]
 16116  			if z.Op != OpPPC64OR {
 16117  				break
 16118  			}
 16119  			_ = z.Args[1]
 16120  			z_0 := z.Args[0]
 16121  			z_1 := z.Args[1]
 16122  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16123  				x := z_0
 16124  				y := z_1
 16125  				if !(z.Uses == 1) {
 16126  					continue
 16127  				}
 16128  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16129  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16130  				v1.AddArg2(x, y)
 16131  				v0.AddArg(v1)
 16132  				b.resetWithControl(BlockPPC64LT, v0)
 16133  				return true
 16134  			}
 16135  			break
 16136  		}
 16137  		// match: (LT (CMPconst [0] z:(XOR x y)) yes no)
 16138  		// cond: z.Uses == 1
 16139  		// result: (LT (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16140  		for b.Controls[0].Op == OpPPC64CMPconst {
 16141  			v_0 := b.Controls[0]
 16142  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16143  				break
 16144  			}
 16145  			z := v_0.Args[0]
 16146  			if z.Op != OpPPC64XOR {
 16147  				break
 16148  			}
 16149  			_ = z.Args[1]
 16150  			z_0 := z.Args[0]
 16151  			z_1 := z.Args[1]
 16152  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16153  				x := z_0
 16154  				y := z_1
 16155  				if !(z.Uses == 1) {
 16156  					continue
 16157  				}
 16158  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16159  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16160  				v1.AddArg2(x, y)
 16161  				v0.AddArg(v1)
 16162  				b.resetWithControl(BlockPPC64LT, v0)
 16163  				return true
 16164  			}
 16165  			break
 16166  		}
 16167  	case BlockPPC64NE:
 16168  		// match: (NE (CMPconst [0] (ANDconst [1] (Equal cc))) yes no)
 16169  		// result: (EQ cc yes no)
 16170  		for b.Controls[0].Op == OpPPC64CMPconst {
 16171  			v_0 := b.Controls[0]
 16172  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16173  				break
 16174  			}
 16175  			v_0_0 := v_0.Args[0]
 16176  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16177  				break
 16178  			}
 16179  			v_0_0_0 := v_0_0.Args[0]
 16180  			if v_0_0_0.Op != OpPPC64Equal {
 16181  				break
 16182  			}
 16183  			cc := v_0_0_0.Args[0]
 16184  			b.resetWithControl(BlockPPC64EQ, cc)
 16185  			return true
 16186  		}
 16187  		// match: (NE (CMPconst [0] (ANDconst [1] (NotEqual cc))) yes no)
 16188  		// result: (NE cc yes no)
 16189  		for b.Controls[0].Op == OpPPC64CMPconst {
 16190  			v_0 := b.Controls[0]
 16191  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16192  				break
 16193  			}
 16194  			v_0_0 := v_0.Args[0]
 16195  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16196  				break
 16197  			}
 16198  			v_0_0_0 := v_0_0.Args[0]
 16199  			if v_0_0_0.Op != OpPPC64NotEqual {
 16200  				break
 16201  			}
 16202  			cc := v_0_0_0.Args[0]
 16203  			b.resetWithControl(BlockPPC64NE, cc)
 16204  			return true
 16205  		}
 16206  		// match: (NE (CMPconst [0] (ANDconst [1] (LessThan cc))) yes no)
 16207  		// result: (LT cc yes no)
 16208  		for b.Controls[0].Op == OpPPC64CMPconst {
 16209  			v_0 := b.Controls[0]
 16210  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16211  				break
 16212  			}
 16213  			v_0_0 := v_0.Args[0]
 16214  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16215  				break
 16216  			}
 16217  			v_0_0_0 := v_0_0.Args[0]
 16218  			if v_0_0_0.Op != OpPPC64LessThan {
 16219  				break
 16220  			}
 16221  			cc := v_0_0_0.Args[0]
 16222  			b.resetWithControl(BlockPPC64LT, cc)
 16223  			return true
 16224  		}
 16225  		// match: (NE (CMPconst [0] (ANDconst [1] (LessEqual cc))) yes no)
 16226  		// result: (LE cc yes no)
 16227  		for b.Controls[0].Op == OpPPC64CMPconst {
 16228  			v_0 := b.Controls[0]
 16229  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16230  				break
 16231  			}
 16232  			v_0_0 := v_0.Args[0]
 16233  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16234  				break
 16235  			}
 16236  			v_0_0_0 := v_0_0.Args[0]
 16237  			if v_0_0_0.Op != OpPPC64LessEqual {
 16238  				break
 16239  			}
 16240  			cc := v_0_0_0.Args[0]
 16241  			b.resetWithControl(BlockPPC64LE, cc)
 16242  			return true
 16243  		}
 16244  		// match: (NE (CMPconst [0] (ANDconst [1] (GreaterThan cc))) yes no)
 16245  		// result: (GT cc yes no)
 16246  		for b.Controls[0].Op == OpPPC64CMPconst {
 16247  			v_0 := b.Controls[0]
 16248  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16249  				break
 16250  			}
 16251  			v_0_0 := v_0.Args[0]
 16252  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16253  				break
 16254  			}
 16255  			v_0_0_0 := v_0_0.Args[0]
 16256  			if v_0_0_0.Op != OpPPC64GreaterThan {
 16257  				break
 16258  			}
 16259  			cc := v_0_0_0.Args[0]
 16260  			b.resetWithControl(BlockPPC64GT, cc)
 16261  			return true
 16262  		}
 16263  		// match: (NE (CMPconst [0] (ANDconst [1] (GreaterEqual cc))) yes no)
 16264  		// result: (GE cc yes no)
 16265  		for b.Controls[0].Op == OpPPC64CMPconst {
 16266  			v_0 := b.Controls[0]
 16267  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16268  				break
 16269  			}
 16270  			v_0_0 := v_0.Args[0]
 16271  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16272  				break
 16273  			}
 16274  			v_0_0_0 := v_0_0.Args[0]
 16275  			if v_0_0_0.Op != OpPPC64GreaterEqual {
 16276  				break
 16277  			}
 16278  			cc := v_0_0_0.Args[0]
 16279  			b.resetWithControl(BlockPPC64GE, cc)
 16280  			return true
 16281  		}
 16282  		// match: (NE (CMPconst [0] (ANDconst [1] (FLessThan cc))) yes no)
 16283  		// result: (FLT cc yes no)
 16284  		for b.Controls[0].Op == OpPPC64CMPconst {
 16285  			v_0 := b.Controls[0]
 16286  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16287  				break
 16288  			}
 16289  			v_0_0 := v_0.Args[0]
 16290  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16291  				break
 16292  			}
 16293  			v_0_0_0 := v_0_0.Args[0]
 16294  			if v_0_0_0.Op != OpPPC64FLessThan {
 16295  				break
 16296  			}
 16297  			cc := v_0_0_0.Args[0]
 16298  			b.resetWithControl(BlockPPC64FLT, cc)
 16299  			return true
 16300  		}
 16301  		// match: (NE (CMPconst [0] (ANDconst [1] (FLessEqual cc))) yes no)
 16302  		// result: (FLE cc yes no)
 16303  		for b.Controls[0].Op == OpPPC64CMPconst {
 16304  			v_0 := b.Controls[0]
 16305  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16306  				break
 16307  			}
 16308  			v_0_0 := v_0.Args[0]
 16309  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16310  				break
 16311  			}
 16312  			v_0_0_0 := v_0_0.Args[0]
 16313  			if v_0_0_0.Op != OpPPC64FLessEqual {
 16314  				break
 16315  			}
 16316  			cc := v_0_0_0.Args[0]
 16317  			b.resetWithControl(BlockPPC64FLE, cc)
 16318  			return true
 16319  		}
 16320  		// match: (NE (CMPconst [0] (ANDconst [1] (FGreaterThan cc))) yes no)
 16321  		// result: (FGT cc yes no)
 16322  		for b.Controls[0].Op == OpPPC64CMPconst {
 16323  			v_0 := b.Controls[0]
 16324  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16325  				break
 16326  			}
 16327  			v_0_0 := v_0.Args[0]
 16328  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16329  				break
 16330  			}
 16331  			v_0_0_0 := v_0_0.Args[0]
 16332  			if v_0_0_0.Op != OpPPC64FGreaterThan {
 16333  				break
 16334  			}
 16335  			cc := v_0_0_0.Args[0]
 16336  			b.resetWithControl(BlockPPC64FGT, cc)
 16337  			return true
 16338  		}
 16339  		// match: (NE (CMPconst [0] (ANDconst [1] (FGreaterEqual cc))) yes no)
 16340  		// result: (FGE cc yes no)
 16341  		for b.Controls[0].Op == OpPPC64CMPconst {
 16342  			v_0 := b.Controls[0]
 16343  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16344  				break
 16345  			}
 16346  			v_0_0 := v_0.Args[0]
 16347  			if v_0_0.Op != OpPPC64ANDconst || auxIntToInt64(v_0_0.AuxInt) != 1 {
 16348  				break
 16349  			}
 16350  			v_0_0_0 := v_0_0.Args[0]
 16351  			if v_0_0_0.Op != OpPPC64FGreaterEqual {
 16352  				break
 16353  			}
 16354  			cc := v_0_0_0.Args[0]
 16355  			b.resetWithControl(BlockPPC64FGE, cc)
 16356  			return true
 16357  		}
 16358  		// match: (NE (FlagEQ) yes no)
 16359  		// result: (First no yes)
 16360  		for b.Controls[0].Op == OpPPC64FlagEQ {
 16361  			b.Reset(BlockFirst)
 16362  			b.swapSuccessors()
 16363  			return true
 16364  		}
 16365  		// match: (NE (FlagLT) yes no)
 16366  		// result: (First yes no)
 16367  		for b.Controls[0].Op == OpPPC64FlagLT {
 16368  			b.Reset(BlockFirst)
 16369  			return true
 16370  		}
 16371  		// match: (NE (FlagGT) yes no)
 16372  		// result: (First yes no)
 16373  		for b.Controls[0].Op == OpPPC64FlagGT {
 16374  			b.Reset(BlockFirst)
 16375  			return true
 16376  		}
 16377  		// match: (NE (InvertFlags cmp) yes no)
 16378  		// result: (NE cmp yes no)
 16379  		for b.Controls[0].Op == OpPPC64InvertFlags {
 16380  			v_0 := b.Controls[0]
 16381  			cmp := v_0.Args[0]
 16382  			b.resetWithControl(BlockPPC64NE, cmp)
 16383  			return true
 16384  		}
 16385  		// match: (NE (CMPconst [0] z:(AND x y)) yes no)
 16386  		// cond: z.Uses == 1
 16387  		// result: (NE (Select1 <types.TypeFlags> (ANDCC x y)) yes no)
 16388  		for b.Controls[0].Op == OpPPC64CMPconst {
 16389  			v_0 := b.Controls[0]
 16390  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16391  				break
 16392  			}
 16393  			z := v_0.Args[0]
 16394  			if z.Op != OpPPC64AND {
 16395  				break
 16396  			}
 16397  			_ = z.Args[1]
 16398  			z_0 := z.Args[0]
 16399  			z_1 := z.Args[1]
 16400  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16401  				x := z_0
 16402  				y := z_1
 16403  				if !(z.Uses == 1) {
 16404  					continue
 16405  				}
 16406  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16407  				v1 := b.NewValue0(v_0.Pos, OpPPC64ANDCC, types.NewTuple(typ.Int64, types.TypeFlags))
 16408  				v1.AddArg2(x, y)
 16409  				v0.AddArg(v1)
 16410  				b.resetWithControl(BlockPPC64NE, v0)
 16411  				return true
 16412  			}
 16413  			break
 16414  		}
 16415  		// match: (NE (CMPconst [0] z:(OR x y)) yes no)
 16416  		// cond: z.Uses == 1
 16417  		// result: (NE (Select1 <types.TypeFlags> (ORCC x y)) yes no)
 16418  		for b.Controls[0].Op == OpPPC64CMPconst {
 16419  			v_0 := b.Controls[0]
 16420  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16421  				break
 16422  			}
 16423  			z := v_0.Args[0]
 16424  			if z.Op != OpPPC64OR {
 16425  				break
 16426  			}
 16427  			_ = z.Args[1]
 16428  			z_0 := z.Args[0]
 16429  			z_1 := z.Args[1]
 16430  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16431  				x := z_0
 16432  				y := z_1
 16433  				if !(z.Uses == 1) {
 16434  					continue
 16435  				}
 16436  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16437  				v1 := b.NewValue0(v_0.Pos, OpPPC64ORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16438  				v1.AddArg2(x, y)
 16439  				v0.AddArg(v1)
 16440  				b.resetWithControl(BlockPPC64NE, v0)
 16441  				return true
 16442  			}
 16443  			break
 16444  		}
 16445  		// match: (NE (CMPconst [0] z:(XOR x y)) yes no)
 16446  		// cond: z.Uses == 1
 16447  		// result: (NE (Select1 <types.TypeFlags> (XORCC x y)) yes no)
 16448  		for b.Controls[0].Op == OpPPC64CMPconst {
 16449  			v_0 := b.Controls[0]
 16450  			if auxIntToInt64(v_0.AuxInt) != 0 {
 16451  				break
 16452  			}
 16453  			z := v_0.Args[0]
 16454  			if z.Op != OpPPC64XOR {
 16455  				break
 16456  			}
 16457  			_ = z.Args[1]
 16458  			z_0 := z.Args[0]
 16459  			z_1 := z.Args[1]
 16460  			for _i0 := 0; _i0 <= 1; _i0, z_0, z_1 = _i0+1, z_1, z_0 {
 16461  				x := z_0
 16462  				y := z_1
 16463  				if !(z.Uses == 1) {
 16464  					continue
 16465  				}
 16466  				v0 := b.NewValue0(v_0.Pos, OpSelect1, types.TypeFlags)
 16467  				v1 := b.NewValue0(v_0.Pos, OpPPC64XORCC, types.NewTuple(typ.Int, types.TypeFlags))
 16468  				v1.AddArg2(x, y)
 16469  				v0.AddArg(v1)
 16470  				b.resetWithControl(BlockPPC64NE, v0)
 16471  				return true
 16472  			}
 16473  			break
 16474  		}
 16475  	}
 16476  	return false
 16477  }
 16478  

View as plain text